[GRASS-SVN] r47510 - grass-addons/grass7/gui/wxpython/wx.stream/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 9 13:16:13 EDT 2011


Author: madi
Date: 2011-08-09 10:16:13 -0700 (Tue, 09 Aug 2011)
New Revision: 47510

Modified:
   grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream.py
   grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream_panelOne.py
Log:
working copy

Modified: grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream.py	2011-08-09 16:55:14 UTC (rev 47509)
+++ grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream.py	2011-08-09 17:16:13 UTC (rev 47510)
@@ -1,3 +1,6 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 """!
 @package rstream.py
 
@@ -21,7 +24,8 @@
 sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython', 'gui_modules'))
 
 import wx
-import wx.aui
+#import wx.aui
+import wx.lib.flatnotebook as FN
 
 from debug import Debug as Debug
 from preferences import globalSettings as UserSettings
@@ -49,14 +53,14 @@
 
         wx.Panel.__init__(self, parent = parent, id = wx.ID_ANY)
 
-        sizer = wx.BoxSizer(wx.VERTICAL)
-        txtOne = wx.TextCtrl(self, wx.ID_ANY, "")
-        txtTwo = wx.TextCtrl(self, wx.ID_ANY, "")
+        self.sizer = wx.BoxSizer(wx.VERTICAL)
+        self.txtOne = wx.TextCtrl(self, wx.ID_ANY, "")
+        self.txtTwo = wx.TextCtrl(self, wx.ID_ANY, "")
  
-        sizer.Add(txtOne, 0, wx.ALL, 5)
-        sizer.Add(txtTwo, 0, wx.ALL, 5)
+        self.sizer.Add(self.txtOne, 0, wx.ALL, 5)
+        self.sizer.Add(self.txtTwo, 0, wx.ALL, 5)
 
-        self.SetSizer(sizer)
+        self.SetSizer(self.sizer)
 
 
 ## #-------------Main Frame-------------
@@ -79,38 +83,38 @@
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         # create the AuiNotebook instance
-        nb = wx.aui.AuiNotebook(self)
+        #nb = wx.aui.AuiNotebook(self)
 
-       
+        self.nb = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
+                                        style = FN.FNB_NO_NAV_BUTTONS |
+                                        FN.FNB_FANCY_TABS | FN.FNB_NO_X_BUTTON)
 
         # add some pages to the notebook
-        pages = [(TabPanelOne(nb), "Network extraction"),
-                 (TabPanel(nb), "Network ordering"),
-                 (TabPanel(nb), "Tab 3")]
+        self.pages = [(TabPanelOne(self.nb), "Network extraction"),
+                      (TabPanel(self.nb), "Network ordering"),
+                      (TabPanel(self.nb), "Tab 3")]
 
-        for page, label in pages:
-            nb.AddPage(page, label)
+        for page, label in self.pages:
+            self.nb.AddPage(page, label)
 
-        sizer = wx.BoxSizer(wx.VERTICAL)
-        sizer.Add(nb, 1, wx.EXPAND)
+        self.sizer = wx.BoxSizer(wx.VERTICAL)
+        self.sizer.Add(self.nb, 1, wx.EXPAND)
 
         # button for close and other
-        button = wx.BoxSizer(wx.HORIZONTAL)
+        self.button = wx.BoxSizer(wx.HORIZONTAL)
         self.btn_close = wx.Button(parent = self, id = wx.ID_CLOSE)
         self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose)
-        button.Add(item=self.btn_close,flag = wx.ALL, border = 5)        
-        sizer.Add(button)
+        self.button.Add(item=self.btn_close,flag = wx.ALL, border = 5)        
+        self.sizer.Add(self.button)
         
-        self.SetSizer(sizer)
+        self.SetSizer(self.sizer)
 
+        self.mapdisp = self.parent.curr_page.maptree.mapdisplay
+
     def OnClose(self, event): 
         self.Destroy()        
         self.Show()
 
-
-
-
-
 def main():
     app = wx.PySimpleApp()
     wx.InitAllImageHandlers()

Modified: grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream_panelOne.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream_panelOne.py	2011-08-09 16:55:14 UTC (rev 47509)
+++ grass-addons/grass7/gui/wxpython/wx.stream/gui_modules/rstream_panelOne.py	2011-08-09 17:16:13 UTC (rev 47510)
@@ -24,7 +24,8 @@
 sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython', 'gui_modules'))
 
 import wx
-import wx.aui
+#import wx.aui
+import wx.lib.flatnotebook as FN
 
 from debug import Debug as Debug
 from preferences import globalSettings as UserSettings
@@ -36,8 +37,8 @@
 import globalvar
 import utils
 import menuform
+import mapdisp_window
 
-from rstream_panelOne import *
 
 
 # First panel # Network extraction
@@ -54,6 +55,7 @@
         self.r_stre = 'r_stre'
         self.v_net = 'v_net'
         self.r_drain = 'r_drain'
+        #self.mapdisp = 
         
         # define the panel for select maps
 	self.panel = wx.Panel(self)                        
@@ -305,6 +307,27 @@
 
     def OnPreview(self, event):
         pass
+        info_region = grass.read_command('g.region', flags = 'p')
+
+        # message box 
+        self.msg = wx.MessageDialog(parent = self.panel, message = "Please select the center of preview window on the map",
+                                    caption = "Preview utility", style = wx.OK | wx.CANCEL, pos = wx.DefaultPosition)
+        self.retCode = self.msg.ShowModal()
+        if self.retCode == wx.ID_OK:
+            print "OK"
+
+            # get current Map Display
+            self.mapdisp.Raise()
+
+            # Get position by panel on mouse click
+            
+
+
+        else:
+            print "Cancel"
+        
+        
+        
     
 
     #-------------Network extraction-------------



More information about the grass-commit mailing list