NXP
/
rt1050_emwin_gui_demo
RT1050 GUI demo using emWin library
emwin/emWin_header/MULTIPAGE.h@0:dd702039127a, 2018-09-20 (annotated)
- Committer:
- alejandroRL
- Date:
- Thu Sep 20 19:16:34 2018 +0000
- Revision:
- 0:dd702039127a
emWin GUI Demo for RT1050
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alejandroRL | 0:dd702039127a | 1 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 3 | * Solutions for real time microcontroller applications * |
alejandroRL | 0:dd702039127a | 4 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 5 | * * |
alejandroRL | 0:dd702039127a | 6 | * (c) 1996 - 2016 SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 7 | * * |
alejandroRL | 0:dd702039127a | 8 | * Internet: www.segger.com Support: support@segger.com * |
alejandroRL | 0:dd702039127a | 9 | * * |
alejandroRL | 0:dd702039127a | 10 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 11 | |
alejandroRL | 0:dd702039127a | 12 | ** emWin V5.38 - Graphical user interface for embedded applications ** |
alejandroRL | 0:dd702039127a | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
alejandroRL | 0:dd702039127a | 14 | emWin is protected by international copyright laws. Knowledge of the |
alejandroRL | 0:dd702039127a | 15 | source code may not be used to write a similar product. This file may |
alejandroRL | 0:dd702039127a | 16 | only be used in accordance with the following terms: |
alejandroRL | 0:dd702039127a | 17 | |
alejandroRL | 0:dd702039127a | 18 | The software has been licensed to NXP Semiconductors USA, Inc. whose |
alejandroRL | 0:dd702039127a | 19 | registered office is situated at 411 E. Plumeria Drive, San Jose, |
alejandroRL | 0:dd702039127a | 20 | CA 95134, USA solely for the purposes of creating libraries for |
alejandroRL | 0:dd702039127a | 21 | NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and |
alejandroRL | 0:dd702039127a | 22 | distributed under the terms and conditions of the NXP End User License |
alejandroRL | 0:dd702039127a | 23 | Agreement. |
alejandroRL | 0:dd702039127a | 24 | Full source code is available at: www.segger.com |
alejandroRL | 0:dd702039127a | 25 | |
alejandroRL | 0:dd702039127a | 26 | We appreciate your understanding and fairness. |
alejandroRL | 0:dd702039127a | 27 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 28 | Licensing information |
alejandroRL | 0:dd702039127a | 29 | |
alejandroRL | 0:dd702039127a | 30 | Licensor: SEGGER Microcontroller Systems LLC |
alejandroRL | 0:dd702039127a | 31 | Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA |
alejandroRL | 0:dd702039127a | 32 | Licensed SEGGER software: emWin |
alejandroRL | 0:dd702039127a | 33 | License number: GUI-00186 |
alejandroRL | 0:dd702039127a | 34 | License model: emWin License Agreement, dated August 20th 2011 |
alejandroRL | 0:dd702039127a | 35 | Licensed product: - |
alejandroRL | 0:dd702039127a | 36 | Licensed platform: NXP's ARM 7/9, Cortex-M0,M3,M4 |
alejandroRL | 0:dd702039127a | 37 | Licensed number of seats: - |
alejandroRL | 0:dd702039127a | 38 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 39 | File : MULTIPAGE.h |
alejandroRL | 0:dd702039127a | 40 | Purpose : MULTIPAGE include |
alejandroRL | 0:dd702039127a | 41 | --------------------END-OF-HEADER------------------------------------- |
alejandroRL | 0:dd702039127a | 42 | */ |
alejandroRL | 0:dd702039127a | 43 | |
alejandroRL | 0:dd702039127a | 44 | #ifndef MULTIPAGE_H |
alejandroRL | 0:dd702039127a | 45 | #define MULTIPAGE_H |
alejandroRL | 0:dd702039127a | 46 | |
alejandroRL | 0:dd702039127a | 47 | #include "WM.h" |
alejandroRL | 0:dd702039127a | 48 | #include "DIALOG.h" // Required for Create indirect data structure |
alejandroRL | 0:dd702039127a | 49 | |
alejandroRL | 0:dd702039127a | 50 | #if GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 51 | |
alejandroRL | 0:dd702039127a | 52 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 53 | extern "C" { // Make sure we have C-declarations in C++ programs |
alejandroRL | 0:dd702039127a | 54 | #endif |
alejandroRL | 0:dd702039127a | 55 | |
alejandroRL | 0:dd702039127a | 56 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 57 | * |
alejandroRL | 0:dd702039127a | 58 | * Defines |
alejandroRL | 0:dd702039127a | 59 | * |
alejandroRL | 0:dd702039127a | 60 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 61 | */ |
alejandroRL | 0:dd702039127a | 62 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 63 | * |
alejandroRL | 0:dd702039127a | 64 | * Create / Status flags |
alejandroRL | 0:dd702039127a | 65 | */ |
alejandroRL | 0:dd702039127a | 66 | #define MULTIPAGE_ALIGN_LEFT (0 << 0) |
alejandroRL | 0:dd702039127a | 67 | #define MULTIPAGE_ALIGN_RIGHT (1 << 0) |
alejandroRL | 0:dd702039127a | 68 | #define MULTIPAGE_ALIGN_TOP (0 << 2) |
alejandroRL | 0:dd702039127a | 69 | #define MULTIPAGE_ALIGN_BOTTOM (1 << 2) |
alejandroRL | 0:dd702039127a | 70 | |
alejandroRL | 0:dd702039127a | 71 | #define MULTIPAGE_CF_ROTATE_CW WIDGET_CF_VERTICAL |
alejandroRL | 0:dd702039127a | 72 | |
alejandroRL | 0:dd702039127a | 73 | #define MULTIPAGE_CI_DISABLED 0 |
alejandroRL | 0:dd702039127a | 74 | #define MULTIPAGE_CI_ENABLED 1 |
alejandroRL | 0:dd702039127a | 75 | |
alejandroRL | 0:dd702039127a | 76 | #define MULTIPAGE_SKIN_FRAME_LEFT (1 << 0) |
alejandroRL | 0:dd702039127a | 77 | #define MULTIPAGE_SKIN_FRAME_RIGHT (1 << 1) |
alejandroRL | 0:dd702039127a | 78 | #define MULTIPAGE_SKIN_FRAME_TOP (1 << 2) |
alejandroRL | 0:dd702039127a | 79 | #define MULTIPAGE_SKIN_FRAME_BOTTOM (1 << 3) |
alejandroRL | 0:dd702039127a | 80 | #define MULTIPAGE_SKIN_FRAME_ALL (MULTIPAGE_SKIN_FRAME_LEFT | MULTIPAGE_SKIN_FRAME_RIGHT | MULTIPAGE_SKIN_FRAME_TOP | MULTIPAGE_SKIN_FRAME_BOTTOM) |
alejandroRL | 0:dd702039127a | 81 | |
alejandroRL | 0:dd702039127a | 82 | #define MULTIPAGE_SKINFLEX_PI_ENABLED 0 |
alejandroRL | 0:dd702039127a | 83 | #define MULTIPAGE_SKINFLEX_PI_SELECTED 1 |
alejandroRL | 0:dd702039127a | 84 | #define MULTIPAGE_SKINFLEX_PI_DISABLED 2 |
alejandroRL | 0:dd702039127a | 85 | |
alejandroRL | 0:dd702039127a | 86 | #define SCROLLBAR_SIZE 32 // Defines the space for the scrollbar arrows |
alejandroRL | 0:dd702039127a | 87 | |
alejandroRL | 0:dd702039127a | 88 | #define MULTIPAGE_BI_SELECTED 0 |
alejandroRL | 0:dd702039127a | 89 | #define MULTIPAGE_BI_UNSELECTED 1 |
alejandroRL | 0:dd702039127a | 90 | #define MULTIPAGE_BI_DISABLED 2 |
alejandroRL | 0:dd702039127a | 91 | #define MULTIPAGE_BI_MAX 3 // The defines above are used as array indices. |
alejandroRL | 0:dd702039127a | 92 | |
alejandroRL | 0:dd702039127a | 93 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 94 | * |
alejandroRL | 0:dd702039127a | 95 | * Public Types |
alejandroRL | 0:dd702039127a | 96 | * |
alejandroRL | 0:dd702039127a | 97 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 98 | */ |
alejandroRL | 0:dd702039127a | 99 | typedef WM_HMEM MULTIPAGE_Handle; |
alejandroRL | 0:dd702039127a | 100 | |
alejandroRL | 0:dd702039127a | 101 | typedef struct { |
alejandroRL | 0:dd702039127a | 102 | GUI_COLOR BkColor; |
alejandroRL | 0:dd702039127a | 103 | GUI_COLOR aBkUpper[2]; |
alejandroRL | 0:dd702039127a | 104 | GUI_COLOR aBkLower[2]; |
alejandroRL | 0:dd702039127a | 105 | GUI_COLOR FrameColor; |
alejandroRL | 0:dd702039127a | 106 | GUI_COLOR TextColor; |
alejandroRL | 0:dd702039127a | 107 | } MULTIPAGE_SKINFLEX_PROPS; |
alejandroRL | 0:dd702039127a | 108 | |
alejandroRL | 0:dd702039127a | 109 | typedef struct { |
alejandroRL | 0:dd702039127a | 110 | U8 SelSideBorderInc; // Number of pixels to add on both sides when drawing the selected item. |
alejandroRL | 0:dd702039127a | 111 | U8 SelTopBorderInc; // Number of pixels to add on top of selected items. |
alejandroRL | 0:dd702039127a | 112 | } MULTIPAGE_SKIN_PROPS; |
alejandroRL | 0:dd702039127a | 113 | |
alejandroRL | 0:dd702039127a | 114 | typedef struct { |
alejandroRL | 0:dd702039127a | 115 | #if GUI_SUPPORT_ROTATION |
alejandroRL | 0:dd702039127a | 116 | GUI_ROTATION * pRotation; |
alejandroRL | 0:dd702039127a | 117 | #endif |
alejandroRL | 0:dd702039127a | 118 | unsigned Align; |
alejandroRL | 0:dd702039127a | 119 | int Sel; |
alejandroRL | 0:dd702039127a | 120 | U16 State; |
alejandroRL | 0:dd702039127a | 121 | U8 FrameFlags; // Flags to let the drawing function know which parts of the frame to display. |
alejandroRL | 0:dd702039127a | 122 | U8 PageStatus; |
alejandroRL | 0:dd702039127a | 123 | GUI_DRAW_HANDLE * pDrawObj; |
alejandroRL | 0:dd702039127a | 124 | } MULTIPAGE_SKIN_INFO; |
alejandroRL | 0:dd702039127a | 125 | |
alejandroRL | 0:dd702039127a | 126 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 127 | * |
alejandroRL | 0:dd702039127a | 128 | * Create functions |
alejandroRL | 0:dd702039127a | 129 | * |
alejandroRL | 0:dd702039127a | 130 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 131 | */ |
alejandroRL | 0:dd702039127a | 132 | MULTIPAGE_Handle MULTIPAGE_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags); |
alejandroRL | 0:dd702039127a | 133 | MULTIPAGE_Handle MULTIPAGE_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
alejandroRL | 0:dd702039127a | 134 | MULTIPAGE_Handle MULTIPAGE_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
alejandroRL | 0:dd702039127a | 135 | MULTIPAGE_Handle MULTIPAGE_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
alejandroRL | 0:dd702039127a | 136 | |
alejandroRL | 0:dd702039127a | 137 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 138 | * |
alejandroRL | 0:dd702039127a | 139 | * The callback ... |
alejandroRL | 0:dd702039127a | 140 | * |
alejandroRL | 0:dd702039127a | 141 | * Do not call it directly ! It is only to be used from within an |
alejandroRL | 0:dd702039127a | 142 | * overwritten callback. |
alejandroRL | 0:dd702039127a | 143 | */ |
alejandroRL | 0:dd702039127a | 144 | void MULTIPAGE_Callback(WM_MESSAGE * pMsg); |
alejandroRL | 0:dd702039127a | 145 | |
alejandroRL | 0:dd702039127a | 146 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 147 | * |
alejandroRL | 0:dd702039127a | 148 | * Member functions |
alejandroRL | 0:dd702039127a | 149 | * |
alejandroRL | 0:dd702039127a | 150 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 151 | */ |
alejandroRL | 0:dd702039127a | 152 | void MULTIPAGE_AddEmptyPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText); |
alejandroRL | 0:dd702039127a | 153 | void MULTIPAGE_AddPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText); |
alejandroRL | 0:dd702039127a | 154 | WM_HWIN MULTIPAGE_AttachWindow (MULTIPAGE_Handle hObj, unsigned Index, WM_HWIN hWin); |
alejandroRL | 0:dd702039127a | 155 | void MULTIPAGE_DeletePage (MULTIPAGE_Handle hObj, unsigned Index, int Delete); |
alejandroRL | 0:dd702039127a | 156 | void MULTIPAGE_DisablePage (MULTIPAGE_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 157 | void MULTIPAGE_EnablePage (MULTIPAGE_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 158 | void MULTIPAGE_EnableScrollbar(MULTIPAGE_Handle hObj, unsigned OnOff); |
alejandroRL | 0:dd702039127a | 159 | const GUI_FONT * MULTIPAGE_GetFont (MULTIPAGE_Handle hObj); |
alejandroRL | 0:dd702039127a | 160 | int MULTIPAGE_GetSelection (MULTIPAGE_Handle hObj); |
alejandroRL | 0:dd702039127a | 161 | int MULTIPAGE_GetPageText (MULTIPAGE_Handle hObj, unsigned Index, char * pBuffer, int MaxLen); |
alejandroRL | 0:dd702039127a | 162 | int MULTIPAGE_GetUserData (MULTIPAGE_Handle hObj, void * pDest, int NumBytes); |
alejandroRL | 0:dd702039127a | 163 | WM_HWIN MULTIPAGE_GetWindow (MULTIPAGE_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 164 | int MULTIPAGE_IsPageEnabled (MULTIPAGE_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 165 | void MULTIPAGE_SelectPage (MULTIPAGE_Handle hObj, unsigned Index); |
alejandroRL | 0:dd702039127a | 166 | void MULTIPAGE_SetAlign (MULTIPAGE_Handle hObj, unsigned Align); |
alejandroRL | 0:dd702039127a | 167 | int MULTIPAGE_SetBitmapEx (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int x, int y, int Index, int State); |
alejandroRL | 0:dd702039127a | 168 | int MULTIPAGE_SetBitmap (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int Index, int State); |
alejandroRL | 0:dd702039127a | 169 | void MULTIPAGE_SetBkColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index); |
alejandroRL | 0:dd702039127a | 170 | void MULTIPAGE_SetFont (MULTIPAGE_Handle hObj, const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 171 | void MULTIPAGE_SetRotation (MULTIPAGE_Handle hObj, unsigned Rotation); |
alejandroRL | 0:dd702039127a | 172 | void MULTIPAGE_SetTabWidth (MULTIPAGE_Handle hObj, int Width, int Index); |
alejandroRL | 0:dd702039127a | 173 | void MULTIPAGE_SetTabHeight (MULTIPAGE_Handle hObj, int Height); |
alejandroRL | 0:dd702039127a | 174 | void MULTIPAGE_SetTextAlign (MULTIPAGE_Handle hObj, unsigned Align); |
alejandroRL | 0:dd702039127a | 175 | void MULTIPAGE_SetText (MULTIPAGE_Handle hObj, const char * pText, unsigned Index); |
alejandroRL | 0:dd702039127a | 176 | void MULTIPAGE_SetTextColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index); |
alejandroRL | 0:dd702039127a | 177 | int MULTIPAGE_SetUserData (MULTIPAGE_Handle hObj, const void * pSrc, int NumBytes); |
alejandroRL | 0:dd702039127a | 178 | |
alejandroRL | 0:dd702039127a | 179 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 180 | * |
alejandroRL | 0:dd702039127a | 181 | * Managing default values |
alejandroRL | 0:dd702039127a | 182 | * |
alejandroRL | 0:dd702039127a | 183 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 184 | */ |
alejandroRL | 0:dd702039127a | 185 | unsigned MULTIPAGE_GetDefaultAlign (void); |
alejandroRL | 0:dd702039127a | 186 | GUI_COLOR MULTIPAGE_GetDefaultBkColor (unsigned Index); |
alejandroRL | 0:dd702039127a | 187 | const GUI_FONT * MULTIPAGE_GetDefaultFont (void); |
alejandroRL | 0:dd702039127a | 188 | GUI_COLOR MULTIPAGE_GetDefaultTextColor (unsigned Index); |
alejandroRL | 0:dd702039127a | 189 | |
alejandroRL | 0:dd702039127a | 190 | void MULTIPAGE_SetDefaultAlign (unsigned Align); |
alejandroRL | 0:dd702039127a | 191 | void MULTIPAGE_SetDefaultBkColor (GUI_COLOR Color, unsigned Index); |
alejandroRL | 0:dd702039127a | 192 | void MULTIPAGE_SetDefaultBorderSizeX(unsigned Size); |
alejandroRL | 0:dd702039127a | 193 | void MULTIPAGE_SetDefaultBorderSizeY(unsigned Size); |
alejandroRL | 0:dd702039127a | 194 | void MULTIPAGE_SetDefaultFont (const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 195 | void MULTIPAGE_SetDefaultTextColor (GUI_COLOR Color, unsigned Index); |
alejandroRL | 0:dd702039127a | 196 | |
alejandroRL | 0:dd702039127a | 197 | void MULTIPAGE_SetEffectColor (unsigned Index, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 198 | GUI_COLOR MULTIPAGE_GetEffectColor (unsigned Index); |
alejandroRL | 0:dd702039127a | 199 | int MULTIPAGE_GetNumEffectColors (void); |
alejandroRL | 0:dd702039127a | 200 | |
alejandroRL | 0:dd702039127a | 201 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 202 | * |
alejandroRL | 0:dd702039127a | 203 | * Member functions: Skinning |
alejandroRL | 0:dd702039127a | 204 | * |
alejandroRL | 0:dd702039127a | 205 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 206 | */ |
alejandroRL | 0:dd702039127a | 207 | int MULTIPAGE_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
alejandroRL | 0:dd702039127a | 208 | void MULTIPAGE_GetSkinFlexProps (MULTIPAGE_SKINFLEX_PROPS * pProps, int Index); |
alejandroRL | 0:dd702039127a | 209 | WIDGET_DRAW_ITEM_FUNC * MULTIPAGE_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
alejandroRL | 0:dd702039127a | 210 | void MULTIPAGE_SetDefaultSkinClassic(void); |
alejandroRL | 0:dd702039127a | 211 | void MULTIPAGE_SetSkinClassic (MULTIPAGE_Handle hObj); |
alejandroRL | 0:dd702039127a | 212 | void MULTIPAGE_SetSkin (MULTIPAGE_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
alejandroRL | 0:dd702039127a | 213 | void MULTIPAGE_SetSkinFlexProps (const MULTIPAGE_SKINFLEX_PROPS * pProps, int Index); |
alejandroRL | 0:dd702039127a | 214 | |
alejandroRL | 0:dd702039127a | 215 | #define MULTIPAGE_SKIN_FLEX MULTIPAGE_DrawSkinFlex |
alejandroRL | 0:dd702039127a | 216 | |
alejandroRL | 0:dd702039127a | 217 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 218 | } |
alejandroRL | 0:dd702039127a | 219 | #endif |
alejandroRL | 0:dd702039127a | 220 | |
alejandroRL | 0:dd702039127a | 221 | #endif // GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 222 | #endif // MULTIPAGE_H |
alejandroRL | 0:dd702039127a | 223 | |
alejandroRL | 0:dd702039127a | 224 | /*************************** End of file ****************************/ |