2014-01-06 20:20:35 +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:
|
|
|
|
*
|
|
|
|
* http://ugfx.org/license.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-02-18 22:00:52 +00:00
|
|
|
* @file src/gwin/frame.h
|
2014-01-06 20:20:35 +00:00
|
|
|
* @brief GWIN Graphic window subsystem header file.
|
|
|
|
*
|
|
|
|
* @defgroup Frame Frame
|
2014-05-20 16:05:38 +00:00
|
|
|
* @ingroup Containers
|
2014-01-06 20:20:35 +00:00
|
|
|
*
|
|
|
|
* @details A frame is a rectangular window that can have optional border as well as buttons to
|
|
|
|
* close, maximize and minimize it. The main purpose of this widget is to contain children.
|
|
|
|
*
|
|
|
|
* @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h
|
|
|
|
* @pre GWIN_NEED_FRAME must be set to TRUE in your gfxconf.h
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GWIN_FRAME_H
|
|
|
|
#define _GWIN_FRAME_H
|
|
|
|
|
2014-05-11 10:11:16 +00:00
|
|
|
/**
|
|
|
|
* @brief Flags for gwinFrameCreate()
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define GWIN_FRAME_BORDER 0x00000001
|
|
|
|
#define GWIN_FRAME_CLOSE_BTN 0x00000002
|
|
|
|
#define GWIN_FRAME_MINMAX_BTN 0x00000004
|
2014-05-20 16:05:38 +00:00
|
|
|
/** @} */
|
2014-01-06 20:20:35 +00:00
|
|
|
|
|
|
|
typedef struct GFrameObject {
|
2014-05-10 08:20:05 +00:00
|
|
|
GContainerObject gc;
|
2014-01-06 20:20:35 +00:00
|
|
|
|
2014-01-07 00:24:54 +00:00
|
|
|
GListener gl; // internal listener for the buttons
|
2014-01-06 20:53:43 +00:00
|
|
|
// These could probably be removed... I have to think harder later
|
2014-01-06 20:20:35 +00:00
|
|
|
GHandle btnClose;
|
|
|
|
GHandle btnMin;
|
|
|
|
GHandle btnMax;
|
|
|
|
} GFrameObject;
|
|
|
|
|
2014-01-06 23:29:56 +00:00
|
|
|
/**
|
|
|
|
* @brief Create a frame widget
|
|
|
|
*
|
2014-07-04 21:53:50 +00:00
|
|
|
* @details This widget provides a window like we know it from desktop systems.
|
2014-01-06 23:29:56 +00:00
|
|
|
*
|
|
|
|
* @param[in] g The GDisplay to display this window on
|
|
|
|
* @param[in] fo The GFrameObject structure to initialize. If this is NULL the structure is dynamically allocated.
|
|
|
|
* @param[in] pInit The initialization parameters
|
|
|
|
* @param[in] flags Some flags, see notes.
|
|
|
|
*
|
|
|
|
* @note Possible flags are: GWIN_FRAME_BORDER, GWIN_FRAME_CLOSE_BTN, GWIN_FRAME_MINMAX_BTN.
|
2014-07-04 21:53:50 +00:00
|
|
|
* When the close or the minimize/maximize buttons are used, the boarder is automatically invoked.
|
2014-01-07 00:24:54 +00:00
|
|
|
* @note These frame buttons are processed internally. The close button will invoke a gwinDestroy() which will
|
|
|
|
* destroy the window itself and EVERY child it contains (also children of children).
|
2014-01-06 23:29:56 +00:00
|
|
|
*
|
2014-01-07 00:29:02 +00:00
|
|
|
* @return NULL if there is no resulting widget. A valid GHandle otherwise.
|
|
|
|
*
|
2014-01-06 23:29:56 +00:00
|
|
|
* @api
|
|
|
|
*/
|
2014-05-10 08:20:05 +00:00
|
|
|
GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint32_t flags);
|
2014-01-06 20:20:35 +00:00
|
|
|
#define gwinFrameCreate(fo, pInit, flags) gwinGFrameCreate(GDISP, fo, pInit, flags);
|
|
|
|
|
|
|
|
#endif /* _GWIN_FRAME_H */
|
|
|
|
/** @} */
|
|
|
|
|