KiCad PCB EDA Suite
PANEL_SETUP_RULES_BASE Class Reference

Class PANEL_SETUP_RULES_BASE. More...

#include <panel_setup_rules_base.h>

Inheritance diagram for PANEL_SETUP_RULES_BASE:
PANEL_SETUP_RULES

Public Member Functions

 PANEL_SETUP_RULES_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~PANEL_SETUP_RULES_BASE ()
 

Protected Member Functions

virtual void OnSyntaxHelp (wxHyperlinkEvent &event)
 
virtual void OnContextMenu (wxMouseEvent &event)
 
virtual void OnCompile (wxCommandEvent &event)
 
virtual void OnErrorLinkClicked (wxHtmlLinkEvent &event)
 

Protected Attributes

wxStaticText * m_title
 
wxHyperlinkCtrl * m_syntaxHelp
 
wxBoxSizer * m_topMargin
 
wxStyledTextCtrl * m_textEditor
 
wxBitmapButton * m_compileButton
 
WX_HTML_REPORT_BOXm_errorsReport
 

Detailed Description

Class PANEL_SETUP_RULES_BASE.

Definition at line 39 of file panel_setup_rules_base.h.

Constructor & Destructor Documentation

◆ PANEL_SETUP_RULES_BASE()

PANEL_SETUP_RULES_BASE::PANEL_SETUP_RULES_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxSize( -1,-1 ),
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxEmptyString 
)

Definition at line 14 of file panel_setup_rules_base.cpp.

14 : wxPanel( parent, id, pos, size, style, name )
15{
16 wxBoxSizer* bPanelSizer;
17 bPanelSizer = new wxBoxSizer( wxVERTICAL );
18
19 wxBoxSizer* bSizer4;
20 bSizer4 = new wxBoxSizer( wxHORIZONTAL );
21
22 m_title = new wxStaticText( this, wxID_ANY, _("DRC rules:"), wxDefaultPosition, wxDefaultSize, 0 );
23 m_title->Wrap( -1 );
24 bSizer4->Add( m_title, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
25
26
27 bSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
28
29 m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
30 m_syntaxHelp->SetToolTip( _("Show syntax help window") );
31
32 bSizer4->Add( m_syntaxHelp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
33
34
35 bPanelSizer->Add( bSizer4, 0, wxEXPAND, 5 );
36
37 m_topMargin = new wxBoxSizer( wxVERTICAL );
38
39 m_textEditor = new wxStyledTextCtrl( this, ID_RULES_EDITOR, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
40 m_textEditor->SetUseTabs( true );
41 m_textEditor->SetTabWidth( 4 );
42 m_textEditor->SetIndent( 4 );
43 m_textEditor->SetTabIndents( true );
44 m_textEditor->SetBackSpaceUnIndents( true );
45 m_textEditor->SetViewEOL( false );
46 m_textEditor->SetViewWhiteSpace( false );
47 m_textEditor->SetMarginWidth( 2, 0 );
48 m_textEditor->SetIndentationGuides( true );
49 m_textEditor->SetReadOnly( false );
50 m_textEditor->SetMarginWidth( 1, 0 );
51 m_textEditor->SetMarginType( 0, wxSTC_MARGIN_NUMBER );
52 m_textEditor->SetMarginWidth( 0, m_textEditor->TextWidth( wxSTC_STYLE_LINENUMBER, wxT("_99999") ) );
53 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS );
54 m_textEditor->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
55 m_textEditor->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
56 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
57 m_textEditor->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
58 m_textEditor->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
59 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY );
60 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
61 m_textEditor->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
62 m_textEditor->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
63 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
64 m_textEditor->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
65 m_textEditor->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
66 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
67 m_textEditor->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
68 m_textEditor->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
69 m_textEditor->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
70 m_topMargin->Add( m_textEditor, 3, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 );
71
72 wxBoxSizer* bSizer5;
73 bSizer5 = new wxBoxSizer( wxHORIZONTAL );
74
75 m_compileButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|0 );
76 m_compileButton->SetToolTip( _("Check rule syntax") );
77
78 bSizer5->Add( m_compileButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
79
80 m_errorsReport = new WX_HTML_REPORT_BOX( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
81 m_errorsReport->SetMinSize( wxSize( 400,60 ) );
82
83 bSizer5->Add( m_errorsReport, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
84
85
86 m_topMargin->Add( bSizer5, 1, wxEXPAND, 5 );
87
88
89 bPanelSizer->Add( m_topMargin, 1, wxEXPAND, 10 );
90
91
92 this->SetSizer( bPanelSizer );
93 this->Layout();
94 bPanelSizer->Fit( this );
95
96 // Connect Events
97 m_syntaxHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( PANEL_SETUP_RULES_BASE::OnSyntaxHelp ), NULL, this );
98 m_textEditor->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( PANEL_SETUP_RULES_BASE::OnContextMenu ), NULL, this );
99 m_compileButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_RULES_BASE::OnCompile ), NULL, this );
100 m_errorsReport->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( PANEL_SETUP_RULES_BASE::OnErrorLinkClicked ), NULL, this );
101}
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnSyntaxHelp(wxHyperlinkEvent &event)
wxStyledTextCtrl * m_textEditor
virtual void OnErrorLinkClicked(wxHtmlLinkEvent &event)
wxHyperlinkCtrl * m_syntaxHelp
WX_HTML_REPORT_BOX * m_errorsReport
virtual void OnContextMenu(wxMouseEvent &event)
wxBitmapButton * m_compileButton
virtual void OnCompile(wxCommandEvent &event)
A slimmed down version of WX_HTML_REPORT_PANEL.
#define _(s)
#define ID_RULES_EDITOR

