Removed onWM_COMMAND from uiWindowsMakeControlParams.

This commit is contained in:
Pietro Gagliardi 2015-05-21 12:07:11 -04:00
parent 96bd7013f8
commit 12b4d0a7c0
14 changed files with 8 additions and 55 deletions

View File

@ -26,7 +26,6 @@ struct uiWindowsMakeControlParams {
// ui redirects the message back and calls these functions.
// Store the result in *lResult and return any non-FALSE value (such as TRUE) to return the given result; return FALSE to pass the notification up to your window procedure.
// Note that these are only issued if they come from the uiControl itself; notifications from children of the uiControl (such as a header control) will be received normally.
BOOL (*onWM_COMMAND)(uiControl *c, WORD code, LRESULT *lResult);
BOOL (*onWM_NOTIFY)(uiControl *c, NMHDR *nm, LRESULT *lResult);
BOOL (*onWM_HSCROLL)(uiControl *c, WORD code, LRESULT *lResult);

View File

@ -33,6 +33,7 @@ static void onDestroy(void *data)
{
struct button *b = (struct button *) data;
uiWindowsUnregisterWM_COMMANDHandler(b->hwnd);
uiFree(b);
}
@ -100,7 +101,6 @@ uiButton *uiNewButton(const char *text)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;
@ -109,6 +109,7 @@ uiButton *uiNewButton(const char *text)
uiFree(wtext);
b->hwnd = (HWND) uiControlHandle(uiControl(b));
uiWindowsRegisterWM_COMMANDHandler(b->hwnd, onWM_COMMAND, uiControl(b));
b->onClicked = defaultOnClicked;

View File

@ -41,6 +41,7 @@ static void onDestroy(void *data)
{
struct checkbox *c = (struct checkbox *) data;
uiWindowsUnregisterWM_COMMANDHandler(c->hwnd);
uiFree(c);
}
@ -115,7 +116,6 @@ uiCheckbox *uiNewCheckbox(const char *text)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;
@ -124,6 +124,7 @@ uiCheckbox *uiNewCheckbox(const char *text)
uiFree(wtext);
c->hwnd = (HWND) uiControlHandle(uiControl(c));
uiWindowsRegisterWM_COMMANDHandler(c->hwnd, onWM_COMMAND, uiControl(c));
c->onToggled = defaultOnToggled;

View File

@ -6,11 +6,6 @@ struct combobox {
HWND hwnd;
};
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -68,7 +63,6 @@ uiCombobox *uiNewCombobox(void)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -58,11 +58,6 @@ void uninitContainer(void)
logLastError("error unregistering container window class in uninitContainer()");
}
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -89,7 +84,6 @@ void uiMakeContainer(uiControl *c)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -13,7 +13,6 @@ void osSingleDestroy(void *internal)
struct singleHWND *s = (struct singleHWND *) internal;
(*(s->onDestroy))(s->onDestroyData);
uiWindowsUnregisterWM_COMMANDHandler(s->hwnd);
uiWindowsUnregisterWM_NOTIFYHandler(s->hwnd);
uiWindowsUnregisterWM_HSCROLLHandler(s->hwnd);
if (DestroyWindow(s->hwnd) == 0)
@ -120,7 +119,6 @@ void uiWindowsMakeControl(uiControl *c, uiWindowsMakeControlParams *p)
if (s->hwnd == NULL)
logLastError("error creating control in uiWindowsMakeControl()");
uiWindowsRegisterWM_COMMANDHandler(s->hwnd, p->onWM_COMMAND, uiControl(c));
uiWindowsRegisterWM_NOTIFYHandler(s->hwnd, p->onWM_NOTIFY, uiControl(c));
uiWindowsRegisterWM_HSCROLLHandler(s->hwnd, p->onWM_HSCROLL, uiControl(c));

View File

@ -36,6 +36,7 @@ static void onDestroy(void *data)
{
struct entry *e = (struct entry *) data;
uiWindowsUnregisterWM_COMMANDHandler(e->hwnd);
uiFree(e);
}
@ -111,7 +112,6 @@ uiEntry *uiNewEntry(void)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;
@ -119,6 +119,7 @@ uiEntry *uiNewEntry(void)
uiWindowsMakeControl(uiControl(e), &p);
e->hwnd = (HWND) uiControlHandle(uiControl(e));
uiWindowsRegisterWM_COMMANDHandler(e->hwnd, onWM_COMMAND, uiControl(e));
e->onChanged = defaultOnChanged;

View File

@ -6,11 +6,6 @@ struct group {
HWND hwnd;
};
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -55,7 +50,6 @@ uiGroup *uiNewGroup(const char *text)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -6,11 +6,6 @@ struct label {
HWND hwnd;
};
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -68,7 +63,6 @@ uiLabel *uiNewLabel(const char *text)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -6,11 +6,6 @@ struct progressbar {
HWND hwnd;
};
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -63,7 +58,6 @@ uiProgressBar *uiNewProgressBar(void)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = FALSE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -10,11 +10,6 @@ struct separator {
HWND hwnd;
};
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -57,7 +52,6 @@ uiSeparator *uiNewHorizontalSeparator(void)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -13,11 +13,6 @@ struct slider {
void *onChangedData;
};
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
return FALSE;
@ -94,7 +89,6 @@ uiSlider *uiNewSlider(intmax_t min, intmax_t max)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;

View File

@ -61,6 +61,7 @@ static void onDestroy(void *data)
{
struct spinbox *s = (struct spinbox *) data;
uiWindowsUnregisterWM_COMMANDHandler(s->hwnd);
uiFree(s);
}
@ -169,7 +170,6 @@ uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;
@ -177,6 +177,7 @@ uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max)
uiWindowsMakeControl(uiControl(s), &p);
s->hwnd = (HWND) uiControlHandle(uiControl(s));
uiWindowsRegisterWM_COMMANDHandler(s->hwnd, onWM_COMMAND, uiControl(s));
recreateUpDown(s);
s->inhibitChanged = TRUE;

View File

@ -41,11 +41,6 @@ static void showHidePage(struct tab *t, LRESULT which, int hide)
// control implementation
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
return FALSE;
}
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
struct tab *t = (struct tab *) c;
@ -218,7 +213,6 @@ uiTab *uiNewTab(void)
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onWM_COMMAND = onWM_COMMAND;
p.onWM_NOTIFY = onWM_NOTIFY;
p.onWM_HSCROLL = onWM_HSCROLL;
p.onDestroy = onDestroy;