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
Expand all
Hide 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
...
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
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>
2009-Feb-7 Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
++All:
++All:
...
...
eeschema/dialog_edit_label.cpp
View file @
af4e798b
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.cpp
// Name: dialog_edit_label.cpp
// Author: jean-pierre Charras
// Author: jean-pierre Charras
// Modified by:
// Modified by:
...
@@ -16,65 +17,80 @@
...
@@ -16,65 +17,80 @@
#include "general.h"
#include "general.h"
#include "dialog_edit_label.h"
#include "dialog_edit_label.h"
DialogLabelEditor
::
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
DialogLabelEditor
::
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
:
:
DialogLabelEditor_Base
(
parent
)
DialogLabelEditor_Base
(
parent
)
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_CurrentText
=
CurrentText
;
m_CurrentText
=
CurrentText
;
}
}
void
DialogLabelEditor
::
OnInitDialog
(
wxInitDialogEvent
&
event
)
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
();
m_TextLabel
->
SetFocus
();
// Set validators
m_TextOrient
->
SetSelection
(
m_CurrentText
->
m_Orient
);
m_TextShape
->
SetSelection
(
m_CurrentText
->
m_Shape
);
switch
(
m_CurrentText
->
Type
()
)
switch
(
m_CurrentText
->
Type
()
)
{
{
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_GLOBALLABEL
:
SetTitle
(
_
(
"Global Label properties"
));
SetTitle
(
_
(
"Global Label Properties"
)
);
break
;
break
;
case
TYPE_SCH_HIERLABEL
:
SetTitle
(
_
(
"Hierarchal Label Properties"
)
);
break
;
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_LABEL
:
SetTitle
(
_
(
"Hierarchal Label properties"
));
SetTitle
(
_
(
"Label Properties"
)
);
break
;
break
;
default
:
SetTitle
(
_
(
"Text Properties"
)
);
break
;
}
case
TYPE_SCH_LABEL
:
unsigned
MINTEXTWIDTH
=
30
;
// M's are big characters, a few establish a lot of width
SetTitle
(
_
(
"Label properties"
));
break
;
default
:
if
(
m_CurrentText
->
m_Text
.
Length
()
<
MINTEXTWIDTH
)
SetTitle
(
_
(
"Text properties"
));
{
break
;
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
;
int
style
=
0
;
if
(
m_CurrentText
->
m_Italic
)
if
(
m_CurrentText
->
m_Italic
)
style
=
1
;
style
=
1
;
if
(
m_CurrentText
->
m_Width
>
1
)
if
(
m_CurrentText
->
m_Width
>
1
)
style
+=
2
;
style
+=
2
;
m_TextStyle
->
SetSelection
(
style
);
m_TextStyle
->
SetSelection
(
style
);
msg
=
m_SizeTitle
->
GetLabel
()
+
ReturnUnitSymbol
();
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
);
msg
=
ReturnStringFromValue
(
g_UnitMetric
,
m_CurrentText
->
m_Size
.
x
,
m_Parent
->
m_InternalUnits
);
m_TextSize
->
SetValue
(
msg
);
m_TextSize
->
SetValue
(
msg
);
if
(
m_CurrentText
->
Type
()
!=
TYPE_SCH_GLOBALLABEL
&&
if
(
m_CurrentText
->
Type
()
!=
TYPE_SCH_GLOBALLABEL
m_CurrentText
->
Type
()
!=
TYPE_SCH_HIERLABEL
)
&&
m_CurrentText
->
Type
()
!=
TYPE_SCH_HIERLABEL
)
m_TextShape
->
Show
(
false
);
{
m_TextShape
->
Show
(
false
);
}
if
(
GetSizer
()
)
if
(
GetSizer
()
)
{
{
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
}
}
}
...
@@ -85,9 +101,10 @@ wxString msg;
...
@@ -85,9 +101,10 @@ wxString msg;
void
DialogLabelEditor
::
OnButtonOKClick
(
wxCommandEvent
&
event
)
void
DialogLabelEditor
::
OnButtonOKClick
(
wxCommandEvent
&
event
)
{
{
TextPropertiesAccept
(
event
);
TextPropertiesAccept
(
event
);
}
}
/*!
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
* 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/
// http://www.wxformbuilder.org/
//
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO "NOT" EDIT THIS FILE!
...
@@ -24,6 +24,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -24,6 +24,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
bSizer2
->
Add
(
m_staticText1
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
bSizer2
->
Add
(
m_staticText1
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
m_TextLabel
=
new
wxTextCtrl
(
this
,
wxID_VALUE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
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
);
bSizer2
->
Add
(
m_TextLabel
,
0
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
wxBoxSizer
*
m_OptionsSizer
;
wxBoxSizer
*
m_OptionsSizer
;
...
@@ -33,23 +35,23 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -33,23 +35,23 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
int
m_TextOrientNChoices
=
sizeof
(
m_TextOrientChoices
)
/
sizeof
(
wxString
);
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
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Direction"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextOrientNChoices
,
m_TextOrientChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextOrient
->
SetSelection
(
0
);
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"
)
};
wxString
m_TextStyleChoices
[]
=
{
_
(
"Normal"
),
_
(
"Italic"
),
_
(
"Bold"
),
_
(
"Bold Italic"
)
};
int
m_TextStyleNChoices
=
sizeof
(
m_TextStyleChoices
)
/
sizeof
(
wxString
);
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
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Style"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextStyleNChoices
,
m_TextStyleChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextStyle
->
SetSelection
(
0
);
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"
)
};
wxString
m_TextShapeChoices
[]
=
{
_
(
"Input"
),
_
(
"Output"
),
_
(
"Bidi"
),
_
(
"TriState"
),
_
(
"Passive"
)
};
int
m_TextShapeNChoices
=
sizeof
(
m_TextShapeChoices
)
/
sizeof
(
wxString
);
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
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Glabel Shape"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextShapeNChoices
,
m_TextShapeChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextShape
->
SetSelection
(
2
);
m_TextShape
->
SetSelection
(
0
);
m_OptionsSizer
->
Add
(
m_TextShape
,
0
,
wxALL
,
5
);
m_OptionsSizer
->
Add
(
m_TextShape
,
1
,
wxALL
,
5
);
bSizer2
->
Add
(
m_OptionsSizer
,
1
,
wxEXPAND
,
5
);
bSizer2
->
Add
(
m_OptionsSizer
,
1
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bSizer2
,
1
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bSizer2
,
5
,
wxEXPAND
,
5
);
wxBoxSizer
*
bSizer4
;
wxBoxSizer
*
bSizer4
;
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
...
@@ -67,14 +69,14 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -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
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonOK
->
SetForegroundColour
(
wxColour
(
234
,
0
,
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
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Cancel"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonCANCEL
->
SetForegroundColour
(
wxColour
(
0
,
0
,
187
)
);
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
->
SetSizer
(
bMainSizer
);
this
->
Layout
();
this
->
Layout
();
...
...
eeschema/dialog_edit_label_base.fbp
View file @
af4e798b
This diff is collapsed.
Click to expand it.
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/
// http://www.wxformbuilder.org/
//
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO "NOT" EDIT THIS FILE!
...
@@ -56,7 +56,8 @@ class DialogLabelEditor_Base : public wxDialog
...
@@ -56,7 +56,8 @@ class DialogLabelEditor_Base : public wxDialog
public
:
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
();
~
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