2018-04-26 10:09:41 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////
|
2020-04-21 15:15:04 +00:00
|
|
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
2018-04-26 10:09:41 +00:00
|
|
|
// http://www.wxformbuilder.org/
|
|
|
|
//
|
|
|
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-08-19 16:10:14 +00:00
|
|
|
#include "widgets/wx_grid.h"
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
#include "dialog_fields_editor_global_base.h"
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
DIALOG_FIELDS_EDITOR_GLOBAL_BASE::DIALOG_FIELDS_EDITOR_GLOBAL_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( wxSize( -1,-1 ), wxDefaultSize );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
wxBoxSizer* bMainSizer;
|
|
|
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-08-02 17:00:41 +00:00
|
|
|
m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_splitter1->SetMinimumPaneSize( 200 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_leftPanel = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
|
|
|
wxBoxSizer* bLeftSizer;
|
|
|
|
bLeftSizer = new wxBoxSizer( wxVERTICAL );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
wxBoxSizer* bGroupSizer;
|
|
|
|
bGroupSizer = new wxBoxSizer( wxHORIZONTAL );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_groupComponentsBox = new wxCheckBox( m_leftPanel, OPT_GROUP_COMPONENTS, _("Group symbols"), wxDefaultPosition, wxDefaultSize, 0 );
|
2020-04-21 15:15:04 +00:00
|
|
|
m_groupComponentsBox->SetValue(true);
|
2018-04-26 10:09:41 +00:00
|
|
|
m_groupComponentsBox->SetToolTip( _("Group components together based on common properties") );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bGroupSizer->Add( m_groupComponentsBox, 0, wxALL|wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bGroupSizer->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
m_bRefresh = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_bRefresh->SetMinSize( wxSize( 30,30 ) );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bGroupSizer->Add( m_bRefresh, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bLeftSizer->Add( bGroupSizer, 0, wxALL|wxBOTTOM|wxEXPAND|wxTOP, 2 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_fieldsCtrl = new wxDataViewListCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_fieldsCtrl->SetMinSize( wxSize( -1,220 ) );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bLeftSizer->Add( m_fieldsCtrl, 1, wxALL|wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-05-23 12:12:01 +00:00
|
|
|
m_addFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Add Field..."), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
bLeftSizer->Add( m_addFieldButton, 0, wxALL|wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_leftPanel->SetSizer( bLeftSizer );
|
|
|
|
m_leftPanel->Layout();
|
|
|
|
bLeftSizer->Fit( m_leftPanel );
|
|
|
|
m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
|
|
|
wxBoxSizer* bRightSizer;
|
|
|
|
bRightSizer = new wxBoxSizer( wxVERTICAL );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-08-19 16:10:14 +00:00
|
|
|
m_grid = new WX_GRID( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
// Grid
|
2020-04-21 15:15:04 +00:00
|
|
|
m_grid->CreateGrid( 5, 5 );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_grid->EnableEditing( true );
|
|
|
|
m_grid->EnableGridLines( true );
|
|
|
|
m_grid->EnableDragGridSize( false );
|
|
|
|
m_grid->SetMargins( 0, 0 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
// Columns
|
2018-10-09 20:27:15 +00:00
|
|
|
m_grid->EnableDragColMove( true );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_grid->EnableDragColSize( true );
|
|
|
|
m_grid->SetColLabelSize( 20 );
|
2020-04-21 15:15:04 +00:00
|
|
|
m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
// Rows
|
|
|
|
m_grid->EnableDragRowSize( false );
|
|
|
|
m_grid->SetRowLabelSize( 0 );
|
2020-04-21 15:15:04 +00:00
|
|
|
m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
// Label Appearance
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
// Cell Defaults
|
|
|
|
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
|
|
|
m_grid->SetMinSize( wxSize( 400,240 ) );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bRightSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_panel4->SetSizer( bRightSizer );
|
|
|
|
m_panel4->Layout();
|
|
|
|
bRightSizer->Fit( m_panel4 );
|
|
|
|
m_splitter1->SplitVertically( m_leftPanel, m_panel4, -1 );
|
|
|
|
bMainSizer->Add( m_splitter1, 1, wxALL|wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
wxBoxSizer* bButtonsSizer;
|
|
|
|
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_button1 = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
bButtonsSizer->Add( m_button1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
|
|
|
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
|
|
|
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
|
|
|
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
|
|
|
|
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
|
|
|
|
m_sdbSizer1->Realize();
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bButtonsSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
this->SetSizer( bMainSizer );
|
|
|
|
this->Layout();
|
|
|
|
bMainSizer->Fit( this );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
this->Centre( wxBOTH );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
// Connect Events
|
2018-06-05 19:59:58 +00:00
|
|
|
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnClose ) );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_groupComponentsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this );
|
|
|
|
m_bRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this );
|
|
|
|
m_fieldsCtrl->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this );
|
|
|
|
m_fieldsCtrl->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this );
|
2018-05-23 12:12:01 +00:00
|
|
|
m_addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnAddField ), NULL, this );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this );
|
2018-05-12 22:04:11 +00:00
|
|
|
m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
|
|
|
|
m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this );
|
2020-04-21 15:15:04 +00:00
|
|
|
m_grid->Connect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableColSize ), NULL, this );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this );
|
|
|
|
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this );
|
|
|
|
}
|
|
|
|
|
|
|
|
DIALOG_FIELDS_EDITOR_GLOBAL_BASE::~DIALOG_FIELDS_EDITOR_GLOBAL_BASE()
|
|
|
|
{
|
|
|
|
// Disconnect Events
|
2018-06-05 19:59:58 +00:00
|
|
|
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnClose ) );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_groupComponentsBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this );
|
|
|
|
m_bRefresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this );
|
|
|
|
m_fieldsCtrl->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this );
|
|
|
|
m_fieldsCtrl->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this );
|
2018-05-23 12:12:01 +00:00
|
|
|
m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnAddField ), NULL, this );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this );
|
2018-05-12 22:04:11 +00:00
|
|
|
m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
|
|
|
|
m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this );
|
2020-04-21 15:15:04 +00:00
|
|
|
m_grid->Disconnect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableColSize ), NULL, this );
|
2018-04-26 10:09:41 +00:00
|
|
|
m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this );
|
|
|
|
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this );
|
2020-04-21 15:15:04 +00:00
|
|
|
|
2018-04-26 10:09:41 +00:00
|
|
|
}
|