aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/frame.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-05-11 13:09:36 +1000
committerinmarket <andrewh@inmarket.com.au>2014-05-11 13:09:36 +1000
commitbdbe78a8daed85e6d794deb1f840c1ec3c3b02f1 (patch)
tree8bc8883ad298e6a8d2a8ac6a57696b41c2fdb816 /src/gwin/frame.c
parenta49b095b945756f1c32d9cfe3795a0d86151d6aa (diff)
downloaduGFX-bdbe78a8daed85e6d794deb1f840c1ec3c3b02f1.tar.gz
uGFX-bdbe78a8daed85e6d794deb1f840c1ec3c3b02f1.tar.bz2
uGFX-bdbe78a8daed85e6d794deb1f840c1ec3c3b02f1.zip
frame fixes
Diffstat (limited to 'src/gwin/frame.c')
-rw-r--r--src/gwin/frame.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gwin/frame.c b/src/gwin/frame.c
index ca37953a..16e16987 100644
--- a/src/gwin/frame.c
+++ b/src/gwin/frame.c
@@ -100,26 +100,26 @@ GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint
if (!(fo = (GFrameObject *)_gcontainerCreate(g, &fo->gc, pInit, &frameVMT)))
return 0;
- fo->btnClose = NULL;
- fo->btnMin = NULL;
- fo->btnMax = NULL;
+ fo->btnClose = 0;
+ fo->btnMin = 0;
+ fo->btnMax = 0;
/* Buttons require a border */
- if ((flags & GWIN_FRAME_CLOSE_BTN || flags & GWIN_FRAME_MINMAX_BTN) && !(flags & GWIN_FRAME_BORDER))
+ if ((flags & (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN)))
flags |= GWIN_FRAME_BORDER;
/* apply flags */
fo->gc.g.flags |= flags;
/* create and initialize the listener if any button is present. */
- if ((flags & GWIN_FRAME_CLOSE_BTN) || (flags & GWIN_FRAME_MINMAX_BTN)) {
+ if ((flags & (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN))) {
geventListenerInit(&fo->gl);
gwinAttachListener(&fo->gl);
geventRegisterCallback(&fo->gl, _callbackBtn, (GHandle)fo);
}
/* create close button if necessary */
- if (flags & GWIN_FRAME_CLOSE_BTN) {
+ if ((flags & GWIN_FRAME_CLOSE_BTN)) {
GWidgetInit wi;
gwinWidgetClearInit(&wi);
@@ -131,11 +131,11 @@ GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint
wi.g.width = BUTTON_X;
wi.g.height = BUTTON_Y;
wi.text = "X";
- fo->btnClose = gwinButtonCreate(NULL, &wi);
+ fo->btnClose = gwinGButtonCreate(g, 0, &wi);
}
/* create minimize and maximize buttons if necessary */
- if (flags & GWIN_FRAME_MINMAX_BTN) {
+ if ((flags & GWIN_FRAME_MINMAX_BTN)) {
GWidgetInit wi;
gwinWidgetClearInit(&wi);
@@ -147,14 +147,14 @@ GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint
wi.g.width = BUTTON_X;
wi.g.height = BUTTON_Y;
wi.text = "O";
- fo->btnMin = gwinButtonCreate(NULL, &wi);
+ fo->btnMin = gwinGButtonCreate(g, 0, &wi);
wi.g.x = (flags & GWIN_FRAME_CLOSE_BTN) ? fo->gc.g.width - 3*BORDER_X - 3*BUTTON_X : fo->gc.g.width - BORDER_X - BUTTON_X;
wi.g.y = (BORDER_Y - BUTTON_Y) / 2;
wi.g.width = BUTTON_X;
wi.g.height = BUTTON_Y;
wi.text = "_";
- fo->btnMax = gwinButtonCreate(NULL, &wi);
+ fo->btnMax = gwinGButtonCreate(g, 0, &wi);
}
gwinSetVisible(&fo->gc.g, pInit->g.show);