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
3d8e783d
Commit
3d8e783d
authored
Jan 29, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chipnameTextCtrl minimum text width
parent
790d646a
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
147 additions
and
11 deletions
+147
-11
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+39
-4
dialog_edit_component_in_schematic.fbp
eeschema/dialog_edit_component_in_schematic.fbp
+101
-1
dialog_edit_component_in_schematic.h
eeschema/dialog_edit_component_in_schematic.h
+3
-0
dialog_edit_component_in_schematic_fbp.cpp
eeschema/dialog_edit_component_in_schematic_fbp.cpp
+1
-4
dialog_edit_component_in_schematic_fbp.h
eeschema/dialog_edit_component_in_schematic_fbp.h
+3
-2
No files found.
eeschema/dialog_edit_component_in_schematic.cpp
View file @
3d8e783d
...
@@ -19,6 +19,23 @@
...
@@ -19,6 +19,23 @@
int
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
s_SelectedRow
;
int
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
s_SelectedRow
;
/**
* Function GetTextSize
* computes the size of a text string in pixels from the wxFont used within a wxTextCtrl.
* @param aString is the text string to measure, must be a single line, no newlines.
* @param aWindow is the wxWindow which is the parent of the wxTextCtrl \a aCtrl.
* @param aWidth is where to put the width of the string in pixels.
* @param aHeight is where to put the heigth of the string in pixels.
*/
static
void
GetTextSize
(
const
wxString
&
aString
,
wxWindow
*
aWindow
,
wxTextCtrl
*
aCtrl
,
wxCoord
*
aWidth
,
wxCoord
*
aHeight
)
{
wxClientDC
dc
(
aWindow
);
dc
.
SetFont
(
aCtrl
->
GetFont
()
);
dc
.
GetTextExtent
(
aString
,
aWidth
,
aHeight
);
}
/**********************************************************************/
/**********************************************************************/
void
InstallCmpeditFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
,
void
InstallCmpeditFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
,
SCH_COMPONENT
*
aComponent
)
SCH_COMPONENT
*
aComponent
)
...
@@ -35,13 +52,30 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
...
@@ -35,13 +52,30 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
}
}
else
else
{
{
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
*
frame
=
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
*
dialog
=
new
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
(
parent
);
new
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
(
parent
);
frame
->
InitBuffers
(
aComponent
);
dialog
->
InitBuffers
(
aComponent
);
// make sure the chipnameTextCtrl is wide enough to hold any unusually long chip names:
{
wxCoord
width
;
wxCoord
height
;
frame
->
ShowModal
();
GetTextSize
(
dialog
->
chipnameTextCtrl
->
GetValue
(),
dialog
,
dialog
->
chipnameTextCtrl
,
&
width
,
&
height
);
frame
->
Destroy
();
wxSize
size
=
dialog
->
chipnameTextCtrl
->
GetSize
();
if
(
size
.
GetWidth
()
<
width
+
10
)
{
size
.
SetWidth
(
width
+
10
);
dialog
->
chipnameTextCtrl
->
SetSizeHints
(
size
);
dialog
->
Layout
();
}
}
dialog
->
ShowModal
();
dialog
->
Destroy
();
}
}
parent
->
DrawPanel
->
MouseToCursorSchema
();
parent
->
DrawPanel
->
MouseToCursorSchema
();
...
@@ -598,6 +632,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
...
@@ -598,6 +632,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
if
(
unitcount
<
1
)
if
(
unitcount
<
1
)
unitcount
=
1
;
unitcount
=
1
;
if
(
unitcount
<
choiceCount
)
if
(
unitcount
<
choiceCount
)
{
{
while
(
unitcount
<
choiceCount
)
while
(
unitcount
<
choiceCount
)
...
...
eeschema/dialog_edit_component_in_schematic.fbp
View file @
3d8e783d
This diff is collapsed.
Click to expand it.
eeschema/dialog_edit_component_in_schematic.h
View file @
3d8e783d
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
*/
*/
class
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
:
public
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
class
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
:
public
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
{
{
friend
void
InstallCmpeditFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
,
SCH_COMPONENT
*
aComponent
);
WinEDA_SchematicFrame
*
m_Parent
;
WinEDA_SchematicFrame
*
m_Parent
;
SCH_COMPONENT
*
m_Cmp
;
SCH_COMPONENT
*
m_Cmp
;
EDA_LibComponentStruct
*
m_LibEntry
;
EDA_LibComponentStruct
*
m_LibEntry
;
...
...
eeschema/dialog_edit_component_in_schematic_fbp.cpp
View file @
3d8e783d
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// 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!
...
@@ -71,7 +71,6 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
...
@@ -71,7 +71,6 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
optionsSizer
->
Add
(
chipnameSizer
,
0
,
wxEXPAND
|
wxLEFT
|
wxRIGHT
|
wxTOP
,
8
);
optionsSizer
->
Add
(
chipnameSizer
,
0
,
wxEXPAND
|
wxLEFT
|
wxRIGHT
|
wxTOP
,
8
);
convertCheckBox
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Convert"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
convertCheckBox
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Convert"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
convertCheckBox
->
SetToolTip
(
_
(
"Use the alternate shape of this component.
\n
For gates, this is the
\"
De Morgan
\"
conversion"
)
);
convertCheckBox
->
SetToolTip
(
_
(
"Use the alternate shape of this component.
\n
For gates, this is the
\"
De Morgan
\"
conversion"
)
);
optionsSizer
->
Add
(
convertCheckBox
,
0
,
wxALL
,
8
);
optionsSizer
->
Add
(
convertCheckBox
,
0
,
wxALL
,
8
);
...
@@ -118,13 +117,11 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
...
@@ -118,13 +117,11 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
bShowRotateSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
bShowRotateSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
showCheckBox
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Show"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
showCheckBox
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Show"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
showCheckBox
->
SetToolTip
(
_
(
"Check if you want this field visible"
)
);
showCheckBox
->
SetToolTip
(
_
(
"Check if you want this field visible"
)
);
bShowRotateSizer
->
Add
(
showCheckBox
,
0
,
wxALL
,
5
);
bShowRotateSizer
->
Add
(
showCheckBox
,
0
,
wxALL
,
5
);
rotateCheckBox
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Rotate"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
rotateCheckBox
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Rotate"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
rotateCheckBox
->
SetToolTip
(
_
(
"Check if you want this field's text rotated 90 degrees"
)
);
rotateCheckBox
->
SetToolTip
(
_
(
"Check if you want this field's text rotated 90 degrees"
)
);
bShowRotateSizer
->
Add
(
rotateCheckBox
,
0
,
wxALL
,
5
);
bShowRotateSizer
->
Add
(
rotateCheckBox
,
0
,
wxALL
,
5
);
...
...
eeschema/dialog_edit_component_in_schematic_fbp.h
View file @
3d8e783d
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// 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!
...
@@ -79,7 +79,8 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public wxDialog
...
@@ -79,7 +79,8 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public wxDialog
public
:
public
:
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Component Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
864
,
550
),
long
style
=
wxCAPTION
|
wxCLOSE_BOX
|
wxDEFAULT_DIALOG_STYLE
|
wxMAXIMIZE_BOX
|
wxMINIMIZE_BOX
|
wxRESIZE_BORDER
|
wxSYSTEM_MENU
);
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Component Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
864
,
640
),
long
style
=
wxCAPTION
|
wxCLOSE_BOX
|
wxDEFAULT_DIALOG_STYLE
|
wxMAXIMIZE_BOX
|
wxMINIMIZE_BOX
|
wxRESIZE_BORDER
|
wxSYSTEM_MENU
);
~
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
();
~
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
();
};
};
...
...
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