RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LISTBOX.h Source File

LISTBOX.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.h
00040 Purpose     : LISTBOX widget include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef LISTBOX_H
00045 #define LISTBOX_H
00046 
00047 #include "WM.h"
00048 #include "WIDGET.h"             /* Req. for WIDGET_DRAW_ITEM_FUNC */
00049 #include "DIALOG_Intern.h"      /* Req. 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 #define LISTBOX_ALL_ITEMS  -1
00065 
00066 /*********************************************************************
00067 *
00068 *       Color indices
00069 */
00070 #define LISTBOX_CI_UNSEL    0
00071 #define LISTBOX_CI_SEL      1
00072 #define LISTBOX_CI_SELFOCUS 2
00073 #define LISTBOX_CI_DISABLED 3
00074 
00075 /************************************************************
00076 *
00077 *       States
00078 */
00079 typedef WM_HMEM LISTBOX_Handle;
00080 
00081 /*********************************************************************
00082 *
00083 *               Notification codes
00084 *
00085 * The following is the list of notification codes specific to this widget,
00086 * Send with the WM_NOTIFY_PARENT message
00087 */
00088 #define LISTBOX_NOTIFICATION_LOST_FOCUS    (WM_NOTIFICATION_WIDGET + 0)
00089 
00090 /************************************************************
00091 *
00092 *       Create / Status flags
00093 */
00094 #define LISTBOX_CF_AUTOSCROLLBAR_H   (1<<0)
00095 #define LISTBOX_CF_AUTOSCROLLBAR_V   (1<<1)
00096 #define LISTBOX_CF_MULTISEL          (1<<2)
00097 #define LISTBOX_CF_WRAP              (1<<3)
00098 #define LISTBOX_SF_AUTOSCROLLBAR_H   LISTBOX_CF_AUTOSCROLLBAR_H
00099 #define LISTBOX_SF_AUTOSCROLLBAR_V   LISTBOX_CF_AUTOSCROLLBAR_V
00100 #define LISTBOX_SF_MULTISEL          LISTBOX_CF_MULTISEL
00101 #define LISTBOX_SF_WRAP              LISTBOX_CF_WRAP
00102 
00103 /*********************************************************************
00104 *
00105 *       Create functions
00106 *
00107 **********************************************************************
00108 */
00109 
00110 LISTBOX_Handle LISTBOX_Create        (const GUI_ConstString * ppText, int x0, int y0, int xSize, int ySize, int Flags);
00111 LISTBOX_Handle LISTBOX_CreateAsChild (const GUI_ConstString * ppText, WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
00112 LISTBOX_Handle LISTBOX_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText);
00113 LISTBOX_Handle LISTBOX_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText, int NumExtraBytes);
00114 LISTBOX_Handle LISTBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00115 
00116 /*********************************************************************
00117 *
00118 *       The callback ...
00119 *
00120 * Do not call it directly ! It is only to be used from within an
00121 * overwritten callback.
00122 */
00123 void LISTBOX_Callback(WM_MESSAGE * pMsg);
00124 
00125 /*********************************************************************
00126 *
00127 *       Member functions
00128 *
00129 **********************************************************************
00130 */
00131 
00132 int          LISTBOX_AddKey          (LISTBOX_Handle hObj, int Key);
00133 void         LISTBOX_AddString       (LISTBOX_Handle hObj, const char * s);
00134 void         LISTBOX_AddStringH      (LISTBOX_Handle hObj, WM_HMEM hString); /* Not to be documented!!! */
00135 void         LISTBOX_DecSel          (LISTBOX_Handle hObj);
00136 void         LISTBOX_DeleteItem      (LISTBOX_Handle hObj, unsigned int Index);
00137 void         LISTBOX_EnableWrapMode  (LISTBOX_Handle hObj, int OnOff);
00138 unsigned     LISTBOX_GetItemSpacing  (LISTBOX_Handle hObj);
00139 unsigned     LISTBOX_GetNumItems     (LISTBOX_Handle hObj);
00140 int          LISTBOX_GetSel          (LISTBOX_Handle hObj);
00141 const GUI_FONT * LISTBOX_GetFont     (LISTBOX_Handle hObj);
00142 int          LISTBOX_GetItemDisabled (LISTBOX_Handle hObj, unsigned Index);
00143 int          LISTBOX_GetItemSel      (LISTBOX_Handle hObj, unsigned Index);
00144 void         LISTBOX_GetItemText     (LISTBOX_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
00145 int          LISTBOX_GetMulti        (LISTBOX_Handle hObj);
00146 WM_HWIN      LISTBOX_GetOwner        (LISTBOX_Handle hObj);
00147 int          LISTBOX_GetScrollStepH  (LISTBOX_Handle hObj);
00148 int          LISTBOX_GetTextAlign    (LISTBOX_Handle hObj);
00149 int          LISTBOX_GetUserData     (LISTBOX_Handle hObj, void * pDest, int NumBytes);
00150 void         LISTBOX_IncSel          (LISTBOX_Handle hObj);
00151 void         LISTBOX_InsertString    (LISTBOX_Handle hObj, const char * s, unsigned int Index);
00152 void         LISTBOX_InvalidateItem  (LISTBOX_Handle hObj, int Index);
00153 int          LISTBOX_OwnerDraw       (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00154 void         LISTBOX_SetAutoScrollH  (LISTBOX_Handle hObj, int OnOff);
00155 void         LISTBOX_SetAutoScrollV  (LISTBOX_Handle hObj, int OnOff);
00156 void         LISTBOX_SetBkColor      (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR color);
00157 void         LISTBOX_SetFont         (LISTBOX_Handle hObj, const GUI_FONT * pFont);
00158 void         LISTBOX_SetItemDisabled (LISTBOX_Handle hObj, unsigned Index, int OnOff);
00159 void         LISTBOX_SetItemSel      (LISTBOX_Handle hObj, unsigned Index, int OnOff);
00160 void         LISTBOX_SetItemSpacing  (LISTBOX_Handle hObj, unsigned Value);
00161 void         LISTBOX_SetMulti        (LISTBOX_Handle hObj, int Mode);
00162 void         LISTBOX_SetOwner        (LISTBOX_Handle hObj, WM_HWIN hOwner);
00163 void         LISTBOX_SetOwnerDraw    (LISTBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
00164 void         LISTBOX_SetScrollStepH  (LISTBOX_Handle hObj, int Value);
00165 void         LISTBOX_SetSel          (LISTBOX_Handle hObj, int Sel);
00166 void         LISTBOX_SetScrollbarColor(LISTBOX_Handle hObj, unsigned Index, GUI_COLOR Color);
00167 void         LISTBOX_SetScrollbarWidth(LISTBOX_Handle hObj, unsigned Width);
00168 void         LISTBOX_SetString       (LISTBOX_Handle hObj, const char * s, unsigned int Index);
00169 void         LISTBOX_SetText         (LISTBOX_Handle hObj, const GUI_ConstString * ppText);
00170 void         LISTBOX_SetTextAlign    (LISTBOX_Handle hObj, int Align);
00171 GUI_COLOR    LISTBOX_SetTextColor    (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR Color);
00172 int          LISTBOX_SetUserData     (LISTBOX_Handle hObj, const void * pSrc, int NumBytes);
00173 int          LISTBOX_UpdateScrollers (LISTBOX_Handle hObj);
00174 
00175 /*********************************************************************
00176 *
00177 *       Managing default values
00178 *
00179 **********************************************************************
00180 */
00181 
00182 const GUI_FONT * LISTBOX_GetDefaultFont(void);
00183 int              LISTBOX_GetDefaultScrollStepH (void);
00184 GUI_COLOR        LISTBOX_GetDefaultBkColor     (unsigned Index);
00185 int              LISTBOX_GetDefaultTextAlign   (void);
00186 GUI_COLOR        LISTBOX_GetDefaultTextColor   (unsigned Index);
00187 void             LISTBOX_SetDefaultFont        (const GUI_FONT * pFont);
00188 void             LISTBOX_SetDefaultScrollStepH (int Value);
00189 void             LISTBOX_SetDefaultBkColor     (unsigned Index, GUI_COLOR Color);
00190 void             LISTBOX_SetDefaultTextAlign   (int Align);
00191 void             LISTBOX_SetDefaultTextColor   (unsigned Index, GUI_COLOR Color);
00192 
00193 /*********************************************************************
00194 *
00195 *       Compatibility to older versions
00196 *
00197 **********************************************************************
00198 */
00199 
00200 #define LISTBOX_SetBackColor(hObj, Index, Color) LISTBOX_SetBkColor(hObj, Index, Color)
00201 #define LISTBOX_DeleteString  LISTBOX_DeleteItem
00202 
00203 #if defined(__cplusplus)
00204   }
00205 #endif
00206 
00207 #endif  // GUI_WINSUPPORT
00208 #endif  // LISTBOX_H
00209 
00210 /*************************** End of file ****************************/