KiCad PCB EDA Suite
DIALOG_LAYER_SELECTION_BASE Class Reference

Class DIALOG_LAYER_SELECTION_BASE. More...

#include <dialog_layer_selection_base.h>

Inheritance diagram for DIALOG_LAYER_SELECTION_BASE:
PCB_ONE_LAYER_SELECTOR

Public Member Functions

 DIALOG_LAYER_SELECTION_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Select Layer:"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(337, 183), long style=wxDEFAULT_DIALOG_STYLE)
 
 ~DIALOG_LAYER_SELECTION_BASE ()
 

Protected Member Functions

virtual void OnLeftGridCellClick (wxGridEvent &event)
 
virtual void OnLeftButtonReleased (wxMouseEvent &event)
 
virtual void OnRightGridCellClick (wxGridEvent &event)
 

Protected Attributes

wxGrid * m_leftGridLayers
 
wxGrid * m_rightGridLayers
 

Detailed Description

Constructor & Destructor Documentation

DIALOG_LAYER_SELECTION_BASE::DIALOG_LAYER_SELECTION_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  title = _("Select Layer:"),
const wxPoint pos = wxDefaultPosition,
const wxSize &  size = wxSize( 337,183 ),
long  style = wxDEFAULT_DIALOG_STYLE 
)

Definition at line 12 of file dialog_layer_selection_base.cpp.

References ID_LEFT_LIST, ID_RIGHT_LIST, m_leftGridLayers, m_rightGridLayers, OnLeftButtonReleased(), OnLeftGridCellClick(), and OnRightGridCellClick().

12  : wxDialog( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bSizerUpper;
20  bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
21 
22  m_leftGridLayers = new wxGrid( this, ID_LEFT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
23 
24  // Grid
25  m_leftGridLayers->CreateGrid( 1, 3 );
26  m_leftGridLayers->EnableEditing( false );
27  m_leftGridLayers->EnableGridLines( true );
28  m_leftGridLayers->EnableDragGridSize( false );
29  m_leftGridLayers->SetMargins( 0, 3 );
30 
31  // Columns
32  m_leftGridLayers->EnableDragColMove( false );
33  m_leftGridLayers->EnableDragColSize( false );
34  m_leftGridLayers->SetColLabelSize( 0 );
35  m_leftGridLayers->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
36 
37  // Rows
38  m_leftGridLayers->EnableDragRowSize( false );
39  m_leftGridLayers->SetRowLabelSize( 0 );
40  m_leftGridLayers->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
41 
42  // Label Appearance
43  m_leftGridLayers->SetLabelBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
44 
45  // Cell Defaults
46  m_leftGridLayers->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
47  m_leftGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
48  bSizerUpper->Add( m_leftGridLayers, 1, wxALL|wxEXPAND, 5 );
49 
50  m_rightGridLayers = new wxGrid( this, ID_RIGHT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
51 
52  // Grid
53  m_rightGridLayers->CreateGrid( 1, 3 );
54  m_rightGridLayers->EnableEditing( false );
55  m_rightGridLayers->EnableGridLines( true );
56  m_rightGridLayers->EnableDragGridSize( false );
57  m_rightGridLayers->SetMargins( 0, 3 );
58 
59  // Columns
60  m_rightGridLayers->EnableDragColMove( false );
61  m_rightGridLayers->EnableDragColSize( false );
62  m_rightGridLayers->SetColLabelSize( 0 );
63  m_rightGridLayers->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
64 
65  // Rows
66  m_rightGridLayers->EnableDragRowSize( false );
67  m_rightGridLayers->SetRowLabelSize( 0 );
68  m_rightGridLayers->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
69 
70  // Label Appearance
71 
72  // Cell Defaults
73  m_rightGridLayers->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
74  m_rightGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
75  bSizerUpper->Add( m_rightGridLayers, 1, wxALL|wxEXPAND, 5 );
76 
77 
78  bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 );
79 
80 
81  this->SetSizer( bSizerMain );
82  this->Layout();
83 
84  this->Centre( wxBOTH );
85 
86  // Connect Events
87  m_leftGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
88  m_leftGridLayers->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
89  m_rightGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
90  m_rightGridLayers->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
91 }
#define ID_RIGHT_LIST
virtual void OnLeftButtonReleased(wxMouseEvent &event)
#define ID_LEFT_LIST
virtual void OnRightGridCellClick(wxGridEvent &event)
virtual void OnLeftGridCellClick(wxGridEvent &event)
DIALOG_LAYER_SELECTION_BASE::~DIALOG_LAYER_SELECTION_BASE ( )

Definition at line 93 of file dialog_layer_selection_base.cpp.

References m_leftGridLayers, m_rightGridLayers, OnLeftButtonReleased(), OnLeftGridCellClick(), and OnRightGridCellClick().

94 {
95  // Disconnect Events
96  m_leftGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
97  m_leftGridLayers->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
98  m_rightGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
99  m_rightGridLayers->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
100 
101 }
virtual void OnLeftButtonReleased(wxMouseEvent &event)
virtual void OnRightGridCellClick(wxGridEvent &event)
virtual void OnLeftGridCellClick(wxGridEvent &event)

Member Function Documentation

virtual void DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ( wxMouseEvent &  event)
inlineprotectedvirtual

Definition at line 44 of file dialog_layer_selection_base.h.

Referenced by DIALOG_LAYER_SELECTION_BASE(), and ~DIALOG_LAYER_SELECTION_BASE().

44 { event.Skip(); }
virtual void DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ( wxGridEvent &  event)
inlineprotectedvirtual

Reimplemented in PCB_ONE_LAYER_SELECTOR.

Definition at line 43 of file dialog_layer_selection_base.h.

Referenced by DIALOG_LAYER_SELECTION_BASE(), and ~DIALOG_LAYER_SELECTION_BASE().

43 { event.Skip(); }
virtual void DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ( wxGridEvent &  event)
inlineprotectedvirtual

Reimplemented in PCB_ONE_LAYER_SELECTOR.

Definition at line 45 of file dialog_layer_selection_base.h.

Referenced by DIALOG_LAYER_SELECTION_BASE(), and ~DIALOG_LAYER_SELECTION_BASE().

45 { event.Skip(); }

Member Data Documentation

wxGrid* DIALOG_LAYER_SELECTION_BASE::m_leftGridLayers
protected
wxGrid* DIALOG_LAYER_SELECTION_BASE::m_rightGridLayers
protected

The documentation for this class was generated from the following files: