diff --git a/container_darwin.m b/container_darwin.m index 51cd1e7a..8b2899c7 100644 --- a/container_darwin.m +++ b/container_darwin.m @@ -59,7 +59,10 @@ uiLogObjCClassAllocations uiControlResize(self.child, x, y, width, height, &d); } -// TODO margined +- (BOOL)uiMargined +{ + return self->uimargined; +} - (void)uiSetMargined:(BOOL)margined { diff --git a/test.c b/test.c index 6d43afb0..e63ed893 100644 --- a/test.c +++ b/test.c @@ -102,7 +102,8 @@ static void showSpaced(uiControl *c, void *data) { char msg[] = { 'm', ' ', '0', ' ', 'p', ' ', '0', '\0' }; - // TODO margined + if (uiWindowMargined(w)) + msg[2] = '1'; if (uiStackPadded(stacks[0])) msg[6] = '1'; uiEntrySetText(e, msg); diff --git a/ui.h b/ui.h index 5a4ed3f9..9bf8601a 100644 --- a/ui.h +++ b/ui.h @@ -53,7 +53,7 @@ void uiWindowShow(uiWindow *); void uiWindowHide(uiWindow *); void uiWindowOnClosing(uiWindow *, int (*)(uiWindow *, void *), void *); void uiWindowSetChild(uiWindow *, uiControl *); -// TODO uiWindowMargined() +int uiWindowMargined(uiWindow *); void uiWindowSetMargined(uiWindow *, int); uiControl *uiNewButton(const char *); diff --git a/uipriv_darwin.h b/uipriv_darwin.h index ced12fc9..0aa348d0 100644 --- a/uipriv_darwin.h +++ b/uipriv_darwin.h @@ -36,5 +36,6 @@ extern void setStandardControlFont(NSControl *); // TODO rename to uiChild @property uiControl *child; - (void)uiUpdateNow; +- (BOOL)uiMargined; - (void)uiSetMargined:(BOOL)margined; @end diff --git a/window_darwin.m b/window_darwin.m index 0b8f1c32..2822a354 100644 --- a/window_darwin.m +++ b/window_darwin.m @@ -111,7 +111,12 @@ void uiWindowSetChild(uiWindow *w, uiControl *c) uiControlSetParent(D.container.child, (uintptr_t) (D.container)); } -// TODO margined +int uiWindowMargined(uiWindow *w) +{ + if ([D.container uiMargined]) + return 1; + return 0; +} void uiWindowSetMargined(uiWindow *w, int margined) { diff --git a/window_unix.c b/window_unix.c index 9a614af4..ba9b7ef6 100644 --- a/window_unix.c +++ b/window_unix.c @@ -82,7 +82,10 @@ void uiWindowSetChild(uiWindow *w, uiControl *c) uiControlSetParent(uiContainer(w->container)->child, (uintptr_t) (w->container)); } -// TODO margined +int uiWindowMargined(uiWindow *w) +{ + return uiContainer(w->container)->margined; +} void uiWindowSetMargined(uiWindow *w, int margined) { diff --git a/window_windows.c b/window_windows.c index c3cd93d5..cb0bffbd 100644 --- a/window_windows.c +++ b/window_windows.c @@ -180,7 +180,10 @@ void uiWindowSetChild(uiWindow *w, uiControl *c) uiControlSetParent(w->child, (uintptr_t) (w->hwnd)); } -// TODO uiWindowMargined +int uiWindowMargined(uiWindow *w) +{ + return w->margined; +} void uiWindowSetMargined(uiWindow *w, int margined) {