Common dialog file housekeeping. Code cleanup, and minor fixes.
This commit is contained in:
parent
8257ebeb32
commit
f930894d9f
|
@ -1,4 +1,5 @@
|
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs
|
||||
${Boost_INCLUDE_DIR}
|
||||
../3d-viewer
|
||||
../pcbnew
|
||||
|
@ -9,6 +10,13 @@ set( COMMON_ABOUT_DLG_SRCS
|
|||
dialog_about/AboutDialog_main.cpp
|
||||
dialog_about/dialog_about.cpp
|
||||
dialog_about/dialog_about_base.cpp
|
||||
dialogs/dialog_display_info_HTML_base.cpp
|
||||
dialogs/dialog_get_component.cpp
|
||||
dialogs/dialog_get_component_base.cpp
|
||||
dialogs/dialog_hotkeys_editor.cpp
|
||||
dialogs/dialog_hotkeys_editor_base.cpp
|
||||
dialogs/dialog_load_error.cpp
|
||||
dialogs/dialog_page_settings_base.cpp
|
||||
)
|
||||
|
||||
set(COMMON_SRCS
|
||||
|
@ -32,12 +40,7 @@ set(COMMON_SRCS
|
|||
common_plotDXF_functions.cpp
|
||||
confirm.cpp
|
||||
copy_to_clipboard.cpp
|
||||
dialog_display_info_HTML_base.cpp
|
||||
dialog_hotkeys_editor.cpp
|
||||
dialog_hotkeys_editor_base.cpp
|
||||
dialog_load_error.cpp
|
||||
dcsvg.cpp
|
||||
dialog_page_settings_base.cpp
|
||||
displlst.cpp
|
||||
dlist.cpp
|
||||
drawframe.cpp
|
||||
|
@ -48,7 +51,6 @@ set(COMMON_SRCS
|
|||
eda_dde.cpp
|
||||
eda_doc.cpp
|
||||
gestfich.cpp
|
||||
get_component_dialog.cpp
|
||||
gr_basic.cpp
|
||||
hotkeys_basic.cpp
|
||||
hotkey_grid_table.cpp
|
||||
|
|
|
@ -0,0 +1,167 @@
|
|||
/*********************************/
|
||||
/* dialog_get_component.cpp */
|
||||
/*********************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
//#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "wxstruct.h"
|
||||
#include "dialog_get_component.h"
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
/* Show a dialog frame to choose a name from an history list, or a new name */
|
||||
/* to select a component or a module */
|
||||
/****************************************************************************/
|
||||
|
||||
static unsigned s_HistoryMaxCount = 8; // Max number of items displayed in history list
|
||||
|
||||
|
||||
/*
|
||||
* Dialog frame to choose a component or a footprint
|
||||
* This dialog shows an history of last selected items
|
||||
*/
|
||||
DIALOG_GET_COMPONENT::DIALOG_GET_COMPONENT( WinEDA_DrawFrame* parent,
|
||||
const wxPoint& framepos,
|
||||
wxArrayString& HistoryList,
|
||||
const wxString& Title,
|
||||
bool show_extra_tool ) :
|
||||
DIALOG_GET_COMPONENT_BASE( parent, -1, Title, framepos )
|
||||
{
|
||||
|
||||
#ifdef __WXMAC__
|
||||
m_auxToolSelector = false;
|
||||
#else
|
||||
m_auxToolSelector = show_extra_tool;
|
||||
#endif
|
||||
initDialog( HistoryList );
|
||||
|
||||
GetSizer()->Fit( this );
|
||||
GetSizer()->SetSizeHints( this );
|
||||
}
|
||||
|
||||
void DIALOG_GET_COMPONENT::initDialog( wxArrayString& aHistoryList )
|
||||
{
|
||||
SetFocus();
|
||||
m_GetExtraFunction = false;
|
||||
m_historyList->Append( aHistoryList );
|
||||
if( !m_auxToolSelector )
|
||||
{
|
||||
m_buttonBrowse->Show( false );
|
||||
m_buttonBrowse->Enable( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_GET_COMPONENT::OnCancel( wxCommandEvent& event )
|
||||
{
|
||||
m_Text = wxEmptyString;
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
void DIALOG_GET_COMPONENT::Accept( wxCommandEvent& event )
|
||||
{
|
||||
switch( event.GetId() )
|
||||
{
|
||||
case ID_SEL_BY_LISTBOX:
|
||||
m_Text = m_historyList->GetStringSelection();
|
||||
break;
|
||||
|
||||
case wxID_OK:
|
||||
m_Text = m_textCmpNameCtrl->GetValue();
|
||||
break;
|
||||
|
||||
case ID_ACCEPT_KEYWORD:
|
||||
m_Text = wxT( "= " ) + m_textCmpNameCtrl->GetValue();
|
||||
break;
|
||||
|
||||
case ID_LIST_ALL:
|
||||
m_Text = wxT( "*" );
|
||||
break;
|
||||
}
|
||||
|
||||
m_Text.Trim( false ); // Remove blanks at beginning
|
||||
m_Text.Trim( true ); // Remove blanks at end
|
||||
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
||||
|
||||
/* Get the component name by the extra function */
|
||||
void DIALOG_GET_COMPONENT::GetExtraSelection( wxCommandEvent& event )
|
||||
{
|
||||
m_GetExtraFunction = true;
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
||||
|
||||
// Return the component name selected by the dialog
|
||||
wxString DIALOG_GET_COMPONENT::GetComponentName( void )
|
||||
{
|
||||
return m_Text;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize the default component name default choice
|
||||
*/
|
||||
void DIALOG_GET_COMPONENT::SetComponentName( const wxString& name )
|
||||
{
|
||||
if( m_textCmpNameCtrl )
|
||||
{
|
||||
m_textCmpNameCtrl->SetValue( name );
|
||||
m_textCmpNameCtrl->SetSelection(-1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxPoint GetComponentDialogPosition( void )
|
||||
{
|
||||
wxPoint pos;
|
||||
int x, y, w, h;
|
||||
|
||||
pos = wxGetMousePosition();
|
||||
wxClientDisplayRect( &x, &y, &w, &h );
|
||||
pos.x -= 100;
|
||||
pos.y -= 50;
|
||||
if( pos.x < x )
|
||||
pos.x = x;
|
||||
if( pos.y < y )
|
||||
pos.y = y;
|
||||
if( pos.x < x )
|
||||
pos.x = x;
|
||||
x += w - 350;
|
||||
if( pos.x > x )
|
||||
pos.x = x;
|
||||
if( pos.y < y )
|
||||
pos.y = y;
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add the string "aName" to the history list aHistoryList
|
||||
*/
|
||||
void AddHistoryComponentName( wxArrayString& aHistoryList, const wxString& aName )
|
||||
{
|
||||
if( ( aHistoryList.GetCount() > 0 ) && ( aName == aHistoryList[0] ) )
|
||||
return;
|
||||
|
||||
/* remove an old identical name if exists */
|
||||
for( unsigned ii = 1; ii < aHistoryList.GetCount(); ii++ )
|
||||
{
|
||||
if( aName == aHistoryList[ii] )
|
||||
{
|
||||
aHistoryList.RemoveAt( ii );
|
||||
ii--;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the new name at the beginning of the history list
|
||||
aHistoryList.Insert(aName, 0);
|
||||
|
||||
// Remove extra names
|
||||
while( aHistoryList.GetCount() >= s_HistoryMaxCount )
|
||||
aHistoryList.RemoveAt( aHistoryList.GetCount()-1 );
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_get_component_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_GET_COMPONENT_BASE::DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizerLeft;
|
||||
bSizerLeft = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextName = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextName->Wrap( -1 );
|
||||
bSizerLeft->Add( m_staticTextName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_textCmpNameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerLeft->Add( m_textCmpNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextHistory = new wxStaticText( this, wxID_ANY, _("History list:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextHistory->Wrap( -1 );
|
||||
bSizerLeft->Add( m_staticTextHistory, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_historyList = new wxListBox( this, ID_SEL_BY_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
||||
m_historyList->SetMinSize( wxSize( 200,100 ) );
|
||||
|
||||
bSizerLeft->Add( m_historyList, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerRight;
|
||||
bSizerRight = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonOK->SetDefault();
|
||||
bSizerRight->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonKW = new wxButton( this, ID_ACCEPT_KEYWORD, _("Search by Keyword"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonKW, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonList = new wxButton( this, ID_LIST_ALL, _("List All"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonList, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonBrowse = new wxButton( this, ID_EXTRA_TOOL, _("Select by Browser"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonBrowse, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
bSizerMain->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_historyList->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonKW->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::OnCancel ), NULL, this );
|
||||
m_buttonList->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::GetExtraSelection ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_GET_COMPONENT_BASE::~DIALOG_GET_COMPONENT_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_historyList->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonKW->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::OnCancel ), NULL, this );
|
||||
m_buttonList->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::GetExtraSelection ), NULL, this );
|
||||
|
||||
}
|
|
@ -0,0 +1,626 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="10" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_get_component_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_get_component_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_GET_COMPONENT_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">375,210</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="title"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerLeft</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Name:</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_staticTextName</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_textCmpNameCtrl</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">History list:</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_staticTextHistory</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxListBox" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="choices"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_SEL_BY_LISTBOX</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size">200,100</property>
|
||||
<property name="name">m_historyList</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnListBox">Accept</event>
|
||||
<event name="OnListBoxDClick"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerRight</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_OK</property>
|
||||
<property name="label">OK</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_buttonOK</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">Accept</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_ACCEPT_KEYWORD</property>
|
||||
<property name="label">Search by Keyword</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_buttonKW</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">Accept</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_CANCEL</property>
|
||||
<property name="label">Cancel</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_buttonCancel</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnCancel</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_LIST_ALL</property>
|
||||
<property name="label">List All</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_buttonList</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">Accept</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_EXTRA_TOOL</property>
|
||||
<property name="label">Select by Browser</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_buttonBrowse</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">GetExtraSelection</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
|
@ -0,0 +1,63 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __dialog_get_component_base__
|
||||
#define __dialog_get_component_base__
|
||||
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/listbox.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define ID_SEL_BY_LISTBOX 1000
|
||||
#define ID_ACCEPT_KEYWORD 1001
|
||||
#define ID_LIST_ALL 1002
|
||||
#define ID_EXTRA_TOOL 1003
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_GET_COMPONENT_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_GET_COMPONENT_BASE : public wxDialog
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_staticTextName;
|
||||
wxTextCtrl* m_textCmpNameCtrl;
|
||||
wxStaticText* m_staticTextHistory;
|
||||
wxListBox* m_historyList;
|
||||
wxButton* m_buttonOK;
|
||||
wxButton* m_buttonKW;
|
||||
wxButton* m_buttonCancel;
|
||||
wxButton* m_buttonList;
|
||||
wxButton* m_buttonBrowse;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void Accept( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void GetExtraSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 375,210 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_GET_COMPONENT_BASE();
|
||||
|
||||
};
|
||||
|
||||
#endif //__dialog_get_component_base__
|
|
@ -1,242 +0,0 @@
|
|||
/*********************************/
|
||||
/* get_component_dialog.cpp */
|
||||
/*********************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "wxstruct.h"
|
||||
#include "get_component_dialog.h"
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
/* Show a dialog frame to choose a name from an history list, or a new name */
|
||||
/* to select a component or a module */
|
||||
/****************************************************************************/
|
||||
|
||||
static unsigned s_HistoryMaxCount = 8; // Max number of items displayed in history list
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE( WinEDA_SelectCmp, wxDialog )
|
||||
EVT_BUTTON( ID_ACCEPT_NAME, WinEDA_SelectCmp::Accept )
|
||||
EVT_BUTTON( ID_ACCEPT_KEYWORD, WinEDA_SelectCmp::Accept )
|
||||
EVT_BUTTON( wxID_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 )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
/*
|
||||
* Dialog frame to choose a component or a footprint
|
||||
* This dialog shows an history of last selected items
|
||||
*/
|
||||
WinEDA_SelectCmp::WinEDA_SelectCmp( WinEDA_DrawFrame* parent,
|
||||
const wxPoint& framepos,
|
||||
wxArrayString& HistoryList,
|
||||
const wxString& Title,
|
||||
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_GetExtraFunction = false;
|
||||
|
||||
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
SetSizer( MainBoxSizer );
|
||||
|
||||
wxBoxSizer* LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
MainBoxSizer->Add( LeftBoxSizer,
|
||||
0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALL | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
wxBoxSizer* RightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
||||
|
||||
Text = new wxStaticText( this, -1, _( "Name:" ) );
|
||||
LeftBoxSizer->Add( Text, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP, 5 );
|
||||
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 ), aHistoryList, wxLB_SINGLE );
|
||||
LeftBoxSizer->Add( m_List,
|
||||
0,
|
||||
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
|
||||
Button = new wxButton( this, ID_ACCEPT_NAME, _( "OK" ) );
|
||||
Button->SetDefault();
|
||||
RightBoxSizer->Add( Button,
|
||||
0,
|
||||
wxGROW | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM,
|
||||
5 );
|
||||
|
||||
Button = new wxButton( this, ID_ACCEPT_KEYWORD, _( "Search by Keyword" ) );
|
||||
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
|
||||
Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
|
||||
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
|
||||
Button = new wxButton( this, ID_LIST_ALL, _( "List All" ) );
|
||||
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
|
||||
#ifndef __WXMAC__
|
||||
if( m_AuxTool ) /* The selection can be done by an extra function */
|
||||
{
|
||||
Button = new wxButton( this, ID_EXTRA_TOOL, _( "Select by Browser" ) );
|
||||
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SelectCmp::Accept( wxCommandEvent& event )
|
||||
{
|
||||
int id = wxID_OK;
|
||||
|
||||
switch( event.GetId() )
|
||||
{
|
||||
case ID_SEL_BY_LISTBOX:
|
||||
m_Text = m_List->GetStringSelection();
|
||||
break;
|
||||
|
||||
case ID_ACCEPT_NAME:
|
||||
m_Text = m_TextCtrl->GetValue();
|
||||
break;
|
||||
|
||||
case ID_ACCEPT_KEYWORD:
|
||||
m_Text = wxT( "= " ) + m_TextCtrl->GetValue();
|
||||
break;
|
||||
|
||||
case wxID_CANCEL:
|
||||
m_Text = wxEmptyString;
|
||||
id = wxID_CANCEL;
|
||||
break;
|
||||
|
||||
case ID_LIST_ALL:
|
||||
m_Text = wxT( "*" );
|
||||
break;
|
||||
}
|
||||
|
||||
m_Text.Trim( false ); // Remove blanks at beginning
|
||||
m_Text.Trim( true ); // Remove blanks at end
|
||||
|
||||
if( IsModal() )
|
||||
EndModal( id );
|
||||
else
|
||||
Close( id );
|
||||
}
|
||||
|
||||
|
||||
/* Get the component name by the extra function */
|
||||
void WinEDA_SelectCmp::GetExtraSelection( wxCommandEvent& event )
|
||||
{
|
||||
m_GetExtraFunction = true;
|
||||
|
||||
if( IsModal() )
|
||||
EndModal( wxID_OK );
|
||||
else
|
||||
Close( wxID_OK );
|
||||
}
|
||||
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxPoint GetComponentDialogPosition( void )
|
||||
{
|
||||
wxPoint pos;
|
||||
int x, y, w, h;
|
||||
|
||||
pos = wxGetMousePosition();
|
||||
wxClientDisplayRect( &x, &y, &w, &h );
|
||||
pos.x -= 100;
|
||||
pos.y -= 50;
|
||||
if( pos.x < x )
|
||||
pos.x = x;
|
||||
if( pos.y < y )
|
||||
pos.y = y;
|
||||
if( pos.x < x )
|
||||
pos.x = x;
|
||||
x += w - 350;
|
||||
if( pos.x > x )
|
||||
pos.x = x;
|
||||
if( pos.y < y )
|
||||
pos.y = y;
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add the string "Name" to the history list HistoryList
|
||||
*/
|
||||
void AddHistoryComponentName( wxArrayString& HistoryList, const wxString& Name )
|
||||
{
|
||||
int ii, c_max;
|
||||
|
||||
if( HistoryList.GetCount() > 0 )
|
||||
{
|
||||
if( Name == HistoryList[0] )
|
||||
return;
|
||||
|
||||
/* remove an old identical selection if exists */
|
||||
for( ii = 1; (unsigned) ii < HistoryList.GetCount(); ii++ )
|
||||
{
|
||||
if( Name == HistoryList[ii] )
|
||||
{
|
||||
HistoryList.RemoveAt( ii ); ii--;
|
||||
}
|
||||
}
|
||||
|
||||
/* shift the list */
|
||||
if( HistoryList.GetCount() < s_HistoryMaxCount )
|
||||
HistoryList.Add( wxT( "" ) );
|
||||
|
||||
c_max = HistoryList.GetCount() - 2;
|
||||
for( ii = c_max; ii >= 0; ii-- )
|
||||
HistoryList[ii + 1] = HistoryList[ii];
|
||||
|
||||
/* Add the new name at the beginning of the history list */
|
||||
HistoryList[0] = Name;
|
||||
}
|
||||
else
|
||||
HistoryList.Add( Name );
|
||||
}
|
|
@ -140,7 +140,7 @@ set(EESCHEMA_SRCS
|
|||
viewlibs.cpp)
|
||||
|
||||
set(EESCHEMA_EXTRA_SRCS
|
||||
../common/dialog_page_settings.cpp
|
||||
../common/dialogs/dialog_page_settings.cpp
|
||||
../common/sch_item_struct.cpp
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "sch_component.h"
|
||||
#include "viewlib_frame.h"
|
||||
|
||||
#include "get_component_dialog.h"
|
||||
#include "dialog_get_component.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
|
@ -51,7 +51,7 @@ wxString WinEDA_SchematicFrame::SelectFromLibBrowser( void )
|
|||
wxMilliSleep( 50 );
|
||||
}
|
||||
|
||||
return m_ViewlibFrame->GetEntryName();
|
||||
return m_ViewlibFrame->GetSelectedComponent();
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,7 +97,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
|
|||
/* Ask for a component name or key words */
|
||||
msg.Printf( _( "component selection (%d items loaded):" ), CmpCount );
|
||||
|
||||
WinEDA_SelectCmp dlg( this, GetComponentDialogPosition(), HistoryList,
|
||||
DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), HistoryList,
|
||||
msg, UseLibBrowser );
|
||||
dlg.SetComponentName( lastCommponentName );
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "general.h"
|
||||
#include "protos.h"
|
||||
|
||||
#include "dialog_display_info_HTML_base.h"
|
||||
#include "../common/dialogs/dialog_display_info_HTML_base.h"
|
||||
#include "dialog_lib_edit_pin.h"
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
*/
|
||||
wxString WinEDA_ViewlibFrame::m_libraryName;
|
||||
wxString WinEDA_ViewlibFrame::m_entryName;
|
||||
wxString WinEDA_ViewlibFrame::m_exportToEeschemaCmpName; // When the viewer is used to select a component
|
||||
// in schematic, the selected component is here
|
||||
int WinEDA_ViewlibFrame::m_unit = 1;
|
||||
int WinEDA_ViewlibFrame::m_convert = 1;
|
||||
wxSize WinEDA_ViewlibFrame::m_clientSize = wxSize( -1, -1 );
|
||||
|
@ -150,6 +152,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
|
|||
m_LibListSize.x = 0;
|
||||
}
|
||||
|
||||
m_exportToEeschemaCmpName.Clear();
|
||||
|
||||
// Creates the component window display
|
||||
m_CmpListSize.y = size.y;
|
||||
win_pos.x = m_LibListSize.x;
|
||||
|
@ -486,9 +490,9 @@ void WinEDA_ViewlibFrame::ExportToSchematicLibraryPart( wxCommandEvent& event )
|
|||
int ii = m_CmpList->GetSelection();
|
||||
|
||||
if( ii >= 0 )
|
||||
m_entryName = m_CmpList->GetString( ii );
|
||||
m_exportToEeschemaCmpName = m_CmpList->GetString( ii );
|
||||
else
|
||||
m_entryName.Empty();
|
||||
m_exportToEeschemaCmpName.Empty();
|
||||
Close( TRUE );
|
||||
}
|
||||
|
||||
|
@ -552,6 +556,10 @@ void WinEDA_ViewlibFrame::OnActivate( wxActivateEvent& event )
|
|||
{
|
||||
WinEDA_DrawFrame::OnActivate( event );
|
||||
|
||||
// Ensure we do not have old selection:
|
||||
if( m_FrameIsActive )
|
||||
m_exportToEeschemaCmpName.Empty();
|
||||
|
||||
if( m_LibList )
|
||||
ReCreateListLib();
|
||||
DisplayLibInfos();
|
||||
|
|
|
@ -40,6 +40,8 @@ private:
|
|||
protected:
|
||||
static wxString m_libraryName;
|
||||
static wxString m_entryName;
|
||||
static wxString m_exportToEeschemaCmpName; // When the viewer is used to select a component
|
||||
// in schematic, the selected component is here
|
||||
static int m_unit;
|
||||
static int m_convert;
|
||||
static wxSize m_clientSize;
|
||||
|
@ -75,6 +77,7 @@ public:
|
|||
void SaveSettings();
|
||||
|
||||
wxString& GetEntryName( void ) const { return m_entryName; }
|
||||
wxString& GetSelectedComponent( void ) const { return m_exportToEeschemaCmpName; }
|
||||
|
||||
int GetUnit( void ) { return m_unit; }
|
||||
int GetConvert( void ) { return m_convert; }
|
||||
|
|
|
@ -1,57 +1,44 @@
|
|||
/**
|
||||
* This file is part of the common libary.
|
||||
* @file get_component_dialog.h
|
||||
* @see common.h
|
||||
* @file dialog_get_component.h
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE__GET_COMPONENT_DIALOG_H__
|
||||
#define __INCLUDE__GET_COMPONENT_DIALOG_H__ 1
|
||||
#ifndef __INCLUDE_DIALOG_GET_COMPONENT_H__
|
||||
#define __INCLUDE_DIALOG_GET_COMPONENT_H__
|
||||
|
||||
#include "../common/dialogs/dialog_get_component_base.h"
|
||||
|
||||
wxPoint GetComponentDialogPosition( void );
|
||||
|
||||
void AddHistoryComponentName( wxArrayString& HistoryList,
|
||||
const wxString& Name );
|
||||
|
||||
/* Add the string "Name" to the history list */
|
||||
|
||||
enum selcmp_id {
|
||||
ID_ACCEPT_NAME = 3900,
|
||||
ID_ACCEPT_KEYWORD,
|
||||
ID_LIST_ALL,
|
||||
ID_EXTRA_TOOL,
|
||||
ID_SEL_BY_LISTBOX
|
||||
};
|
||||
|
||||
/* Dialog frame to choose a component name */
|
||||
class WinEDA_SelectCmp : public wxDialog
|
||||
class DIALOG_GET_COMPONENT : public DIALOG_GET_COMPONENT_BASE
|
||||
{
|
||||
private:
|
||||
bool m_AuxTool;
|
||||
bool m_auxToolSelector;
|
||||
wxString m_Text;
|
||||
wxTextCtrl* m_TextCtrl;
|
||||
wxListBox* m_List;
|
||||
|
||||
public:
|
||||
bool m_GetExtraFunction;
|
||||
|
||||
public:
|
||||
// Constructor and destructor
|
||||
WinEDA_SelectCmp( WinEDA_DrawFrame* parent, const wxPoint& framepos,
|
||||
DIALOG_GET_COMPONENT( WinEDA_DrawFrame* parent, const wxPoint& framepos,
|
||||
wxArrayString& HistoryList, const wxString& Title,
|
||||
bool show_extra_tool );
|
||||
~WinEDA_SelectCmp() {};
|
||||
~DIALOG_GET_COMPONENT() {};
|
||||
|
||||
wxString GetComponentName( void );
|
||||
void SetComponentName( const wxString& name );
|
||||
|
||||
private:
|
||||
void InitDialog( wxArrayString& aHistoryList );
|
||||
void initDialog( wxArrayString& aHistoryList );
|
||||
void OnCancel( wxCommandEvent& event );
|
||||
void Accept( wxCommandEvent& event );
|
||||
void GetExtraSelection( wxCommandEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
#endif /* __INCLUDE__GET_COMPONENT_DIALOG_H__ */
|
||||
#endif /* __INCLUDE_DIALOG_GET_COMPONENT_H__ */
|
|
@ -19,7 +19,7 @@
|
|||
#include "hotkeys_basic.h"
|
||||
#include "hotkey_grid_table.h"
|
||||
#include "wxstruct.h"
|
||||
#include "dialog_hotkeys_editor_base.h"
|
||||
#include "../common/dialogs/dialog_hotkeys_editor_base.h"
|
||||
|
||||
class HOTKEYS_EDITOR_DIALOG : public HOTKEYS_EDITOR_DIALOG_BASE
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
|
||||
*/
|
||||
|
||||
#include "dialog_display_info_HTML_base.h"
|
||||
#include "../common/dialogs/dialog_display_info_HTML_base.h"
|
||||
|
||||
/** Implementing DIALOG_LOAD_ERROR */
|
||||
class DIALOG_LOAD_ERROR : public DIALOG_DISPLAY_HTML_TEXT_BASE
|
||||
|
|
|
@ -190,7 +190,7 @@ set(PCBNEW_SRCS
|
|||
# We need some extra sources from common
|
||||
###
|
||||
set(PCBNEW_EXTRA_SRCS
|
||||
../common/dialog_page_settings.cpp
|
||||
../common/dialogs/dialog_page_settings.cpp
|
||||
)
|
||||
|
||||
###
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "gestfich.h"
|
||||
#include "pcbnew.h"
|
||||
#include "wxPcbStruct.h"
|
||||
#include "../common/dialog_display_info_HTML_base.h"
|
||||
#include "../common/dialogs/dialog_display_info_HTML_base.h"
|
||||
|
||||
#include "dialog_freeroute_exchange.h"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "eda_doc.h"
|
||||
#include "kicad_string.h"
|
||||
#include "gestfich.h"
|
||||
#include "get_component_dialog.h"
|
||||
#include "dialog_get_component.h"
|
||||
#include "appl_wxstruct.h"
|
||||
|
||||
#include "pcbnew.h"
|
||||
|
@ -24,12 +24,12 @@ public:
|
|||
ModList* Next;
|
||||
wxString m_Name, m_Doc, m_KeyWord;
|
||||
|
||||
public: ModList()
|
||||
public:
|
||||
ModList()
|
||||
{
|
||||
Next = NULL;
|
||||
}
|
||||
|
||||
|
||||
~ModList()
|
||||
{
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
|
|||
bool AllowWildSeach = TRUE;
|
||||
|
||||
/* Ask for a component name or key words */
|
||||
WinEDA_SelectCmp dlg( this, GetComponentDialogPosition(), HistoryList,
|
||||
DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), HistoryList,
|
||||
_( "Place Module" ), false );
|
||||
|
||||
dlg.SetComponentName( lastCommponentName );
|
||||
|
|
|
@ -352,8 +352,9 @@ void WinEDA_ModuleEditFrame::SetToolbars()
|
|||
GetScreen()->GetRedoCommandCount()>0 && active );
|
||||
menuBar->Enable( wxID_REDO, GetScreen()->GetRedoCommandCount()>0 && active );
|
||||
|
||||
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, GetBoard()->m_Modules != NULL );
|
||||
menuBar->Enable( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, GetBoard()->m_Modules != NULL );
|
||||
bool canLoadModuleFromBoard = frame->GetBoard()->m_Modules != NULL;
|
||||
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, canLoadModuleFromBoard );
|
||||
menuBar->Enable( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, canLoadModuleFromBoard );
|
||||
m_HToolBar->Refresh();
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue