[GRASS-SVN] r42756 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 10 17:17:23 EDT 2010


Author: martinl
Date: 2010-07-10 21:17:23 +0000 (Sat, 10 Jul 2010)
New Revision: 42756

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
   grass/trunk/gui/wxpython/gui_modules/wxnviz.py
Log:
wxGUI/nviz: various fixes (save to file)


Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-07-10 20:25:43 UTC (rev 42755)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-07-10 21:17:23 UTC (rev 42756)
@@ -40,8 +40,6 @@
 from workspace import Nviz as NvizDefault
 
 import wxnviz
-# sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
-# import grass7_wxnviz as wxnviz
 
 wxUpdateProperties, EVT_UPDATE_PROP = NewEvent()
 wxUpdateView,       EVT_UPDATE_VIEW = NewEvent()
@@ -193,7 +191,7 @@
             self.init = True
         
         self.UpdateMap()
-        
+                
     def OnMouseAction(self, event):
         # change perspective with mouse wheel
         wheel = event.GetWheelRotation()
@@ -315,7 +313,6 @@
         start = time.clock()
         
         self.resize = False
-        self.SwapBuffers()
         
         if self.render['quick'] is False:
             self.parent.statusbarWin['progress'].Show()
@@ -336,6 +333,8 @@
         else: # None -> reuse last rendered image
             pass # TODO
         
+        self.SwapBuffers()
+        
         stop = time.clock()
         
         if self.render['quick'] is False:
@@ -343,11 +342,6 @@
             # hide process bar
             self.parent.statusbarWin['progress'].Hide()
         
-        #
-        # update statusbar
-        #
-        # self.parent.StatusbarUpdate()
-        
         Debug.msg(3, "GLWindow.UpdateMap(): quick = %d, -> time = %g" % \
                       (self.render['quick'], (stop-start)))
         
@@ -1132,9 +1126,8 @@
         @param width image width
         @param height image height
         """
-        self.SetCurrent()
         self._display.SaveToFile(FileName, width, height)
-        
+                
         # pbuffer = wx.EmptyBitmap(max(1, self.Map.width), max(1, self.Map.height))
         # dc = wx.BufferedPaintDC(self, pbuffer)
         # dc.Clear()

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2010-07-10 20:25:43 UTC (rev 42755)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2010-07-10 21:17:23 UTC (rev 42756)
@@ -233,8 +233,8 @@
                       pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL)
         
         color = csel.ColourSelect(panel, id = wx.ID_ANY,
-                                  colour = UserSettings.Get(group = 'nviz', key = 'settings',
-                                                            subkey = ['general', 'bgcolor']),
+                                  colour = UserSettings.Get(group = 'nviz', key = 'view',
+                                                            subkey = ['background', 'color']),
                                   size = globalvar.DIALOG_COLOR_SIZE)
         self.win['view']['bgcolor'] = color.GetId()
         color.Bind(csel.EVT_COLOURSELECT, self.OnBgColor)
@@ -257,7 +257,7 @@
                                                 agwStyle = globalvar.FNPageDStyle)
         else:
             self.notebookData = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
-                                                agwStyle = globalvar.FNPageDStyle)
+                                                style = globalvar.FNPageDStyle)
         
         # surface page
         self.notebookData.AddPage(page = self._createSurfacePage(),

Modified: grass/trunk/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2010-07-10 20:25:43 UTC (rev 42755)
+++ grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2010-07-10 21:17:23 UTC (rev 42756)
@@ -1100,7 +1100,7 @@
         heightOrig = self.height
         
         self.ResizeWindow(width, height)
-        GS_clear(self.data.bgcolor)
+        GS_clear(Nviz_get_bgcolor(self.data))
         self.Draw(False, -1)
         if itype == 'ppm':
             GS_write_ppm(filename)



More information about the grass-commit mailing list