KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BUTTON_ROW_PANEL Class Reference

A panel that contains buttons, arranged on the left and/or right sides. More...

#include <button_row_panel.h>

Inheritance diagram for BUTTON_ROW_PANEL:

Classes

struct  BTN_DEF
 The information needed to instantiate a button on a BUTTON_ROW_PANEL. More...
 

Public Types

using BTN_CALLBACK = std::function< void(wxCommandEvent &) >
 Callback function definition.
 
using BTN_DEF_LIST = std::vector< BTN_DEF >
 A list of BTN_DEFs, used to group buttons into the left/right groups.
 

Public Member Functions

 BUTTON_ROW_PANEL (wxWindow *aWindow, const BTN_DEF_LIST &aLeftBtns, const BTN_DEF_LIST &aRightBtns)
 Construct a SIMPLE_BUTTON_PANEL with a set of buttons on each side.
 

Private Member Functions

void addButtons (bool aLeft, const BTN_DEF_LIST &aDefs)
 Add a set of buttons to one side of the panel.
 

Private Attributes

wxBoxSizer * m_sizer
 

Detailed Description

A panel that contains buttons, arranged on the left and/or right sides.

Definition at line 40 of file button_row_panel.h.

Member Typedef Documentation

◆ BTN_CALLBACK

using BUTTON_ROW_PANEL::BTN_CALLBACK = std::function< void( wxCommandEvent& ) >

Callback function definition.

A callback of this type can be registered to handle the button click event.

Definition at line 48 of file button_row_panel.h.

◆ BTN_DEF_LIST

A list of BTN_DEFs, used to group buttons into the left/right groups.

Definition at line 81 of file button_row_panel.h.

Constructor & Destructor Documentation

◆ BUTTON_ROW_PANEL()

BUTTON_ROW_PANEL::BUTTON_ROW_PANEL ( wxWindow *  aWindow,
const BTN_DEF_LIST aLeftBtns,
const BTN_DEF_LIST aRightBtns 
)

Construct a SIMPLE_BUTTON_PANEL with a set of buttons on each side.

Parameters
aLeftBtnsbuttons on the left side, from left to right
aRightBtnsbuttons on the right side, from left to right

Definition at line 31 of file button_row_panel.cpp.

References addButtons(), KIUI::GetStdMargin(), and m_sizer.

Member Function Documentation

◆ addButtons()

void BUTTON_ROW_PANEL::addButtons ( bool  aLeft,
const BTN_DEF_LIST aDefs 
)
private

Add a set of buttons to one side of the panel.

Parameters
aSizerthe sizer to add them to
aLeftplace on the left (false for right)
aDefslist of button defs, from left to right

Definition at line 50 of file button_row_panel.cpp.

References KIUI::GetStdMargin(), and m_sizer.

Referenced by BUTTON_ROW_PANEL().

Member Data Documentation

◆ m_sizer

wxBoxSizer* BUTTON_ROW_PANEL::m_sizer
private

Definition at line 104 of file button_row_panel.h.

Referenced by addButtons(), and BUTTON_ROW_PANEL().


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