[GRASS-SVN] r29671 - grass/trunk/gui/wxpython
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 11 15:47:06 EST 2008
Author: martinl
Date: 2008-01-11 15:47:06 -0500 (Fri, 11 Jan 2008)
New Revision: 29671
Modified:
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: Fix bug #17, gui function v.in.ogr form not consistent with other wx gui forms
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2008-01-11 20:45:31 UTC (rev 29670)
+++ grass/trunk/gui/wxpython/wxgui.py 2008-01-11 20:47:06 UTC (rev 29671)
@@ -80,8 +80,6 @@
from gui_modules.debug import Debug as Debug
from icons.icon import Icons as Icons
-menucmd = {}
-
class GMFrame(wx.Frame):
"""
GIS Manager frame with notebook widget for controlling
@@ -102,6 +100,14 @@
self._auimgr = wx.aui.AuiManager(self)
+ # initialize variables
+ self.disp_idx = 0 # index value for map displays and layer trees
+ self.curr_page = '' # currently selected page for layer tree notebook
+ self.curr_pagenum = '' # currently selected page number for layer tree notebook
+ self.encoding = 'ISO-8859-1' # default encoding for display fonts
+ self.workspaceFile = workspace # workspace file
+ self.menucmd = {} # menuId / cmd
+
# creating widgets
# -> self.notebook, self.goutput, self.outpage
self.notebook = self.__createNoteBook()
@@ -113,13 +119,6 @@
# set environmental variables
os.environ["GRASS_RENDER_IMMEDIATE"] = "TRUE"
- # initialize variables
- self.disp_idx = 0 # index value for map displays and layer trees
- self.curr_page = '' # currently selected page for layer tree notebook
- self.curr_pagenum = '' # currently selected page number for layer tree notebook
- self.encoding = 'ISO-8859-1' # default encoding for display fonts
- self.workspaceFile = workspace # workspace file
-
# bindings
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
self.Bind(wx.EVT_LEFT_DOWN, self.AddRaster, self.notebook)
@@ -242,10 +241,13 @@
helpString = gcmd + ' (' + help + ')'
else:
helpString = help
+
menuItem = menu.Append(wx.ID_ANY, label, helpString, kind)
- if label:
- menucmd[label] = gcmd
+
+ self.menucmd[menuItem.GetId()] = gcmd
+
rhandler = eval(handler)
+
self.Bind(wx.EVT_MENU, rhandler, menuItem)
def __createNoteBook(self):
@@ -395,9 +397,7 @@
Return command as a list"""
- menuitem = self.menubar.FindItemById(event.GetId())
- itemtext = menuitem.GetText()
- cmd = menucmd[itemtext]
+ cmd = self.menucmd[event.GetId()]
try:
cmdlist = cmd.split(' ')
except: # already list?
More information about the grass-commit
mailing list