Fix incorrect handling of wxID_CANCEL and Close events in DIALOG_BOM_EDITOR.

This commit is contained in:
jean-pierre charras 2017-06-07 18:43:28 +02:00
parent 9d524fe2e3
commit 51bed4bae9
6 changed files with 130 additions and 114 deletions

View File

@ -41,10 +41,10 @@
/* BOM Table Colours */
// Create and show BOM editor
int InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller )
void InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller )
{
DIALOG_BOM_EDITOR dlg( aCaller );
return dlg.ShowQuasiModal();
dlg.ShowQuasiModal();
}
DIALOG_BOM_EDITOR::DIALOG_BOM_EDITOR( SCH_EDIT_FRAME* parent ) :
@ -115,24 +115,28 @@ DIALOG_BOM_EDITOR::DIALOG_BOM_EDITOR( SCH_EDIT_FRAME* parent ) :
Centre();
}
DIALOG_BOM_EDITOR::~DIALOG_BOM_EDITOR()
{
//TODO
// Nothing to do.
}
void DIALOG_BOM_EDITOR::OnCloseButton( wxCommandEvent& event )
{
CloseDialog();
// DIALOG_BOM_EDITOR::OnDialogClosed() will be called,
// when closing this dialog.
// The default wxID_CANCEL handler is not suitable for us,
// because it calls DIALOG_SHIM::EndQuasiModal() without calling
// DIALOG_BOM_EDITOR::OnDialogClosed()
Close();
}
bool DIALOG_BOM_EDITOR::CloseDialog()
bool DIALOG_BOM_EDITOR::CanCloseDialog()
{
if( !m_bom->HaveFieldsChanged() )
{
EndQuasiModal( wxID_CANCEL );
Destroy();
return true;
}
int result = DisplayExitDialog( this, _( "Changes exist in component table" ) );
@ -140,26 +144,32 @@ bool DIALOG_BOM_EDITOR::CloseDialog()
{
case wxID_CANCEL:
return false;
case wxID_NO:
break;
case wxID_YES:
ApplyAllChanges();
break;
}
EndQuasiModal( wxID_CANCEL );
Destroy();
return true;
}
void DIALOG_BOM_EDITOR::OnDialogClosed( wxCloseEvent& event )
{
if( !CloseDialog() )
if( !CanCloseDialog() )
{
event.Veto();
}
else
// Mandatory to call DIALOG_SHIM::OnCloseWindow( wxCloseEvent& aEvent )
// and actually close the dialog
event.Skip();
}
/* Struct for keeping track of schematic sheet changes
* Stores:
* SHEET_PATH - Schematic to apply changes to
@ -253,6 +263,7 @@ void DIALOG_BOM_EDITOR::ApplyAllChanges()
m_bom->SetBackupPoint();
}
/**
* Update the window title to reflect the contents of the table
*/
@ -283,6 +294,7 @@ void DIALOG_BOM_EDITOR::UpdateTitle()
SetTitle( title );
}
/**
* Load component data from the entire schematic set
*/
@ -301,6 +313,7 @@ void DIALOG_BOM_EDITOR::LoadComponents()
m_bom->SetComponents( refs, m_parent->GetTemplateFieldNames() );
}
/**
* Display list of columns (fields)
*/
@ -325,6 +338,7 @@ void DIALOG_BOM_EDITOR::LoadColumnNames()
}
}
void DIALOG_BOM_EDITOR::ReloadColumns()
{
m_bom->AttachTo( m_bomView );
@ -332,6 +346,7 @@ void DIALOG_BOM_EDITOR::ReloadColumns()
UpdateTitle();
}
void DIALOG_BOM_EDITOR::OnColumnItemToggled( wxDataViewEvent& event )
{
wxDataViewItem item = event.GetItem();
@ -372,6 +387,7 @@ void DIALOG_BOM_EDITOR::OnColumnItemToggled( wxDataViewEvent& event )
}
}
/**
* Called when the "Group Components" toggle is pressed
*/
@ -385,6 +401,7 @@ void DIALOG_BOM_EDITOR::OnGroupComponentsToggled( wxCommandEvent& event )
Update();
}
void DIALOG_BOM_EDITOR::OnUpdateUI( wxUpdateUIEvent& event )
{
m_regroupComponentsButton->Enable( m_bom->GetColumnGrouping() );
@ -397,11 +414,13 @@ void DIALOG_BOM_EDITOR::OnUpdateUI( wxUpdateUIEvent& event )
UpdateTitle();
}
void DIALOG_BOM_EDITOR::OnTableValueChanged( wxDataViewEvent& event )
{
Update();
}
void DIALOG_BOM_EDITOR::OnRegroupComponents( wxCommandEvent& event )
{
m_bom->ReloadTable();
@ -414,6 +433,7 @@ void DIALOG_BOM_EDITOR::OnApplyFieldChanges( wxCommandEvent& event )
Update();
}
void DIALOG_BOM_EDITOR::OnRevertFieldChanges( wxCommandEvent& event )
{
if( m_bom->HaveFieldsChanged() )
@ -435,6 +455,8 @@ void DIALOG_BOM_EDITOR::OnTableItemActivated( wxDataViewEvent& event )
event.Skip();
}
// Called when a cell is right-clicked
void DIALOG_BOM_EDITOR::OnTableItemContextMenu( wxDataViewEvent& event )
{

View File

@ -87,7 +87,7 @@ private:
virtual void OnDialogClosed( wxCloseEvent& event ) override;
virtual void OnCloseButton( wxCommandEvent& event ) override;
bool CloseDialog();
bool CanCloseDialog();
void UpdateTitle( void );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 1 2017)
// C++ code generated with wxFormBuilder (version Feb 19 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -9,131 +9,146 @@
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DIALOG_BOM_EDITOR_BASE, DIALOG_SHIM )
EVT_CLOSE( DIALOG_BOM_EDITOR_BASE::_wxFB_OnDialogClosed )
EVT_UPDATE_UI( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnUpdateUI )
EVT_CHECKBOX( OPT_GROUP_COMPONENTS, DIALOG_BOM_EDITOR_BASE::_wxFB_OnGroupComponentsToggled )
EVT_BUTTON( ID_BUTTON_REGROUP, DIALOG_BOM_EDITOR_BASE::_wxFB_OnRegroupComponents )
EVT_DATAVIEW_ITEM_VALUE_CHANGED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnColumnItemToggled )
EVT_DATAVIEW_COLUMN_REORDERED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnBomColumReordered )
EVT_DATAVIEW_COLUMN_SORTED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnBomColumnSorted )
EVT_DATAVIEW_ITEM_ACTIVATED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnTableItemActivated )
EVT_DATAVIEW_ITEM_CONTEXT_MENU( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnTableItemContextMenu )
EVT_DATAVIEW_ITEM_EDITING_DONE( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnTableValueChanged )
EVT_DATAVIEW_SELECTION_CHANGED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnSelectionChanged )
EVT_BUTTON( ID_BUTTON_APPLY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnApplyFieldChanges )
EVT_BUTTON( ID_BUTTON_REVERT, DIALOG_BOM_EDITOR_BASE::_wxFB_OnRevertFieldChanges )
EVT_BUTTON( wxID_CANCEL, DIALOG_BOM_EDITOR_BASE::_wxFB_OnCloseButton )
END_EVENT_TABLE()
DIALOG_BOM_EDITOR_BASE::DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bHorizontalSizer;
bHorizontalSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer61;
bSizer61 = new wxBoxSizer( wxVERTICAL );
m_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxVERTICAL );
m_splitter1 = new wxSplitterWindow( m_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_BOM_EDITOR_BASE::m_splitter1OnIdle ), NULL, this );
m_splitter1->SetMinimumPaneSize( 120 );
m_leftPanel = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_leftPanel, wxID_ANY, _("Options") ), wxVERTICAL );
m_groupComponentsBox = new wxCheckBox( sbSizer1->GetStaticBox(), OPT_GROUP_COMPONENTS, _("Group components"), wxDefaultPosition, wxDefaultSize, 0 );
m_groupComponentsBox->SetValue(true);
m_groupComponentsBox->SetValue(true);
m_groupComponentsBox->SetToolTip( _("Group components together based on common properties") );
sbSizer1->Add( m_groupComponentsBox, 0, wxALL|wxEXPAND, 5 );
m_regroupComponentsButton = new wxButton( sbSizer1->GetStaticBox(), ID_BUTTON_REGROUP, _("Regroup components"), wxDefaultPosition, wxDefaultSize, 0 );
m_regroupComponentsButton = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, _("Regroup components"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_regroupComponentsButton, 0, wxALL|wxEXPAND, 5 );
bSizer6->Add( sbSizer1, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer9;
bSizer9 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_fieldListSizer;
m_fieldListSizer = new wxStaticBoxSizer( new wxStaticBox( m_leftPanel, wxID_ANY, _("Fields") ), wxVERTICAL );
m_columnListCtrl = new wxDataViewListCtrl( m_fieldListSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_columnListCtrl->SetMinSize( wxSize( -1,250 ) );
m_fieldListSizer->Add( m_columnListCtrl, 1, wxALL|wxEXPAND, 5 );
bSizer9->Add( m_fieldListSizer, 1, wxEXPAND, 5 );
bSizer6->Add( bSizer9, 5, wxEXPAND, 5 );
m_leftPanel->SetSizer( bSizer6 );
m_leftPanel->Layout();
bSizer6->Fit( m_leftPanel );
m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxVERTICAL );
m_bomView = new wxDataViewCtrl( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE|wxDV_ROW_LINES|wxDV_VERT_RULES );
m_bomView->SetMinSize( wxSize( 450,250 ) );
bSizer5->Add( m_bomView, 1, wxALL|wxEXPAND, 5 );
m_panel4->SetSizer( bSizer5 );
m_panel4->Layout();
bSizer5->Fit( m_panel4 );
m_splitter1->SplitVertically( m_leftPanel, m_panel4, 231 );
bSizer7->Add( m_splitter1, 1, wxEXPAND, 5 );
m_panel->SetSizer( bSizer7 );
m_panel->Layout();
bSizer7->Fit( m_panel );
bSizer61->Add( m_panel, 1, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizer71;
bSizer71 = new wxBoxSizer( wxHORIZONTAL );
m_applyChangesButton = new wxButton( this, ID_BUTTON_APPLY, _("Apply Changes"), wxDefaultPosition, wxDefaultSize, 0 );
m_applyChangesButton = new wxButton( this, wxID_ANY, _("Apply Changes"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer71->Add( m_applyChangesButton, 0, wxALL, 5 );
m_revertChangesButton = new wxButton( this, ID_BUTTON_REVERT, _("Revert Changes"), wxDefaultPosition, wxDefaultSize, 0 );
m_revertChangesButton = new wxButton( this, wxID_ANY, _("Revert Changes"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer71->Add( m_revertChangesButton, 0, wxALL, 5 );
bSizer71->Add( 0, 0, 1, wxEXPAND, 5 );
m_closeButton = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer71->Add( m_closeButton, 0, wxALL, 5 );
bSizer61->Add( bSizer71, 0, wxEXPAND, 5 );
bHorizontalSizer->Add( bSizer61, 1, wxEXPAND, 5 );
this->SetSizer( bHorizontalSizer );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_BOM_EDITOR_BASE::OnDialogClosed ) );
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_BOM_EDITOR_BASE::OnUpdateUI ) );
m_groupComponentsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnGroupComponentsToggled ), NULL, this );
m_regroupComponentsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnRegroupComponents ), NULL, this );
m_columnListCtrl->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnColumnItemToggled ), NULL, this );
m_bomView->Connect( wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnBomColumReordered ), NULL, this );
m_bomView->Connect( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnBomColumnSorted ), NULL, this );
m_bomView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnTableItemActivated ), NULL, this );
m_bomView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnTableItemContextMenu ), NULL, this );
m_bomView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnTableValueChanged ), NULL, this );
m_bomView->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnSelectionChanged ), NULL, this );
m_applyChangesButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnApplyFieldChanges ), NULL, this );
m_revertChangesButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnRevertFieldChanges ), NULL, this );
m_closeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnCloseButton ), NULL, this );
}
DIALOG_BOM_EDITOR_BASE::~DIALOG_BOM_EDITOR_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_BOM_EDITOR_BASE::OnDialogClosed ) );
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_BOM_EDITOR_BASE::OnUpdateUI ) );
m_groupComponentsBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnGroupComponentsToggled ), NULL, this );
m_regroupComponentsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnRegroupComponents ), NULL, this );
m_columnListCtrl->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnColumnItemToggled ), NULL, this );
m_bomView->Disconnect( wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnBomColumReordered ), NULL, this );
m_bomView->Disconnect( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnBomColumnSorted ), NULL, this );
m_bomView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnTableItemActivated ), NULL, this );
m_bomView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnTableItemContextMenu ), NULL, this );
m_bomView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnTableValueChanged ), NULL, this );
m_bomView->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_BOM_EDITOR_BASE::OnSelectionChanged ), NULL, this );
m_applyChangesButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnApplyFieldChanges ), NULL, this );
m_revertChangesButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnRevertFieldChanges ), NULL, this );
m_closeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_EDITOR_BASE::OnCloseButton ), NULL, this );
}

