The ZX Ecosystem v5.1.0;_GUI_v3.1.0
Loading...
Searching...
No Matches
ZXWidgetMenuBar.h
Go to the documentation of this file.
1
2/* **************************************************************************/
19#ifndef ZXWIDGET_MENUBAR
20#define ZXWIDGET_MENUBAR
21
22#include <vector>
26
27
28namespace zxeco
29{
30
31namespace gui
32{
33
34
35/*******************************************************************************
36*
37* Class: MenuBarWidget
38*
39*******************************************************************************/
40
42
44{
45 public:
46
47 MenuBarWidget(ID id, const std::string & name,
48 const LabelTree & menuses, bool extend = true,
49 const std::string & tooltiptext = "",
50 HorAlign hal = HorAlign::LEFT,
51 VertAlign val = VertAlign::TOP);
53
62 size_t lastSelected(void) const noexcept;
64
70
74 const char * className(void) const noexcept { return("MenuBarWidget"); }
75 const AreaFitting & calcFittingNeeds(const CharArea & area);
76
77
78 private:
79
80 static const Widget::ID kFirstElemID;
81
82 const bool extend_;
83 const size_t origtreesize_;
84 std::vector<LabelList::Indexes> indexmaps_;
85 std::vector<ComboBoxWidget *> barelems_;
86};
87
88
89
90} // end namespace gui
91} // end namespace zxeco
92
93#endif
94 // ZXWidgetMenuBar
96
97
98
A tree of labels based on LabelList.
Definition: ZXGUIGeneral.h:720
HorAlign
Horizontal alignment of widgets within the areas of their containers.
VertAlign
Vertical alignment of widgets within the areas of their containers.
A container of other widgets.
int ID
A numeric ID associated to the widget.
Definition: ZXWidgetsBase.h:67
Information about the fitting of widgets drawings into rectangular areas.
const AreaFitting & calcFittingNeeds(const CharArea &area)
Must calculate the widget fitting within the dimensions of AREA.
void clearLastSelected(void)
Clear the last selected element.
size_t lastSelected(void) const noexcept
Return the index in the original tree of the last element selected.
MenuBarWidget(ID id, const std::string &name, const LabelTree &menuses, bool extend=true, const std::string &tooltiptext="", HorAlign hal=HorAlign::LEFT, VertAlign val=VertAlign::TOP)
Constructor.
const char * className(void) const noexcept
Must return a text with the name of the class.
A widget to show a horizontal menu bar with a menu in each element.
The main namespace of the library, that spans across all the zx modules.
Definition: ZXChars.h:31