dabo Commit
Revision 4332
Date: 2008-08-02 13:05:17 -0700 (Sat, 02 Aug 2008)
Author: Nate
Trac: http://svn.dabodev.com/trac/dabo/changeset/4332

Changed:
U   trunk/dabo/ui/uiwx/__init__.py

Log:
Added menu item type support to the mnxml processing.  Attribute in mnxml is 
MenuType.  Defaults to "" when attribute is not present, so the change is 
backwards compatible.

Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2008-08-02 14:55:02 UTC (rev 4331)
+++ trunk/dabo/ui/uiwx/__init__.py      2008-08-02 20:05:17 UTC (rev 4332)
@@ -987,16 +987,40 @@
                        expanded += argSp
                args = expanded
                arglist = []
-               fileDict = dabo.file_extensions
-               fileDict.update(dabo.custom_extensions)
-               tmplt = "%s (*.%s)|*.%s"
-               normArgs = list(set([arg.lower() for arg in args]))
-               for ftype in normArgs:
-                       try:
-                               fDesc = fileDict[ftype.lower()]
-                       except KeyError:
-                               fDesc = "%s Files" % ftype.upper()
-                       arglist.append(tmplt % (fDesc, ftype, ftype))
+               tmplt = "%s Files (*.%s)|*.%s"
+               fileDict = {"html" : "HTML",
+                       "xml" : "XML",
+                       "txt" : "Text",
+                       "jpg" : "JPEG",
+                       "gif" : "GIF",
+                       "tif" : "TIFF",
+                       "tiff" : "TIFF",
+                       "png" : "PNG",
+                       "ico" : "Icon",
+                       "bmp" : "Bitmap" }
+
+               for a in args:
+                       descrp = ext = ""
+                       if a == "py":
+                               fDesc = "Python Scripts (*.py)|*.py"
+                       elif a == "*":
+                               fDesc = "All Files (*)|*"
+                       elif a == "fsxml":
+                               fDesc = "Dabo FieldSpec Files (*.fsxml)|*.fsxml"
+                       elif a == "cnxml":
+                               fDesc = "Dabo Connection Files 
(*.cnxml)|*.cnxml"
+                       elif a == "rfxml":
+                               fDesc = "Dabo Report Format Files 
(*.rfxml)|*.rfxml"
+                       elif a == "cdxml":
+                               fDesc = "Dabo Class Designer Files 
(*.cdxml)|*.cdxml"
+                       elif a == "mnxml":
+                               fDesc = "Dabo Menu Designer Files 
(*.mnxml)|*.mnxml"
+                       else:
+                               if a in fileDict:
+                                       fDesc = tmplt % (fileDict[a], a, a)
+                               else:
+                                       fDesc = "%s files (*.%s)|*.%s" % 
(a.upper(), a, a)
+                       arglist.append(fDesc)
                ret = "|".join(arglist)
        return ret
 
@@ -1147,9 +1171,10 @@
                                                binding = eval(fnc)
                                        except NameError:
                                                binding = fnc
+                               type = menu._extractKey(itmatts, "MenuType", "")
                                help = menu._extractKey(itmatts, "HelpText")
                                menuItem = menu.append(cap, OnHit=binding, 
help=help,
-                                               picture=pic, special=special, 
HotKey=hk)
+                                               picture=pic, special=special, 
HotKey=hk, menutype=type)
                                if itmatts:
                                        menuItem.setPropertiesFromAtts(itmatts, 
                                                        context={"form": form, 
"app": dabo.dAppRef})




_______________________________________________
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]

Reply via email to