Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
af4e798b
Commit
af4e798b
authored
Feb 09, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhance dialog_edit_label
parent
04174ecd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
59 deletions
+126
-59
CHANGELOG.txt
CHANGELOG.txt
+7
-0
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+51
-34
dialog_edit_label_base.cpp
eeschema/dialog_edit_label_base.cpp
+12
-10
dialog_edit_label_base.fbp
eeschema/dialog_edit_label_base.fbp
+53
-13
dialog_edit_label_base.h
eeschema/dialog_edit_label_base.h
+3
-2
No files found.
CHANGELOG.txt
View file @
af4e798b
...
...
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2009-Feb-09 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++eeschema
Changed dialog_edit_label so that is is UIpolicies.txt compliant. Proper case
on window titles, resizeable dialog border, minimum text width handling.
2009-Feb-7 Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++All:
...
...
eeschema/dialog_edit_label.cpp
View file @
af4e798b
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.cpp
// Author: jean-pierre Charras
// Modified by:
...
...
@@ -16,65 +17,80 @@
#include "general.h"
#include "dialog_edit_label.h"
DialogLabelEditor
::
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
:
DialogLabelEditor_Base
(
parent
)
DialogLabelEditor
::
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
:
DialogLabelEditor_Base
(
parent
)
{
m_Parent
=
parent
;
m_CurrentText
=
CurrentText
;
m_CurrentText
=
CurrentText
;
}
void
DialogLabelEditor
::
OnInitDialog
(
wxInitDialogEvent
&
event
)
{
wxString
msg
;
wxString
msg
;
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
m_TextLabel
->
SetValue
(
m_CurrentText
->
m_Text
);
m_TextLabel
->
SetValue
(
m_CurrentText
->
m_Text
);
m_TextLabel
->
SetFocus
();
// Set validators
m_TextOrient
->
SetSelection
(
m_CurrentText
->
m_Orient
);
m_TextShape
->
SetSelection
(
m_CurrentText
->
m_Shape
);
switch
(
m_CurrentText
->
Type
()
)
{
case
TYPE_SCH_GLOBALLABEL
:
SetTitle
(
_
(
"Global Label properties"
)
);
SetTitle
(
_
(
"Global Label Properties"
)
);
break
;
case
TYPE_SCH_HIERLABEL
:
SetTitle
(
_
(
"Hierarchal Label properties"
)
);
SetTitle
(
_
(
"Hierarchal Label Properties"
)
);
break
;
case
TYPE_SCH_LABEL
:
SetTitle
(
_
(
"Label properties"
)
);
SetTitle
(
_
(
"Label Properties"
)
);
break
;
default
:
SetTitle
(
_
(
"Text properties"
)
);
SetTitle
(
_
(
"Text Properties"
)
);
break
;
}
unsigned
MINTEXTWIDTH
=
30
;
// M's are big characters, a few establish a lot of width
if
(
m_CurrentText
->
m_Text
.
Length
()
<
MINTEXTWIDTH
)
{
wxString
textWidth
;
textWidth
.
Append
(
'M'
,
MINTEXTWIDTH
);
EnsureTextCtrlWidth
(
m_TextLabel
,
&
textWidth
);
}
else
EnsureTextCtrlWidth
(
m_TextLabel
);
// Set validators
m_TextOrient
->
SetSelection
(
m_CurrentText
->
m_Orient
);
m_TextShape
->
SetSelection
(
m_CurrentText
->
m_Shape
);
int
style
=
0
;
if
(
m_CurrentText
->
m_Italic
)
if
(
m_CurrentText
->
m_Italic
)
style
=
1
;
if
(
m_CurrentText
->
m_Width
>
1
)
if
(
m_CurrentText
->
m_Width
>
1
)
style
+=
2
;
m_TextStyle
->
SetSelection
(
style
);
m_TextStyle
->
SetSelection
(
style
);
msg
=
m_SizeTitle
->
GetLabel
()
+
ReturnUnitSymbol
();
m_SizeTitle
->
SetLabel
(
msg
);
m_SizeTitle
->
SetLabel
(
msg
);
msg
=
ReturnStringFromValue
(
g_UnitMetric
,
m_CurrentText
->
m_Size
.
x
,
m_Parent
->
m_InternalUnits
);
m_TextSize
->
SetValue
(
msg
);
msg
=
ReturnStringFromValue
(
g_UnitMetric
,
m_CurrentText
->
m_Size
.
x
,
m_Parent
->
m_InternalUnits
);
m_TextSize
->
SetValue
(
msg
);
if
(
m_CurrentText
->
Type
()
!=
TYPE_SCH_GLOBALLABEL
&&
m_CurrentText
->
Type
()
!=
TYPE_SCH_HIERLABEL
)
m_TextShape
->
Show
(
false
);
if
(
m_CurrentText
->
Type
()
!=
TYPE_SCH_GLOBALLABEL
&&
m_CurrentText
->
Type
()
!=
TYPE_SCH_HIERLABEL
)
{
m_TextShape
->
Show
(
false
);
}
if
(
GetSizer
()
)
if
(
GetSizer
()
)
{
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
}
...
...
@@ -85,9 +101,10 @@ wxString msg;
void
DialogLabelEditor
::
OnButtonOKClick
(
wxCommandEvent
&
event
)
{
TextPropertiesAccept
(
event
);
TextPropertiesAccept
(
event
);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
...
...
eeschema/dialog_edit_label_base.cpp
View file @
af4e798b
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version A
pr 16
2008)
// C++ code generated with wxFormBuilder (version A
ug 7
2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
...
...
@@ -24,6 +24,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
bSizer2
->
Add
(
m_staticText1
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
m_TextLabel
=
new
wxTextCtrl
(
this
,
wxID_VALUE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_TextLabel
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
bSizer2
->
Add
(
m_TextLabel
,
0
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
wxBoxSizer
*
m_OptionsSizer
;
...
...
@@ -33,23 +35,23 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
int
m_TextOrientNChoices
=
sizeof
(
m_TextOrientChoices
)
/
sizeof
(
wxString
);
m_TextOrient
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Direction"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextOrientNChoices
,
m_TextOrientChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextOrient
->
SetSelection
(
0
);
m_OptionsSizer
->
Add
(
m_TextOrient
,
0
,
wxALL
,
5
);
m_OptionsSizer
->
Add
(
m_TextOrient
,
1
,
wxALL
,
5
);
wxString
m_TextStyleChoices
[]
=
{
_
(
"Normal"
),
_
(
"Italic"
),
_
(
"Bold"
),
_
(
"Bold Italic"
)
};
int
m_TextStyleNChoices
=
sizeof
(
m_TextStyleChoices
)
/
sizeof
(
wxString
);
m_TextStyle
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Style"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextStyleNChoices
,
m_TextStyleChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextStyle
->
SetSelection
(
0
);
m_OptionsSizer
->
Add
(
m_TextStyle
,
0
,
wxALL
,
5
);
m_OptionsSizer
->
Add
(
m_TextStyle
,
1
,
wxALL
,
5
);
wxString
m_TextShapeChoices
[]
=
{
_
(
"Input"
),
_
(
"Output"
),
_
(
"Bidi"
),
_
(
"TriState"
),
_
(
"Passive"
)
};
int
m_TextShapeNChoices
=
sizeof
(
m_TextShapeChoices
)
/
sizeof
(
wxString
);
m_TextShape
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Glabel Shape
:
"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextShapeNChoices
,
m_TextShapeChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextShape
->
SetSelection
(
2
);
m_OptionsSizer
->
Add
(
m_TextShape
,
0
,
wxALL
,
5
);
m_TextShape
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Glabel Shape"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextShapeNChoices
,
m_TextShapeChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextShape
->
SetSelection
(
0
);
m_OptionsSizer
->
Add
(
m_TextShape
,
1
,
wxALL
,
5
);
bSizer2
->
Add
(
m_OptionsSizer
,
1
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bSizer2
,
1
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bSizer2
,
5
,
wxEXPAND
,
5
);
wxBoxSizer
*
bSizer4
;
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
...
...
@@ -67,14 +69,14 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
m_buttonOK
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonOK
->
SetForegroundColour
(
wxColour
(
234
,
0
,
0
)
);
bSizer4
->
Add
(
m_buttonOK
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bSizer4
->
Add
(
m_buttonOK
,
1
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
m_buttonCANCEL
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Cancel"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonCANCEL
->
SetForegroundColour
(
wxColour
(
0
,
0
,
187
)
);
bSizer4
->
Add
(
m_buttonCANCEL
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bSizer4
->
Add
(
m_buttonCANCEL
,
1
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bMainSizer
->
Add
(
bSizer4
,
0
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bSizer4
,
1
,
0
,
5
);
this
->
SetSizer
(
bMainSizer
);
this
->
Layout
();
...
...
eeschema/dialog_edit_label_base.fbp
View file @
af4e798b
...
...
@@ -32,11 +32,15 @@
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
DialogLabelEditor_Base
</property>
<property
name=
"pos"
></property>
<property
name=
"size"
>
401,222
</property>
<property
name=
"style"
>
wxDEFAULT_DIALOG_STYLE
</property>
<property
name=
"size"
>
600,300
</property>
<property
name=
"style"
>
wxDEFAULT_DIALOG_STYLE
|wxRESIZE_BORDER
</property>
<property
name=
"subclass"
></property>
<property
name=
"title"
>
Text Editor
</property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -78,7 +82,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxEXPAND
</property>
<property
name=
"proportion"
>
1
</property>
<property
name=
"proportion"
>
5
</property>
<object
class=
"wxBoxSizer"
expanded=
"1"
>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
bSizer2
</property>
...
...
@@ -106,6 +110,10 @@
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -156,7 +164,11 @@
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"tooltip"
>
Enter the text to be used within the schematic
</property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"value"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
...
...
@@ -202,7 +214,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxRadioBox"
expanded=
"1"
>
<property
name=
"bg"
></property>
<property
name=
"choices"
>
"
Right
"
"
Up
"
"
Left
"
"
Down
"
</property>
...
...
@@ -224,6 +236,10 @@
<property
name=
"style"
>
wxRA_SPECIFY_COLS
</property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -256,7 +272,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxRadioBox"
expanded=
"1"
>
<property
name=
"bg"
></property>
<property
name=
"choices"
>
"
Normal
"
"
Italic
"
"
Bold
"
"
Bold Italic
"
</property>
...
...
@@ -278,6 +294,10 @@
<property
name=
"style"
>
wxRA_SPECIFY_COLS
</property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -310,7 +330,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxRadioBox"
expanded=
"1"
>
<property
name=
"bg"
></property>
<property
name=
"choices"
>
"
Input
"
"
Output
"
"
Bidi
"
"
TriState
"
"
Passive
"
</property>
...
...
@@ -320,18 +340,22 @@
<property
name=
"font"
></property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"label"
>
Glabel Shape
:
</property>
<property
name=
"label"
>
Glabel Shape
</property>
<property
name=
"majorDimension"
>
1
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
m_TextShape
</property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pos"
></property>
<property
name=
"selection"
>
2
</property>
<property
name=
"selection"
>
0
</property>
<property
name=
"size"
></property>
<property
name=
"style"
>
wxRA_SPECIFY_COLS
</property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -367,8 +391,8 @@
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxEXPAND
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"flag"
></property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxBoxSizer"
expanded=
"1"
>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
bSizer4
</property>
...
...
@@ -396,6 +420,10 @@
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -447,6 +475,10 @@
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"value"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
...
...
@@ -493,7 +525,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"bg"
></property>
<property
name=
"context_help"
></property>
...
...
@@ -513,6 +545,10 @@
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
@@ -545,7 +581,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxALL|wxALIGN_CENTER_HORIZONTAL
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxButton"
expanded=
"1"
>
<property
name=
"bg"
></property>
<property
name=
"context_help"
></property>
...
...
@@ -565,6 +601,10 @@
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
...
...
eeschema/dialog_edit_label_base.h
View file @
af4e798b
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version A
pr 16
2008)
// C++ code generated with wxFormBuilder (version A
ug 7
2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
...
...
@@ -56,7 +56,8 @@ class DialogLabelEditor_Base : public wxDialog
public
:
DialogLabelEditor_Base
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Text Editor"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
401
,
222
),
long
style
=
wxDEFAULT_DIALOG_STYLE
);
DialogLabelEditor_Base
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Text Editor"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
600
,
300
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DialogLabelEditor_Base
();
};
...
...
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