References _, ID_RULES_EDITOR, m_compileButton, m_errorsReport, m_syntaxHelp, m_textEditor, m_title, m_topMargin, OnCompile(), OnContextMenu(), OnErrorLinkClicked(), and OnSyntaxHelp().

◆ ~PANEL_SETUP_RULES_BASE()

PANEL_SETUP_RULES_BASE::~PANEL_SETUP_RULES_BASE ( )

Definition at line 103 of file panel_setup_rules_base.cpp.

104{
105 // Disconnect Events
106 m_syntaxHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( PANEL_SETUP_RULES_BASE::OnSyntaxHelp ), NULL, this );
107 m_textEditor->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( PANEL_SETUP_RULES_BASE::OnContextMenu ), NULL, this );
108 m_compileButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_RULES_BASE::OnCompile ), NULL, this );
109 m_errorsReport->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( PANEL_SETUP_RULES_BASE::OnErrorLinkClicked ), NULL, this );
110
111}

References m_compileButton, m_errorsReport, m_syntaxHelp, m_textEditor, OnCompile(), OnContextMenu(), OnErrorLinkClicked(), and OnSyntaxHelp().

Member Function Documentation

◆ OnCompile()

virtual void PANEL_SETUP_RULES_BASE::OnCompile ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_SETUP_RULES.

Definition at line 54 of file panel_setup_rules_base.h.

54{ event.Skip(); }

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

◆ OnContextMenu()

virtual void PANEL_SETUP_RULES_BASE::OnContextMenu ( wxMouseEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_SETUP_RULES.

Definition at line 53 of file panel_setup_rules_base.h.

53{ event.Skip(); }

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

◆ OnErrorLinkClicked()

virtual void PANEL_SETUP_RULES_BASE::OnErrorLinkClicked ( wxHtmlLinkEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_SETUP_RULES.

Definition at line 55 of file panel_setup_rules_base.h.

55{ event.Skip(); }

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

◆ OnSyntaxHelp()

virtual void PANEL_SETUP_RULES_BASE::OnSyntaxHelp ( wxHyperlinkEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_SETUP_RULES.

Definition at line 52 of file panel_setup_rules_base.h.

52{ event.Skip(); }

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

Member Data Documentation

◆ m_compileButton

wxBitmapButton* PANEL_SETUP_RULES_BASE::m_compileButton
protected

◆ m_errorsReport

WX_HTML_REPORT_BOX* PANEL_SETUP_RULES_BASE::m_errorsReport
protected

◆ m_syntaxHelp

wxHyperlinkCtrl* PANEL_SETUP_RULES_BASE::m_syntaxHelp
protected

Definition at line 45 of file panel_setup_rules_base.h.

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

◆ m_textEditor

◆ m_title

wxStaticText* PANEL_SETUP_RULES_BASE::m_title
protected

Definition at line 44 of file panel_setup_rules_base.h.

Referenced by PANEL_SETUP_RULES_BASE().

◆ m_topMargin

wxBoxSizer* PANEL_SETUP_RULES_BASE::m_topMargin
protected

Definition at line 46 of file panel_setup_rules_base.h.

Referenced by PANEL_SETUP_RULES_BASE().


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