View File

@ -10,7 +10,7 @@
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">table</property>
<property name="event_generation">connect</property>
<property name="file">dialog_bom_editor_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
@ -486,7 +486,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_BUTTON_REGROUP</property>
<property name="id">wxID_ANY</property>
<property name="label">Regroup components</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -544,20 +544,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">5</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer9</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0">
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Fields</property>
<property name="minimum_size"></property>
@ -838,7 +838,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_BUTTON_APPLY</property>
<property name="id">wxID_ANY</property>
<property name="label">Apply Changes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -926,7 +926,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_BUTTON_REVERT</property>
<property name="id">wxID_ANY</property>
<property name="label">Revert Changes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 1 2017)
// C++ code generated with wxFormBuilder (version Feb 19 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -31,35 +31,14 @@ class DIALOG_SHIM;
///////////////////////////////////////////////////////////////////////////
#define OPT_GROUP_COMPONENTS 1000
#define ID_BUTTON_REGROUP 1001
#define ID_BUTTON_APPLY 1002
#define ID_BUTTON_REVERT 1003
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_BOM_EDITOR_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnDialogClosed( wxCloseEvent& event ){ OnDialogClosed( event ); }
void _wxFB_OnUpdateUI( wxUpdateUIEvent& event ){ OnUpdateUI( event ); }
void _wxFB_OnGroupComponentsToggled( wxCommandEvent& event ){ OnGroupComponentsToggled( event ); }
void _wxFB_OnRegroupComponents( wxCommandEvent& event ){ OnRegroupComponents( event ); }
void _wxFB_OnColumnItemToggled( wxDataViewEvent& event ){ OnColumnItemToggled( event ); }
void _wxFB_OnBomColumReordered( wxDataViewEvent& event ){ OnBomColumReordered( event ); }
void _wxFB_OnBomColumnSorted( wxDataViewEvent& event ){ OnBomColumnSorted( event ); }
void _wxFB_OnTableItemActivated( wxDataViewEvent& event ){ OnTableItemActivated( event ); }
void _wxFB_OnTableItemContextMenu( wxDataViewEvent& event ){ OnTableItemContextMenu( event ); }
void _wxFB_OnTableValueChanged( wxDataViewEvent& event ){ OnTableValueChanged( event ); }
void _wxFB_OnSelectionChanged( wxDataViewEvent& event ){ OnSelectionChanged( event ); }
void _wxFB_OnApplyFieldChanges( wxCommandEvent& event ){ OnApplyFieldChanges( event ); }
void _wxFB_OnRevertFieldChanges( wxCommandEvent& event ){ OnRevertFieldChanges( event ); }
void _wxFB_OnCloseButton( wxCommandEvent& event ){ OnCloseButton( event ); }
protected:
wxPanel* m_panel;
wxSplitterWindow* m_splitter1;
@ -72,7 +51,7 @@ class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM
wxButton* m_applyChangesButton;
wxButton* m_revertChangesButton;
wxButton* m_closeButton;
// Virtual event handlers, overide them in your derived class
virtual void OnDialogClosed( wxCloseEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
@ -88,19 +67,19 @@ class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM
virtual void OnApplyFieldChanges( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRevertFieldChanges( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCloseButton( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("BOM editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 775,654 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER );
DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("BOM editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 775,654 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER );
~DIALOG_BOM_EDITOR_BASE();
void m_splitter1OnIdle( wxIdleEvent& )
{
m_splitter1->SetSashPosition( 231 );
m_splitter1->Disconnect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_BOM_EDITOR_BASE::m_splitter1OnIdle ), NULL, this );
}
};
#endif //__DIALOG_BOM_EDITOR_BASE_H__

View File

@ -81,7 +81,7 @@ int InvokeDialogPrintUsingPrinter( SCH_EDIT_FRAME* aCaller );
int InvokeDialogCreateBOM( SCH_EDIT_FRAME* aCaller );
/// Create and show DIALOG_BOM_EDITOR
int InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller );
void InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller );
/**
* Function InvokeDialogNetList