From 8898ad9b25fca6afe2374d293a981db02a83d7e9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 31 May 2012 14:46:27 +0000 Subject: Committing the documentation to svn to have it accessible online --- Doc/doxygen/html/_menu_8cpp_source.html | 260 ++++++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 Doc/doxygen/html/_menu_8cpp_source.html (limited to 'Doc/doxygen/html/_menu_8cpp_source.html') diff --git a/Doc/doxygen/html/_menu_8cpp_source.html b/Doc/doxygen/html/_menu_8cpp_source.html new file mode 100644 index 0000000..623e8b3 --- /dev/null +++ b/Doc/doxygen/html/_menu_8cpp_source.html @@ -0,0 +1,260 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/nGenEx/Menu.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
Menu.cpp
+
+
+Go to the documentation of this file.
1 /* Project nGenEx
+
2  Destroyer Studios LLC
+
3  Copyright © 1997-2004. All Rights Reserved.
+
4 
+
5  SUBSYSTEM: nGenEx.lib
+
6  FILE: Menu.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Simple menu hierarchy class
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "Menu.h"
+
17 
+
18 // +--------------------------------------------------------------------+
+
19 
+
20 void
+
21 Menu::AddItem(Text label, DWORD value, bool enabled)
+
22 {
+
23  MenuItem* item = new(__FILE__,__LINE__) MenuItem(label, value, enabled);
+
24 
+
25  if (item) {
+
26  item->menu = this;
+
27  items.append(item);
+
28  }
+
29 }
+
30 
+
31 void
+ +
33 {
+
34  if (item->submenu)
+
35  item->submenu->SetParent(this);
+
36  item->menu = this;
+
37  items.append(item);
+
38 }
+
39 
+
40 void
+
41 Menu::AddMenu(Text label, Menu* menu, DWORD value)
+
42 {
+
43  MenuItem* item = new(__FILE__,__LINE__) MenuItem(label, value);
+
44 
+
45  if (item) {
+
46  item->menu = this;
+
47  item->submenu = menu;
+
48  menu->parent = this;
+
49 
+
50  items.append(item);
+
51  }
+
52 }
+
53 
+
54 MenuItem*
+
55 Menu::GetItem(int index)
+
56 {
+
57  if (index >= 0 && index < items.size())
+
58  return items[index];
+
59 
+
60  return 0;
+
61 }
+
62 
+
63 void
+
64 Menu::SetItem(int index, MenuItem* item)
+
65 {
+
66  if (item && index >= 0 && index < items.size())
+
67  items[index] = item;
+
68 }
+
69 
+
70 int
+ +
72 {
+
73  return items.size();
+
74 }
+
75 
+
76 void
+ +
78 {
+
79  items.destroy();
+
80 }
+
81 
+
82 
+
83 // +--------------------------------------------------------------------+
+
84 
+
85 MenuItem::MenuItem(Text label, DWORD value, bool e)
+
86 : text(label), data(value), enabled(e), submenu(0), selected(0)
+
87 { }
+
88 
+ +
90 { }
+
91 
+
92 // +--------------------------------------------------------------------+
+
93 
+
94 Menu*
+ +
96 {
+
97  int n = history.size();
+
98 
+
99  if (n)
+
100  return history[n-1];
+
101 
+
102  return 0;
+
103 }
+
104 
+
105 Menu*
+ +
107 {
+
108  if (n >= 0 && n < history.size())
+
109  return history[n];
+
110 
+
111  return 0;
+
112 }
+
113 
+
114 Menu*
+
115 MenuHistory::Find(const char* title)
+
116 {
+
117  for (int i = 0; i < history.size(); i++)
+
118  if (history[i]->GetTitle() == title)
+
119  return history[i];
+
120 
+
121  return 0;
+
122 }
+
123 
+
124 void
+ +
126 {
+
127  int n = history.size();
+
128 
+
129  if (n)
+
130  history.removeIndex(n-1);
+
131 }
+
132 
+
133 void
+ +
135 {
+
136  history.append(menu);
+
137 }
+
138 
+
139 void
+ +
141 {
+
142  history.clear();
+
143 }
+
+
+ + + + -- cgit v1.1