diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-17 13:21:20 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-17 13:21:20 -0400 |
| commit | 492845da5d3403c97c4deb85d121a131c6be87e6 (patch) | |
| tree | 251498909ee63caff27d3bf0f7ae062928c92264 | |
| parent | d2e1c9f261e1b6cfe3097638028525de0df43252 (diff) | |
Adjusted background painting code on Windows for the new container structure.
| -rw-r--r-- | newctrl/common_windows.c | 8 | ||||
| -rw-r--r-- | newctrl/container_windows.c | 2 | ||||
| -rw-r--r-- | newctrl/winapi_windows.h | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/newctrl/common_windows.c b/newctrl/common_windows.c index 3f1a52e..b30b132 100644 --- a/newctrl/common_windows.c +++ b/newctrl/common_windows.c @@ -103,7 +103,7 @@ void paintControlBackground(HWND hwnd, HDC dc) WCHAR classname[128] = L""; // more than enough to avoid collisions parent = hwnd; - do { + for (;;) { parent = GetParent(parent); if (parent == NULL) xpanic("error getting parent container of control in paintControlBackground()", GetLastError()); @@ -117,7 +117,11 @@ void paintControlBackground(HWND hwnd, HDC dc) return; if (GetClassNameW(parent, classname, 128) == 0) xpanic("error getting name of focused window class in paintControlBackground()", GetLastError()); - } while (_wcsicmp(classname, L"button") == 0); // skip groupboxes + // skip container and groupboxes + if (_wcsicmp(classname, containerclass) != 0) // container + if (_wcsicmp(classname, L"button") != 0) // groupbox + break; + } if (GetWindowRect(hwnd, &r) == 0) xpanic("error getting control's window rect in paintControlBackground()", GetLastError()); // the above is a window rect; convert to client rect diff --git a/newctrl/container_windows.c b/newctrl/container_windows.c index 50ebc1e..bdb2e08 100644 --- a/newctrl/container_windows.c +++ b/newctrl/container_windows.c @@ -9,8 +9,6 @@ In this case, I chose to waste a window handle rather than keep things super com If this is seriously an issue in the future, I can roll it back. */ -#define containerclass L"gouicontainer" - static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LRESULT lResult; diff --git a/newctrl/winapi_windows.h b/newctrl/winapi_windows.h index 9ee3994..c045f70 100644 --- a/newctrl/winapi_windows.h +++ b/newctrl/winapi_windows.h @@ -122,6 +122,7 @@ extern intptr_t tableSelectedItem(HWND); extern void tableSelectItem(HWND, intptr_t); // container_windows.c +#define containerclass L"gouicontainer" extern DWORD makeContainerWindowClass(char **); extern HWND newContainer(); extern void calculateBaseUnits(HWND, int *, int *, LONG *); |
