diff --git a/redo/test/page2.c b/redo/test/page2.c index 23b77cac..af1a46b7 100644 --- a/redo/test/page2.c +++ b/redo/test/page2.c @@ -42,6 +42,15 @@ static void openAnotherWindow(uiButton *b, void *data) uiControlShow(uiControl(uiNewWindow("Another Window", 100, 100, data != NULL))); } +static void openAnotherDisabledWindow(uiButton *b, void *data) +{ + uiWindow *w; + + w = uiNewWindow("Another Window", 100, 100, data != NULL); + uiControlDisable(uiControl(w)); + uiControlShow(uiControl(w)); +} + #define SHED(method, Method) \ static void method ## Control(uiButton *b, void *data) \ { \ @@ -117,6 +126,12 @@ uiBox *makePage2(void) button = uiNewButton("Open Menuless Window"); uiButtonOnClicked(button, openAnotherWindow, NULL); uiBoxAppend(hbox, uiControl(button), 0); + button = uiNewButton("Disabled Menued"); + uiButtonOnClicked(button, openAnotherDisabledWindow, button); + uiBoxAppend(hbox, uiControl(button), 0); + button = uiNewButton("Disabled Menuless"); + uiButtonOnClicked(button, openAnotherDisabledWindow, NULL); + uiBoxAppend(hbox, uiControl(button), 0); uiBoxAppend(page2, uiControl(hbox), 0); nestedBox = newHorizontalBox(); diff --git a/redo/ui_windows.h b/redo/ui_windows.h index e651bbb7..b129097b 100644 --- a/redo/ui_windows.h +++ b/redo/ui_windows.h @@ -41,7 +41,7 @@ struct uiSizingSys { #define uiWindowsDlgUnitsToX(dlg, baseX) MulDiv((dlg), baseX, 4) #define uiWindowsDlgUnitsToY(dlg, baseY) MulDiv((dlg), baseY, 8) // Use this as your control's Sizing() implementation. -extern uiSizing *uiWindowsSizing(uiControl *); +_UI_EXTERN uiSizing *uiWindowsSizing(uiControl *c); // and use this if you need the text of the window width _UI_EXTERN intmax_t uiWindowsWindowTextWidth(HWND hwnd); diff --git a/redo/windows/control.c b/redo/windows/control.c index 9cff75ff..2dafc059 100644 --- a/redo/windows/control.c +++ b/redo/windows/control.c @@ -1,8 +1,6 @@ // 27 may 2015 #include "uipriv_windows.h" -// TODO Edit ,s/Util/HWND/g ? - HWND uiWindowsUtilCreateControlHWND(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, HINSTANCE hInstance, LPVOID lpParam, BOOL useStandardControlFont) { HWND hwnd; @@ -62,7 +60,7 @@ static void singleHWNDResize(uiControl *c, intmax_t x, intmax_t y, intmax_t widt static uiSizing *singleHWNDSizing(uiControl *c) { - // TODO change this to take a HWND and the parent + // TODO see if we can make this take an HWND and the parent return uiWindowsSizing(c); } diff --git a/redo/windows/dialoghelper.c b/redo/windows/dialoghelper.c index 1d722c56..aeb0c25e 100644 --- a/redo/windows/dialoghelper.c +++ b/redo/windows/dialoghelper.c @@ -43,7 +43,6 @@ static void dialogBegin(void) for (d = windows; d != NULL; d = d->hh.next) { prevstate = EnableWindow(d->hwnd, FALSE); // store the previous state in case the window was already disabled by the user - // (TODO test) // note the !; EnableWindow() returns TRUE if window was previously /disabled/ if (d->n == 0) d->prevstate = !prevstate; diff --git a/redo/windows/resize.c b/redo/windows/resize.c index b08c488a..b72a26bf 100644 --- a/redo/windows/resize.c +++ b/redo/windows/resize.c @@ -89,8 +89,8 @@ void setWindowInsertAfter(HWND hwnd, HWND insertAfter) uiSizing *uiWindowsSizing(uiControl *c) { uiSizing *d; - HWND hwnd; HDC dc; + HWND hwnd; HFONT prevfont; TEXTMETRICW tm; SIZE size;