Cleaned up some control ID stuff.
This commit is contained in:
parent
8b42c22caf
commit
56853c5d86
|
@ -221,6 +221,9 @@ _UI_EXTERN HWND uiWindowsMakeContainer(void (*onResize)(void *data), void *data)
|
||||||
// TODO document
|
// TODO document
|
||||||
_UI_EXTERN void uiWindowsControlNotifyMinimumSizeChanged(uiWindowsControl *);
|
_UI_EXTERN void uiWindowsControlNotifyMinimumSizeChanged(uiWindowsControl *);
|
||||||
|
|
||||||
|
// TODO document
|
||||||
|
_UI_EXTERN void uiWindowsControlAssignSoleControlIDZOrder(uiWindowsControl *);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,10 +21,9 @@ void uiWindowsControlChildMinimumSizeChanged(uiWIndowsControl *c)
|
||||||
(*(c->ChildMinimumSizeChanged))(c);
|
(*(c->ChildMinimumSizeChanged))(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO get the correct argument names from existing implemenations for here and ui_windows.h
|
void uiWindowsControlAssignControlIDZOrder(uiWindowsControl *c, LONG_PTR *controlID, HWND *insertAfter)
|
||||||
void uiWindowsControlAssignControlIDZOrder(uiWindowsControl *c, LONG_PTR *cid, HWND *zorder)
|
|
||||||
{
|
{
|
||||||
(*(c->AssignControlIDZorder))(c, cID, zorder);
|
(*(c->AssignControlIDZorder))(c, controlID, insertAfter);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND uiWindowsEnsureCreateControlHWND(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, HINSTANCE hInstance, LPVOID lpParam, BOOL useStandardControlFont)
|
HWND uiWindowsEnsureCreateControlHWND(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, HINSTANCE hInstance, LPVOID lpParam, BOOL useStandardControlFont)
|
||||||
|
@ -66,3 +65,13 @@ void uiWindowsControlNotifyMinimumSizeChanged(uiWindowsControl *c)
|
||||||
if (parent != NULL)
|
if (parent != NULL)
|
||||||
uiWindowsControlChildMinimumSizeChanged(uiWindowsControl(parent));
|
uiWindowsControlChildMinimumSizeChanged(uiWindowsControl(parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uiWindowsControlAssignSoleControlIDZOrder(uiWindowsControl *c)
|
||||||
|
{
|
||||||
|
LONG_PTR controlID;
|
||||||
|
HWND insertAfter;
|
||||||
|
|
||||||
|
controlID = 100;
|
||||||
|
insertAfter = NULL;
|
||||||
|
uiWindowsControlAssignControlIDZorder(c, &controlID, &insertAfter);
|
||||||
|
}
|
||||||
|
|
|
@ -184,9 +184,8 @@ uiWindowsDefaultAssignControlIDZorder(uiTab)
|
||||||
|
|
||||||
static void tabArrangePages(uiTab *t)
|
static void tabArrangePages(uiTab *t)
|
||||||
{
|
{
|
||||||
// TODO what should these be called and what should their initial values be? also update box, group, and window
|
LONG_PTR controlID = 100;
|
||||||
LONG_PTR cID = 100;
|
HWND insertAfter = NULL;
|
||||||
HWND after = NULL;
|
|
||||||
|
|
||||||
// TODO is this first or last?
|
// TODO is this first or last?
|
||||||
uiWindowsEnsureAssignControlIDZOrder(t->tabHWND, &cid, &after);
|
uiWindowsEnsureAssignControlIDZOrder(t->tabHWND, &cid, &after);
|
||||||
|
|
|
@ -275,9 +275,6 @@ void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *data)
|
||||||
|
|
||||||
void uiWindowSetChild(uiWindow *w, uiControl *child)
|
void uiWindowSetChild(uiWindow *w, uiControl *child)
|
||||||
{
|
{
|
||||||
LONG_PTR id;
|
|
||||||
HWND dummy;
|
|
||||||
|
|
||||||
if (w->child != NULL) {
|
if (w->child != NULL) {
|
||||||
uiControlSetParent(w->child, NULL);
|
uiControlSetParent(w->child, NULL);
|
||||||
uiWindowsControlSetParentHWND(uiWindowsControl(w->child), NULL);
|
uiWindowsControlSetParentHWND(uiWindowsControl(w->child), NULL);
|
||||||
|
@ -286,9 +283,7 @@ void uiWindowSetChild(uiWindow *w, uiControl *child)
|
||||||
if (w->child != NULL) {
|
if (w->child != NULL) {
|
||||||
uiControlSetParent(w->child, uiControl(w));
|
uiControlSetParent(w->child, uiControl(w));
|
||||||
uiWindowsControlSetParentHWND(uiWindowsControl(w->child), w->hwnd);
|
uiWindowsControlSetParentHWND(uiWindowsControl(w->child), w->hwnd);
|
||||||
id = 100;
|
uiWindowsControlAssignSoleControlIDZOrder(uiWindowsControl(w->child));
|
||||||
dummy = NULL;
|
|
||||||
uiWindowsControlAssignControlIDZOrder(uiWindowsControl(w->child), &id, &dummy);
|
|
||||||
windowRelayout(w);
|
windowRelayout(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,12 @@ void uiWindowsEnsureSetParentHWND(HWND hwnd, HWND parent)
|
||||||
logLastError(L"error setting window parent");
|
logLastError(L"error setting window parent");
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiWindowsEnsureAssignControlIDZOrder(HWND hwnd, LONG_PTR controlID, HWND insertAfter)
|
void uiWindowsEnsureAssignControlIDZOrder(HWND hwnd, LONG_PTR *controlID, HWND *insertAfter)
|
||||||
{
|
{
|
||||||
SetWindowLongPtrW(hwnd, GWLP_ID, controlID);
|
SetWindowLongPtrW(hwnd, GWLP_ID, *controlID);
|
||||||
setWindowInsertAfter(hwnd, insertAfter);
|
(*controlID)++;
|
||||||
|
setWindowInsertAfter(hwnd, *insertAfter);
|
||||||
|
*insertAfter = hwnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiWindowsEnsureMoveWindowDuringResize(HWND hwnd, intmax_t x, intmax_t y, intmax_t width, intmax_t height)
|
void uiWindowsEnsureMoveWindowDuringResize(HWND hwnd, intmax_t x, intmax_t y, intmax_t width, intmax_t height)
|
||||||
|
|
Loading…
Reference in New Issue