ugfx/include/gwin/list.h

67 lines
1.6 KiB
C
Raw Normal View History

2013-07-17 15:49:21 +00:00
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
2013-07-21 20:20:37 +00:00
* http://ugfx.org/license.html
2013-07-17 15:49:21 +00:00
*/
/**
* @file include/gwin/list.h
* @brief GWIN list widget header file
*
* @defgroup List List
* @ingroup GWIN
*
* @details GWIN allows it to create a list widget.
*
* @pre GFX_USE_GDISP must be set to TRUE in your gfxconf.h
* @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h
* @pre GDISP_NEED_TEXT must be set to TRUE in your gfxconf.h
* @pre GWIN_NEED_LIST must be set to TRUE in your gfxconf.h
* @pre The font you want to use must be enabled in your gfxconf.h
*
* @{
*/
#ifndef _GWIN_LIST_H
#define _GWIN_LIST_H
// This file is included within "gwin/gwin.h"
/**
* @brief The event type for a list event
*/
#define GEVENT_GWIN_LIST (GEVENT_GWIN_FIRST+4)
/**
* @brief A list event
*/
typedef struct GEventGWinList {
2013-07-25 17:15:51 +00:00
GEventType type; // The type of this event (GEVENT_GWIN_LIST)
GHandle list; // The list
int item; // The item that has been selected (or unselected in a multi-select listbox)
2013-07-17 15:49:21 +00:00
} GEventGWinList;
// A list window
typedef struct GListObject {
GWidgetObject w;
2013-07-25 17:15:51 +00:00
int cnt; // Number of items currently in the list (quicker than counting each time)
gfxQueueASync list_head; // The list of items
2013-07-17 15:49:21 +00:00
} GListObject;
#ifdef __cplusplus
extern "C" {
#endif
GHandle gwinListCreate(GListObject *widget, GWidgetInit *pInit);
2013-07-25 17:15:51 +00:00
int gwinListAddItem(GHandle gh, const char* item, bool_t useAlloc);
2013-07-17 15:49:21 +00:00
#ifdef __cplusplus
}
#endif
#endif // _GWIN_LIST_H
/** @} */