mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
draw fancy windows explorer style selection rectangles
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1567 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -338,3 +338,29 @@ void draw_radiobox(Window* win, DC& dc, const wxRect& rect, bool checked, bool e
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool selected, bool focused, bool hot) {
|
||||
#if wxUSE_UXTHEME && defined(__WXMSW__)
|
||||
wxUxThemeEngine *themeEngine = wxUxThemeEngine::Get();
|
||||
if (themeEngine && themeEngine->IsAppThemed()) {
|
||||
wxUxThemeHandle hTheme(win, L"LISTVIEW");
|
||||
RECT r;
|
||||
r.left = rect.x;
|
||||
r.top = rect.y;
|
||||
r.right = rect.x + rect.width;
|
||||
r.bottom = rect.y + rect.height;
|
||||
if (hTheme) {
|
||||
wxUxThemeEngine::Get()->SetWindowTheme((HWND)win->GetHWND(), L"Explorer", NULL);
|
||||
wxUxThemeEngine::Get()->DrawThemeBackground(
|
||||
(HTHEME)hTheme,
|
||||
(HDC)dc.GetHDC(),
|
||||
LVP_LISTITEM,
|
||||
hot&&selected ? LISS_HOTSELECTED : hot ? LISS_HOT :selected&&focused ? LISS_SELECTED : selected ? LISS_SELECTEDNOTFOCUS : LISS_NORMAL,
|
||||
&r,
|
||||
NULL
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -75,5 +75,8 @@ void draw_checkbox(Window* win, DC& dc, const wxRect& rect, bool checked, bool e
|
||||
/// Draws a radio button
|
||||
void draw_radiobox(Window* win, DC& dc, const wxRect& rect, bool checked, bool enabled = true);
|
||||
|
||||
/// Draws a (fancy) selection rectangle
|
||||
void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool selected = true, bool focused = true, bool hot = false);
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user