More error fixing.

This commit is contained in:
Pietro Gagliardi 2015-05-29 20:53:12 -04:00
parent 9431f2a837
commit 7fdb9f3424
11 changed files with 18 additions and 18 deletions

View File

@ -17,7 +17,7 @@ _UI_EXTERN void uiWindowsUtilHide(HWND hwnd);
_UI_EXTERN void uiWIndowsUtilEnable(HWND hwnd); _UI_EXTERN void uiWIndowsUtilEnable(HWND hwnd);
_UI_EXTERN void uiWindowsUtilDisable(HWND hwnd); _UI_EXTERN void uiWindowsUtilDisable(HWND hwnd);
_UI_EXTERN void uiWindowsUtilSysFunc(HWND hwnd, uiControlSysFuncParams *p); _UI_EXTERN void uiWindowsUtilSysFunc(HWND hwnd, uiControlSysFuncParams *p);
_UI_EXTERN void uiWindowsUtilStartZOrder(HWND hwnd, uiControlSysFuncParams *p); _UI_EXTERN int uiWindowsUtilStartZOrder(HWND hwnd, uiControlSysFuncParams *p);
_UI_EXTERN uiControl *uiWindowsNewSingleHWNDControl(uintmax_t type); _UI_EXTERN uiControl *uiWindowsNewSingleHWNDControl(uintmax_t type);
// This contains the Windows-specific parts of the uiSizing structure. // This contains the Windows-specific parts of the uiSizing structure.

View File

@ -8,7 +8,7 @@ HWND uiWindowsUtilCreateControlHWND(DWORD dwExStyle, LPCWSTR lpClassName, LPCWST
HWND hwnd; HWND hwnd;
hwnd = CreateWindowExW(dwExStyle, hwnd = CreateWindowExW(dwExStyle,
lpClassName, lpWIndowName, lpClassName, lpWindowName,
dwStyle | WS_CHILD | WS_VISIBLE, dwStyle | WS_CHILD | WS_VISIBLE,
0, 0, 0, 0,
// use a nonzero initial size just in case some control breaks with a zero initial size // use a nonzero initial size just in case some control breaks with a zero initial size
@ -66,7 +66,7 @@ static uiSizing *singleHWNDSizing(uiControl *c)
return uiWindowsSizing(c); return uiWindowsSizing(c);
} }
void uiWIndowsUtilShow(HWND hwnd) void uiWindowsUtilShow(HWND hwnd)
{ {
ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOW);
} }
@ -86,7 +86,7 @@ static void singleHWNDCommitHide(uiControl *c)
uiWindowsUtilHide(HWND(c)); uiWindowsUtilHide(HWND(c));
} }
void uiWIndowsUtilEnable(HWND hwnd) void uiWindowsUtilEnable(HWND hwnd)
{ {
EnableWindow(hwnd, TRUE); EnableWindow(hwnd, TRUE);
} }
@ -128,7 +128,7 @@ static void singleHWNDSysFunc(uiControl *c, uiControlSysFuncParams *p)
uiWindowsUtilSysFunc(HWND(c), p); uiWindowsUtilSysFunc(HWND(c), p);
} }
void uiWindowsUtilStartZOrder(HWND hwnd, uiControlSysFuncParams *p) int uiWindowsUtilStartZOrder(HWND hwnd, uiControlSysFuncParams *p)
{ {
HWND insertAfter; HWND insertAfter;
@ -137,11 +137,12 @@ void uiWindowsUtilStartZOrder(HWND hwnd, uiControlSysFuncParams *p)
if (insertAfter == NULL) if (insertAfter == NULL)
logLastError("error getting insert after window in uiWindowsUtilStartZOrder()"); logLastError("error getting insert after window in uiWindowsUtilStartZOrder()");
p->InsertAfter = insertAfter; p->InsertAfter = insertAfter;
return 1;
} }
static void singleHWNDStartZOrder(uiControl *c, uiControlSysFuncParams *p) static int singleHWNDStartZOrder(uiControl *c, uiControlSysFuncParams *p)
{ {
uiWindowsUtilStartZOrder(HWND(c), p); return uiWindowsUtilStartZOrder(HWND(c), p);
} }
void setSingleHWNDFuncs(uiControl *c) void setSingleHWNDFuncs(uiControl *c)
@ -151,7 +152,7 @@ void setSingleHWNDFuncs(uiControl *c)
uiControl(c)->Resize = singleHWNDResize; uiControl(c)->Resize = singleHWNDResize;
uiControl(c)->Sizing = singleHWNDSizing; uiControl(c)->Sizing = singleHWNDSizing;
uiControl(c)->CommitShow = singleHWNDCommitShow; uiControl(c)->CommitShow = singleHWNDCommitShow;
uiControl(c)->CommitHide = singleHWNDCommitHide uiControl(c)->CommitHide = singleHWNDCommitHide;
uiControl(c)->CommitEnable = singleHWNDCommitEnable; uiControl(c)->CommitEnable = singleHWNDCommitEnable;
uiControl(c)->CommitDisable = singleHWNDCommitDisable; uiControl(c)->CommitDisable = singleHWNDCommitDisable;
uiControl(c)->SysFunc = singleHWNDSysFunc; uiControl(c)->SysFunc = singleHWNDSysFunc;

