[GRASS-SVN] r39720 - grass-addons/gui/wxpython/data_catalog

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 13 13:15:52 EST 2009


Author: rashadkm
Date: 2009-11-13 13:15:51 -0500 (Fri, 13 Nov 2009)
New Revision: 39720

Modified:
   grass-addons/gui/wxpython/data_catalog/catalog.py
Log:
s

Modified: grass-addons/gui/wxpython/data_catalog/catalog.py
===================================================================
--- grass-addons/gui/wxpython/data_catalog/catalog.py	2009-11-13 17:50:35 UTC (rev 39719)
+++ grass-addons/gui/wxpython/data_catalog/catalog.py	2009-11-13 18:15:51 UTC (rev 39720)
@@ -55,8 +55,6 @@
 		self.ID_REN= wx.NewId()
 		self.ID_COPY = wx.NewId()
 		self.ID_DEL = wx.NewId()
-		self.ID_EXPAND = wx.NewId()
-		self.ID_COLLAPSE = wx.NewId()
 
 		acel = wx.AcceleratorTable([ 
 				(wx.ACCEL_CTRL,  ord('R'), self.ID_REN ) ,
@@ -78,10 +76,21 @@
 		#populate location combobox
 		self.loclist = self.GetLocations()
 
+		#setting splitter window
+		self.win = wx.SplitterWindow(self)
+		self.pLeft = wx.Panel(self.win, style=wx.SUNKEN_BORDER)
+		self.pRight = wx.Panel(self.win, style=wx.SUNKEN_BORDER)
+		self.cmbPanel = wx.Panel(self)
+		self.pRight.SetBackgroundColour("white")
+		self.pLeft.Hide()
+		self.pRight.Hide()
+		self.win.Initialize(self.pLeft)
+		self.win.SplitVertically(self.pLeft, self.pRight, 310)
+
+
 		#creating controls
 		self.mInfo = wx.TextCtrl(self.pRight, wx.ID_ANY, style = wx.TE_MULTILINE|wx.HSCROLL|wx.TE_READONLY)
-		self.chkInfo = wx.CheckBox(self.cmbPanel, wx.ID_ANY,"Display Info", wx.DefaultPosition, wx.DefaultSize)
-		self.treeExpand = wx.CheckBox(self.cmbPanel, wx.ID_ANY,"Expand All", wx.DefaultPosition, wx.DefaultSize)
+		self.chkInfo = wx.CheckBox(self.cmbPanel, wx.ID_ANY,"display Info", wx.DefaultPosition, wx.DefaultSize)
 		self.lbLocation = wx.StaticText(self.cmbPanel, wx.ID_ANY, "Location")
 		self.lbMapset = wx.StaticText(self.cmbPanel, wx.ID_ANY, "Mapset")
 		self.cmbLocation = wx.ComboBox(self.cmbPanel, value = "Select Location",size=wx.DefaultSize, choices=self.loclist)
@@ -97,7 +106,6 @@
 
 		#By default v/r.info will be displayed
 		self.chkInfo.SetValue(True) 
-		self.treeExpand.SetValue(False)
 
 		#apply bindings and setting layouts
 		self.doBindings()
@@ -113,12 +121,6 @@
 			self.viewInfo = False
 			self.mInfo.Hide()
 
-	def OnToggleExpand(self,event):  
-		if self.tree and self.treeExpand.GetValue() == True:
-		  self.tree.ExpandAll()
-		else: 
-		  self.tree.CollapseAll()
-
 	def OnBeginRename(self,event):
 
 	    item = self.tree.GetItemText(event.GetItem())
@@ -162,9 +164,6 @@
 			self.tree.PopupMenu(self.popupmenu)
 
 
-
-
-
 	def OnCopy( self,event ):
         #print "copy"
 		item =  self.tree.GetSelection()
@@ -312,9 +311,10 @@
 		self.gisrc['LOCATION_NAME'] = str(self.cmbLocation.GetValue())
 		self.gisrc['MAPSET'] = str(self.cmbMapset.GetValue())
 		self.update_grassrc(self.gisrc)
+		gcmd.RunCommand("g.gisenv", set = "LOCATION_NAME=%s" % str(self.cmbLocation.GetValue()))
+		gcmd.RunCommand("g.gisenv", set = "MAPSET=%s" % str(self.cmbMapset.GetValue()))
 
 
-
 	def OnLocationChange(self,event):
 		"""
 		Populate mapset combobox with selected location.
@@ -373,7 +373,7 @@
 		for mapset in glob.glob(os.path.join(self.gisdbase, location, "*")):
 			if os.path.isdir(mapset) and os.path.isfile(os.path.join(self.gisdbase, location, mapset, "WIND")):
 				maplist.append(os.path.basename(mapset))
-				#print mapset
+				print mapset
 		return maplist
 
 	def GetLocations(self):
@@ -404,11 +404,12 @@
 		self.Bind(wx.EVT_MENU,self.OnRename,id=self.ID_REN)
 		self.Bind(wx.EVT_MENU,self.OnDelete,id=self.ID_DEL)
 
+
 		self.Bind(wx.EVT_CLOSE,    self.OnCloseWindow)
 
 		#Event bindings for v/r.info checkbox
 		self.Bind(wx.EVT_CHECKBOX, self.OnToggleInfo,self.chkInfo)
-		self.Bind(wx.EVT_CHECKBOX, self.OnToggleExpand,self.treeExpand)
+
 	def doLayout(self):
 
 		#combo panel sizers
@@ -417,7 +418,6 @@
 		self.cmbSizer.Add(self.cmbLocation,pos=(2,0),flag=wx.ALL)
 		self.cmbSizer.Add(self.cmbMapset,pos=(2,1),flag=wx.ALL)
 		self.cmbSizer.Add(self.chkInfo,pos=(2,2),flag=wx.ALL)
-		self.cmbSizer.Add(self.treeExpand,pos=(2,3),flag=wx.ALL)
 		self.cmbPanel.SetSizer(self.cmbSizer)
 
 		#splitter window sizers



More information about the grass-commit mailing list