parent
5b71ffceee
commit
9d3f13b689
|
@ -66,8 +66,7 @@ void uiControlSetMinSize(uiControl *c, int w, int h)
|
||||||
{
|
{
|
||||||
c->MinWidth = w;
|
c->MinWidth = w;
|
||||||
c->MinHeight = h;
|
c->MinHeight = h;
|
||||||
|
(*(c->SetMinSize))(c, w, h);
|
||||||
// TODO: resize if needed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uiControlSignature 0x7569436F
|
#define uiControlSignature 0x7569436F
|
||||||
|
|
|
@ -73,6 +73,7 @@ struct uiControl {
|
||||||
void (*Enable)(uiControl *);
|
void (*Enable)(uiControl *);
|
||||||
void (*Disable)(uiControl *);
|
void (*Disable)(uiControl *);
|
||||||
void (*SetFocus)(uiControl *);
|
void (*SetFocus)(uiControl *);
|
||||||
|
void (*SetMinSize)(uiControl*, int, int);
|
||||||
|
|
||||||
int MinWidth, MinHeight;
|
int MinWidth, MinHeight;
|
||||||
};
|
};
|
||||||
|
|
|
@ -107,6 +107,10 @@ _UI_EXTERN void uiWindowsControlChildVisibilityChanged(uiWindowsControl *);
|
||||||
{ \
|
{ \
|
||||||
SetFocus(type(c)->hwnd); \
|
SetFocus(type(c)->hwnd); \
|
||||||
}
|
}
|
||||||
|
#define uiWindowsControlDefaultSetMinSize(type) \
|
||||||
|
static void type ## SetMinSize(uiControl *c, int w, int h) \
|
||||||
|
{ \
|
||||||
|
}
|
||||||
#define uiWindowsControlDefaultSyncEnableState(type) \
|
#define uiWindowsControlDefaultSyncEnableState(type) \
|
||||||
static void type ## SyncEnableState(uiWindowsControl *c, int enabled) \
|
static void type ## SyncEnableState(uiWindowsControl *c, int enabled) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -158,6 +162,7 @@ _UI_EXTERN void uiWindowsControlChildVisibilityChanged(uiWindowsControl *);
|
||||||
uiWindowsControlDefaultEnable(type) \
|
uiWindowsControlDefaultEnable(type) \
|
||||||
uiWindowsControlDefaultDisable(type) \
|
uiWindowsControlDefaultDisable(type) \
|
||||||
uiWindowsControlDefaultSetFocus(type) \
|
uiWindowsControlDefaultSetFocus(type) \
|
||||||
|
uiWindowsControlDefaultSetMinSize(type) \
|
||||||
uiWindowsControlDefaultSyncEnableState(type) \
|
uiWindowsControlDefaultSyncEnableState(type) \
|
||||||
uiWindowsControlDefaultSetParentHWND(type) \
|
uiWindowsControlDefaultSetParentHWND(type) \
|
||||||
uiWindowsControlDefaultMinimumSizeChanged(type) \
|
uiWindowsControlDefaultMinimumSizeChanged(type) \
|
||||||
|
@ -184,6 +189,7 @@ _UI_EXTERN void uiWindowsControlChildVisibilityChanged(uiWindowsControl *);
|
||||||
uiControl(var)->Enable = type ## Enable; \
|
uiControl(var)->Enable = type ## Enable; \
|
||||||
uiControl(var)->Disable = type ## Disable; \
|
uiControl(var)->Disable = type ## Disable; \
|
||||||
uiControl(var)->SetFocus = type ## SetFocus; \
|
uiControl(var)->SetFocus = type ## SetFocus; \
|
||||||
|
uiControl(var)->SetMinSize = type ## SetMinSize; \
|
||||||
uiWindowsControl(var)->SyncEnableState = type ## SyncEnableState; \
|
uiWindowsControl(var)->SyncEnableState = type ## SyncEnableState; \
|
||||||
uiWindowsControl(var)->SetParentHWND = type ## SetParentHWND; \
|
uiWindowsControl(var)->SetParentHWND = type ## SetParentHWND; \
|
||||||
uiWindowsControl(var)->MinimumSize = type ## MinimumSize; \
|
uiWindowsControl(var)->MinimumSize = type ## MinimumSize; \
|
||||||
|
|
|
@ -38,7 +38,6 @@ static void boxRelayout(uiBox *b)
|
||||||
int i;
|
int i;
|
||||||
int minimumWidth, minimumHeight;
|
int minimumWidth, minimumHeight;
|
||||||
int nVisible;
|
int nVisible;
|
||||||
uiWindowsSizing *d;
|
|
||||||
|
|
||||||
if (b->controls->size() == 0)
|
if (b->controls->size() == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -165,10 +164,8 @@ static void uiBoxMinimumSize(uiWindowsControl *c, int *width, int *height)
|
||||||
// these two contain the largest minimum width and height of all stretchy controls in the box
|
// these two contain the largest minimum width and height of all stretchy controls in the box
|
||||||
// all stretchy controls will use this value to determine the final minimum size
|
// all stretchy controls will use this value to determine the final minimum size
|
||||||
int maxStretchyWidth, maxStretchyHeight;
|
int maxStretchyWidth, maxStretchyHeight;
|
||||||
int i;
|
|
||||||
int minimumWidth, minimumHeight;
|
int minimumWidth, minimumHeight;
|
||||||
int nVisible;
|
int nVisible;
|
||||||
uiWindowsSizing sizing;
|
|
||||||
|
|
||||||
*width = 0;
|
*width = 0;
|
||||||
*height = 0;
|
*height = 0;
|
||||||
|
@ -235,6 +232,12 @@ static void uiBoxMinimumSizeChanged(uiWindowsControl *c)
|
||||||
boxRelayout(b);
|
boxRelayout(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void uiBoxSetMinSize(uiControl *c, int w, int h)
|
||||||
|
{
|
||||||
|
// checkme
|
||||||
|
uiBoxMinimumSizeChanged(uiWindowsControl(c));
|
||||||
|
}
|
||||||
|
|
||||||
uiWindowsControlDefaultLayoutRect(uiBox)
|
uiWindowsControlDefaultLayoutRect(uiBox)
|
||||||
uiWindowsControlDefaultAssignControlIDZOrder(uiBox)
|
uiWindowsControlDefaultAssignControlIDZOrder(uiBox)
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,6 @@ static void hsv2RGB(double h, double s, double v, double *r, double *g, double *
|
||||||
int h60;
|
int h60;
|
||||||
double x;
|
double x;
|
||||||
double m;
|
double m;
|
||||||
double c1, c2;
|
|
||||||
|
|
||||||
c = v * s;
|
c = v * s;
|
||||||
hPrime = h * 6;
|
hPrime = h * 6;
|
||||||
|
|
|
@ -232,6 +232,12 @@ static void uiFormMinimumSizeChanged(uiWindowsControl *c)
|
||||||
formRelayout(f);
|
formRelayout(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void uiFormSetMinSize(uiControl *c, int w, int h)
|
||||||
|
{
|
||||||
|
// checkme
|
||||||
|
uiFormMinimumSizeChanged(uiWindowsControl(c));
|
||||||
|
}
|
||||||
|
|
||||||
uiWindowsControlDefaultLayoutRect(uiForm)
|
uiWindowsControlDefaultLayoutRect(uiForm)
|
||||||
uiWindowsControlDefaultAssignControlIDZOrder(uiForm)
|
uiWindowsControlDefaultAssignControlIDZOrder(uiForm)
|
||||||
|
|
||||||
|
|
|
@ -516,6 +516,12 @@ static void uiGridMinimumSizeChanged(uiWindowsControl *c)
|
||||||
gridRelayout(g);
|
gridRelayout(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void uiGridSetMinSize(uiControl *c, int w, int h)
|
||||||
|
{
|
||||||
|
// checkme
|
||||||
|
uiGridMinimumSizeChanged(uiWindowsControl(c));
|
||||||
|
}
|
||||||
|
|
||||||
uiWindowsControlDefaultLayoutRect(uiGrid)
|
uiWindowsControlDefaultLayoutRect(uiGrid)
|
||||||
uiWindowsControlDefaultAssignControlIDZOrder(uiGrid)
|
uiWindowsControlDefaultAssignControlIDZOrder(uiGrid)
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,12 @@ static void uiGroupMinimumSizeChanged(uiWindowsControl *c)
|
||||||
groupRelayout(g);
|
groupRelayout(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void uiGroupSetMinSize(uiControl *c, int w, int h)
|
||||||
|
{
|
||||||
|
// checkme
|
||||||
|
uiGroupMinimumSizeChanged(uiWindowsControl(c));
|
||||||
|
}
|
||||||
|
|
||||||
uiWindowsControlDefaultLayoutRect(uiGroup)
|
uiWindowsControlDefaultLayoutRect(uiGroup)
|
||||||
uiWindowsControlDefaultAssignControlIDZOrder(uiGroup)
|
uiWindowsControlDefaultAssignControlIDZOrder(uiGroup)
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,12 @@ static void uiTabMinimumSizeChanged(uiWindowsControl *c)
|
||||||
tabRelayout(t);
|
tabRelayout(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void uiTabSetMinSize(uiControl *c, int w, int h)
|
||||||
|
{
|
||||||
|
// checkme
|
||||||
|
uiTabMinimumSizeChanged(uiWindowsControl(c));
|
||||||
|
}
|
||||||
|
|
||||||
uiWindowsControlDefaultLayoutRect(uiTab)
|
uiWindowsControlDefaultLayoutRect(uiTab)
|
||||||
uiWindowsControlDefaultAssignControlIDZOrder(uiTab)
|
uiWindowsControlDefaultAssignControlIDZOrder(uiTab)
|
||||||
|
|
||||||
|
|
|
@ -309,6 +309,11 @@ static void uiWindowLayoutRect(uiWindowsControl *c, RECT *r)
|
||||||
uiWindowsEnsureGetClientRect(w->hwnd, r);
|
uiWindowsEnsureGetClientRect(w->hwnd, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void uiWindowSetMinSize(uiControl *c, int w, int h)
|
||||||
|
{
|
||||||
|
// TODO: relayout, eventually
|
||||||
|
}
|
||||||
|
|
||||||
uiWindowsControlDefaultAssignControlIDZOrder(uiWindow)
|
uiWindowsControlDefaultAssignControlIDZOrder(uiWindow)
|
||||||
|
|
||||||
static void uiWindowChildVisibilityChanged(uiWindowsControl *c)
|
static void uiWindowChildVisibilityChanged(uiWindowsControl *c)
|
||||||
|
|
Loading…
Reference in New Issue