KiCad PCB EDA Suite
Loading...
Searching...
No Matches
tool_menu.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
#ifndef TOOLS_TOOL_MENU__H_
21
#define TOOLS_TOOL_MENU__H_
22
23
#include <
tool/conditional_menu.h
>
24
25
#include <vector>
26
#include <memory>
27
28
class
ACTION_MENU
;
29
class
TOOL_INTERACTIVE
;
30
38
class
TOOL_MENU
39
{
40
public
:
41
49
TOOL_MENU
(
TOOL_INTERACTIVE
& aTool );
50
54
~TOOL_MENU
();
55
60
CONDITIONAL_MENU
&
GetMenu
();
61
71
void
RegisterSubMenu
( std::shared_ptr<ACTION_MENU> aSubMenu );
72
76
std::vector<std::shared_ptr<ACTION_MENU> >&
GetSubMenus
()
77
{
78
return
m_subMenus
;
79
}
80
89
void
ShowContextMenu
(
SELECTION
& aSelection );
90
95
void
ShowContextMenu
();
96
97
private
:
101
CONDITIONAL_MENU
m_menu
;
102
106
TOOL_INTERACTIVE
&
m_tool
;
107
111
std::vector<std::shared_ptr<ACTION_MENU> >
m_subMenus
;
112
};
113
114
#endif
// TOOLS_TOOL_MENU__H_
ACTION_MENU
Define the structure of a menu based on ACTIONs.
Definition
action_menu.h:43
CONDITIONAL_MENU
Definition
conditional_menu.h:38
SELECTION
Definition
selection.h:35
TOOL_INTERACTIVE
Definition
tool_interactive.h:53
TOOL_MENU::GetMenu
CONDITIONAL_MENU & GetMenu()
Definition
tool_menu.cpp:40
TOOL_MENU::m_tool
TOOL_INTERACTIVE & m_tool
The tool that owns this menu.
Definition
tool_menu.h:106
TOOL_MENU::RegisterSubMenu
void RegisterSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Store a submenu of this menu model.
Definition
tool_menu.cpp:46
TOOL_MENU::ShowContextMenu
void ShowContextMenu()
Helper function to show a context menu without any selection for tools that can't make selections.
Definition
tool_menu.cpp:62
TOOL_MENU::~TOOL_MENU
~TOOL_MENU()
Destruct any submenus created with TOOL_MENU::CreateSubMenu().
Definition
tool_menu.cpp:35
TOOL_MENU::TOOL_MENU
TOOL_MENU(TOOL_INTERACTIVE &aTool)
Construct a new TOOL_MENU for a specific tool.
Definition
tool_menu.cpp:28
TOOL_MENU::m_subMenus
std::vector< std::shared_ptr< ACTION_MENU > > m_subMenus
Lifetime-managing container of submenus.
Definition
tool_menu.h:111
TOOL_MENU::m_menu
CONDITIONAL_MENU m_menu
The conditional menu displayed by the tool.
Definition
tool_menu.h:101
TOOL_MENU::GetSubMenus
std::vector< std::shared_ptr< ACTION_MENU > > & GetSubMenus()
Definition
tool_menu.h:76
conditional_menu.h
src
include
tool
tool_menu.h
Generated on Fri Jun 26 2026 00:05:37 for KiCad PCB EDA Suite by
1.13.2