summaryrefslogtreecommitdiff
path: root/alf/alf.cpp
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-09 19:08:46 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-09 19:08:46 +0200
commit860d61661b82198bae93736980c340f5d2c4e152 (patch)
treee02570a90c25f51ddde6da6a08b1eae9ccbe5e2a /alf/alf.cpp
parent2a08707cf5a5207a19715907cdef6c2f7a8a52e7 (diff)
notebook: fix focus when changing tabs
Diffstat (limited to 'alf/alf.cpp')
-rw-r--r--alf/alf.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp
index 7c0fa2a..0ab1901 100644
--- a/alf/alf.cpp
+++ b/alf/alf.cpp
@@ -442,7 +442,7 @@ ALF_ShouldMessageBubble(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|| msg == WM_MEASUREITEM || msg == WM_DRAWITEM
|| msg == WM_CTLCOLORBTN || msg == WM_CTLCOLOREDIT
|| msg == WM_CTLCOLORLISTBOX || msg == WM_CTLCOLORSCROLLBAR
- || msg == WM_CTLCOLORSTATIC;
+ || msg == WM_CTLCOLORSTATIC || msg == ALF_WM_SETFOCUS;
}
void
@@ -503,3 +503,12 @@ ALF_SetTextColor(HWND win, ALFColor color)
{
SendMessage(win, ALF_WM_SETTEXTCOLOR, 0, (LPARAM)color);
}
+
+void
+ALF_SetFocus(HWND target)
+{
+ if (GetWindowStyle(target) & WS_CHILD)
+ PostMessage(GetParent(target), ALF_WM_SETFOCUS, 0, (LPARAM)target);
+ else
+ PostMessage(target, ALF_WM_SETFOCUS, 0, (LPARAM)target);
+}