KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_design_block_properties_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
8#include "widgets/wx_grid.h"
9
11
13
14DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::DIALOG_DESIGN_BLOCK_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
15{
16 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
17
18 wxBoxSizer* bMainSizer;
19 bMainSizer = new wxBoxSizer( wxVERTICAL );
20
21 wxStaticBoxSizer* sbSizerGeneral;
22 sbSizerGeneral = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("General") ), wxVERTICAL );
23
24 wxFlexGridSizer* fgProperties;
25 fgProperties = new wxFlexGridSizer( 0, 2, 0, 0 );
26 fgProperties->AddGrowableCol( 1 );
27 fgProperties->AddGrowableRow( 2 );
28 fgProperties->SetFlexibleDirection( wxBOTH );
29 fgProperties->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
30
31 m_staticTextName = new wxStaticText( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
32 m_staticTextName->Wrap( -1 );
33 fgProperties->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
34
35 m_textName = new wxTextCtrl( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
36 fgProperties->Add( m_textName, 0, wxALL|wxEXPAND, 5 );
37
38 m_staticTextKeywords = new wxStaticText( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxT("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
39 m_staticTextKeywords->Wrap( -1 );
40 fgProperties->Add( m_staticTextKeywords, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
41
42 m_textKeywords = new wxTextCtrl( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
43 fgProperties->Add( m_textKeywords, 0, wxALL|wxEXPAND, 5 );
44
45 wxBoxSizer* bSizer3;
46 bSizer3 = new wxBoxSizer( wxVERTICAL );
47
48 m_staticTextDescription = new wxStaticText( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxT("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
49 m_staticTextDescription->Wrap( -1 );
50 bSizer3->Add( m_staticTextDescription, 1, wxALIGN_RIGHT|wxALL, 5 );
51
52
53 bSizer3->Add( 0, 0, 3, wxEXPAND, 5 );
54
55
56 fgProperties->Add( bSizer3, 1, wxEXPAND, 5 );
57
58 m_textDescription = new wxTextCtrl( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
59 fgProperties->Add( m_textDescription, 0, wxALL|wxEXPAND, 5 );
60
61
62 sbSizerGeneral->Add( fgProperties, 1, wxEXPAND, 5 );
63
64
65 bMainSizer->Add( sbSizerGeneral, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
66
67 wxStaticBoxSizer* sbFields;
68 sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Default Fields") ), wxVERTICAL );
69
70 m_fieldsGrid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
71
72 // Grid
73 m_fieldsGrid->CreateGrid( 1, 2 );
74 m_fieldsGrid->EnableEditing( true );
75 m_fieldsGrid->EnableGridLines( true );
76 m_fieldsGrid->EnableDragGridSize( false );
77 m_fieldsGrid->SetMargins( 0, 0 );
78
79 // Columns
80 m_fieldsGrid->SetColSize( 0, 150 );
81 m_fieldsGrid->SetColSize( 1, 300 );
82 m_fieldsGrid->EnableDragColMove( false );
83 m_fieldsGrid->EnableDragColSize( true );
84 m_fieldsGrid->SetColLabelValue( 0, wxT("Name") );
85 m_fieldsGrid->SetColLabelValue( 1, wxT("Value") );
87 m_fieldsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
88
89 // Rows
90 m_fieldsGrid->EnableDragRowSize( true );
91 m_fieldsGrid->SetRowLabelSize( 0 );
92 m_fieldsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
93
94 // Label Appearance
95
96 // Cell Defaults
97 m_fieldsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
98 m_fieldsGrid->SetMinSize( wxSize( -1,180 ) );
99
100 sbFields->Add( m_fieldsGrid, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
101
102 wxBoxSizer* bButtonSizer;
103 bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
104
105 m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
106 bButtonSizer->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
107
108 m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
109 bButtonSizer->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
110
111 m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
112 bButtonSizer->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
113
114
115 bButtonSizer->Add( 20, 0, 0, wxEXPAND, 10 );
116
117 m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
118 bButtonSizer->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
119
120
121 bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
122
123
124 sbFields->Add( bButtonSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
125
126
127 bMainSizer->Add( sbFields, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
128
129 m_stdButtons = new wxStdDialogButtonSizer();
130 m_stdButtonsOK = new wxButton( this, wxID_OK );
131 m_stdButtons->AddButton( m_stdButtonsOK );
132 m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
133 m_stdButtons->AddButton( m_stdButtonsCancel );
134 m_stdButtons->Realize();
135
136 bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 );
137
138
139 this->SetSizer( bMainSizer );
140 this->Layout();
141
142 this->Centre( wxBOTH );
143
144 // Connect Events
145 m_fieldsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
146 m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnAddField ), NULL, this );
147 m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldUp ), NULL, this );
148 m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldDown ), NULL, this );
149 m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnDeleteField ), NULL, this );
150 m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
151}
152
154{
155 // Disconnect Events
156 m_fieldsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
157 m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnAddField ), NULL, this );
158 m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldUp ), NULL, this );
159 m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldDown ), NULL, this );
160 m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnDeleteField ), NULL, this );
161 m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
162
163}
virtual void OnDeleteField(wxCommandEvent &event)
virtual void OnMoveFieldUp(wxCommandEvent &event)
DIALOG_DESIGN_BLOCK_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxT("Design Block Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(551, 637), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnAddField(wxCommandEvent &event)
virtual void OnCancelButtonClick(wxCommandEvent &event)
virtual void OnMoveFieldDown(wxCommandEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:88
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
Definition: wx_grid.cpp:249