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
95316beb
Commit
95316beb
authored
Mar 30, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed other issue in dialog edit multiline text
parent
686358d6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
151 additions
and
74 deletions
+151
-74
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+7
-12
dialog_edit_label.h
eeschema/dialog_edit_label.h
+1
-0
dialog_edit_label_base.cpp
eeschema/dialog_edit_label_base.cpp
+19
-6
dialog_edit_label_base.fbp
eeschema/dialog_edit_label_base.fbp
+119
-53
dialog_edit_label_base.h
eeschema/dialog_edit_label_base.h
+5
-3
No files found.
eeschema/dialog_edit_label.cpp
View file @
95316beb
...
@@ -55,20 +55,15 @@ void DialogLabelEditor::InitDialog()
...
@@ -55,20 +55,15 @@ void DialogLabelEditor::InitDialog()
if
(
m_CurrentText
->
m_MultilineAllowed
)
if
(
m_CurrentText
->
m_MultilineAllowed
)
{
{
/* Multiline text edit control must be created because changing the text
m_textLabel
=
m_textLabelMultiLine
;
* control style to multiline must be done when the control is created.
m_textLabelSingleLine
->
Show
(
false
);
*/
m_textControlSizer
->
Detach
(
m_textLabel
);
m_textLabel
->
Destroy
();
m_textLabel
=
NULL
;
m_textLabel
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_MULTILINE
|
wxTE_PROCESS_ENTER
);
m_textLabel
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
m_textLabel
->
SetMinSize
(
wxSize
(
-
1
,
60
)
);
m_textControlSizer
->
Insert
(
1
,
m_textLabel
,
0
,
wxLEFT
|
wxEXPAND
,
3
);
m_textControlSizer
->
RecalcSizes
();
multiLine
=
true
;
multiLine
=
true
;
}
}
else
{
m_textLabel
=
m_textLabelSingleLine
;
m_textLabelMultiLine
->
Show
(
false
);
}
m_textLabel
->
SetValue
(
m_CurrentText
->
m_Text
);
m_textLabel
->
SetValue
(
m_CurrentText
->
m_Text
);
m_textLabel
->
SetFocus
();
m_textLabel
->
SetFocus
();
...
...
eeschema/dialog_edit_label.h
View file @
95316beb
...
@@ -15,6 +15,7 @@ class DialogLabelEditor : public DialogLabelEditor_Base
...
@@ -15,6 +15,7 @@ class DialogLabelEditor : public DialogLabelEditor_Base
private
:
private
:
WinEDA_SchematicFrame
*
m_Parent
;
WinEDA_SchematicFrame
*
m_Parent
;
SCH_TEXT
*
m_CurrentText
;
SCH_TEXT
*
m_CurrentText
;
wxTextCtrl
*
m_textLabel
;
public
:
public
:
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
aTextItem
);
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
aTextItem
);
...
...
eeschema/dialog_edit_label_base.cpp
View file @
95316beb
...
@@ -17,6 +17,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -17,6 +17,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
bMainSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
bMainSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_textControlSizer
=
new
wxFlexGridSizer
(
2
,
2
,
3
,
3
);
m_textControlSizer
=
new
wxFlexGridSizer
(
2
,
2
,
3
,
3
);
m_textControlSizer
->
AddGrowableCol
(
1
);
m_textControlSizer
->
AddGrowableRow
(
0
);
m_textControlSizer
->
SetFlexibleDirection
(
wxBOTH
);
m_textControlSizer
->
SetFlexibleDirection
(
wxBOTH
);
m_textControlSizer
->
SetNonFlexibleGrowMode
(
wxFLEX_GROWMODE_SPECIFIED
);
m_textControlSizer
->
SetNonFlexibleGrowMode
(
wxFLEX_GROWMODE_SPECIFIED
);
...
@@ -24,10 +26,20 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -24,10 +26,20 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
m_staticText1
->
Wrap
(
-
1
);
m_staticText1
->
Wrap
(
-
1
);
m_textControlSizer
->
Add
(
m_staticText1
,
0
,
wxRIGHT
,
3
);
m_textControlSizer
->
Add
(
m_staticText1
,
0
,
wxRIGHT
,
3
);
m_textLabel
=
new
wxTextCtrl
(
this
,
wxID_VALUE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_PROCESS_ENTER
)
;
wxBoxSizer
*
bSizeText
;
m_textLabel
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
bSizeText
=
new
wxBoxSizer
(
wxVERTICAL
);
m_textControlSizer
->
Add
(
m_textLabel
,
0
,
wxEXPAND
|
wxLEFT
,
3
);
m_textLabelSingleLine
=
new
wxTextCtrl
(
this
,
wxID_VALUESINGLE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_PROCESS_ENTER
);
m_textLabelSingleLine
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
bSizeText
->
Add
(
m_textLabelSingleLine
,
0
,
wxEXPAND
|
wxLEFT
,
3
);
m_textLabelMultiLine
=
new
wxTextCtrl
(
this
,
wxID_VALUEMULTI
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_MULTILINE
|
wxTE_PROCESS_ENTER
);
m_textLabelMultiLine
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
bSizeText
->
Add
(
m_textLabelMultiLine
,
1
,
wxEXPAND
|
wxLEFT
,
5
);
m_textControlSizer
->
Add
(
bSizeText
,
1
,
wxEXPAND
,
5
);
m_SizeTitle
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"&Size:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_SizeTitle
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"&Size:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_SizeTitle
->
Wrap
(
-
1
);
m_SizeTitle
->
Wrap
(
-
1
);
...
@@ -80,10 +92,10 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -80,10 +92,10 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
this
->
SetSizer
(
bMainSizer
);
this
->
SetSizer
(
bMainSizer
);
this
->
Layout
();
this
->
Layout
();
bMainSizer
->
Fit
(
this
);
// Connect Events
// Connect Events
m_textLabel
->
Connect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnEnterKey
),
NULL
,
this
);
m_textLabelSingleLine
->
Connect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnEnterKey
),
NULL
,
this
);
m_textLabelMultiLine
->
Connect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnEnterKey
),
NULL
,
this
);
m_sdbSizer1Cancel
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnCancelClick
),
NULL
,
this
);
m_sdbSizer1Cancel
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnCancelClick
),
NULL
,
this
);
m_sdbSizer1OK
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnOkClick
),
NULL
,
this
);
m_sdbSizer1OK
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnOkClick
),
NULL
,
this
);
}
}
...
@@ -91,7 +103,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -91,7 +103,8 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
DialogLabelEditor_Base
::~
DialogLabelEditor_Base
()
DialogLabelEditor_Base
::~
DialogLabelEditor_Base
()
{
{
// Disconnect Events
// Disconnect Events
m_textLabel
->
Disconnect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnEnterKey
),
NULL
,
this
);
m_textLabelSingleLine
->
Disconnect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnEnterKey
),
NULL
,
this
);
m_textLabelMultiLine
->
Disconnect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnEnterKey
),
NULL
,
this
);
m_sdbSizer1Cancel
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnCancelClick
),
NULL
,
this
);
m_sdbSizer1Cancel
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnCancelClick
),
NULL
,
this
);
m_sdbSizer1OK
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnOkClick
),
NULL
,
this
);
m_sdbSizer1OK
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DialogLabelEditor_Base
::
OnOkClick
),
NULL
,
this
);
}
}
eeschema/dialog_edit_label_base.fbp
View file @
95316beb
This diff is collapsed.
Click to expand it.
eeschema/dialog_edit_label_base.h
View file @
95316beb
...
@@ -34,13 +34,15 @@ class DialogLabelEditor_Base : public wxDialog
...
@@ -34,13 +34,15 @@ class DialogLabelEditor_Base : public wxDialog
protected
:
protected
:
enum
enum
{
{
wxID_VALUE
=
1000
,
wxID_VALUESINGLE
=
1000
,
wxID_VALUEMULTI
,
wxID_SIZE
,
wxID_SIZE
,
};
};
wxFlexGridSizer
*
m_textControlSizer
;
wxFlexGridSizer
*
m_textControlSizer
;
wxStaticText
*
m_staticText1
;
wxStaticText
*
m_staticText1
;
wxTextCtrl
*
m_textLabel
;
wxTextCtrl
*
m_textLabelSingleLine
;
wxTextCtrl
*
m_textLabelMultiLine
;
wxStaticText
*
m_SizeTitle
;
wxStaticText
*
m_SizeTitle
;
wxTextCtrl
*
m_TextSize
;
wxTextCtrl
*
m_TextSize
;
wxStaticText
*
m_staticSizeUnits
;
wxStaticText
*
m_staticSizeUnits
;
...
@@ -58,7 +60,7 @@ class DialogLabelEditor_Base : public wxDialog
...
@@ -58,7 +60,7 @@ 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
(
-
1
,
-
1
),
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
(
359
,
347
),
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