You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

238 lines
12 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. // C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
  3. // http://www.wxformbuilder.org/
  4. //
  5. // PLEASE DO *NOT* EDIT THIS FILE!
  6. ///////////////////////////////////////////////////////////////////////////
  7. #include "widgets/bitmap_button.h"
  8. #include "widgets/wx_grid.h"
  9. #include "appearance_controls_base.h"
  10. ///////////////////////////////////////////////////////////////////////////
  11. APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : WX_PANEL( parent, id, pos, size, style, name )
  12. {
  13. this->SetMinSize( wxSize( 200,360 ) );
  14. m_sizerOuter = new wxBoxSizer( wxVERTICAL );
  15. m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
  16. m_panelLayers = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
  17. m_panelLayersSizer = new wxBoxSizer( wxVERTICAL );
  18. m_windowLayers = new wxScrolledCanvas( m_panelLayers, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
  19. m_panelLayersSizer->Add( m_windowLayers, 1, wxEXPAND, 5 );
  20. m_panelLayers->SetSizer( m_panelLayersSizer );
  21. m_panelLayers->Layout();
  22. m_panelLayersSizer->Fit( m_panelLayers );
  23. m_notebook->AddPage( m_panelLayers, _("Layers"), true );
  24. m_panelObjects = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
  25. m_panelObjects->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
  26. m_objectsPanelSizer = new wxBoxSizer( wxVERTICAL );
  27. m_windowObjects = new wxScrolledCanvas( m_panelObjects, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
  28. m_objectsPanelSizer->Add( m_windowObjects, 1, wxEXPAND, 5 );
  29. m_panelObjects->SetSizer( m_objectsPanelSizer );
  30. m_panelObjects->Layout();
  31. m_objectsPanelSizer->Fit( m_panelObjects );
  32. m_notebook->AddPage( m_panelObjects, _("Objects"), false );
  33. m_panelNetsAndClasses = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
  34. m_netsTabOuterSizer = new wxBoxSizer( wxVERTICAL );
  35. m_netsTabSplitter = new wxSplitterWindow( m_panelNetsAndClasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
  36. m_netsTabSplitter->SetSashGravity( 0.8 );
  37. m_netsTabSplitter->Connect( wxEVT_IDLE, wxIdleEventHandler( APPEARANCE_CONTROLS_BASE::m_netsTabSplitterOnIdle ), NULL, this );
  38. m_netsTabSplitter->SetMinimumPaneSize( 80 );
  39. m_panelNets = new wxPanel( m_netsTabSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
  40. wxBoxSizer* bSizer192;
  41. bSizer192 = new wxBoxSizer( wxVERTICAL );
  42. wxBoxSizer* bSizer17;
  43. bSizer17 = new wxBoxSizer( wxHORIZONTAL );
  44. m_staticTextNets = new wxStaticText( m_panelNets, wxID_ANY, _("Nets"), wxDefaultPosition, wxDefaultSize, 0 );
  45. m_staticTextNets->Wrap( -1 );
  46. bSizer17->Add( m_staticTextNets, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
  47. m_txtNetFilter = new wxTextCtrl( m_panelNets, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
  48. m_txtNetFilter->Hide();
  49. bSizer17->Add( m_txtNetFilter, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
  50. m_btnNetInspector = new BITMAP_BUTTON( m_panelNets, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
  51. m_btnNetInspector->SetToolTip( _("Show the Net Inspector") );
  52. bSizer17->Add( m_btnNetInspector, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
  53. bSizer192->Add( bSizer17, 0, wxEXPAND, 5 );
  54. m_netsGrid = new WX_GRID( m_panelNets, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
  55. // Grid
  56. m_netsGrid->CreateGrid( 5, 3 );
  57. m_netsGrid->EnableEditing( false );
  58. m_netsGrid->EnableGridLines( false );
  59. m_netsGrid->EnableDragGridSize( false );
  60. m_netsGrid->SetMargins( 0, 0 );
  61. // Columns
  62. m_netsGrid->SetColSize( 0, 40 );
  63. m_netsGrid->SetColSize( 1, 40 );
  64. m_netsGrid->SetColSize( 2, 400 );
  65. m_netsGrid->EnableDragColMove( false );
  66. m_netsGrid->EnableDragColSize( false );
  67. m_netsGrid->SetColLabelSize( 0 );
  68. m_netsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
  69. // Rows
  70. m_netsGrid->EnableDragRowSize( false );
  71. m_netsGrid->SetRowLabelSize( 0 );
  72. m_netsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
  73. // Label Appearance
  74. // Cell Defaults
  75. m_netsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
  76. bSizer192->Add( m_netsGrid, 0, wxALL|wxEXPAND, 5 );
  77. m_panelNets->SetSizer( bSizer192 );
  78. m_panelNets->Layout();
  79. bSizer192->Fit( m_panelNets );
  80. m_panelNetclasses = new wxPanel( m_netsTabSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
  81. wxBoxSizer* bSizerNetClasses;
  82. bSizerNetClasses = new wxBoxSizer( wxVERTICAL );
  83. wxBoxSizer* bSizer20;
  84. bSizer20 = new wxBoxSizer( wxHORIZONTAL );
  85. m_staticTextNetClasses = new wxStaticText( m_panelNetclasses, wxID_ANY, _("Net Classes"), wxDefaultPosition, wxDefaultSize, 0 );
  86. m_staticTextNetClasses->Wrap( -1 );
  87. bSizer20->Add( m_staticTextNetClasses, 1, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
  88. m_btnConfigureNetClasses = new BITMAP_BUTTON( m_panelNetclasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
  89. m_btnConfigureNetClasses->SetToolTip( _("Configure net classes") );
  90. bSizer20->Add( m_btnConfigureNetClasses, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
  91. bSizerNetClasses->Add( bSizer20, 0, wxEXPAND, 5 );
  92. m_netclassScrolledWindow = new wxScrolledWindow( m_panelNetclasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
  93. m_netclassScrolledWindow->SetScrollRate( 5, 5 );
  94. m_netclassOuterSizer = new wxBoxSizer( wxVERTICAL );
  95. m_netclassScrolledWindow->SetSizer( m_netclassOuterSizer );
  96. m_netclassScrolledWindow->Layout();
  97. m_netclassOuterSizer->Fit( m_netclassScrolledWindow );
  98. bSizerNetClasses->Add( m_netclassScrolledWindow, 1, wxEXPAND | wxALL, 5 );
  99. m_panelNetclasses->SetSizer( bSizerNetClasses );
  100. m_panelNetclasses->Layout();
  101. bSizerNetClasses->Fit( m_panelNetclasses );
  102. m_netsTabSplitter->SplitHorizontally( m_panelNets, m_panelNetclasses, 300 );
  103. m_netsTabOuterSizer->Add( m_netsTabSplitter, 1, wxEXPAND, 5 );
  104. m_panelNetsAndClasses->SetSizer( m_netsTabOuterSizer );
  105. m_panelNetsAndClasses->Layout();
  106. m_netsTabOuterSizer->Fit( m_panelNetsAndClasses );
  107. m_notebook->AddPage( m_panelNetsAndClasses, _("Nets"), false );
  108. m_sizerOuter->Add( m_notebook, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
  109. wxBoxSizer* bBottomMargin;
  110. bBottomMargin = new wxBoxSizer( wxVERTICAL );
  111. wxBoxSizer* bPresets;
  112. bPresets = new wxBoxSizer( wxVERTICAL );
  113. m_presetsLabel = new wxStaticText( this, wxID_ANY, _("Presets (Ctrl+Tab):"), wxDefaultPosition, wxDefaultSize, 0 );
  114. m_presetsLabel->Wrap( -1 );
  115. bPresets->Add( m_presetsLabel, 1, wxTOP|wxRIGHT|wxLEFT, 2 );
  116. wxString m_cbLayerPresetsChoices[] = { _("All Layers"), _("(unsaved)") };
  117. int m_cbLayerPresetsNChoices = sizeof( m_cbLayerPresetsChoices ) / sizeof( wxString );
  118. m_cbLayerPresets = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbLayerPresetsNChoices, m_cbLayerPresetsChoices, 0 );
  119. m_cbLayerPresets->SetSelection( 1 );
  120. bPresets->Add( m_cbLayerPresets, 0, wxALL|wxEXPAND, 2 );
  121. bBottomMargin->Add( bPresets, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
  122. bBottomMargin->Add( 0, 2, 0, wxEXPAND, 5 );
  123. wxBoxSizer* bViewports;
  124. bViewports = new wxBoxSizer( wxVERTICAL );
  125. m_viewportsLabel = new wxStaticText( this, wxID_ANY, _("Viewports (Alt+Tab):"), wxDefaultPosition, wxDefaultSize, 0 );
  126. m_viewportsLabel->Wrap( -1 );
  127. bViewports->Add( m_viewportsLabel, 1, wxRIGHT|wxLEFT, 2 );
  128. wxString m_cbViewportsChoices[] = { _("(unsaved)") };
  129. int m_cbViewportsNChoices = sizeof( m_cbViewportsChoices ) / sizeof( wxString );
  130. m_cbViewports = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbViewportsNChoices, m_cbViewportsChoices, 0 );
  131. m_cbViewports->SetSelection( 1 );
  132. bViewports->Add( m_cbViewports, 0, wxALL|wxEXPAND, 2 );
  133. bBottomMargin->Add( bViewports, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
  134. m_sizerOuter->Add( bBottomMargin, 0, wxEXPAND|wxTOP|wxBOTTOM, 4 );
  135. this->SetSizer( m_sizerOuter );
  136. this->Layout();
  137. m_sizerOuter->Fit( this );
  138. // Connect Events
  139. this->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ) );
  140. this->Connect( wxEVT_SIZE, wxSizeEventHandler( APPEARANCE_CONTROLS_BASE::OnSize ) );
  141. m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( APPEARANCE_CONTROLS_BASE::OnNotebookPageChanged ), NULL, this );
  142. m_notebook->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  143. m_panelLayers->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  144. m_panelObjects->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  145. m_panelNetsAndClasses->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  146. m_panelNets->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  147. m_netsGrid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridClick ), NULL, this );
  148. m_netsGrid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridDoubleClick ), NULL, this );
  149. m_netsGrid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridRightClick ), NULL, this );
  150. m_netsGrid->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  151. m_panelNetclasses->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  152. m_cbLayerPresets->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::onLayerPresetChanged ), NULL, this );
  153. m_cbViewports->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::onViewportChanged ), NULL, this );
  154. }
  155. APPEARANCE_CONTROLS_BASE::~APPEARANCE_CONTROLS_BASE()
  156. {
  157. // Disconnect Events
  158. this->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ) );
  159. this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( APPEARANCE_CONTROLS_BASE::OnSize ) );
  160. m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( APPEARANCE_CONTROLS_BASE::OnNotebookPageChanged ), NULL, this );
  161. m_notebook->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  162. m_panelLayers->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  163. m_panelObjects->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  164. m_panelNetsAndClasses->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  165. m_panelNets->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  166. m_netsGrid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridClick ), NULL, this );
  167. m_netsGrid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridDoubleClick ), NULL, this );
  168. m_netsGrid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridRightClick ), NULL, this );
  169. m_netsGrid->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  170. m_panelNetclasses->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this );
  171. m_cbLayerPresets->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::onLayerPresetChanged ), NULL, this );
  172. m_cbViewports->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::onViewportChanged ), NULL, this );
  173. }