KiCad PCB EDA Suite
Loading...
Searching...
No Matches
button_row_panel.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KICAD, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include "wx/panel.h"
23
24
#include <vector>
25
#include <functional>
26
27
28
// Forward defs for private-only classes
29
class
wxBoxSizer;
30
31
35
class
BUTTON_ROW_PANEL
:
public
wxPanel
36
{
37
public
:
38
43
using
BTN_CALLBACK
= std::function< void( wxCommandEvent& ) >;
44
48
struct
BTN_DEF
49
{
54
wxWindowID
m_id
;
55
59
wxString
m_text
;
60
64
wxString
m_tooltip
;
65
70
BTN_CALLBACK
m_callback
;
71
};
72
76
using
BTN_DEF_LIST
= std::vector<BTN_DEF>;
77
84
BUTTON_ROW_PANEL
( wxWindow* aWindow,
const
BTN_DEF_LIST
& aLeftBtns,
const
BTN_DEF_LIST
& aRightBtns );
85
86
private
:
94
void
addButtons
(
bool
aLeft,
const
BTN_DEF_LIST
& aDefs );
95
96
private
:
97
wxBoxSizer*
m_sizer
;
98
};
BUTTON_ROW_PANEL::m_sizer
wxBoxSizer * m_sizer
Definition
button_row_panel.h:97
BUTTON_ROW_PANEL::BTN_CALLBACK
std::function< void(wxCommandEvent &) > BTN_CALLBACK
Callback function definition.
Definition
button_row_panel.h:43
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.
Definition
button_row_panel.cpp:27
BUTTON_ROW_PANEL::addButtons
void addButtons(bool aLeft, const BTN_DEF_LIST &aDefs)
Add a set of buttons to one side of the panel.
Definition
button_row_panel.cpp:45
BUTTON_ROW_PANEL::BTN_DEF_LIST
std::vector< BTN_DEF > BTN_DEF_LIST
A list of BTN_DEFs, used to group buttons into the left/right groups.
Definition
button_row_panel.h:76
BUTTON_ROW_PANEL::BTN_DEF
The information needed to instantiate a button on a BUTTON_ROW_PANEL.
Definition
button_row_panel.h:49
BUTTON_ROW_PANEL::BTN_DEF::m_tooltip
wxString m_tooltip
Button tooltip text - empty string for no tooltip.
Definition
button_row_panel.h:64
BUTTON_ROW_PANEL::BTN_DEF::m_id
wxWindowID m_id
The button ID.
Definition
button_row_panel.h:54
BUTTON_ROW_PANEL::BTN_DEF::m_text
wxString m_text
The button display text.
Definition
button_row_panel.h:59
BUTTON_ROW_PANEL::BTN_DEF::m_callback
BTN_CALLBACK m_callback
The callback fired when the button is clicked.
Definition
button_row_panel.h:70
src
include
widgets
button_row_panel.h
Generated on Fri Jun 26 2026 00:05:37 for KiCad PCB EDA Suite by
1.13.2