Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
77983048
Commit
77983048
authored
Dec 07, 2010
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw fancy windows explorer style selection rectangles
parent
98b0bf00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
src/gui/util.cpp
src/gui/util.cpp
+26
-0
src/gui/util.hpp
src/gui/util.hpp
+3
-0
No files found.
src/gui/util.cpp
View file @
77983048
...
...
@@ -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
}
src/gui/util.hpp
View file @
77983048
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment