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
98b0bf00
Commit
98b0bf00
authored
Dec 07, 2010
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use native themed push buttons
parent
28901f3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
src/gui/util.cpp
src/gui/util.cpp
+17
-0
src/gui/util.hpp
src/gui/util.hpp
+3
-0
src/gui/value/symbol.cpp
src/gui/value/symbol.cpp
+1
-9
No files found.
src/gui/util.cpp
View file @
98b0bf00
...
...
@@ -265,6 +265,23 @@ void draw_control_box(Window* win, DC& dc, const wxRect& rect, bool focused, boo
#endif
}
void
draw_button
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
focused
,
bool
down
,
bool
enabled
)
{
#if 1
wxRendererNative
&
rn
=
wxRendererNative
::
GetDefault
();
rn
.
DrawPushButton
(
win
,
dc
,
rect
,
(
focused
?
wxCONTROL_FOCUSED
:
0
)
|
(
down
?
wxCONTROL_PRESSED
:
0
)
|
(
enabled
?
0
:
wxCONTROL_DISABLED
));
#else
dc
.
SetPen
(
*
wxTRANSPARENT_PEN
);
dc
.
SetBrush
(
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_BTNFACE
));
dc
.
DrawRectangle
(
rect
.
x
,
rect
.
y
,
rect
.
width
,
rect
.
height
);
dc
.
SetPen
(
wxSystemSettings
::
GetColour
(
down
?
wxSYS_COLOUR_BTNSHADOW
:
wxSYS_COLOUR_BTNHIGHLIGHT
));
dc
.
DrawLine
(
rect
.
x
,
rect
.
y
,
rect
.
x
+
rect
.
width
,
rect
.
y
);
dc
.
DrawLine
(
rect
.
x
,
rect
.
y
,
rect
.
x
,
rect
.
y
+
rect
.
height
);
dc
.
SetPen
(
wxSystemSettings
::
GetColour
(
down
?
wxSYS_COLOUR_BTNHIGHLIGHT
:
wxSYS_COLOUR_BTNSHADOW
));
dc
.
DrawLine
(
rect
.
x
+
rect
.
width
-
1
,
rect
.
y
,
rect
.
x
+
rect
.
width
-
1
,
rect
.
y
+
rect
.
height
);
dc
.
DrawLine
(
rect
.
x
,
rect
.
y
+
rect
.
height
-
1
,
rect
.
x
+
rect
.
width
,
rect
.
y
+
rect
.
height
-
1
);
#endif
}
// portable, based on wxRendererGeneric::DrawComboBoxDropButton
void
draw_menu_arrow
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
active
)
{
wxPoint
pt
[]
=
...
...
src/gui/util.hpp
View file @
98b0bf00
...
...
@@ -60,6 +60,9 @@ wxBitmap load_resource_tool_image(const String& name);
/** Based on wxRendererXP::DrawComboBoxDropButton */
void
draw_control_box
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
focused
,
bool
enabled
=
true
);
/// Draw a (possibly themed) button
void
draw_button
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
focused
,
bool
down
,
bool
enabled
);
/// Draws an arrow for a menu item indicating it has a sub menu
void
draw_menu_arrow
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
active
);
...
...
src/gui/value/symbol.cpp
View file @
98b0bf00
...
...
@@ -43,15 +43,7 @@ void SymbolValueEditor::drawButton(RotatedDC& dc, int button, const String& text
double
x
=
style
().
width
-
width
-
(
width
+
1
)
*
button
;
double
y
=
0
;
// draw button
dc
.
SetPen
(
*
wxTRANSPARENT_PEN
);
dc
.
SetBrush
(
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_BTNFACE
));
dc
.
DrawRectangle
(
RealRect
(
x
,
y
,
width
,
height
));
dc
.
SetPen
(
wxSystemSettings
::
GetColour
(
down
?
wxSYS_COLOUR_BTNSHADOW
:
wxSYS_COLOUR_BTNHIGHLIGHT
));
dc
.
DrawLine
(
RealPoint
(
x
,
y
),
RealPoint
(
x
+
width
,
y
));
dc
.
DrawLine
(
RealPoint
(
x
,
y
),
RealPoint
(
x
,
y
+
height
));
dc
.
SetPen
(
wxSystemSettings
::
GetColour
(
down
?
wxSYS_COLOUR_BTNHIGHLIGHT
:
wxSYS_COLOUR_BTNSHADOW
));
dc
.
DrawLine
(
RealPoint
(
x
+
width
-
1
,
y
),
RealPoint
(
x
+
width
-
1
,
y
+
height
));
dc
.
DrawLine
(
RealPoint
(
x
,
y
+
height
-
1
),
RealPoint
(
x
+
width
,
y
+
height
-
1
));
draw_button
(
&
editor
(),
dc
.
getDC
(),
dc
.
trRectToBB
(
RealRect
(
x
,
y
,
width
,
height
)),
false
,
down
,
true
);
// draw text
RealSize
text_size
=
dc
.
GetTextExtent
(
text
);
dc
.
DrawText
(
text
,
align_in_rect
((
Alignment
)(
ALIGN_BOTTOM
|
ALIGN_CENTER
),
text_size
,
RealRect
(
x
,
y
,
width
,
height
*
0.9
)));
...
...
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