diff options
author | Joel Bodenmann <joel@seriouslyembedded.com> | 2016-02-10 23:30:24 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@seriouslyembedded.com> | 2016-02-10 23:30:24 +0100 |
commit | 23e04c480322709648533e6f79658805b1d43a97 (patch) | |
tree | ff472a168450fbebeb46a316c04b112e6bcf84c0 /src/gwin/gwin_frame.c | |
parent | f28e9d9eef51776b7ed9dfe573d39776c7336049 (diff) | |
parent | 507fb2d57e2d76d4a268e664efd3c59431132061 (diff) | |
download | uGFX-23e04c480322709648533e6f79658805b1d43a97.tar.gz uGFX-23e04c480322709648533e6f79658805b1d43a97.tar.bz2 uGFX-23e04c480322709648533e6f79658805b1d43a97.zip |
Merge branch 'master' of https://bitbucket.org/Tectu/ugfx
Diffstat (limited to 'src/gwin/gwin_frame.c')
-rw-r--r-- | src/gwin/gwin_frame.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c index 28d7c01d..a9abbb9b 100644 --- a/src/gwin/gwin_frame.c +++ b/src/gwin/gwin_frame.c @@ -28,11 +28,11 @@ #define FRM_BORDER_B 2 // Bottom Border /* Internal state flags */ -#define GWIN_FRAME_USER_FLAGS (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN) -#define GWIN_FRAME_CLOSE_PRESSED (GWIN_FRAME_MINMAX_BTN << 1) -#define GWIN_FRAME_MIN_PRESSED (GWIN_FRAME_MINMAX_BTN << 2) -#define GWIN_FRAME_MAX_PRESSED (GWIN_FRAME_MINMAX_BTN << 3) -#define GWIN_FRAME_REDRAW_FRAME (GWIN_FRAME_MINMAX_BTN << 4) // Only redraw the frame +#define GWIN_FRAME_USER_FLAGS (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN|GWIN_FRAME_KEEPONCLOSE) +#define GWIN_FRAME_CLOSE_PRESSED (GWIN_FRAME_KEEPONCLOSE << 1) +#define GWIN_FRAME_MIN_PRESSED (GWIN_FRAME_KEEPONCLOSE << 2) +#define GWIN_FRAME_MAX_PRESSED (GWIN_FRAME_KEEPONCLOSE << 3) +#define GWIN_FRAME_REDRAW_FRAME (GWIN_FRAME_KEEPONCLOSE << 4) // Only redraw the frame #if GWIN_FRAME_CLOSE_BTN < GWIN_FIRST_CONTROL_FLAG #error "GWIN Frame: - Flag definitions don't match" #endif @@ -96,7 +96,8 @@ static void forceFrameRedraw(GWidgetObject *gw) { gw->g.flags &= ~(GWIN_FRAME_CLOSE_PRESSED|GWIN_FRAME_MAX_PRESSED|GWIN_FRAME_MIN_PRESSED); forceFrameRedraw(gw); _gwinSendEvent(&gw->g, GEVENT_GWIN_CLOSE); - _gwinDestroy(&gw->g, REDRAW_INSESSION); + if (!(gw->g.flags & GWIN_FRAME_KEEPONCLOSE)) + _gwinDestroy(&gw->g, REDRAW_INSESSION); return; } if ((gw->g.flags & GWIN_FRAME_MAX_PRESSED)) { @@ -129,7 +130,8 @@ static void forceFrameRedraw(GWidgetObject *gw) { gw->g.flags &= ~(GWIN_FRAME_CLOSE_PRESSED|GWIN_FRAME_MAX_PRESSED|GWIN_FRAME_MIN_PRESSED); forceFrameRedraw(gw); _gwinSendEvent(&gw->g, GEVENT_GWIN_CLOSE); - _gwinDestroy(&gw->g, REDRAW_INSESSION); + if (!(gw->g.flags & GWIN_FRAME_KEEPONCLOSE)) + _gwinDestroy(&gw->g, REDRAW_INSESSION); return; } pos -= FRM_BUTTON_X; |