From 45edacf8cad4b1439f8cd99f3eb356b8c1140290 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 24 May 2016 21:18:29 -0400 Subject: [PATCH] Consolidated GetAncestor() calls again. --- windows/colorbutton.cpp | 2 +- windows/editablecombo.cpp | 3 +-- windows/fontbutton.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/windows/colorbutton.cpp b/windows/colorbutton.cpp index c4c91701..462c0ddb 100644 --- a/windows/colorbutton.cpp +++ b/windows/colorbutton.cpp @@ -31,7 +31,7 @@ static BOOL onWM_COMMAND(uiControl *c, HWND hwnd, WORD code, LRESULT *lResult) if (code != BN_CLICKED) 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.g = b->g; rgba.b = b->b; diff --git a/windows/editablecombo.cpp b/windows/editablecombo.cpp index 85b0e8eb..4c3820d1 100644 --- a/windows/editablecombo.cpp +++ b/windows/editablecombo.cpp @@ -20,8 +20,7 @@ static BOOL onWM_COMMAND(uiControl *cc, HWND hwnd, WORD code, LRESULT *lResult) if (code == CBN_SELCHANGE) { // like on OS X, this is sent before the edit has been updated :( // TODO error check - // TODO proper function for GetAncestor() - PostMessage(GetAncestor(hwnd, GA_PARENT), + PostMessage(parentOf(hwnd), WM_COMMAND, MAKEWPARAM(GetWindowLongPtrW(hwnd, GWLP_ID), CBN_EDITCHANGE), (LPARAM) hwnd); diff --git a/windows/fontbutton.cpp b/windows/fontbutton.cpp index 323504a3..22e11abb 100644 --- a/windows/fontbutton.cpp +++ b/windows/fontbutton.cpp @@ -41,7 +41,7 @@ static BOOL onWM_COMMAND(uiControl *c, HWND hwnd, WORD code, LRESULT *lResult) if (code != BN_CLICKED) 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))) { updateFontButtonLabel(b); (*(b->onChanged))(b, b->onChangedData);