summaryrefslogtreecommitdiff
path: root/alf
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-04 16:15:33 +0100
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-04 16:15:33 +0100
commit3271b043f89966a8c33bdd2de4e93a4428c0488d (patch)
tree562cea601ced128f741201e9f24d0ea19a28b90f /alf
parent69e851e60e98dd45359dc942fb332b5de6ffccfe (diff)
improve label display on Win32s/NT3.x and make it actually run on NT 3.1
NT 3.1 doesn't have GetSysColorBrush(), and the label display isn't broken enough for us to worry about it, since we're gonna replace it anyway at some point
Diffstat (limited to 'alf')
-rw-r--r--alf/alf.cpp17
-rw-r--r--alf/alfcompat.cpp2
-rw-r--r--alf/alflabel.cpp2
3 files changed, 2 insertions, 19 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp
index 9f68479..03c0fbf 100644
--- a/alf/alf.cpp
+++ b/alf/alf.cpp
@@ -571,23 +571,6 @@ ALF_DefWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
return TRUE;
}
- if (msg == WM_CTLCOLORSTATIC) {
- HDC hdcStatic = (HDC)wparam;
- HWND hwndStatic = (HWND)lparam;
-
- // HACK! return correct label background for NT3.x and NT4/95
- // get rid of this once we fixed the label to draw on the parent control background
- if (LOBYTE(LOWORD(GetVersion())) < 4) {
- SetTextColor(hdcStatic, GetSysColor(IsWindowEnabled(hwndStatic) ? COLOR_WINDOWTEXT : COLOR_GRAYTEXT));
- SetBkColor(hdcStatic, GetSysColor(COLOR_WINDOW));
- return (LRESULT)GetSysColorBrush(COLOR_WINDOW);
- } else {
- SetTextColor(hdcStatic, GetSysColor(IsWindowEnabled(hwndStatic) ? COLOR_BTNTEXT : COLOR_GRAYTEXT));
- SetBkColor(hdcStatic, GetSysColor(COLOR_BTNFACE));
- return (LRESULT)GetSysColorBrush(COLOR_BTNFACE);
- }
- }
-
return DefWindowProc(hwnd, msg, wparam, lparam);
}
diff --git a/alf/alfcompat.cpp b/alf/alfcompat.cpp
index 5486b19..9a36d4d 100644
--- a/alf/alfcompat.cpp
+++ b/alf/alfcompat.cpp
@@ -32,7 +32,7 @@ static int WINAPI
fallbackGetSystemMetricsForDpi(int nIndex, UINT dpi)
{
(void)dpi;
- if (LOBYTE(LOWORD(GetVersion)) < 4) {
+ if (LOBYTE(LOWORD(GetVersion())) < 4) {
// old NT does not support several properties, so we fake them
switch (nIndex) {
case SM_CXEDGE:
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index a0dc138..108c8d5 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -9,7 +9,7 @@ int ALF__LabelTopPadding(HWND hwnd, ALFAPP app)
// see also: alfedit.cpp
return app->compatFn->GetSystemMetricsForDpi(
SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200))
- + 1 /* internal padding in edit control */
+ + ((LOBYTE(LOWORD(GetVersion())) < 4) ? 2 : 1) /* internal padding in edit control */
+ 1 /* external padding around edit control */;
}