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
ee661525
Commit
ee661525
authored
Sep 26, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor enhancements and fixed minor bug in field editor dialog
parent
8570d331
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
16 deletions
+44
-16
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+6
-2
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+28
-1
dialog_edit_label_base.cpp
eeschema/dialog_edit_label_base.cpp
+3
-3
dialog_edit_label_base.fbp
eeschema/dialog_edit_label_base.fbp
+5
-5
dialog_edit_label_base.h
eeschema/dialog_edit_label_base.h
+1
-1
dialog_edit_libentry_fields_in_lib.cpp
eeschema/dialog_edit_libentry_fields_in_lib.cpp
+1
-4
No files found.
eeschema/dialog_edit_component_in_schematic.cpp
View file @
ee661525
...
...
@@ -66,7 +66,7 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
}
parent
->
DrawPanel
->
MouseToCursorSchema
();
parent
->
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
parent
->
DrawPanel
->
m_IgnoreMouseEvents
=
false
;
}
...
...
@@ -522,8 +522,12 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
fieldValueTextCtrl
->
SetValue
(
field
.
m_Text
);
// For power symbols, the value is NOR editable, because value and pin name must be same
// and can be edited only in library editor
if
(
fieldNdx
==
VALUE
&&
m_LibEntry
&&
m_LibEntry
->
m_Options
==
ENTRY_POWER
)
fieldValueTextCtrl
->
Enable
(
FALSE
);
fieldValueTextCtrl
->
Enable
(
false
);
else
fieldValueTextCtrl
->
Enable
(
true
);
textSizeTextCtrl
->
SetValue
(
WinEDA_GraphicTextCtrl
::
FormatSize
(
EESCHEMA_INTERNAL_UNIT
,
g_UnitMetric
,
field
.
m_Size
.
x
)
);
...
...
eeschema/dialog_edit_label.cpp
View file @
ee661525
...
...
@@ -46,11 +46,13 @@ DialogLabelEditor::DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT* C
void
DialogLabelEditor
::
init
()
{
wxString
msg
;
bool
multine
=
false
;
if
(
m_CurrentText
->
m_MultilineAllowed
)
{
m_TextLabel
=
m_textCtrlMultiline
;
m_TextLabelSingleline
->
Show
(
false
);
multine
=
true
;
}
else
{
...
...
@@ -90,8 +92,33 @@ void DialogLabelEditor::init()
textWidth
.
Append
(
'M'
,
MINTEXTWIDTH
);
EnsureTextCtrlWidth
(
m_TextLabel
,
&
textWidth
);
}
else
else
if
(
!
multine
)
EnsureTextCtrlWidth
(
m_TextLabel
);
else
{
// calculate the lenght of the biggest line
// we cannot use the lenght of the entire text that has no meaning
int
max_len
=
0
;
int
curr_len
=
0
;
int
imax
=
m_CurrentText
->
m_Text
.
Len
();
for
(
int
count
=
0
;
count
<
imax
;
count
++
)
{
if
(
m_CurrentText
->
m_Text
[
count
]
==
'\n'
||
m_CurrentText
->
m_Text
[
count
]
==
'\r'
)
// new line
{
curr_len
=
0
;
}
else
{
curr_len
++
;
if
(
max_len
<
curr_len
)
max_len
=
curr_len
;
}
}
wxString
textWidth
;
textWidth
.
Append
(
'M'
,
max_len
);
EnsureTextCtrlWidth
(
m_TextLabel
,
&
textWidth
);
}
// Set validators
m_TextOrient
->
SetSelection
(
m_CurrentText
->
GetSchematicTextOrientation
()
);
...
...
eeschema/dialog_edit_label_base.cpp
View file @
ee661525
...
...
@@ -23,13 +23,13 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
m_TextLabelSingleline
=
new
wxTextCtrl
(
this
,
wxID_VALUE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_PROCESS_ENTER
);
m_TextLabelSingleline
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
bMainSizer
->
Add
(
m_TextLabelSingleline
,
0
,
wx
BOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
bMainSizer
->
Add
(
m_TextLabelSingleline
,
0
,
wx
EXPAND
|
wxRIGHT
|
wxLEFT
,
5
);
m_textCtrlMultiline
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_MULTILINE
|
wxTE_PROCESS_ENTER
);
m_textCtrlMultiline
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
m_textCtrlMultiline
->
SetMinSize
(
wxSize
(
-
1
,
60
)
);
bMainSizer
->
Add
(
m_textCtrlMultiline
,
0
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
bMainSizer
->
Add
(
m_textCtrlMultiline
,
1
,
wxEXPAND
|
wxRIGHT
|
wxLEFT
,
5
);
wxBoxSizer
*
m_OptionsSizer
;
m_OptionsSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
...
...
@@ -73,7 +73,7 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
m_OptionsSizer
->
Add
(
bSizer4
,
1
,
0
,
5
);
bMainSizer
->
Add
(
m_OptionsSizer
,
1
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
m_OptionsSizer
,
0
,
wxEXPAND
,
5
);
this
->
SetSizer
(
bMainSizer
);
this
->
Layout
();
...
...
eeschema/dialog_edit_label_base.fbp
View file @
ee661525
...
...
@@ -32,7 +32,7 @@
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
DialogLabelEditor_Base
</property>
<property
name=
"pos"
></property>
<property
name=
"size"
>
526,2
81
</property>
<property
name=
"size"
>
526,2
90
</property>
<property
name=
"style"
>
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
</property>
<property
name=
"subclass"
></property>
<property
name=
"title"
>
Text Editor
</property>
...
...
@@ -128,7 +128,7 @@
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wx
BOTTOM|wxRIGHT|wxLEFT|wxEXPAND
</property>
<property
name=
"flag"
>
wx
EXPAND|wxRIGHT|wxLEFT
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxTextCtrl"
expanded=
"1"
>
<property
name=
"bg"
></property>
...
...
@@ -183,8 +183,8 @@
</object>
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wx
BOTTOM|wxRIGHT|wxLEFT|wxEXPAND
</property>
<property
name=
"proportion"
>
0
</property>
<property
name=
"flag"
>
wx
EXPAND|wxRIGHT|wxLEFT
</property>
<property
name=
"proportion"
>
1
</property>
<object
class=
"wxTextCtrl"
expanded=
"1"
>
<property
name=
"bg"
></property>
<property
name=
"context_help"
></property>
...
...
@@ -239,7 +239,7 @@
<object
class=
"sizeritem"
expanded=
"1"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxEXPAND
</property>
<property
name=
"proportion"
>
1
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxBoxSizer"
expanded=
"1"
>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
m_OptionsSizer
</property>
...
...
eeschema/dialog_edit_label_base.h
View file @
ee661525
...
...
@@ -57,7 +57,7 @@ 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
(
526
,
2
81
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
DialogLabelEditor_Base
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Text Editor"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
526
,
2
90
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DialogLabelEditor_Base
();
};
...
...
eeschema/dialog_edit_libentry_fields_in_lib.cpp
View file @
ee661525
...
...
@@ -533,7 +533,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
fieldNameTextCtrl
->
SetValue
(
field
.
m_Name
);
// if fieldNdx == REFERENCE, VALUE, FOOTPRINT, or DATASHEET, then disable fi
le
d name editing
// if fieldNdx == REFERENCE, VALUE, FOOTPRINT, or DATASHEET, then disable fi
el
d name editing
fieldNameTextCtrl
->
Enable
(
fieldNdx
>=
FIELD1
);
fieldNameTextCtrl
->
SetEditable
(
fieldNdx
>=
FIELD1
);
moveUpButton
->
Enable
(
fieldNdx
>=
FIELD1
);
// disable move up button for non moveable fields
...
...
@@ -542,9 +542,6 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
fieldValueTextCtrl
->
SetValue
(
field
.
m_Text
);
if
(
fieldNdx
==
VALUE
&&
m_LibEntry
&&
m_LibEntry
->
m_Options
==
ENTRY_POWER
)
fieldValueTextCtrl
->
Enable
(
FALSE
);
textSizeTextCtrl
->
SetValue
(
WinEDA_GraphicTextCtrl
::
FormatSize
(
EESCHEMA_INTERNAL_UNIT
,
g_UnitMetric
,
field
.
m_Size
.
x
)
);
...
...
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