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
fb25b5c4
Commit
fb25b5c4
authored
Apr 28, 2009
by
drannou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding multi-line feature in PCBNEW and EESCHEMA
parent
fab8dece
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
193 additions
and
81 deletions
+193
-81
base_struct.cpp
common/base_struct.cpp
+56
-33
common.cpp
common/common.cpp
+32
-0
wxwineda.cpp
common/wxwineda.cpp
+8
-3
class_text-label.cpp
eeschema/class_text-label.cpp
+45
-23
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+26
-12
dialog_edit_label.h
eeschema/dialog_edit_label.h
+2
-2
dialog_edit_label_base.cpp
eeschema/dialog_edit_label_base.cpp
+11
-4
dialog_edit_label_base.h
eeschema/dialog_edit_label_base.h
+1
-1
base_struct.h
include/base_struct.h
+4
-0
common.h
include/common.h
+5
-0
wxstruct.h
include/wxstruct.h
+1
-1
dialog_pcb_text_properties.cpp
pcbnew/dialog_pcb_text_properties.cpp
+2
-2
No files found.
common/base_struct.cpp
View file @
fb25b5c4
...
@@ -171,7 +171,7 @@ EDA_TextStruct::EDA_TextStruct( const wxString& text )
...
@@ -171,7 +171,7 @@ EDA_TextStruct::EDA_TextStruct( const wxString& text )
m_Orient
=
0
;
/* Orient in 0.1 degrees */
m_Orient
=
0
;
/* Orient in 0.1 degrees */
m_Attributs
=
0
;
m_Attributs
=
0
;
m_Mirror
=
false
;
// display mirror if true
m_Mirror
=
false
;
// display mirror if true
m_HJustify
=
GR_TEXT_HJUSTIFY_
CENTER
;
m_HJustify
=
GR_TEXT_HJUSTIFY_
LEFT
;
m_VJustify
=
GR_TEXT_VJUSTIFY_CENTER
;
/* Justifications Horiz et Vert du texte */
m_VJustify
=
GR_TEXT_VJUSTIFY_CENTER
;
/* Justifications Horiz et Vert du texte */
m_Width
=
0
;
/* thickness */
m_Width
=
0
;
/* thickness */
m_Italic
=
false
;
/* true = italic shape */
m_Italic
=
false
;
/* true = italic shape */
...
@@ -264,7 +264,6 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
...
@@ -264,7 +264,6 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
int
aDrawMode
,
int
aDrawMode
,
GRFillMode
aDisplayMode
,
EDA_Colors
aAnchor_color
)
GRFillMode
aDisplayMode
,
EDA_Colors
aAnchor_color
)
/***************************************************************/
/***************************************************************/
/** Function Draw
/** Function Draw
* @param aPanel = the current DrawPanel
* @param aPanel = the current DrawPanel
* @param aDC = the current Device Context
* @param aDC = the current Device Context
...
@@ -274,44 +273,68 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
...
@@ -274,44 +273,68 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
* @param aDisplayMode = FILAIRE, FILLED or SKETCH
* @param aDisplayMode = FILAIRE, FILLED or SKETCH
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
*/
*/
{
int
width
;
width
=
m_Width
;
{
if
(
aDisplayMode
==
FILAIRE
)
wxPoint
pos
=
m_Pos
;
width
=
0
;
wxArrayString
*
list
=
wxStringSplit
(
m_Text
,
'\n'
);
if
(
aDrawMode
!=
-
1
)
GRSetDrawMode
(
aDC
,
aDrawMode
);
/* Draw text anchor, if allowed */
for
(
int
i
=
0
;
i
<
list
->
Count
();
i
++
)
if
(
aAnchor_color
!=
UNSPECIFIED_COLOR
)
{
{
int
anchor_size
=
aPanel
->
GetScreen
()
->
Unscale
(
2
);
wxString
txt
=
list
->
Item
(
i
);
aAnchor_color
=
(
EDA_Colors
)
(
aAnchor_color
&
MASKCOLOR
);
wxSize
size
=
DrawOneLine
(
aPanel
,
aDC
,
aOffset
,
aColor
,
aDrawMode
,
aDisplayMode
,
aAnchor_color
,
txt
,
pos
);
pos
.
y
+=
1.5
*
(
size
.
y
);
int
cX
=
m_Pos
.
x
+
aOffset
.
x
;
int
cY
=
m_Pos
.
y
+
aOffset
.
y
;
GRLine
(
&
aPanel
->
m_ClipBox
,
aDC
,
cX
-
anchor_size
,
cY
,
cX
+
anchor_size
,
cY
,
0
,
aAnchor_color
);
GRLine
(
&
aPanel
->
m_ClipBox
,
aDC
,
cX
,
cY
-
anchor_size
,
cX
,
cY
+
anchor_size
,
0
,
aAnchor_color
);
}
}
delete
(
list
);
}
if
(
aDisplayMode
==
SKETCH
)
width
=
-
width
;
wxSize
size
=
m_Size
;
if
(
m_Mirror
)
size
.
x
=
-
size
.
x
;
DrawGraphicText
(
aPanel
,
aDC
,
aOffset
+
m_Pos
,
aColor
,
m_Text
,
m_Orient
,
size
,
m_HJustify
,
m_VJustify
,
width
,
m_Italic
);
}
wxSize
EDA_TextStruct
::
DrawOneLine
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
EDA_Colors
aColor
,
int
aDrawMode
,
GRFillMode
aDisplayMode
,
EDA_Colors
aAnchor_color
,
wxString
txt
,
wxPoint
pos
)
{
int
width
=
m_Width
;
if
(
aDisplayMode
==
FILAIRE
)
width
=
0
;
if
(
aDrawMode
!=
-
1
)
GRSetDrawMode
(
aDC
,
aDrawMode
);
/* Draw text anchor, if allowed */
if
(
aAnchor_color
!=
UNSPECIFIED_COLOR
)
{
int
anchor_size
=
aPanel
->
GetScreen
()
->
Unscale
(
2
);
aAnchor_color
=
(
EDA_Colors
)
(
aAnchor_color
&
MASKCOLOR
);
int
cX
=
pos
.
x
+
aOffset
.
x
;
int
cY
=
pos
.
y
+
aOffset
.
y
;
GRLine
(
&
aPanel
->
m_ClipBox
,
aDC
,
cX
-
anchor_size
,
cY
,
cX
+
anchor_size
,
cY
,
0
,
aAnchor_color
);
GRLine
(
&
aPanel
->
m_ClipBox
,
aDC
,
cX
,
cY
-
anchor_size
,
cX
,
cY
+
anchor_size
,
0
,
aAnchor_color
);
}
if
(
aDisplayMode
==
SKETCH
)
width
=
-
width
;
wxSize
size
=
m_Size
;
if
(
m_Mirror
)
size
.
x
=
-
size
.
x
;
DrawGraphicText
(
aPanel
,
aDC
,
aOffset
+
pos
,
aColor
,
txt
,
m_Orient
,
size
,
m_HJustify
,
m_VJustify
,
width
,
m_Italic
);
return
size
;
}
/******************/
/******************/
/* Class EDA_Rect */
/* Class EDA_Rect */
...
...
common/common.cpp
View file @
fb25b5c4
...
@@ -378,6 +378,38 @@ int ReturnValueFromString( int Units, const wxString& TextValue,
...
@@ -378,6 +378,38 @@ int ReturnValueFromString( int Units, const wxString& TextValue,
return
Value
;
return
Value
;
}
}
/**
* Function wxStringSplit
* Split a String to a String List when founding 'splitter'
* @return the list
* @param txt : wxString : a String text
* @param splitter : wxChar : the 'split' character
*/
/**********************************************************/
wxArrayString
*
wxStringSplit
(
wxString
txt
,
wxChar
splitter
)
/**********************************************************/
{
wxArrayString
*
list
=
new
wxArrayString
();
while
(
1
)
{
int
index
=
txt
.
Find
(
splitter
);
if
(
index
==
wxNOT_FOUND
)
break
;
wxString
tmp
;
tmp
=
txt
.
Mid
(
0
,
index
);
txt
=
txt
.
Mid
(
index
+
1
,
txt
.
size
()
-
index
);
list
->
Add
(
tmp
);
}
if
(
!
txt
.
IsEmpty
())
{
list
->
Add
(
txt
);
}
return
list
;
}
/******************************************************************/
/******************************************************************/
double
To_User_Unit
(
bool
is_metric
,
int
val
,
int
internal_unit_value
)
double
To_User_Unit
(
bool
is_metric
,
int
val
,
int
internal_unit_value
)
...
...
common/wxwineda.cpp
View file @
fb25b5c4
...
@@ -12,13 +12,13 @@
...
@@ -12,13 +12,13 @@
/**********************************************************************************/
/**********************************************************************************/
/* Classe WinEDA_EnterText pour entrer une ligne texte au clavier dans les frames */
/* Classe WinEDA_EnterText pour entrer une
ou plusieurs
ligne texte au clavier dans les frames */
/**********************************************************************************/
/**********************************************************************************/
WinEDA_EnterText
::
WinEDA_EnterText
(
wxWindow
*
parent
,
WinEDA_EnterText
::
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
wxBoxSizer
*
BoxSizer
,
const
wxSize
&
Size
)
const
wxSize
&
Size
,
bool
Multiline
)
{
{
m_Modify
=
FALSE
;
m_Modify
=
FALSE
;
if
(
!
TextToEdit
.
IsEmpty
()
)
if
(
!
TextToEdit
.
IsEmpty
()
)
...
@@ -28,7 +28,12 @@ WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent,
...
@@ -28,7 +28,12 @@ WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent,
BoxSizer
->
Add
(
m_Title
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxADJUST_MINSIZE
,
5
);
BoxSizer
->
Add
(
m_Title
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxADJUST_MINSIZE
,
5
);
m_FrameText
=
new
wxTextCtrl
(
parent
,
-
1
,
TextToEdit
,
wxDefaultPosition
,
Size
);
long
style
=
0
;
if
(
Multiline
)
style
=
wxTE_MULTILINE
;
m_FrameText
=
new
wxTextCtrl
(
parent
,
-
1
,
TextToEdit
,
wxDefaultPosition
,
Size
,
style
);
m_FrameText
->
SetInsertionPoint
(
1
);
m_FrameText
->
SetInsertionPoint
(
1
);
BoxSizer
->
Add
(
m_FrameText
,
BoxSizer
->
Add
(
m_FrameText
,
...
...
eeschema/class_text-label.cpp
View file @
fb25b5c4
...
@@ -189,46 +189,68 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
...
@@ -189,46 +189,68 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
color
=
ReturnLayerColor
(
m_Layer
);
color
=
ReturnLayerColor
(
m_Layer
);
GRSetDrawMode
(
DC
,
DrawMode
);
GRSetDrawMode
(
DC
,
DrawMode
);
wxArrayString
*
list
=
wxStringSplit
(
m_Text
,
'\n'
);
wxPoint
pos
;
int
orientation
;
GRTextHorizJustifyType
Hjustify
;
GRTextVertJustifyType
Vjustify
;
pos
=
m_Pos
+
offset
;
switch
(
m_Orient
)
switch
(
m_Orient
)
{
{
case
0
:
/* Horiz Normal Orientation (left justified) */
case
0
:
/* Horiz Normal Orientation (left justified) */
DrawGraphicText
(
panel
,
DC
,
orientation
=
TEXT_ORIENT_HORIZ
;
wxPoint
(
m_Pos
.
x
+
offset
.
x
,
m_Pos
.
y
-
TXTMARGE
+
offset
.
y
),
Hjustify
=
GR_TEXT_HJUSTIFY_LEFT
;
color
,
m_Text
,
TEXT_ORIENT_HORIZ
,
m_Size
,
Vjustify
=
GR_TEXT_VJUSTIFY_BOTTOM
;
GR_TEXT_HJUSTIFY_LEFT
,
pos
.
y
-=
TXTMARGE
;
GR_TEXT_VJUSTIFY_BOTTOM
,
width
,
m_Italic
,
true
);
break
;
break
;
case
1
:
/* Vert Orientation UP */
case
1
:
/* Vert Orientation UP */
DrawGraphicText
(
panel
,
DC
,
orientation
=
TEXT_ORIENT_VERT
;
wxPoint
(
m_Pos
.
x
-
TXTMARGE
+
offset
.
x
,
Hjustify
=
GR_TEXT_HJUSTIFY_RIGHT
;
m_Pos
.
y
+
offset
.
y
),
Vjustify
=
GR_TEXT_VJUSTIFY_BOTTOM
;
color
,
m_Text
,
TEXT_ORIENT_VERT
,
m_Size
,
pos
.
x
-=
TXTMARGE
;
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_BOTTOM
,
width
,
m_Italic
,
true
);
break
;
break
;
case
2
:
/* Horiz Orientation - Right justified */
case
2
:
/* Horiz Orientation - Right justified */
DrawGraphicText
(
panel
,
DC
,
orientation
=
TEXT_ORIENT_HORIZ
;
wxPoint
(
m_Pos
.
x
+
offset
.
x
,
m_Pos
.
y
-
Hjustify
=
GR_TEXT_HJUSTIFY_RIGHT
;
TXTMARGE
+
offset
.
y
),
Vjustify
=
GR_TEXT_VJUSTIFY_BOTTOM
;
color
,
m_Text
,
TEXT_ORIENT_HORIZ
,
m_Size
,
pos
.
y
-=
TXTMARGE
;
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_BOTTOM
,
width
,
m_Italic
,
true
);
break
;
break
;
case
3
:
/* Vert Orientation BOTTOM */
case
3
:
/* Vert Orientation BOTTOM */
DrawGraphicText
(
panel
,
DC
,
orientation
=
TEXT_ORIENT_VERT
;
wxPoint
(
m_Pos
.
x
-
TXTMARGE
+
offset
.
x
,
Hjustify
=
GR_TEXT_HJUSTIFY_RIGHT
;
m_Pos
.
y
+
offset
.
y
),
Vjustify
=
GR_TEXT_VJUSTIFY_TOP
;
color
,
m_Text
,
TEXT_ORIENT_VERT
,
m_Size
,
pos
.
x
-=
TXTMARGE
;
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_TOP
,
width
,
m_Italic
,
true
);
break
;
break
;
}
}
for
(
int
i
=
0
;
i
<
list
->
Count
();
i
++
)
{
wxString
txt
=
list
->
Item
(
i
);
DrawGraphicText
(
panel
,
DC
,
pos
,
color
,
txt
,
orientation
,
m_Size
,
Hjustify
,
Vjustify
,
width
,
m_Italic
,
true
);
if
(
orientation
==
TEXT_ORIENT_HORIZ
)
pos
.
y
+=
1.5
*
(
m_Size
.
y
);
else
pos
.
x
+=
1.5
*
(
m_Size
.
x
);
}
delete
(
list
);
if
(
m_IsDangling
)
if
(
m_IsDangling
)
DrawDanglingSymbol
(
panel
,
DC
,
m_Pos
+
offset
,
color
);
DrawDanglingSymbol
(
panel
,
DC
,
m_Pos
+
offset
,
color
);
}
}
...
...
eeschema/dialog_edit_label.cpp
View file @
fb25b5c4
...
@@ -21,8 +21,22 @@
...
@@ -21,8 +21,22 @@
int
DialogLabelEditor
::
ShowModally
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
int
DialogLabelEditor
::
ShowModally
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
{
{
int
ret
;
int
ret
;
bool
multiline
;
DialogLabelEditor
*
dialog
=
new
DialogLabelEditor
(
parent
,
CurrentText
);
switch
(
CurrentText
->
Type
()
)
{
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_LABEL
:
multiline
=
false
;
break
;
default
:
multiline
=
true
;
break
;
}
DialogLabelEditor
*
dialog
=
new
DialogLabelEditor
(
parent
,
CurrentText
,
multiline
);
// doing any post construction resizing is better done here than in
// doing any post construction resizing is better done here than in
// OnInitDialog() since it tends to flash/redraw the dialog less.
// OnInitDialog() since it tends to flash/redraw the dialog less.
...
@@ -35,8 +49,8 @@ int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * C
...
@@ -35,8 +49,8 @@ int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * C
DialogLabelEditor
::
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
)
:
DialogLabelEditor
::
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
,
bool
multiline
)
:
DialogLabelEditor_Base
(
parent
)
DialogLabelEditor_Base
(
parent
,
wxID_ANY
,
multiline
)
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_CurrentText
=
CurrentText
;
m_CurrentText
=
CurrentText
;
...
@@ -67,6 +81,7 @@ void DialogLabelEditor::init()
...
@@ -67,6 +81,7 @@ void DialogLabelEditor::init()
default
:
default
:
SetTitle
(
_
(
"Text Properties"
)
);
SetTitle
(
_
(
"Text Properties"
)
);
m_TextLabel
->
Disconnect
(
wxEVT_COMMAND_TEXT_ENTER
,
wxCommandEventHandler
(
DialogLabelEditor
::
onEnterKey
),
NULL
,
this
);
break
;
break
;
}
}
...
@@ -111,6 +126,14 @@ void DialogLabelEditor::init()
...
@@ -111,6 +126,14 @@ void DialogLabelEditor::init()
}
}
}
}
/*!
* wxTE_PROCESS_ENTER event handler for m_TextLabel
*/
void
DialogLabelEditor
::
onEnterKey
(
wxCommandEvent
&
event
)
{
TextPropertiesAccept
(
event
);
}
/*!
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
...
@@ -132,12 +155,3 @@ void DialogLabelEditor::OnButtonCANCEL_Click( wxCommandEvent& event )
...
@@ -132,12 +155,3 @@ void DialogLabelEditor::OnButtonCANCEL_Click( wxCommandEvent& event )
EndModal
(
-
1
);
EndModal
(
-
1
);
}
}
/*!
* wxTE_PROCESS_ENTER event handler for m_TextLabel
*/
void
DialogLabelEditor
::
onEnterKey
(
wxCommandEvent
&
event
)
{
TextPropertiesAccept
(
event
);
}
eeschema/dialog_edit_label.h
View file @
fb25b5c4
...
@@ -18,7 +18,7 @@ private:
...
@@ -18,7 +18,7 @@ private:
protected
:
protected
:
// these are protected so that the static ShowModally() gets used.
// these are protected so that the static ShowModally() gets used.
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
);
DialogLabelEditor
(
WinEDA_SchematicFrame
*
parent
,
SCH_TEXT
*
CurrentText
,
bool
multiline
);
~
DialogLabelEditor
(){};
~
DialogLabelEditor
(){};
...
@@ -35,7 +35,7 @@ public:
...
@@ -35,7 +35,7 @@ public:
private
:
private
:
void
init
(
);
void
init
(
);
void
onEnterKey
(
wxCommandEvent
&
event
);
void
onEnterKey
(
wxCommandEvent
&
event
);
void
OnButtonOKClick
(
wxCommandEvent
&
event
);
void
OnButtonOKClick
(
wxCommandEvent
&
event
);
void
OnButtonCANCEL_Click
(
wxCommandEvent
&
event
);
void
OnButtonCANCEL_Click
(
wxCommandEvent
&
event
);
void
TextPropertiesAccept
(
wxCommandEvent
&
event
);
void
TextPropertiesAccept
(
wxCommandEvent
&
event
);
...
...
eeschema/dialog_edit_label_base.cpp
View file @
fb25b5c4
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
DialogLabelEditor_Base
::
DialogLabelEditor_Base
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
wxDialog
(
parent
,
id
,
title
,
pos
,
size
,
style
)
DialogLabelEditor_Base
::
DialogLabelEditor_Base
(
wxWindow
*
parent
,
wxWindowID
id
,
bool
multiline
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
wxDialog
(
parent
,
id
,
title
,
pos
,
size
,
style
)
{
{
this
->
SetSizeHints
(
wxDefaultSize
,
wxDefaultSize
);
this
->
SetSizeHints
(
wxDefaultSize
,
wxDefaultSize
);
...
@@ -19,11 +19,18 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
...
@@ -19,11 +19,18 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id,
wxBoxSizer
*
bSizer2
;
wxBoxSizer
*
bSizer2
;
bSizer2
=
new
wxBoxSizer
(
wxVERTICAL
);
bSizer2
=
new
wxBoxSizer
(
wxVERTICAL
);
m_staticText1
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Text"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText1
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Text"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText1
->
Wrap
(
-
1
);
m_staticText1
->
Wrap
(
-
1
);
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
,
wxTE_PROCESS_ENTER
);
if
(
multiline
)
{
m_TextLabel
=
new
wxTextCtrl
(
this
,
wxID_VALUE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_PROCESS_ENTER
|
wxTE_MULTILINE
);
}
else
{
m_TextLabel
=
new
wxTextCtrl
(
this
,
wxID_VALUE
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_PROCESS_ENTER
);
}
m_TextLabel
->
SetToolTip
(
_
(
"Enter the text to be used within the schematic"
)
);
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
);
...
...
eeschema/dialog_edit_label_base.h
View file @
fb25b5c4
...
@@ -56,7 +56,7 @@ class DialogLabelEditor_Base : public wxDialog
...
@@ -56,7 +56,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
(
600
,
300
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
DialogLabelEditor_Base
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
bool
multiline
=
false
,
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
();
};
};
...
...
include/base_struct.h
View file @
fb25b5c4
...
@@ -527,6 +527,10 @@ public:
...
@@ -527,6 +527,10 @@ public:
int
aDisplayMode
,
GRFillMode
aDisplay_mode
=
FILAIRE
,
int
aDisplayMode
,
GRFillMode
aDisplay_mode
=
FILAIRE
,
EDA_Colors
aAnchor_color
=
UNSPECIFIED_COLOR
);
EDA_Colors
aAnchor_color
=
UNSPECIFIED_COLOR
);
wxSize
DrawOneLine
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
EDA_Colors
aColor
,
int
aDisplayMode
,
GRFillMode
aDisplay_mode
=
FILAIRE
,
EDA_Colors
aAnchor_color
=
UNSPECIFIED_COLOR
,
wxString
txt
=
wxString
(),
wxPoint
pos
=
wxPoint
(
0
,
0
)
);
/**
/**
* Function HitTest
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* tests if the given wxPoint is within the bounds of this object.
...
...
include/common.h
View file @
fb25b5c4
...
@@ -351,6 +351,11 @@ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value,
...
@@ -351,6 +351,11 @@ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value,
int
ReturnValueFromTextCtrl
(
const
wxTextCtrl
&
TextCtr
,
int
ReturnValueFromTextCtrl
(
const
wxTextCtrl
&
TextCtr
,
int
Internal_Unit
);
int
Internal_Unit
);
/* return a String List from a string, whith a specific splitter*/
//WX_DECLARE_LIST( wxString, StringList );
//WX_DEFINE_LIST( StringList );
wxArrayString
*
wxStringSplit
(
wxString
txt
,
wxChar
splitter
);
/**
/**
* Function To_User_Unit
* Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units
* Convert in inch or mm the variable "val" (double)given in internal units
...
...
include/wxstruct.h
View file @
fb25b5c4
...
@@ -398,7 +398,7 @@ public:
...
@@ -398,7 +398,7 @@ public:
// Constructor and destructor
// Constructor and destructor
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxSize
&
Size
);
const
wxSize
&
Size
,
bool
Multiline
=
false
);
~
WinEDA_EnterText
()
~
WinEDA_EnterText
()
{
{
...
...
pcbnew/dialog_pcb_text_properties.cpp
View file @
fb25b5c4
...
@@ -107,7 +107,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
...
@@ -107,7 +107,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
m_Name
=
new
WinEDA_EnterText
(
this
,
_
(
"Text:"
),
m_Name
=
new
WinEDA_EnterText
(
this
,
_
(
"Text:"
),
TextPCB
->
m_Text
,
TextPCB
->
m_Text
,
LeftBoxSizer
,
wxSize
(
200
,
-
1
)
);
LeftBoxSizer
,
wxSize
(
200
,
60
),
true
);
m_Name
->
SetFocus
();
m_Name
->
SetFocus
();
m_Name
->
SetSelection
(
-
1
,
-
1
);
m_Name
->
SetSelection
(
-
1
,
-
1
);
...
@@ -232,7 +232,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
...
@@ -232,7 +232,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
CurrentTextPCB
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
);
CurrentTextPCB
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
);
CurrentTextPCB
->
m_Italic
=
m_Style
->
GetSelection
()
?
1
:
0
;
CurrentTextPCB
->
m_Italic
=
m_Style
->
GetSelection
()
?
1
:
0
;
if
(
m_DC
)
// Displ
ya
new text
if
(
m_DC
)
// Displ
ay
new text
{
{
CurrentTextPCB
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_OR
);
CurrentTextPCB
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_OR
);
}
}
...
...
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