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
7a66c84c
Commit
7a66c84c
authored
Jun 30, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Width of labels in native look editor is adjusted based on the longest label
parent
b1000aad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
src/gui/control/native_look_editor.cpp
src/gui/control/native_look_editor.cpp
+17
-0
src/gui/control/native_look_editor.hpp
src/gui/control/native_look_editor.hpp
+5
-4
No files found.
src/gui/control/native_look_editor.cpp
View file @
7a66c84c
...
...
@@ -58,6 +58,23 @@ void NativeLookEditor::resizeViewers() {
int
w
,
h
;
GetClientSize
(
&
w
,
&
h
);
const
int
default_height
=
17
;
// Determine label width
{
label_width
=
0
;
wxClientDC
dc
(
this
);
dc
.
SetFont
(
*
wxNORMAL_FONT
);
FOR_EACH
(
v
,
viewers
)
{
ValueEditor
*
e
=
v
->
getEditor
();
if
(
!
e
||
e
->
drawLabel
())
{
// width of the label string
int
w
;
Style
&
s
=
*
v
->
getStyle
();
String
text
=
tr
(
*
set
->
game
,
s
.
fieldP
->
name
,
capitalize_sentence
(
s
.
fieldP
->
name
));
dc
.
GetTextExtent
(
text
,
&
w
,
nullptr
);
label_width
=
max
(
label_width
,
w
+
label_margin
);
}
}
}
// Set editor sizes
FOR_EACH
(
v
,
viewers
)
{
StyleP
s
=
v
->
getStyle
();
...
...
src/gui/control/native_look_editor.hpp
View file @
7a66c84c
...
...
@@ -35,10 +35,11 @@ class NativeLookEditor : public DataEditor {
virtual
void
onInit
();
private:
static
const
UInt
margin
=
6
;
static
const
UInt
margin_left
=
4
;
static
const
UInt
label_width
=
150
;
static
const
UInt
vspace
=
10
;
static
const
int
margin
=
6
;
static
const
int
margin_left
=
4
;
static
const
int
vspace
=
10
;
static
const
int
label_margin
=
10
;
int
label_width
;
DECLARE_EVENT_TABLE
();
...
...
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