summaryrefslogtreecommitdiff
path: root/alf/alfedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfedit.cpp')
-rw-r--r--alf/alfedit.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/alf/alfedit.cpp b/alf/alfedit.cpp
index bbe36b8..1fde70d 100644
--- a/alf/alfedit.cpp
+++ b/alf/alfedit.cpp
@@ -7,8 +7,6 @@ ALF__EditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_P
(void)uIdSubclass;
(void)dwRefData;
- ALFAPP app = (ALFAPP)dwRefData;
-
if (uMsg == ALF_WM_QUERYSIZE) {
HDC hDc = GetDC(hwnd);
HFONT font = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);
@@ -26,7 +24,7 @@ ALF__EditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_P
}
if (!ps->cy) {
- ps->cy = tm.tmHeight + 2*app->compatFn->GetSystemMetricsForDpi(
+ ps->cy = tm.tmHeight + 2*ALF_Compat_GetSystemMetricsForDpi(
SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200))
+ 4 /* padding internal to the edit control */
+ 2 /* external padding to line up with themed button */;
@@ -48,10 +46,10 @@ ALF__EditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_P
p->right - p->left, p->bottom - p->top - 2,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOCOPYBITS);
} else if (uMsg == WM_DESTROY) {
- app->compatFn->RemoveWindowSubclass(hwnd, ALF__EditSubclassProc, 0);
+ ALF_Compat_RemoveWindowSubclass(hwnd, ALF__EditSubclassProc, 0);
}
- return app->compatFn->DefSubclassProc(hwnd, uMsg, wParam, lParam);
+ return ALF_Compat_DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
HWND
@@ -78,9 +76,7 @@ ALF_AddEdit(HWND win, WORD id, UINT x, UINT y, const TCHAR *text)
(HINSTANCE)GetWindowLongPtr(win, GWLP_HINSTANCE),
NULL);
- ALFAPP app = ALF_ApplicationFromWindow(win);
-
- app->compatFn->SetWindowSubclass(hwndEdit, ALF__EditSubclassProc, 0, (DWORD_PTR)app);
+ ALF_Compat_SetWindowSubclass(hwndEdit, ALF__EditSubclassProc, 0, 0);
SetWindowPos(hwndEdit, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_FRAMECHANGED);
ALFWidgetLayoutParams p;