diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-02-19 08:00:52 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-02-19 08:00:52 +1000 |
commit | b82448c3e23663a25a423402343fbca78253b80c (patch) | |
tree | 57a03e35b88f6e434b6c4d084695fc5ce1061932 /src/gwin/frame.h | |
parent | dcedf414136e55e6dacbe736babe748e1374e19e (diff) | |
parent | 37966ff16d923bbca53c9464815cb49cbd7fc3be (diff) | |
download | uGFX-b82448c3e23663a25a423402343fbca78253b80c.tar.gz uGFX-b82448c3e23663a25a423402343fbca78253b80c.tar.bz2 uGFX-b82448c3e23663a25a423402343fbca78253b80c.zip |
Merge branch 'master' into gwin
Diffstat (limited to 'src/gwin/frame.h')
-rw-r--r-- | src/gwin/frame.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/gwin/frame.h b/src/gwin/frame.h new file mode 100644 index 00000000..9d1d63fb --- /dev/null +++ b/src/gwin/frame.h @@ -0,0 +1,68 @@ +/* + * 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 + */ + +/** + * @file src/gwin/frame.h + * @brief GWIN Graphic window subsystem header file. + * + * @defgroup Frame Frame + * @ingroup GWIN + * + * @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 + +#include "src/gwin/class_gwin.h" + +// Flags for gwinFrameCreate() +#define GWIN_FRAME_BORDER (GWIN_FIRST_CONTROL_FLAG << 0) +#define GWIN_FRAME_CLOSE_BTN (GWIN_FIRST_CONTROL_FLAG << 1) +#define GWIN_FRAME_MINMAX_BTN (GWIN_FIRST_CONTROL_FLAG << 2) + +typedef struct GFrameObject { + GWidgetObject w; + + GListener gl; // internal listener for the buttons + // These could probably be removed... I have to think harder later + GHandle btnClose; + GHandle btnMin; + GHandle btnMax; +} GFrameObject; + +/** + * @brief Create a frame widget + * + * @details This widget provides a window like we know it from desktop systems. You usually use this together with + * gwinAddChild(). + * + * @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. + * Whether the close or the minimize maximize buttons are used, the boarder is automatically invoked. + * @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). + * + * @return NULL if there is no resulting widget. A valid GHandle otherwise. + * + * @api + */ +GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint16_t flags); +#define gwinFrameCreate(fo, pInit, flags) gwinGFrameCreate(GDISP, fo, pInit, flags); + +#endif /* _GWIN_FRAME_H */ +/** @} */ + |