GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
MainMenu.h
Go to the documentation of this file.
1#line 2 "src/Gui/MainMenu.h"
2
3#ifndef __GUI_MAINMENU_H___
4#define __GUI_MAINMENU_H___
5
6#include <Wt/WMenu.h>
7
8namespace GCW {
9 namespace Gui {
10 class MainWidget;
11
12/*!
13** \brief Site Main Menu
14**
15** This is the main menu for the whole site. This is the menu that has the
16** "File", "Edit", "View" menu item, right at the top of the page.
17**
18*/
20: public Wt::WMenu
21{
22 public:
23
24 MainMenu( MainWidget * _mainWidget );
25
26 /*!
27 ** \brief Find Menu Item
28 **
29 ** This will find a menu item by text() value.
30 **
31 ** This is a recursive function, and it will loop through all the menu
32 ** items until it finds a match by text. Since the menu items are also
33 ** language translations, in order to find the correct menu item, make
34 ** the call using the language translation strings, as follows;
35 **
36 ** \code
37 ** if( auto item = menu-> menuItem( TR( "gcw.MainWidget.mu.view.doubleline" ), this ) )
38 ** {
39 ** std::cout << __FILE__ << ":" << __LINE__ << " " << item-> text() << std::endl;
40 ** }
41 ** \endcode
42 **
43 */
44 auto menuItem( const Wt::WString & _text )-> Wt::WMenuItem * ;
45
46 private:
47
48 /*
49 ** internal recursive search
50 */
51 auto menuItem( const Wt::WString & _text, Wt::WMenu * _menu )-> Wt::WMenuItem * ;
52
53}; // endclass MainMenu
54
55 } // endnamespace Gui {
56} // endnamespace GCW {
57
58#endif // #ifndef __GUI_MAINMENU_H___
59
60
61
Site Main Menu.
Definition MainMenu.h:21
auto menuItem(const Wt::WString &_text) -> Wt::WMenuItem *
Find Menu Item.
Definition MainMenu.cpp:390
Site Main Widget.
Definition MainWidget.h:32
Definition App.h:18