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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 27 09:04:06 EDT 2010


Author: rashadkm
Date: 2010-04-27 09:04:04 -0400 (Tue, 27 Apr 2010)
New Revision: 42047

Modified:
   grass-addons/gui/wxpython/data_catalog/catalog.py
   grass-addons/gui/wxpython/data_catalog/mapdisplay.py
Log:
added mouse clicks for planet sasha

Modified: grass-addons/gui/wxpython/data_catalog/catalog.py
===================================================================
--- grass-addons/gui/wxpython/data_catalog/catalog.py	2010-04-27 12:49:25 UTC (rev 42046)
+++ grass-addons/gui/wxpython/data_catalog/catalog.py	2010-04-27 13:04:04 UTC (rev 42047)
@@ -196,7 +196,7 @@
         self.cb_mapfile = []
         
         #creating controls
-        #self.mInfo = wx.TextCtrl(self.pRight, wx.ID_ANY, style = wx.TE_MULTILINE|wx.HSCROLL|wx.TE_READONLY)
+        self.mInfo = wx.TextCtrl(self.cmbPanel, wx.ID_ANY, style = wx.TE_READONLY,size=(300,30))
         #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.cmbLocation = wx.ComboBox(self.cmbPanel, value = "Select Location",size=wx.DefaultSize, choices=self.loclist)
@@ -2046,7 +2046,7 @@
 	    #combo panel sizers
         self.cmbSizer.Add(self.cmbLocation)
         self.cmbSizer.Add(self.cmbMapset)
-        #self.cmbSizer.Add(self.treeExpand)
+        self.cmbSizer.Add(self.mInfo)
         #splitter window sizers
         self.mSizer.Add(self.cmbPanel,flag=wx.EXPAND)
         #self.mSizer.Add(self.win, 1, wx.EXPAND)

Modified: grass-addons/gui/wxpython/data_catalog/mapdisplay.py
===================================================================
--- grass-addons/gui/wxpython/data_catalog/mapdisplay.py	2010-04-27 12:49:25 UTC (rev 42046)
+++ grass-addons/gui/wxpython/data_catalog/mapdisplay.py	2010-04-27 13:04:04 UTC (rev 42047)
@@ -1986,6 +1986,7 @@
             self.Map.AlignExtentFromDisplay()
 
             # update map
+            self.flag =True
             self.UpdateMap()
 
             # update statusbar
@@ -2431,6 +2432,7 @@
         # default is 2D display mode
         self.MapWindow = self.MapWindow2D
         self.MapWindow.Bind(wx.EVT_MOTION, self.OnMotion)
+        self.MapWindow.Bind(wx.EVT_LEFT_DOWN, self.OnClick)
         self.MapWindow.SetCursor(self.cursors["default"])
         # used by Nviz (3D display mode)
         self.MapWindow3D = None 
@@ -2522,12 +2524,19 @@
         self._mgr.AddPane(self.maptree, wx.aui.AuiPaneInfo().Left().
                                         Dockable(False).BestSize((400,300)).
                                         CloseButton(False).DestroyOnClose(True).
-                                        Layer(0).Caption("Map Tree"))
+                                        Layer(0).Caption("MapTree"))
 
         self._mgr.Update()
 
+
+
         #r.rightSizer.Add(self.maptree)
 
+    def OnClick(self,event):
+        x, y = self.MapWindow.Pixel2Cell(event.GetPosition())
+        self.frame.mInfo.SetValue(str(x) + ' , ' + str(y))
+        event.Skip()
+
     def read_gisrc(self):
 	    """
 	    Read variables gisrc file
@@ -2888,6 +2897,7 @@
         """
         Pointer button clicked
         """
+
         if self.toolbars['map']:
             if event:
                 self.toolbars['map'].OnTool(event)



More information about the grass-commit mailing list