FlightGear next
FGNasalMenuBar.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: NasalMenuBar.hxx
3 * SPDX-FileComment: XML-configured menu bar
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 * SPDX-FileCopyrightText: Copyright (C) 2023 James Turner
6 */
7
8#pragma once
9
10#include <GUI/menubar.hxx>
11
12// std
13#include <memory>
14#include <string>
15#include <vector>
16
17// SimGear
18#include <simgear/nasal/cppbind/NasalHash.hxx>
19#include <simgear/props/propsfwd.hxx>
20
21
31{
32public:
37 virtual ~FGNasalMenuBar() = default;
38
39
43 void init() override;
44
45 void postinit() override;
46
50 void show() override;
51
52
56 void hide() override;
57
58
62 bool isVisible() const override;
63
64 void setHideIfOverlapsWindow(bool hide) override;
65
66 bool getHideIfOverlapsWindow() const override;
67
68
69 static void setupGhosts(nasal::Hash& compatModule);
70
71
72private:
73 void recomputeVisibility();
74
75 void configure(SGPropertyNode_ptr config);
76
77
79 std::shared_ptr<NasalMenuBarPrivate> _d;
80};
void hide() override
Make the menu bar invisible.
void show() override
Make the menu bar visible.
FGNasalMenuBar()
Constructor.
void setHideIfOverlapsWindow(bool hide) override
Request the menubar to be hidden if its display overlays the main window content.
virtual ~FGNasalMenuBar()=default
static void setupGhosts(nasal::Hash &compatModule)
bool isVisible() const override
Test whether the menu bar is visible.
void init() override
Initialize the menu bar from $FG_ROOT/gui/menubar.xml.
bool getHideIfOverlapsWindow() const override
void postinit() override