STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
LISTBOX_Private.h
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.28 - Graphical user interface for embedded applications **
13 All Intellectual Property rights in the Software belongs to SEGGER.
14 emWin is protected by international copyright laws. Knowledge of the
15 source code may not be used to write a similar product. This file may
16 only be used in accordance with the following terms:
17 
18 The software has been licensed to STMicroelectronics International
19 N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
20 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
21 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
22 troller products commercialized by Licensee only, sublicensed and dis_
23 tributed under the terms and conditions of the End User License Agree_
24 ment supplied by STMicroelectronics International N.V.
25 Full source code is available at: www.segger.com
26 
27 We appreciate your understanding and fairness.
28 ----------------------------------------------------------------------
29 File : LISTBOX_Private.h
30 Purpose : Private LISTBOX include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef LISTBOX_PRIVATE_H
35 #define LISTBOX_PRIVATE_H
36 
37 #include "LISTBOX.h"
38 #include "WM.h"
39 #include "GUI_ARRAY.h"
40 #include "WIDGET.h"
41 
42 #if GUI_WINSUPPORT
43 
44 /*********************************************************************
45 *
46 * Defines
47 *
48 **********************************************************************
49 */
50 #define LISTBOX_ITEM_SELECTED (1 << 0)
51 #define LISTBOX_ITEM_DISABLED (1 << 1)
52 
53 /*********************************************************************
54 *
55 * Object definition
56 *
57 **********************************************************************
58 */
59 
60 typedef struct {
61  U16 xSize, ySize;
62  I32 ItemPosY;
63  U8 Status;
64  char acText[1];
65 } LISTBOX_ITEM;
66 
67 typedef struct {
68  const GUI_FONT * pFont;
69  U16 ScrollStepH;
70  GUI_COLOR aBackColor[4];
71  GUI_COLOR aTextColor[4];
72  GUI_COLOR aScrollbarColor[3];
73  I16 Align;
74 } LISTBOX_PROPS;
75 
76 typedef struct {
77  WIDGET Widget;
78  GUI_ARRAY ItemArray;
79  WIDGET_DRAW_ITEM_FUNC* pfDrawItem;
80  WM_SCROLL_STATE ScrollStateV;
81  WM_SCROLL_STATE ScrollStateH;
82  LISTBOX_PROPS Props;
83  WM_HWIN hOwner;
84  I16 Sel; /* current selection */
85  U8 Flags;
86  U8 ScrollbarWidth;
87  U16 ItemSpacing;
88  U16 ContentSizeX;
89 } LISTBOX_Obj;
90 
91 /*********************************************************************
92 *
93 * Macros for internal use
94 *
95 **********************************************************************
96 */
97 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
98  #define LISTBOX_INIT_ID(p) p->Widget.DebugId = LISTBOX_ID
99 #else
100  #define LISTBOX_INIT_ID(p)
101 #endif
102 
103 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
104  LISTBOX_Obj * LISTBOX_LockH(LISTBOX_Handle h);
105  #define LISTBOX_LOCK_H(h) LISTBOX_LockH(h)
106 #else
107  #define LISTBOX_LOCK_H(h) (LISTBOX_Obj *)GUI_LOCK_H(h)
108 #endif
109 
110 /*********************************************************************
111 *
112 * Private (module internal) data
113 *
114 **********************************************************************
115 */
116 
117 extern LISTBOX_PROPS LISTBOX_DefaultProps;
118 
119 /*********************************************************************
120 *
121 * Private (module internal) functions
122 *
123 **********************************************************************
124 */
125 unsigned LISTBOX__GetNumItems (const LISTBOX_Obj * pObj);
126 const char * LISTBOX__GetpStringLocked (LISTBOX_Handle hObj, int Index, LISTBOX_ITEM ** ppItem);
127 void LISTBOX__InvalidateInsideArea (LISTBOX_Handle hObj);
128 void LISTBOX__InvalidateItem (LISTBOX_Handle hObj, int Sel);
129 void LISTBOX__InvalidateItemAndBelow(LISTBOX_Handle hObj, int Sel);
130 void LISTBOX__InvalidateItemSize (const LISTBOX_Obj * pObj, unsigned Index);
131 void LISTBOX__SetScrollbarColor (LISTBOX_Handle hObj, const LISTBOX_Obj * pObj);
132 void LISTBOX__SetScrollbarWidth (LISTBOX_Handle hObj, const LISTBOX_Obj * pObj);
133 void LISTBOX__AddSize (LISTBOX_Obj * pObj, int Index);
134 
135 #endif /* GUI_WINSUPPORT */
136 
137 #else /* Avoid problems with empty object modules */
138  void LISTBOX_C(void) {}
139 #endif
140 
141 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define I16
Definition: Global.h:56
#define U16
Definition: Global.h:47
#define I32
Definition: Global.h:59
#define U8
Definition: Global.h:44