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
902bb851
Commit
902bb851
authored
Jun 02, 2010
by
jp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug 587970.
parent
215b322a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
get_component_dialog.cpp
common/get_component_dialog.cpp
+23
-12
get_component_dialog.h
include/get_component_dialog.h
+1
-2
No files found.
common/get_component_dialog.cpp
View file @
902bb851
...
...
@@ -21,7 +21,7 @@ static unsigned s_HistoryMaxCount = 8; // Max number of items displayed in hist
BEGIN_EVENT_TABLE
(
WinEDA_SelectCmp
,
wxDialog
)
EVT_BUTTON
(
ID_ACCEPT_NAME
,
WinEDA_SelectCmp
::
Accept
)
EVT_BUTTON
(
ID_ACCEPT_KEYWORD
,
WinEDA_SelectCmp
::
Accept
)
EVT_BUTTON
(
ID_CANCEL
,
WinEDA_SelectCmp
::
Accept
)
EVT_BUTTON
(
wx
ID_CANCEL
,
WinEDA_SelectCmp
::
Accept
)
EVT_BUTTON
(
ID_LIST_ALL
,
WinEDA_SelectCmp
::
Accept
)
EVT_BUTTON
(
ID_EXTRA_TOOL
,
WinEDA_SelectCmp
::
GetExtraSelection
)
EVT_LISTBOX
(
ID_SEL_BY_LISTBOX
,
WinEDA_SelectCmp
::
Accept
)
...
...
@@ -39,10 +39,19 @@ WinEDA_SelectCmp::WinEDA_SelectCmp( WinEDA_DrawFrame* parent,
bool
show_extra_tool
)
:
wxDialog
(
parent
,
-
1
,
Title
,
framepos
,
wxDefaultSize
,
DIALOG_STYLE
)
{
m_AuxTool
=
show_extra_tool
;
InitDialog
(
HistoryList
);
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
void
WinEDA_SelectCmp
::
InitDialog
(
wxArrayString
&
aHistoryList
)
{
wxButton
*
Button
;
wxStaticText
*
Text
;
m_AuxTool
=
show_extra_tool
;
m_GetExtraFunction
=
false
;
wxBoxSizer
*
MainBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
...
...
@@ -58,20 +67,19 @@ WinEDA_SelectCmp::WinEDA_SelectCmp( WinEDA_DrawFrame* parent,
Text
=
new
wxStaticText
(
this
,
-
1
,
_
(
"Name:"
)
);
LeftBoxSizer
->
Add
(
Text
,
0
,
wxALIGN_LEFT
|
wxLEFT
|
wxRIGHT
|
wxTOP
,
5
);
m_TextCtrl
=
new
wxTextCtrl
(
this
,
ID_ENTER_NAME
,
m_Text
);
m_TextCtrl
->
SetInsertionPoint
(
1
);
m_TextCtrl
->
SetFocus
();
m_TextCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
);
m_TextCtrl
->
SetFocus
();
// text value will be initialized later by calling GetComponentName()
LeftBoxSizer
->
Add
(
m_TextCtrl
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
|
wxADJUST_MINSIZE
,
5
);
Text
=
new
wxStaticText
(
this
,
-
1
,
_
(
"History list:"
)
);
LeftBoxSizer
->
Add
(
Text
,
0
,
wxALIGN_LEFT
|
wxLEFT
|
wxRIGHT
|
wxTOP
,
5
);
m_List
=
new
wxListBox
(
this
,
ID_SEL_BY_LISTBOX
,
wxDefaultPosition
,
wxSize
(
220
,
-
1
),
HistoryList
,
wxLB_SINGLE
);
wxSize
(
220
,
-
1
),
a
HistoryList
,
wxLB_SINGLE
);
LeftBoxSizer
->
Add
(
m_List
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
|
wxADJUST_MINSIZE
,
...
...
@@ -87,7 +95,7 @@ WinEDA_SelectCmp::WinEDA_SelectCmp( WinEDA_DrawFrame* parent,
Button
=
new
wxButton
(
this
,
ID_ACCEPT_KEYWORD
,
_
(
"Search by Keyword"
)
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
Button
=
new
wxButton
(
this
,
ID_CANCEL
,
_
(
"Cancel"
)
);
Button
=
new
wxButton
(
this
,
wx
ID_CANCEL
,
_
(
"Cancel"
)
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
Button
=
new
wxButton
(
this
,
ID_LIST_ALL
,
_
(
"List All"
)
);
...
...
@@ -100,9 +108,6 @@ WinEDA_SelectCmp::WinEDA_SelectCmp( WinEDA_DrawFrame* parent,
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
}
#endif
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
...
...
@@ -124,7 +129,7 @@ void WinEDA_SelectCmp::Accept( wxCommandEvent& event )
m_Text
=
wxT
(
"= "
)
+
m_TextCtrl
->
GetValue
();
break
;
case
ID_CANCEL
:
case
wx
ID_CANCEL
:
m_Text
=
wxEmptyString
;
id
=
wxID_CANCEL
;
break
;
...
...
@@ -156,16 +161,22 @@ void WinEDA_SelectCmp::GetExtraSelection( wxCommandEvent& event )
}
// Return the component name selected by the dialog
wxString
WinEDA_SelectCmp
::
GetComponentName
(
void
)
{
return
m_Text
;
}
/* Initialize the default component name default choice
*/
void
WinEDA_SelectCmp
::
SetComponentName
(
const
wxString
&
name
)
{
if
(
m_TextCtrl
)
{
m_TextCtrl
->
SetValue
(
name
);
m_TextCtrl
->
SetSelection
(
-
1
,
-
1
);
}
}
...
...
include/get_component_dialog.h
View file @
902bb851
...
...
@@ -18,8 +18,6 @@ void AddHistoryComponentName( wxArrayString& HistoryList,
enum
selcmp_id
{
ID_ACCEPT_NAME
=
3900
,
ID_ACCEPT_KEYWORD
,
ID_ENTER_NAME
,
ID_CANCEL
,
ID_LIST_ALL
,
ID_EXTRA_TOOL
,
ID_SEL_BY_LISTBOX
...
...
@@ -48,6 +46,7 @@ public:
void
SetComponentName
(
const
wxString
&
name
);
private
:
void
InitDialog
(
wxArrayString
&
aHistoryList
);
void
Accept
(
wxCommandEvent
&
event
);
void
GetExtraSelection
(
wxCommandEvent
&
event
);
...
...
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