summaryrefslogtreecommitdiff
path: root/lib/widgets.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/widgets.cc')
-rw-r--r--lib/widgets.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/widgets.cc b/lib/widgets.cc
index 3298385..9d62bd9 100644
--- a/lib/widgets.cc
+++ b/lib/widgets.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: widgets.cc,v 1.7 2004-07-16 15:04:53 pixel Exp $ */
+/* $Id: widgets.cc,v 1.8 2004-07-17 10:08:16 pixel Exp $ */
#include <SDL.h>
#include <vector>
@@ -900,11 +900,10 @@ bool mogltk::widgets::ContextMenu::process_event(int xe, int ye, mogltk::event_t
action * a;
int n;
- selected = -1;
-
switch (event) {
case E_MOUSE_MOVE:
sticky = false;
+ selected = -1;
for (i = nodes.begin(), n = 0; i != nodes.end(); i++, n++) {
if (!i->GetLine()) {
int ax, ax2, ay, ay2;
@@ -985,6 +984,10 @@ String mogltk::widgets::Menu::node::GetCaption() {
return caption;
}
+void mogltk::widgets::Menu::node::SetCaption(const String & s) {
+ caption = s;
+}
+
mogltk::widgets::ContextMenu * mogltk::widgets::Menu::node::GetSub() {
return sub;
}
@@ -1037,6 +1040,10 @@ void mogltk::widgets::Menu::SetEnabled(int i, bool e) {
nodes[i].SetEnabled(e);
}
+void mogltk::widgets::Menu::SetCaption(int i, const String & s) {
+ nodes[i].SetCaption(s);
+}
+
void mogltk::widgets::Menu::draw(void) {
std::vector<node>::iterator i;
int n;