View File

@ -32,9 +32,8 @@ static void datetimepickerPreferredSize(uiControl *c, uiSizing *d, intmax_t *wid
uiDateTimePicker *finishNewDateTimePicker(DWORD style, WCHAR *format) uiDateTimePicker *finishNewDateTimePicker(DWORD style, WCHAR *format)
{ {
struct datetimepicker *d; struct datetimepicker *d;
uiWindowsMakeControlParams p;
d = (struct datetimepicker *) uiWindowsNewSingleHWNDControluiTypeDateTimePicker()); d = (struct datetimepicker *) uiWindowsNewSingleHWNDControl(uiTypeDateTimePicker());
d->hwnd = uiWindowsUtilCreateControlHWND(0, // TODO client edge? d->hwnd = uiWindowsUtilCreateControlHWND(0, // TODO client edge?
DATETIMEPICK_CLASSW, L"", DATETIMEPICK_CLASSW, L"",

View File

@ -103,7 +103,7 @@ uiEntry *uiNewEntry(void)
e = (struct entry *) uiWindowsNewSingleHWNDControl(uiTypeEntry()); e = (struct entry *) uiWindowsNewSingleHWNDControl(uiTypeEntry());
e->hwnd = uiWindowsNewSingleHWNDControl(WS_EX_CLIENTEDGE, e->hwnd = uiWindowsUtilCreateControlHWND(WS_EX_CLIENTEDGE,
L"edit", L"", L"edit", L"",
ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP, ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP,
hInstance, NULL, hInstance, NULL,

View File

@ -35,7 +35,7 @@ uiGroup *uiNewGroup(const char *text)
g = (struct group *) uiWindowsNewSingleHWNDControl(uiTypeGroup()); g = (struct group *) uiWindowsNewSingleHWNDControl(uiTypeGroup());
wtext = toUTF16(text); wtext = toUTF16(text);
g->hwnd = uiWindowsNewSingleHWNDControl(WS_EX_CONTROLPARENT, g->hwnd = uiWindowsUtilCreateControlHWND(WS_EX_CONTROLPARENT,
L"button", wtext, L"button", wtext,
BS_GROUPBOX, BS_GROUPBOX,
hInstance, NULL, hInstance, NULL,

View File

@ -44,7 +44,7 @@ uiLabel *uiNewLabel(const char *text)
l = (struct label *) uiWindowsNewSingleHWNDControl(uiTypeLabel()); l = (struct label *) uiWindowsNewSingleHWNDControl(uiTypeLabel());
wtext = toUTF16(text); wtext = toUTF16(text);
l->hwnd = uiWindowsNewSingleHWNDControl(0, l->hwnd = uiWindowsUtilCreateControlHWND(0,
L"static", wtext, L"static", wtext,
// SS_LEFTNOWORDWRAP clips text past the end; SS_NOPREFIX avoids accelerator translation // SS_LEFTNOWORDWRAP clips text past the end; SS_NOPREFIX avoids accelerator translation
// controls are vertically aligned to the top by default (thanks Xeek in irc.freenode.net/#winapi) // controls are vertically aligned to the top by default (thanks Xeek in irc.freenode.net/#winapi)

View File

@ -41,7 +41,7 @@ uiProgressBar *uiNewProgressBar(void)
p = (struct progressbar *) uiWindowsNewSingleHWNDControl(uiTypeProgressBar()); p = (struct progressbar *) uiWindowsNewSingleHWNDControl(uiTypeProgressBar());
p->hwnd = uiWindowsNewSingleHWNDControl(0, p->hwnd = uiWindowsUtilCreateControlHWND(0,
PROGRESS_CLASSW, L"", PROGRESS_CLASSW, L"",
PBS_SMOOTH, PBS_SMOOTH,
hInstance, NULL, hInstance, NULL,

View File

@ -35,7 +35,7 @@ uiSeparator *uiNewHorizontalSeparator(void)
s = (struct separator *) uiWindowsNewSingleHWNDControl(uiTypeSeparator()); s = (struct separator *) uiWindowsNewSingleHWNDControl(uiTypeSeparator());
s->hwnd = uiWindowsNewSingleHWNDControl(0, s->hwnd = uiWindowsUtilCreateControlHWND(0,
L"static", L"", L"static", L"",
SS_ETCHEDHORZ, SS_ETCHEDHORZ,
hInstance, NULL, hInstance, NULL,

View File

@ -85,7 +85,7 @@ uiSlider *uiNewSlider(intmax_t min, intmax_t max)
s = (struct slider *) uiWindowsNewSingleHWNDControl(uiTypeSlider()); s = (struct slider *) uiWindowsNewSingleHWNDControl(uiTypeSlider());
s->hwnd = uiWindowsNewSingleHWNDControl(0, s->hwnd = uiWindowsUtilCreateControlHWND(0,
TRACKBAR_CLASSW, L"", TRACKBAR_CLASSW, L"",
// TODO TBS_TRANSPARENTBKGND when making Vista-only // TODO TBS_TRANSPARENTBKGND when making Vista-only
TBS_HORZ | TBS_TOOLTIPS | WS_TABSTOP, TBS_HORZ | TBS_TOOLTIPS | WS_TABSTOP,

View File

@ -164,7 +164,7 @@ uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max)
s = (struct spinbox *) uiWindowsNewSingleHWNDControl(uiTypeSpinbox()); s = (struct spinbox *) uiWindowsNewSingleHWNDControl(uiTypeSpinbox());
s->hwnd = uiWindowsNewSingleHWNDControl(WS_EX_CLIENTEDGE, s->hwnd = uiWindowsUtilCreateControlHWND(WS_EX_CLIENTEDGE,
L"edit", L"", L"edit", L"",
// TODO ES_NUMBER doesn't allow typing in a leading - // TODO ES_NUMBER doesn't allow typing in a leading -
ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | ES_NUMBER | WS_TABSTOP, ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | ES_NUMBER | WS_TABSTOP,

View File

@ -214,7 +214,7 @@ uiTab *uiNewTab(void)
t = (struct tab *) uiWindowsNewSingleHWNDControl(uiTypeTab()); t = (struct tab *) uiWindowsNewSingleHWNDControl(uiTypeTab());
t->hwnd = uiWindowsNewSingleHWNDControl(0, // don't set WS_EX_CONTROLPARENT yet; we do that dynamically in the message loop (see main_windows.c) t->hwnd = uiWindowsUtilCreateControlHWND(0, // don't set WS_EX_CONTROLPARENT yet; we do that dynamically in the message loop (see main_windows.c)
WC_TABCONTROLW, L"", WC_TABCONTROLW, L"",
TCS_TOOLTIPS | WS_TABSTOP, // start with this; we will alternate between this and WS_EX_CONTROLPARENT as needed (see main.c and msgHasTabStops above and the toggling functions below) TCS_TOOLTIPS | WS_TABSTOP, // start with this; we will alternate between this and WS_EX_CONTROLPARENT as needed (see main.c and msgHasTabStops above and the toggling functions below)
hInstance, NULL, hInstance, NULL,