KiCad PCB EDA Suite
WX_PANEL Class Reference

#include <wx_panel.h>

Inheritance diagram for WX_PANEL:
APPEARANCE_CONTROLS_BASE HIERARCHY_PANE PANEL_SELECTION_FILTER_BASE APPEARANCE_CONTROLS PANEL_SELECTION_FILTER

Public Member Functions

 WX_PANEL (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~WX_PANEL ()
 
void SetBorders (bool aLeft, bool aRight, bool aTop, bool aBottom)
 

Private Member Functions

void OnPaint (wxPaintEvent &event)
 

Private Attributes

bool m_leftBorder
 
bool m_rightBorder
 
bool m_topBorder
 
bool m_bottomBorder
 

Detailed Description

Definition at line 29 of file wx_panel.h.

Constructor & Destructor Documentation

◆ WX_PANEL()

WX_PANEL::WX_PANEL ( 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 29 of file wx_panel.cpp.

30 :
31 wxPanel( parent, id, pos, size, style, name ),
32 m_leftBorder( false ),
33 m_rightBorder( false ),
34 m_topBorder( false ),
35 m_bottomBorder( false )
36{
37 this->Connect( wxEVT_PAINT, wxPaintEventHandler( WX_PANEL::OnPaint ) );
38}
const char * name
Definition: DXF_plotter.cpp:56
bool m_topBorder
Definition: wx_panel.h:52
bool m_rightBorder
Definition: wx_panel.h:51
bool m_leftBorder
Definition: wx_panel.h:50
bool m_bottomBorder
Definition: wx_panel.h:53
void OnPaint(wxPaintEvent &event)
Definition: wx_panel.cpp:47

References OnPaint().

◆ ~WX_PANEL()

WX_PANEL::~WX_PANEL ( )

Definition at line 41 of file wx_panel.cpp.

42{
43 this->Disconnect( wxEVT_PAINT, wxPaintEventHandler( WX_PANEL::OnPaint ) );
44}

References OnPaint().

Member Function Documentation

◆ OnPaint()

void WX_PANEL::OnPaint ( wxPaintEvent &  event)
private

Definition at line 47 of file wx_panel.cpp.

48{
49 wxRect rect( wxPoint( 0, 0 ), GetClientSize() );
50 wxPaintDC dc( this );
51
52 KIGFX::COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
53 KIGFX::COLOR4D fg = wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER );
54 KIGFX::COLOR4D border = fg.Mix( bg, 0.18 );
55 dc.SetPen( wxPen( border.ToColour(), 1 ) );
56
57 if( m_leftBorder )
58 dc.DrawLine( rect.GetLeft(), rect.GetTop(), rect.GetLeft(), rect.GetBottom() );
59
60 if( m_rightBorder )
61 dc.DrawLine( rect.GetRight(), rect.GetTop(), rect.GetRight(), rect.GetBottom() );
62
63 if( m_topBorder )
64 dc.DrawLine( rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetTop() );
65
66 if( m_bottomBorder )
67 dc.DrawLine( rect.GetLeft(), rect.GetBottom(), rect.GetRight(), rect.GetBottom() );
68}
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:102
wxColour ToColour() const
Definition: color4d.cpp:219
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition: color4d.h:293

References m_bottomBorder, m_leftBorder, m_rightBorder, m_topBorder, KIGFX::COLOR4D::Mix(), and KIGFX::COLOR4D::ToColour().

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

◆ SetBorders()

Member Data Documentation

◆ m_bottomBorder

bool WX_PANEL::m_bottomBorder
private

Definition at line 53 of file wx_panel.h.

Referenced by OnPaint(), and SetBorders().

◆ m_leftBorder

bool WX_PANEL::m_leftBorder
private

Definition at line 50 of file wx_panel.h.

Referenced by OnPaint(), and SetBorders().

◆ m_rightBorder

bool WX_PANEL::m_rightBorder
private

Definition at line 51 of file wx_panel.h.

Referenced by OnPaint(), and SetBorders().

◆ m_topBorder

bool WX_PANEL::m_topBorder
private

Definition at line 52 of file wx_panel.h.

Referenced by OnPaint(), and SetBorders().


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