Consolidated GetAncestor() calls again.
This commit is contained in:
parent
095e08bc79
commit
45edacf8ca
|
@ -31,7 +31,7 @@ static BOOL onWM_COMMAND(uiControl *c, HWND hwnd, WORD code, LRESULT *lResult)
|
||||||
if (code != BN_CLICKED)
|
if (code != BN_CLICKED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
parent = GetAncestor(b->hwnd, GA_ROOT); // TODO didn't we have a function for this
|
parent = parentToplevel(b->hwnd);
|
||||||
rgba.r = b->r;
|
rgba.r = b->r;
|
||||||
rgba.g = b->g;
|
rgba.g = b->g;
|
||||||
rgba.b = b->b;
|
rgba.b = b->b;
|
||||||
|
|
|
@ -20,8 +20,7 @@ static BOOL onWM_COMMAND(uiControl *cc, HWND hwnd, WORD code, LRESULT *lResult)
|
||||||
if (code == CBN_SELCHANGE) {
|
if (code == CBN_SELCHANGE) {
|
||||||
// like on OS X, this is sent before the edit has been updated :(
|
// like on OS X, this is sent before the edit has been updated :(
|
||||||
// TODO error check
|
// TODO error check
|
||||||
// TODO proper function for GetAncestor()
|
PostMessage(parentOf(hwnd),
|
||||||
PostMessage(GetAncestor(hwnd, GA_PARENT),
|
|
||||||
WM_COMMAND,
|
WM_COMMAND,
|
||||||
MAKEWPARAM(GetWindowLongPtrW(hwnd, GWLP_ID), CBN_EDITCHANGE),
|
MAKEWPARAM(GetWindowLongPtrW(hwnd, GWLP_ID), CBN_EDITCHANGE),
|
||||||
(LPARAM) hwnd);
|
(LPARAM) hwnd);
|
||||||
|
|
|
@ -41,7 +41,7 @@ static BOOL onWM_COMMAND(uiControl *c, HWND hwnd, WORD code, LRESULT *lResult)
|
||||||
if (code != BN_CLICKED)
|
if (code != BN_CLICKED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
parent = GetAncestor(b->hwnd, GA_ROOT); // TODO didn't we have a function for this
|
parent = parentToplevel(b->hwnd);
|
||||||
if (showFontDialog(parent, &(b->params))) {
|
if (showFontDialog(parent, &(b->params))) {
|
||||||
updateFontButtonLabel(b);
|
updateFontButtonLabel(b);
|
||||||
(*(b->onChanged))(b, b->onChangedData);
|
(*(b->onChanged))(b, b->onChangedData);
|
||||||
|
|
Loading…
Reference in New Issue