RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DROPDOWN.h Source File

DROPDOWN.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller GmbH & Co. KG                *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2016  SEGGER Microcontroller GmbH & Co. KG       *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.38 - 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  NXP Semiconductors USA, Inc.  whose
00019 registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose,
00020 CA 95134, USA  solely for  the  purposes  of  creating  libraries  for
00021 NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and
00022 distributed under the terms and conditions of the NXP 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 
00030 Licensor:                 SEGGER Microcontroller Systems LLC
00031 Licensed to:              NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
00032 Licensed SEGGER software: emWin
00033 License number:           GUI-00186
00034 License model:            emWin License Agreement, dated August 20th 2011
00035 Licensed product:         -
00036 Licensed platform:        NXP's ARM 7/9, Cortex-M0,M3,M4
00037 Licensed number of seats: -
00038 ----------------------------------------------------------------------
00039 File        : DROPDOWN.h
00040 Purpose     : Multiple choice object include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef DROPDOWN_H
00045 #define DROPDOWN_H
00046 
00047 #include "WM.h"
00048 #include "DIALOG_Intern.h"      /* Req. for Create indirect data structure */
00049 #include "LISTBOX.h"
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 *       Create flags
00060 */
00061 #define DROPDOWN_CF_AUTOSCROLLBAR   (1 << 0)
00062 #define DROPDOWN_CF_UP              (1 << 1)
00063 
00064 /*********************************************************************
00065 *
00066 *       Color indices
00067 */
00068 #define DROPDOWN_CI_UNSEL    0
00069 #define DROPDOWN_CI_SEL      1
00070 #define DROPDOWN_CI_SELFOCUS 2
00071 
00072 #define DROPDOWN_CI_ARROW    0
00073 #define DROPDOWN_CI_BUTTON   1
00074 
00075 /*********************************************************************
00076 *
00077 *       Skinning property indices
00078 */
00079 #define DROPDOWN_SKINFLEX_PI_EXPANDED 0
00080 #define DROPDOWN_SKINFLEX_PI_FOCUSSED 1
00081 #define DROPDOWN_SKINFLEX_PI_ENABLED  2
00082 #define DROPDOWN_SKINFLEX_PI_DISABLED 3
00083 
00084 /*********************************************************************
00085 *
00086 *       Types
00087 *
00088 **********************************************************************
00089 */
00090 typedef WM_HMEM DROPDOWN_Handle;
00091 
00092 typedef struct {
00093   GUI_COLOR aColorFrame[3];
00094   GUI_COLOR aColorUpper[2];
00095   GUI_COLOR aColorLower[2];
00096   GUI_COLOR ColorArrow;
00097   GUI_COLOR ColorText;
00098   GUI_COLOR ColorSep;
00099   int Radius;
00100 } DROPDOWN_SKINFLEX_PROPS;
00101 
00102 /*********************************************************************
00103 *
00104 *       Create functions
00105 *
00106 **********************************************************************
00107 */
00108 DROPDOWN_Handle DROPDOWN_Create        (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
00109 DROPDOWN_Handle DROPDOWN_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
00110 DROPDOWN_Handle DROPDOWN_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
00111 DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb);
00112 
00113 /*********************************************************************
00114 *
00115 *       The callback ...
00116 *
00117 * Do not call it directly ! It is only to be used from within an
00118 * overwritten callback.
00119 */
00120 void DROPDOWN_Callback(WM_MESSAGE * pMsg);
00121 
00122 /*********************************************************************
00123 *
00124 *       Member functions
00125 *
00126 **********************************************************************
00127 */
00128 void     DROPDOWN_AddKey           (DROPDOWN_Handle hObj, int Key);
00129 void     DROPDOWN_AddString        (DROPDOWN_Handle hObj, const char* s);
00130 void     DROPDOWN_Collapse         (DROPDOWN_Handle hObj);
00131 void     DROPDOWN_DecSel           (DROPDOWN_Handle hObj);
00132 void     DROPDOWN_DecSelExp        (DROPDOWN_Handle hObj);
00133 void     DROPDOWN_DeleteItem       (DROPDOWN_Handle hObj, unsigned int Index);
00134 void     DROPDOWN_Expand           (DROPDOWN_Handle hObj);
00135 unsigned DROPDOWN_GetItemDisabled  (DROPDOWN_Handle hObj, unsigned Index);
00136 unsigned DROPDOWN_GetItemSpacing   (DROPDOWN_Handle hObj);
00137 int      DROPDOWN_GetItemText      (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
00138 LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj);
00139 int      DROPDOWN_GetNumItems      (DROPDOWN_Handle hObj);
00140 int      DROPDOWN_GetSel           (DROPDOWN_Handle hObj);
00141 int      DROPDOWN_GetSelExp        (DROPDOWN_Handle hObj);
00142 int      DROPDOWN_GetUserData      (DROPDOWN_Handle hObj, void * pDest, int NumBytes);
00143 void     DROPDOWN_IncSel           (DROPDOWN_Handle hObj);
00144 void     DROPDOWN_IncSelExp        (DROPDOWN_Handle hObj);
00145 void     DROPDOWN_InsertString     (DROPDOWN_Handle hObj, const char* s, unsigned int Index);
00146 void     DROPDOWN_SetAutoScroll    (DROPDOWN_Handle hObj, int OnOff);
00147 void     DROPDOWN_SetBkColor       (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color);
00148 void     DROPDOWN_SetColor         (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color);
00149 void     DROPDOWN_SetFont          (DROPDOWN_Handle hObj, const GUI_FONT * pfont);
00150 void     DROPDOWN_SetItemDisabled  (DROPDOWN_Handle hObj, unsigned Index, int OnOff);
00151 void     DROPDOWN_SetItemSpacing   (DROPDOWN_Handle hObj, unsigned Value);
00152 int      DROPDOWN_SetListHeight    (DROPDOWN_Handle hObj, unsigned Height);
00153 void     DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color);
00154 void     DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width);
00155 void     DROPDOWN_SetSel           (DROPDOWN_Handle hObj, int Sel);
00156 void     DROPDOWN_SetSelExp        (DROPDOWN_Handle hObj, int Sel);
00157 void     DROPDOWN_SetTextAlign     (DROPDOWN_Handle hObj, int Align);
00158 void     DROPDOWN_SetTextColor     (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color);
00159 void     DROPDOWN_SetTextHeight    (DROPDOWN_Handle hObj, unsigned TextHeight);
00160 int      DROPDOWN_SetUpMode        (DROPDOWN_Handle hObj, int OnOff);
00161 int      DROPDOWN_SetUserData      (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes);
00162 
00163 /*********************************************************************
00164 *
00165 *       Member functions: Skinning
00166 *
00167 **********************************************************************
00168 */
00169 void DROPDOWN_GetSkinFlexProps     (DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
00170 void DROPDOWN_SetSkinClassic       (DROPDOWN_Handle hObj);
00171 void DROPDOWN_SetSkin              (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00172 int  DROPDOWN_DrawSkinFlex         (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00173 void DROPDOWN_SetSkinFlexProps     (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
00174 void DROPDOWN_SetDefaultSkinClassic(void);
00175 WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00176 
00177 #define DROPDOWN_SKIN_FLEX    DROPDOWN_DrawSkinFlex
00178 
00179 /*********************************************************************
00180 *
00181 *       Managing default values
00182 *
00183 **********************************************************************
00184 */
00185 GUI_COLOR        DROPDOWN_GetDefaultBkColor       (int Index);
00186 GUI_COLOR        DROPDOWN_GetDefaultColor         (int Index);
00187 const GUI_FONT * DROPDOWN_GetDefaultFont          (void);
00188 GUI_COLOR        DROPDOWN_GetDefaultScrollbarColor(int Index);
00189 void             DROPDOWN_SetDefaultFont          (const GUI_FONT * pFont);
00190 GUI_COLOR        DROPDOWN_SetDefaultBkColor       (int Index, GUI_COLOR Color);
00191 GUI_COLOR        DROPDOWN_SetDefaultColor         (int Index, GUI_COLOR Color);
00192 GUI_COLOR        DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color);
00193 
00194 #if defined(__cplusplus)
00195   }
00196 #endif
00197 
00198 #endif  // GUI_WINSUPPORT
00199 #endif  // DROPDOWN_H
00200 
00201 /*************************** End of file ****************************/