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(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
 ~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( -1,-1 ),
long  style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER 
)

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().

Referenced by 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( false );
28  m_leftGridLayers->EnableDragGridSize( false );
29  m_leftGridLayers->SetMargins( 5, 3 );
30 
31  // Columns
32  m_leftGridLayers->SetColSize( 0, 24 );
33  m_leftGridLayers->SetColSize( 1, 20 );
34  m_leftGridLayers->SetColSize( 2, 72 );
35  m_leftGridLayers->EnableDragColMove( false );
36  m_leftGridLayers->EnableDragColSize( false );
37  m_leftGridLayers->SetColLabelSize( 0 );
38  m_leftGridLayers->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
39 
40  // Rows
41  m_leftGridLayers->EnableDragRowSize( false );
42  m_leftGridLayers->SetRowLabelSize( 0 );
43  m_leftGridLayers->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
44 
45  // Label Appearance
46  m_leftGridLayers->SetLabelBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
47 
48  // Cell Defaults
49  m_leftGridLayers->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
50  m_leftGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
51  bSizerUpper->Add( m_leftGridLayers, 1, wxALL|wxEXPAND, 5 );
52 
53  m_rightGridLayers = new wxGrid( this, ID_RIGHT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
54 
55  // Grid
56  m_rightGridLayers->CreateGrid( 1, 3 );
57  m_rightGridLayers->EnableEditing( false );
58  m_rightGridLayers->EnableGridLines( false );
59  m_rightGridLayers->EnableDragGridSize( false );
60  m_rightGridLayers->SetMargins( 5, 3 );
61 
62  // Columns
63  m_rightGridLayers->SetColSize( 0, 24 );
64  m_rightGridLayers->SetColSize( 1, 20 );
65  m_rightGridLayers->SetColSize( 2, 72 );
66  m_rightGridLayers->EnableDragColMove( false );
67  m_rightGridLayers->EnableDragColSize( false );
68  m_rightGridLayers->SetColLabelSize( 0 );
69  m_rightGridLayers->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
70 
71  // Rows
72  m_rightGridLayers->EnableDragRowSize( false );
73  m_rightGridLayers->SetRowLabelSize( 0 );
74  m_rightGridLayers->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
75 
76  // Label Appearance
77 
78  // Cell Defaults
79  m_rightGridLayers->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
80  m_rightGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
81  bSizerUpper->Add( m_rightGridLayers, 1, wxALL|wxEXPAND, 5 );
82 
83 
84  bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 10 );
85 
86 
87  this->SetSizer( bSizerMain );
88  this->Layout();
89  bSizerMain->Fit( this );
90 
91  this->Centre( wxBOTH );
92 
93  // Connect Events
94  m_leftGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
95  m_leftGridLayers->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
96  m_rightGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
97  m_rightGridLayers->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
98 }
#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 100 of file dialog_layer_selection_base.cpp.

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

Referenced by OnRightGridCellClick().

101 {
102  // Disconnect Events
103  m_leftGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
104  m_leftGridLayers->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
105  m_rightGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
106  m_rightGridLayers->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
107 
108 }
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

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: