Author: dmeyer
Date: Sat Apr 29 10:15:16 2006
New Revision: 8156
Modified:
trunk/ui/src/menu/menu.py
trunk/ui/src/menu/stack.py
Log:
keep track of menu changes
Modified: trunk/ui/src/menu/menu.py
==============================================================================
--- trunk/ui/src/menu/menu.py (original)
+++ trunk/ui/src/menu/menu.py Sat Apr 29 10:15:16 2006
@@ -50,6 +50,8 @@
the selected item or the internal choices directly, use 'select',
'set_items' or 'change_item' to do this.
"""
+ next_id = 0
+
def __init__(self, heading, choices=[], theme=None,
reload_func = None, item_types = None,
force_skin_layout = -1):
@@ -57,6 +59,14 @@
self.heading = heading
self.stack = None
+ # unique id of the menu object
+ Menu.next_id += 1
+ self.id = Menu.next_id
+ # state, will increase on every item change
+ self.state = 0
+ # position in the menu stack
+ self.pos = -1
+
# set items
self.choices = []
self.selected = None
@@ -118,6 +128,9 @@
Set/replace the items in this menu. If refresh is True, the menu
stack will be refreshed and redrawn.
"""
+ # increase state variable
+ self.state += 1
+
# delete ref to menu for old choices
for c in self.choices:
c.menu = None
@@ -207,6 +220,10 @@
"""
Replace the item 'old' with the 'new'.
"""
+ # increase state variable
+ self.state += 1
+
+ # change item
self.choices[self.choices.index(old)] = new
if self.selected == old:
self.select(new)
Modified: trunk/ui/src/menu/stack.py
==============================================================================
--- trunk/ui/src/menu/stack.py (original)
+++ trunk/ui/src/menu/stack.py Sat Apr 29 10:15:16 2006
@@ -150,7 +150,10 @@
self.inside_menu = True
previous.inside_menu = True
+ # set menu.pos and append
+ menu.pos = len(self.menustack)
self.menustack.append(menu)
+
# Check the new menu. Maybe we need to set 'inside_menu' if we
# switch between MenuApplication(s) and also set a new theme
# for the global Freevo look
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog