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.2.1-0-g80c4cb6)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
9#include "widgets/wx_grid.h"
10
12
14
15DIALOG_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 )
16{
17 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
18
19 wxBoxSizer* bMainSizer;
20 bMainSizer = new wxBoxSizer( wxVERTICAL );
21
22 wxBoxSizer* bMargins;
23 bMargins = new wxBoxSizer( wxVERTICAL );
24
25 wxStaticBoxSizer* sbFields;
26 sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Default Fields") ), wxVERTICAL );
27
28 m_fieldsGrid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
29
30 // Grid
31 m_fieldsGrid->CreateGrid( 1, 2 );
32 m_fieldsGrid->EnableEditing( true );
33 m_fieldsGrid->EnableGridLines( true );
34 m_fieldsGrid->EnableDragGridSize( false );
35 m_fieldsGrid->SetMargins( 0, 0 );
36
37 // Columns
38 m_fieldsGrid->SetColSize( 0, 150 );
39 m_fieldsGrid->SetColSize( 1, 300 );
40 m_fieldsGrid->EnableDragColMove( false );
41 m_fieldsGrid->EnableDragColSize( true );
42 m_fieldsGrid->SetColLabelValue( 0, wxT("Name") );
43 m_fieldsGrid->SetColLabelValue( 1, wxT("Value") );
45 m_fieldsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
46
47 // Rows
48 m_fieldsGrid->EnableDragRowSize( true );
49 m_fieldsGrid->SetRowLabelSize( 0 );
50 m_fieldsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
51
52 // Label Appearance
53
54 // Cell Defaults
55 m_fieldsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
56 m_fieldsGrid->SetMinSize( wxSize( -1,180 ) );
57
58 sbFields->Add( m_fieldsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
59
60 wxBoxSizer* bButtonSizer;
61 bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
62
63 m_bpAdd = new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
64 bButtonSizer->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
65
66 m_bpMoveUp = new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
67 bButtonSizer->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
68
69 m_bpMoveDown = new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
70 bButtonSizer->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
71
72
73 bButtonSizer->Add( 20, 0, 0, wxEXPAND, 10 );
74
75 m_bpDelete = new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
76 bButtonSizer->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
77
78
79 bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
80
81
82 sbFields->Add( bButtonSizer, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
83
84
85 bMargins->Add( sbFields, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
86
87
88 bMainSizer->Add( bMargins, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
89
90 wxFlexGridSizer* fgProperties;
91 fgProperties = new wxFlexGridSizer( 0, 2, 5, 0 );
92 fgProperties->AddGrowableCol( 1 );
93 fgProperties->AddGrowableRow( 2 );
94 fgProperties->SetFlexibleDirection( wxBOTH );
95 fgProperties->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
96
97 m_staticTextName = new wxStaticText( this, wxID_ANY, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
98 m_staticTextName->Wrap( -1 );
99 fgProperties->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
100
101 m_textName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
102 fgProperties->Add( m_textName, 0, wxEXPAND, 5 );
103
104 m_staticTextKeywords = new wxStaticText( this, wxID_ANY, wxT("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
105 m_staticTextKeywords->Wrap( -1 );
106 fgProperties->Add( m_staticTextKeywords, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
107
108 m_textKeywords = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
109 fgProperties->Add( m_textKeywords, 0, wxEXPAND, 5 );
110
111 m_staticTextDescription = new wxStaticText( this, wxID_ANY, wxT("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
112 m_staticTextDescription->Wrap( -1 );
113 fgProperties->Add( m_staticTextDescription, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
114
115 m_textDescription = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
116 fgProperties->Add( m_textDescription, 0, wxEXPAND, 5 );
117
118
119 bMainSizer->Add( fgProperties, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
120
121 m_stdButtons = new wxStdDialogButtonSizer();
122 m_stdButtonsOK = new wxButton( this, wxID_OK );
123 m_stdButtons->AddButton( m_stdButtonsOK );
124 m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
125 m_stdButtons->AddButton( m_stdButtonsCancel );
126 m_stdButtons->Realize();
127
128 bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 );
129
130
131 this->SetSizer( bMainSizer );
132 this->Layout();
133 bMainSizer->Fit( this );
134
135 this->Centre( wxBOTH );
136
137 // Connect Events
138 m_fieldsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
139 m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnAddField ), NULL, this );
140 m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldUp ), NULL, this );
141 m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldDown ), NULL, this );
142 m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnDeleteField ), NULL, this );
143 m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
144}
145
147{
148 // Disconnect Events
149 m_fieldsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
150 m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnAddField ), NULL, this );
151 m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldUp ), NULL, this );
152 m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnMoveFieldDown ), NULL, this );
153 m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnDeleteField ), NULL, this );
154 m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
155
156}
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(-1,-1), 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
A bitmap button widget that behaves like a standard dialog button except with an icon.
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:256