Re-connected Windows events. More TODOs.

This commit is contained in:
Pietro Gagliardi 2015-04-29 19:17:26 -04:00
parent 4c75b4fb3a
commit a036632795
3 changed files with 17 additions and 15 deletions

2
box.c
View File

@ -3,7 +3,7 @@
#include "uipriv.h" #include "uipriv.h"
// TODOs // TODOs
// - setting padded doesn't take effect immediately on OS X // - setting padded doesn't take effect immediately on Windows and OS X
// TODO remove these // TODO remove these
typedef struct box box; typedef struct box box;

View File

@ -65,19 +65,6 @@ static LRESULT CALLBACK parentWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA
// these must always be executed, even on the initial parent // these must always be executed, even on the initial parent
// why? http://blogs.msdn.com/b/oldnewthing/archive/2010/03/16/9979112.aspx // why? http://blogs.msdn.com/b/oldnewthing/archive/2010/03/16/9979112.aspx
switch (uMsg) { switch (uMsg) {
case WM_COMMAND:
// bounce back to the control in question
// except if to the initial parent, in which case act as if the message was ignored
control = (HWND) lParam;
if (control != NULL && IsChild(initialOSContainer, control) == 0)
return SendMessageW(control, msgCOMMAND, wParam, lParam);
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
case WM_NOTIFY:
// same as WM_COMMAND
control = nm->hwndFrom;
if (control != NULL && IsChild(initialOSContainer, control) == 0)
return SendMessageW(control, msgNOTIFY, wParam, lParam);
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
case WM_CTLCOLORSTATIC: case WM_CTLCOLORSTATIC:
case WM_CTLCOLORBTN: case WM_CTLCOLORBTN:
/*TODO // read-only TextFields and Textboxes are exempt /*TODO // read-only TextFields and Textboxes are exempt

View File

@ -58,6 +58,8 @@ static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
uiContainer *cc; uiContainer *cc;
struct container *c; struct container *c;
CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam; CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam;
HWND control;
NMHDR *nm = (NMHDR *) lParam;
WINDOWPOS *wp = (WINDOWPOS *) lParam; WINDOWPOS *wp = (WINDOWPOS *) lParam;
RECT r; RECT r;
@ -72,7 +74,20 @@ static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
switch (uMsg) { switch (uMsg) {
// these must always be run, even on the initial parent // these must always be run, even on the initial parent
// why? http://blogs.msdn.com/b/oldnewthing/archive/2010/03/16/9979112.aspx // why? http://blogs.msdn.com/b/oldnewthing/archive/2010/03/16/9979112.aspx
// TODO case WM_COMMAND:
// bounce back to the control in question
// except if to the initial parent, in which case act as if the message was ignored
control = (HWND) lParam;
if (control != NULL && IsChild(initialParent, control) == 0)
return SendMessageW(control, msgCOMMAND, wParam, lParam);
break; // fall through to DefWindowProcW()
case WM_NOTIFY:
// same as WM_COMMAND
control = nm->hwndFrom;
if (control != NULL && IsChild(initialParent, control) == 0)
return SendMessageW(control, msgNOTIFY, wParam, lParam);
break;
// these are only run if c is not NULL // these are only run if c is not NULL
case WM_WINDOWPOSCHANGED: case WM_WINDOWPOSCHANGED:
if ((wp->flags & SWP_NOSIZE) != 0) if ((wp->flags & SWP_NOSIZE) != 0)