Added uiWindowMargined() and implemented it on all platforms.

This commit is contained in:
Pietro Gagliardi 2015-04-09 21:11:56 -04:00
parent 5c2ead2fea
commit 759feeb7a1
7 changed files with 22 additions and 6 deletions

View File

@ -59,7 +59,10 @@ uiLogObjCClassAllocations
uiControlResize(self.child, x, y, width, height, &d);
}
// TODO margined
- (BOOL)uiMargined
{
return self->uimargined;
}
- (void)uiSetMargined:(BOOL)margined
{

3
test.c
View File

@ -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);

2
ui.h
View File

@ -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 *);

View File

@ -36,5 +36,6 @@ extern void setStandardControlFont(NSControl *);
// TODO rename to uiChild
@property uiControl *child;
- (void)uiUpdateNow;
- (BOOL)uiMargined;
- (void)uiSetMargined:(BOOL)margined;
@end

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{