Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MenuView.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: MenuView.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  View class for displaying right-click context menus
13 */
14 
15 #ifndef MenuView_h
16 #define MenuView_h
17 
18 #include "Types.h"
19 #include "View.h"
20 #include "Bitmap.h"
21 #include "Font.h"
22 #include "Text.h"
23 
24 // +--------------------------------------------------------------------+
25 
26 class Menu;
27 class MenuItem;
28 
29 // +--------------------------------------------------------------------+
30 
31 class MenuView : public View
32 {
33 public:
34  MenuView(Window* c);
35  virtual ~MenuView();
36 
37  // Operations:
38  virtual void Refresh();
39  virtual void OnWindowMove();
40  virtual void DoMouseFrame();
41  virtual void DrawMenu();
42  virtual void DrawMenu(int x, int y, Menu* menu);
43  virtual int ProcessMenuItem();
44  virtual void ClearMenuSelection(Menu* menu);
45 
46  virtual bool IsShown() { return show_menu != 0; }
47  virtual int GetAction() { return action; }
48  virtual Menu* GetMenu() { return menu; }
49  virtual void SetMenu(Menu* m) { menu = m; }
50  virtual MenuItem* GetMenuItem() { return menu_item; }
51 
52  virtual Color GetBackColor() { return back_color; }
53  virtual void SetBackColor(Color c) { back_color = c; }
54  virtual Color GetTextColor() { return text_color; }
55  virtual void SetTextColor(Color c) { text_color = c; }
56 
57 protected:
58  int width, height;
59 
63  int show_menu;
64  POINT right_start;
65  POINT offset;
66 
67  int action;
71 
74 };
75 
76 #endif MenuView_h
77