xref: /haiku/src/tests/kits/interface/menu/menuworld/MenuWindow.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 //--------------------------------------------------------------------
2 //
3 //	MenuWindow.h
4 //
5 //	Written by: Owen Smith
6 //
7 //--------------------------------------------------------------------
8 
9 /*
10 	Copyright 1999, Be Incorporated.   All Rights Reserved.
11 	This file may be used under the terms of the Be Sample Code License.
12 */
13 
14 #ifndef _MenuWindow_h
15 #define _MenuWindow_h
16 
17 #include <Message.h>
18 
19 #include <Window.h>
20 #include "TestMenuBuilder.h"
21 
22 class MenuView;
23 class BButton;
24 class BListItem;
25 class BOutlineListView;
26 class BStringView;
27 class BTextControl;
28 
29 //====================================================================
30 //	CLASS: MenuWindow
31 
32 class MenuWindow : public BWindow
33 {
34 	//----------------------------------------------------------------
35 	//	Constructors, destructors, operators
36 
37 public:
38 					MenuWindow(const char* name);
39 
40 
41 	//----------------------------------------------------------------
42 	//	Virtual member function overrides
43 
44 public:
45 	void			MenusBeginning(void);
46 	void			MessageReceived(BMessage* message);
47 	bool			QuitRequested(void);
48 
49 
50 	//----------------------------------------------------------------
51 	//	Operations
52 
53 public:
54 	void			UpdateStatus(const char* str1 = NULL,
55 						const char* str2 = NULL);
56 
57 
58 	//----------------------------------------------------------------
59 	//	Message handlers
60 
61 private:
62 	void			AddMenu(BMessage* message);
63 	void			DeleteMenu(BMessage* message);
64 	void			TestMenu(BMessage* message);
65 	void			UserMenu(BMessage* message);
66 	void			ToggleUserMenus(BMessage* message);
67 	void			ToggleTestIcons(BMessage* message);
68 
69 
70 	//----------------------------------------------------------------
71 	//	Implementation member functions
72 
73 private:
74 	bool			Valid(void) const;
75 	BMenu*			BuildFileMenu(void) const;
76 	void			ReplaceTestMenu(BMenuBar* pMenuBar, icon_size size);
77 
78 	//----------------------------------------------------------------
79 	//	Member variables
80 
81 private:
82 	BMenuBar* 			m_pFullMenuBar;
83 	BMenuBar*			m_pHiddenMenuBar;
84 	bool				m_bUsingFullMenuBar;
85 	BStringView*		m_pStatusView;
86 	MenuView*			m_pMenuView;
87 	TestMenuBuilder		m_testMenuBuilder;
88 };
89 
90 #endif /* _MenuWindow_h */
91