Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MULTIPAGE.h
00001 /********************************************************************* 00002 * SEGGER Microcontroller GmbH * 00003 * Solutions for real time microcontroller applications * 00004 ********************************************************************** 00005 * * 00006 * (c) 1996 - 2018 SEGGER Microcontroller GmbH * 00007 * * 00008 * Internet: www.segger.com Support: support@segger.com * 00009 * * 00010 ********************************************************************** 00011 00012 ** emWin V5.48 - Graphical user interface for embedded applications ** 00013 All Intellectual Property rights in the Software belongs to SEGGER. 00014 emWin is protected by international copyright laws. Knowledge of the 00015 source code may not be used to write a similar product. This file may 00016 only be used in accordance with the following terms: 00017 00018 The software has been licensed to Cypress Semiconductor Corporation, 00019 whose registered office is situated at 198 Champion Ct. San Jose, CA 00020 95134 USA solely for the purposes of creating libraries for Cypress 00021 PSoC3 and PSoC5 processor-based devices, sublicensed and distributed 00022 under the terms and conditions of the Cypress End User License 00023 Agreement. 00024 Full source code is available at: www.segger.com 00025 00026 We appreciate your understanding and fairness. 00027 ---------------------------------------------------------------------- 00028 Licensing information 00029 Licensor: SEGGER Microcontroller Systems LLC 00030 Licensed to: Cypress Semiconductor Corp, 198 Champion Ct., San Jose, CA 95134, USA 00031 Licensed SEGGER software: emWin 00032 License number: GUI-00319 00033 License model: Services and License Agreement, signed June 10th, 2009 00034 Licensed platform: Any Cypress platform (Initial targets are: PSoC3, PSoC5) 00035 ---------------------------------------------------------------------- 00036 Support and Update Agreement (SUA) 00037 SUA period: 2009-06-12 - 2022-07-27 00038 Contact to extend SUA: sales@segger.com 00039 ---------------------------------------------------------------------- 00040 File : MULTIPAGE.h 00041 Purpose : MULTIPAGE include 00042 --------------------END-OF-HEADER------------------------------------- 00043 */ 00044 00045 #ifndef MULTIPAGE_H 00046 #define MULTIPAGE_H 00047 00048 #include "WM.h" 00049 #include "DIALOG.h" // Required for Create indirect data structure 00050 00051 #if GUI_WINSUPPORT 00052 00053 #if defined(__cplusplus) 00054 extern "C" { // Make sure we have C-declarations in C++ programs 00055 #endif 00056 00057 /********************************************************************* 00058 * 00059 * Defines 00060 * 00061 ********************************************************************** 00062 */ 00063 /********************************************************************* 00064 * 00065 * Create / Status flags 00066 */ 00067 #define MULTIPAGE_ALIGN_LEFT (0 << 0) 00068 #define MULTIPAGE_ALIGN_RIGHT (1 << 0) 00069 #define MULTIPAGE_ALIGN_TOP (0 << 2) 00070 #define MULTIPAGE_ALIGN_BOTTOM (1 << 2) 00071 00072 #define MULTIPAGE_CF_ROTATE_CW WIDGET_CF_VERTICAL 00073 00074 #define MULTIPAGE_CI_DISABLED 0 00075 #define MULTIPAGE_CI_ENABLED 1 00076 00077 #define MULTIPAGE_SKIN_FRAME_LEFT (1 << 0) 00078 #define MULTIPAGE_SKIN_FRAME_RIGHT (1 << 1) 00079 #define MULTIPAGE_SKIN_FRAME_TOP (1 << 2) 00080 #define MULTIPAGE_SKIN_FRAME_BOTTOM (1 << 3) 00081 #define MULTIPAGE_SKIN_FRAME_ALL (MULTIPAGE_SKIN_FRAME_LEFT | MULTIPAGE_SKIN_FRAME_RIGHT | MULTIPAGE_SKIN_FRAME_TOP | MULTIPAGE_SKIN_FRAME_BOTTOM) 00082 00083 #define MULTIPAGE_SKINFLEX_PI_ENABLED 0 00084 #define MULTIPAGE_SKINFLEX_PI_SELECTED 1 00085 #define MULTIPAGE_SKINFLEX_PI_DISABLED 2 00086 00087 #define SCROLLBAR_SIZE 32 // Defines the space for the scrollbar arrows 00088 00089 #define MULTIPAGE_BI_SELECTED 0 00090 #define MULTIPAGE_BI_UNSELECTED 1 00091 #define MULTIPAGE_BI_DISABLED 2 00092 #define MULTIPAGE_BI_MAX 3 // The defines above are used as array indices. 00093 00094 /********************************************************************* 00095 * 00096 * Public Types 00097 * 00098 ********************************************************************** 00099 */ 00100 typedef WM_HMEM MULTIPAGE_Handle; 00101 00102 typedef struct { 00103 GUI_COLOR BkColor; 00104 GUI_COLOR aBkUpper[2]; 00105 GUI_COLOR aBkLower[2]; 00106 GUI_COLOR FrameColor; 00107 GUI_COLOR TextColor; 00108 } MULTIPAGE_SKINFLEX_PROPS; 00109 00110 typedef struct { 00111 U8 SelSideBorderInc; // Number of pixels to add on both sides when drawing the selected item. 00112 U8 SelTopBorderInc; // Number of pixels to add on top of selected items. 00113 } MULTIPAGE_SKIN_PROPS; 00114 00115 typedef struct { 00116 #if GUI_SUPPORT_ROTATION 00117 GUI_ROTATION * pRotation; 00118 #endif 00119 unsigned Align; 00120 int Sel; 00121 U16 State; 00122 U8 FrameFlags; // Flags to let the drawing function know which parts of the frame to display. 00123 U8 PageStatus; 00124 GUI_DRAW_HANDLE * pDrawObj; 00125 } MULTIPAGE_SKIN_INFO; 00126 00127 /********************************************************************* 00128 * 00129 * Create functions 00130 * 00131 ********************************************************************** 00132 */ 00133 MULTIPAGE_Handle MULTIPAGE_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags); 00134 MULTIPAGE_Handle MULTIPAGE_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); 00135 MULTIPAGE_Handle MULTIPAGE_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); 00136 MULTIPAGE_Handle MULTIPAGE_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); 00137 00138 /********************************************************************* 00139 * 00140 * The callback ... 00141 * 00142 * Do not call it directly ! It is only to be used from within an 00143 * overwritten callback. 00144 */ 00145 void MULTIPAGE_Callback(WM_MESSAGE * pMsg); 00146 00147 /********************************************************************* 00148 * 00149 * Member functions 00150 * 00151 ********************************************************************** 00152 */ 00153 void MULTIPAGE_AddEmptyPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText); 00154 void MULTIPAGE_AddPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText); 00155 WM_HWIN MULTIPAGE_AttachWindow (MULTIPAGE_Handle hObj, unsigned Index, WM_HWIN hWin); 00156 void MULTIPAGE_DeletePage (MULTIPAGE_Handle hObj, unsigned Index, int Delete); 00157 void MULTIPAGE_DisablePage (MULTIPAGE_Handle hObj, unsigned Index); 00158 void MULTIPAGE_EnablePage (MULTIPAGE_Handle hObj, unsigned Index); 00159 void MULTIPAGE_EnableScrollbar(MULTIPAGE_Handle hObj, unsigned OnOff); 00160 GUI_COLOR MULTIPAGE_GetBkColor (MULTIPAGE_Handle hObj, unsigned Index); 00161 const GUI_FONT * MULTIPAGE_GetFont (MULTIPAGE_Handle hObj); 00162 int MULTIPAGE_GetSelection (MULTIPAGE_Handle hObj); 00163 int MULTIPAGE_GetPageText (MULTIPAGE_Handle hObj, unsigned Index, char * pBuffer, int MaxLen); 00164 GUI_COLOR MULTIPAGE_GetTextColor (MULTIPAGE_Handle hObj, unsigned Index); 00165 int MULTIPAGE_GetUserData (MULTIPAGE_Handle hObj, void * pDest, int NumBytes); 00166 WM_HWIN MULTIPAGE_GetWindow (MULTIPAGE_Handle hObj, unsigned Index); 00167 int MULTIPAGE_IsPageEnabled (MULTIPAGE_Handle hObj, unsigned Index); 00168 void MULTIPAGE_SelectPage (MULTIPAGE_Handle hObj, unsigned Index); 00169 void MULTIPAGE_SetAlign (MULTIPAGE_Handle hObj, unsigned Align); 00170 int MULTIPAGE_SetBitmapEx (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int x, int y, int Index, int State); 00171 int MULTIPAGE_SetBitmap (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int Index, int State); 00172 void MULTIPAGE_SetBkColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index); 00173 void MULTIPAGE_SetFont (MULTIPAGE_Handle hObj, const GUI_FONT * pFont); 00174 void MULTIPAGE_SetRotation (MULTIPAGE_Handle hObj, unsigned Rotation); 00175 void MULTIPAGE_SetTabWidth (MULTIPAGE_Handle hObj, int Width, int Index); 00176 void MULTIPAGE_SetTabHeight (MULTIPAGE_Handle hObj, int Height); 00177 void MULTIPAGE_SetTextAlign (MULTIPAGE_Handle hObj, unsigned Align); 00178 void MULTIPAGE_SetText (MULTIPAGE_Handle hObj, const char * pText, unsigned Index); 00179 void MULTIPAGE_SetTextColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index); 00180 int MULTIPAGE_SetUserData (MULTIPAGE_Handle hObj, const void * pSrc, int NumBytes); 00181 00182 /********************************************************************* 00183 * 00184 * Managing default values 00185 * 00186 ********************************************************************** 00187 */ 00188 unsigned MULTIPAGE_GetDefaultAlign (void); 00189 GUI_COLOR MULTIPAGE_GetDefaultBkColor (unsigned Index); 00190 const GUI_FONT * MULTIPAGE_GetDefaultFont (void); 00191 GUI_COLOR MULTIPAGE_GetDefaultTextColor (unsigned Index); 00192 00193 void MULTIPAGE_SetDefaultAlign (unsigned Align); 00194 void MULTIPAGE_SetDefaultBkColor (GUI_COLOR Color, unsigned Index); 00195 void MULTIPAGE_SetDefaultBorderSizeX(unsigned Size); 00196 void MULTIPAGE_SetDefaultBorderSizeY(unsigned Size); 00197 void MULTIPAGE_SetDefaultFont (const GUI_FONT * pFont); 00198 void MULTIPAGE_SetDefaultTextColor (GUI_COLOR Color, unsigned Index); 00199 00200 void MULTIPAGE_SetEffectColor (unsigned Index, GUI_COLOR Color); 00201 GUI_COLOR MULTIPAGE_GetEffectColor (unsigned Index); 00202 int MULTIPAGE_GetNumEffectColors (void); 00203 00204 /********************************************************************* 00205 * 00206 * Member functions: Skinning 00207 * 00208 ********************************************************************** 00209 */ 00210 int MULTIPAGE_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); 00211 void MULTIPAGE_GetSkinFlexProps (MULTIPAGE_SKINFLEX_PROPS * pProps, int Index); 00212 WIDGET_DRAW_ITEM_FUNC * MULTIPAGE_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00213 void MULTIPAGE_SetDefaultSkinClassic(void); 00214 void MULTIPAGE_SetSkinClassic (MULTIPAGE_Handle hObj); 00215 void MULTIPAGE_SetSkin (MULTIPAGE_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00216 void MULTIPAGE_SetSkinFlexProps (const MULTIPAGE_SKINFLEX_PROPS * pProps, int Index); 00217 00218 #define MULTIPAGE_SKIN_FLEX MULTIPAGE_DrawSkinFlex 00219 00220 #if defined(__cplusplus) 00221 } 00222 #endif 00223 00224 #endif // GUI_WINSUPPORT 00225 #endif // MULTIPAGE_H 00226 00227 /*************************** End of file ****************************/
Generated on Thu Jul 14 2022 12:58:43 by
