dabo Commit
Revision 4265
Date: 2008-07-10 12:29:57 -0700 (Thu, 10 Jul 2008)
Author: Nate
Trac: http://svn.dabodev.com/trac/dabo/changeset/4265
Changed:
U trunk/dabo/ui/uiwx/__init__.py
U trunk/dabo/ui/uiwx/dMenuItem.py
Log:
Tracked down and found the errors associated with the dMenu problems I was
having. The main problem was that in the mnxml files, a Caption and Hotkey
would be specified separately, but they would be combined into the Caption
property by createMenuBar and that would cause a slew of problems. In
addition, if you had a Caption w/ a hotkey in it and then specified the hotkey
property, wx would have a conniption fit. I added a check to the Caption
property to raise an error if the Caption has a HotKey in it.
Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py 2008-07-09 20:59:35 UTC (rev 4264)
+++ trunk/dabo/ui/uiwx/__init__.py 2008-07-10 19:29:57 UTC (rev 4265)
@@ -1164,9 +1164,6 @@
hk = itmatts["HotKey"]
pic = itmatts["Picture"]
special = itmatts.get("special", None)
- if hk:
- cap += "\t%s" % hk
- txt = cap
binding = previewFunc
fnc = ""
useFunc = ("Action" in itmatts) and
(itmatts["Action"])
@@ -1179,7 +1176,7 @@
binding = fnc
help = itmatts["HelpText"]
menuItem = menu.append(cap, OnHit=binding,
help=help,
- picture=pic, special=special)
+ picture=pic, special=special,
HotKey=hk)
try:
srcFile = resolvePathAndUpdate(srcFile)
Modified: trunk/dabo/ui/uiwx/dMenuItem.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenuItem.py 2008-07-09 20:59:35 UTC (rev 4264)
+++ trunk/dabo/ui/uiwx/dMenuItem.py 2008-07-10 19:29:57 UTC (rev 4265)
@@ -82,11 +82,14 @@
def _getCaption(self):
- return self._caption
+ return self._caption[:]
def _setCaption(self, val):
if self._constructed():
- self._caption = val
+ if len(val.split("\t")) == 1:
+ self._caption = val
+ else:
+ raise ValueError, "Please put HotKey
combination in HotKey property."
self._redefine()
else:
self._properties["Caption"] = val
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]