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