RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LISTBOX_Private.h Source File

LISTBOX_Private.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        : LISTBOX_Private.h
00040 Purpose     : Private LISTBOX include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef LISTBOX_PRIVATE_H
00045 #define LISTBOX_PRIVATE_H
00046 
00047 #include "LISTBOX.h"
00048 #include "WM.h"
00049 #include "GUI_ARRAY.h"
00050 #include "WIDGET.h"
00051 
00052 #if GUI_WINSUPPORT
00053 
00054 /*********************************************************************
00055 *
00056 *       Defines
00057 *
00058 **********************************************************************
00059 */
00060 #define LISTBOX_ITEM_SELECTED (1 << 0)
00061 #define LISTBOX_ITEM_DISABLED (1 << 1)
00062 
00063 /*********************************************************************
00064 *
00065 *       Object definition
00066 *
00067 **********************************************************************
00068 */
00069 
00070 typedef struct {
00071   U16  xSize, ySize;
00072   I32  ItemPosY;
00073   U8   Status;
00074   char acText[1];
00075 } LISTBOX_ITEM;
00076 
00077 typedef struct {
00078   const GUI_FONT * pFont;
00079   U16              ScrollStepH;
00080   GUI_COLOR aBackColor[4];
00081   GUI_COLOR aTextColor[4];
00082   GUI_COLOR aScrollbarColor[3];
00083   I16 Align;
00084 } LISTBOX_PROPS;
00085 
00086 typedef struct {
00087   WIDGET Widget;
00088   GUI_ARRAY ItemArray;
00089   WIDGET_DRAW_ITEM_FUNC* pfDrawItem;
00090   WM_SCROLL_STATE ScrollStateV;
00091   WM_SCROLL_STATE ScrollStateH;
00092   LISTBOX_PROPS Props;
00093   WM_HWIN hOwner;
00094   I16 Sel;                        /* current selection */
00095   U8 Flags;
00096   U8  ScrollbarWidth;
00097   U16 ItemSpacing;
00098   U16 ContentSizeX;
00099 } LISTBOX_Obj;
00100 
00101 /*********************************************************************
00102 *
00103 *       Macros for internal use
00104 *
00105 **********************************************************************
00106 */
00107 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00108   #define LISTBOX_INIT_ID(p) p->Widget.DebugId = LISTBOX_ID
00109 #else
00110   #define LISTBOX_INIT_ID(p)
00111 #endif
00112 
00113 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00114   LISTBOX_Obj * LISTBOX_LockH(LISTBOX_Handle h);
00115   #define LISTBOX_LOCK_H(h)   LISTBOX_LockH(h)
00116 #else
00117   #define LISTBOX_LOCK_H(h)   (LISTBOX_Obj *)GUI_LOCK_H(h)
00118 #endif
00119 
00120 /*********************************************************************
00121 *
00122 *       Private (module internal) data
00123 *
00124 **********************************************************************
00125 */
00126 
00127 extern LISTBOX_PROPS LISTBOX_DefaultProps;
00128 
00129 /*********************************************************************
00130 *
00131 *       Private (module internal) functions
00132 *
00133 **********************************************************************
00134 */
00135 unsigned     LISTBOX__GetNumItems           (const LISTBOX_Obj * pObj);
00136 const char * LISTBOX__GetpStringLocked      (LISTBOX_Handle hObj, int Index, LISTBOX_ITEM ** ppItem);
00137 void         LISTBOX__InvalidateInsideArea  (LISTBOX_Handle hObj);
00138 void         LISTBOX__InvalidateItem        (LISTBOX_Handle hObj, int Sel);
00139 void         LISTBOX__InvalidateItemAndBelow(LISTBOX_Handle hObj, int Sel);
00140 void         LISTBOX__InvalidateItemSize    (const LISTBOX_Obj * pObj, unsigned Index);
00141 void         LISTBOX__SetScrollbarColor     (LISTBOX_Handle hObj, const LISTBOX_Obj * pObj);
00142 void         LISTBOX__SetScrollbarWidth     (LISTBOX_Handle hObj, const LISTBOX_Obj * pObj);
00143 void         LISTBOX__AddSize               (LISTBOX_Obj * pObj, int Index);
00144 
00145 #endif /* GUI_WINSUPPORT */
00146 
00147 #else                            /* Avoid problems with empty object modules */
00148   void LISTBOX_C(void) {}
00149 #endif
00150 
00151 /*************************** End of file ****************************/