More work. NOW we're getting boring :v
This commit is contained in:
parent
36f572078e
commit
60becb332e
|
@ -59,6 +59,7 @@ static void boxContainerUpdateState(uiControl *c)
|
||||||
|
|
||||||
// Grid unfortunately does not have a way to set the spacing between rows and columns.
|
// Grid unfortunately does not have a way to set the spacing between rows and columns.
|
||||||
// This means we have to do padding ourselves.
|
// This means we have to do padding ourselves.
|
||||||
|
// TODO this doesn't work right for visibility purposes
|
||||||
static void resetMargins(uiBox *b)
|
static void resetMargins(uiBox *b)
|
||||||
{
|
{
|
||||||
double paddingUnit;
|
double paddingUnit;
|
||||||
|
|
|
@ -49,8 +49,7 @@ static uiCombobox *finishNewCombobox(bool editable)
|
||||||
|
|
||||||
c->combobox = new gcroot<ComboBox ^>();
|
c->combobox = new gcroot<ComboBox ^>();
|
||||||
*(c->combobox) = gcnew ComboBox();
|
*(c->combobox) = gcnew ComboBox();
|
||||||
// TODO doesn't affect the presence of a textbox
|
(*(c->combobox))->IsEditable = editable;
|
||||||
(*(c->combobox))->IsReadOnly = editable;
|
|
||||||
|
|
||||||
uiComboboxOnSelected(c, defaultOnSelected, NULL);
|
uiComboboxOnSelected(c, defaultOnSelected, NULL);
|
||||||
|
|
||||||
|
@ -61,10 +60,10 @@ static uiCombobox *finishNewCombobox(bool editable)
|
||||||
|
|
||||||
uiCombobox *uiNewCombobox(void)
|
uiCombobox *uiNewCombobox(void)
|
||||||
{
|
{
|
||||||
return finishNewCombobox(true);
|
return finishNewCombobox(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
uiCombobox *uiNewEditableCombobox(void)
|
uiCombobox *uiNewEditableCombobox(void)
|
||||||
{
|
{
|
||||||
return finishNewCombobox(false);
|
return finishNewCombobox(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,28 @@
|
||||||
struct uiGroup {
|
struct uiGroup {
|
||||||
uiWindowsControl c;
|
uiWindowsControl c;
|
||||||
gcroot<GroupBox ^> *groupbox;
|
gcroot<GroupBox ^> *groupbox;
|
||||||
|
uiControl *child;
|
||||||
int margined;
|
int margined;
|
||||||
};
|
};
|
||||||
|
|
||||||
uiWindowsDefineControl(
|
static void onDestroy(uiGroup *);
|
||||||
|
|
||||||
|
uiWindowsDefineControlWithOnDestroy(
|
||||||
uiGroup, // type name
|
uiGroup, // type name
|
||||||
uiGroupType, // type function
|
uiGroupType, // type function
|
||||||
groupbox // handle
|
groupbox, // handle
|
||||||
|
onDestroy(hthis); // on destroy
|
||||||
)
|
)
|
||||||
|
|
||||||
|
static void onDestroy(uiGroup *g)
|
||||||
|
{
|
||||||
|
if (g->child != NULL) {
|
||||||
|
(*(g->groupbox))->Content = nullptr;
|
||||||
|
uiControlSetParent(g->child, NULL);
|
||||||
|
uiControlDestroy(g->child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char *uiGroupTitle(uiGroup *g)
|
char *uiGroupTitle(uiGroup *g)
|
||||||
{
|
{
|
||||||
String ^text;
|
String ^text;
|
||||||
|
@ -30,7 +43,15 @@ void uiGroupSetTitle(uiGroup *g, const char *title)
|
||||||
|
|
||||||
void uiGroupSetChild(uiGroup *g, uiControl *c)
|
void uiGroupSetChild(uiGroup *g, uiControl *c)
|
||||||
{
|
{
|
||||||
// TODO
|
if (g->child != NULL) {
|
||||||
|
uiControlSetParent(g->child, NULL);
|
||||||
|
(*(g->groupbox))->Content = nullptr;
|
||||||
|
}
|
||||||
|
g->child = c;
|
||||||
|
if (g->child != NULL) {
|
||||||
|
(*(g->groupbox))->Content = genericHandle(g->child);
|
||||||
|
uiControlSetParent(g->child, uiControl(g));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int uiGroupMargined(uiGroup *g)
|
int uiGroupMargined(uiGroup *g)
|
||||||
|
@ -40,7 +61,13 @@ int uiGroupMargined(uiGroup *g)
|
||||||
|
|
||||||
void uiGroupSetMargined(uiGroup *g, int margined)
|
void uiGroupSetMargined(uiGroup *g, int margined)
|
||||||
{
|
{
|
||||||
// TODO
|
g->margined = margined;
|
||||||
|
// TODO Margin or Padding?
|
||||||
|
// TODO really this? or should we just use another Border?
|
||||||
|
if (g->margined)
|
||||||
|
(*(g->groupbox))->Padding = Thickness(10, 10, 10, 10);
|
||||||
|
else
|
||||||
|
(*(g->groupbox))->Padding = Thickness(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uiGroup *uiNewGroup(const char *title)
|
uiGroup *uiNewGroup(const char *title)
|
||||||
|
|
Loading…
Reference in New Issue