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
bdaa8083
Commit
bdaa8083
authored
Dec 07, 2010
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw_control_box instead of draw_control_border
parent
0230317c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
11 deletions
+28
-11
src/gui/control/native_look_editor.cpp
src/gui/control/native_look_editor.cpp
+2
-6
src/gui/control/native_look_editor.hpp
src/gui/control/native_look_editor.hpp
+1
-1
src/gui/util.cpp
src/gui/util.cpp
+23
-2
src/gui/util.hpp
src/gui/util.hpp
+2
-2
No files found.
src/gui/control/native_look_editor.cpp
View file @
bdaa8083
...
@@ -36,18 +36,14 @@ void NativeLookEditor::drawViewer(RotatedDC& dc, ValueViewer& v) {
...
@@ -36,18 +36,14 @@ void NativeLookEditor::drawViewer(RotatedDC& dc, ValueViewer& v) {
if
(
!
shouldDraw
(
v
))
return
;
if
(
!
shouldDraw
(
v
))
return
;
ValueEditor
*
e
=
v
.
getEditor
();
ValueEditor
*
e
=
v
.
getEditor
();
if
(
!
e
||
e
->
drawLabel
())
{
if
(
!
e
||
e
->
drawLabel
())
{
// draw
background
// draw
control border and box
Style
&
s
=
*
v
.
getStyle
();
Style
&
s
=
*
v
.
getStyle
();
dc
.
SetPen
(
*
wxTRANSPARENT_PEN
);
draw_control_box
(
this
,
dc
.
getDC
(),
dc
.
trRectStraight
(
s
.
getInternalRect
().
grow
(
1
)),
current_editor
==
e
,
e
!=
nullptr
);
dc
.
SetBrush
(
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOW
));
dc
.
DrawRectangle
(
s
.
getInternalRect
().
grow
(
1
));
// draw label
// draw label
dc
.
SetFont
(
*
wxNORMAL_FONT
);
dc
.
SetFont
(
*
wxNORMAL_FONT
);
// TODO : tr using stylesheet or using game?
// TODO : tr using stylesheet or using game?
dc
.
DrawText
(
tr
(
getStylePackage
(),
s
.
fieldP
->
name
,
capitalize_sentence
),
dc
.
DrawText
(
tr
(
getStylePackage
(),
s
.
fieldP
->
name
,
capitalize_sentence
),
RealPoint
(
margin_left
-
s
.
left
,
1
));
RealPoint
(
margin_left
-
s
.
left
,
1
));
// draw 3D border
draw_control_border
(
this
,
dc
.
getDC
(),
dc
.
trRectStraight
(
s
.
getInternalRect
().
grow
(
1
)));
}
}
// draw viewer
// draw viewer
v
.
draw
(
dc
);
v
.
draw
(
dc
);
...
...
src/gui/control/native_look_editor.hpp
View file @
bdaa8083
...
@@ -19,7 +19,7 @@ DECLARE_POINTER_TYPE(ExportTemplate);
...
@@ -19,7 +19,7 @@ DECLARE_POINTER_TYPE(ExportTemplate);
/// A data editor with a platform native look
/// A data editor with a platform native look
class
NativeLookEditor
:
public
DataEditor
{
class
NativeLookEditor
:
public
DataEditor
{
public:
public:
NativeLookEditor
(
Window
*
parent
,
int
id
,
long
style
=
0
);
NativeLookEditor
(
Window
*
parent
,
int
id
,
long
style
=
wxBORDER_THEME
);
/// Uses a native look
/// Uses a native look
virtual
bool
nativeLook
()
const
{
return
true
;
}
virtual
bool
nativeLook
()
const
{
return
true
;
}
...
...
src/gui/util.cpp
View file @
bdaa8083
...
@@ -194,6 +194,18 @@ wxBitmap load_resource_tool_image(const String& name) {
...
@@ -194,6 +194,18 @@ wxBitmap load_resource_tool_image(const String& name) {
#endif
#endif
}
}
#if defined(_UNICODE) && defined(_MSC_VER) && _MSC_VER >= 1400
// manifest to use new-style controls in Windows Vista / Windows 7
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
// ----------------------------------------------------------------------------- : Platform look
// ----------------------------------------------------------------------------- : Platform look
// Draw a basic 3D border
// Draw a basic 3D border
...
@@ -212,7 +224,7 @@ void draw3DBorder(DC& dc, int x1, int y1, int x2, int y2) {
...
@@ -212,7 +224,7 @@ void draw3DBorder(DC& dc, int x1, int y1, int x2, int y2) {
dc
.
DrawLine
(
x2
+
1
,
y1
-
1
,
x2
+
1
,
y2
+
2
);
dc
.
DrawLine
(
x2
+
1
,
y1
-
1
,
x2
+
1
,
y2
+
2
);
}
}
void
draw_control_bo
rder
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
)
{
void
draw_control_bo
x
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
focused
,
bool
enabled
)
{
#if wxUSE_UXTHEME && defined(__WXMSW__)
#if wxUSE_UXTHEME && defined(__WXMSW__)
RECT
r
;
RECT
r
;
wxUxThemeEngine
*
themeEngine
=
wxUxThemeEngine
::
Get
();
wxUxThemeEngine
*
themeEngine
=
wxUxThemeEngine
::
Get
();
...
@@ -227,19 +239,28 @@ void draw_control_border(Window* win, DC& dc, const wxRect& rect) {
...
@@ -227,19 +239,28 @@ void draw_control_border(Window* win, DC& dc, const wxRect& rect) {
(
HTHEME
)
hTheme
,
(
HTHEME
)
hTheme
,
(
HDC
)
dc
.
GetHDC
(),
(
HDC
)
dc
.
GetHDC
(),
EP_EDITTEXT
,
EP_EDITTEXT
,
ETS_NORMAL
,
!
enabled
?
ETS_DISABLED
:
focused
?
ETS_NORMAL
:
ETS_NORMAL
,
&
r
,
&
r
,
NULL
NULL
);
);
return
;
return
;
}
}
}
}
#endif
// otherwise, draw a standard border
// clear the background
dc
.
SetPen
(
*
wxTRANSPARENT_PEN
);
dc
.
SetBrush
(
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOW
));
dc
.
DrawRectangle
(
rect
);
// draw the border
#if defined(__WXMSW__)
r
.
left
=
rect
.
x
-
2
;
r
.
left
=
rect
.
x
-
2
;
r
.
top
=
rect
.
y
-
2
;
r
.
top
=
rect
.
y
-
2
;
r
.
right
=
rect
.
x
+
rect
.
width
+
2
;
r
.
right
=
rect
.
x
+
rect
.
width
+
2
;
r
.
bottom
=
rect
.
y
+
rect
.
height
+
2
;
r
.
bottom
=
rect
.
y
+
rect
.
height
+
2
;
DrawEdge
((
HDC
)
dc
.
GetHDC
(),
&
r
,
EDGE_SUNKEN
,
BF_RECT
);
DrawEdge
((
HDC
)
dc
.
GetHDC
(),
&
r
,
EDGE_SUNKEN
,
BF_RECT
);
#else
#else
// draw a 3D border
draw3DBorder
(
dc
,
rect
.
x
-
1
,
rect
.
y
-
1
,
rect
.
x
+
rect
.
width
,
rect
.
y
+
rect
.
height
);
draw3DBorder
(
dc
,
rect
.
x
-
1
,
rect
.
y
-
1
,
rect
.
x
+
rect
.
width
,
rect
.
y
+
rect
.
height
);
#endif
#endif
}
}
...
...
src/gui/util.hpp
View file @
bdaa8083
...
@@ -56,9 +56,9 @@ wxBitmap load_resource_tool_image(const String& name);
...
@@ -56,9 +56,9 @@ wxBitmap load_resource_tool_image(const String& name);
// ----------------------------------------------------------------------------- : Platform look
// ----------------------------------------------------------------------------- : Platform look
/// Draws a bo
rder
for a control *around* a rect
/// Draws a bo
x
for a control *around* a rect
/** Based on wxRendererXP::DrawComboBoxDropButton */
/** Based on wxRendererXP::DrawComboBoxDropButton */
void
draw_control_bo
rder
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
);
void
draw_control_bo
x
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
focused
,
bool
enabled
=
true
);
/// Draws an arrow for a menu item indicating it has a sub menu
/// 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
);
void
draw_menu_arrow
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
active
);
...
...
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