More TODO resolution.

This commit is contained in:
Pietro Gagliardi 2015-06-05 17:12:51 -04:00
parent 3f5df058c2
commit ad66aa25d5
5 changed files with 18 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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