[GRASS-SVN] r42217 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 11 12:29:24 EDT 2010


Author: martinl
Date: 2010-05-11 12:29:23 -0400 (Tue, 11 May 2010)
New Revision: 42217

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mcalc_builder.py
Log:
wxGUI/mcalc: windows fixes

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mcalc_builder.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mcalc_builder.py	2010-05-10 14:31:31 UTC (rev 42216)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mcalc_builder.py	2010-05-11 16:29:23 UTC (rev 42217)
@@ -1,4 +1,4 @@
-"""
+"""!
 @package mcalc_builder.py
 
 @brief Map calculator, wrapper for r.mapcalc
@@ -38,7 +38,7 @@
     r(3).mapcalc statements
     """
     def __init__(self, parent, id = wx.ID_ANY, title = _('Map calculator'), 
-                 rast3d = False, **kwargs):
+                 rast3d = False, style = wx.DEFAULT_FRAME_STYLE | wx.RESIZE_BORDER, **kwargs):
         self.parent = parent
         if self.parent:
             self.log = self.parent.GetLogWindow()
@@ -47,7 +47,9 @@
         
         self.rast3d = rast3d
         wx.Frame.__init__(self, parent, id = id, title = title, **kwargs)
-
+        
+        self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
+        
         #
         # variables
         #
@@ -105,94 +107,94 @@
             maplabel = _('raster map')
             element = 'cell'
 
-        self.operatorBox = wx.StaticBox(parent = self, id = wx.ID_ANY,
+        self.operatorBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
                                         label=" %s " % _('Operators'))
-        self.operandBox = wx.StaticBox(parent = self, id = wx.ID_ANY,
+        self.operandBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
                                        label=" %s " % _('Operands'))
-        self.expressBox = wx.StaticBox(parent = self, id = wx.ID_ANY,
+        self.expressBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
                                        label=" %s " % _('Expression'))
         
         #
         # Buttons
         #
-        self.btn_clear = wx.Button(parent = self, id = wx.ID_CLEAR)
-        self.btn_help = wx.Button(parent = self, id = wx.ID_HELP)
-        self.btn_run = wx.Button(parent = self, id = wx.ID_ANY, label = _("&Run"))
+        self.btn_clear = wx.Button(parent = self.panel, id = wx.ID_CLEAR)
+        self.btn_help = wx.Button(parent = self.panel, id = wx.ID_HELP)
+        self.btn_run = wx.Button(parent = self.panel, id = wx.ID_ANY, label = _("&Run"))
         self.btn_run.SetDefault()
-        self.btn_close = wx.Button(parent = self, id = wx.ID_CLOSE)
+        self.btn_close = wx.Button(parent = self.panel, id = wx.ID_CLOSE)
 
         self.btn = dict()        
-        self.btn['pow'] = wx.Button(parent = self, id = wx.ID_ANY, label = "^")
+        self.btn['pow'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "^")
         self.btn['pow'].SetToolTipString(_('exponent'))
-        self.btn['div'] = wx.Button(parent = self, id = wx.ID_ANY, label = "/")
+        self.btn['div'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "/")
         self.btn['div'].SetToolTipString(_('divide'))
-        self.btn['add'] = wx.Button(parent = self, id = wx.ID_ANY, label = "+")
+        self.btn['add'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "+")
         self.btn['add'].SetToolTipString(_('add'))
-        self.btn['minus'] = wx.Button(parent = self, id = wx.ID_ANY, label = "-")
+        self.btn['minus'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "-")
         self.btn['minus'].SetToolTipString(_('subtract'))
-        self.btn['mod'] = wx.Button(parent = self, id = wx.ID_ANY, label = "%")
+        self.btn['mod'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "%")
         self.btn['mod'].SetToolTipString(_('modulus'))
-        self.btn['mult'] = wx.Button(parent = self, id = wx.ID_ANY, label = "*")
+        self.btn['mult'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "*")
         self.btn['mult'].SetToolTipString(_('multiply'))
 
-        self.btn['paren'] = wx.Button(parent = self, id = wx.ID_ANY, label = "( )") 
+        self.btn['paren'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "( )") 
 
-        self.btn['lshift'] = wx.Button(parent = self, id = wx.ID_ANY, label = "<<")
+        self.btn['lshift'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "<<")
         self.btn['lshift'].SetToolTipString(_('left shift'))
-        self.btn['rshift'] = wx.Button(parent = self, id = wx.ID_ANY, label = ">>")
+        self.btn['rshift'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = ">>")
         self.btn['rshift'].SetToolTipString(_('right shift'))
-        self.btn['rshiftu'] = wx.Button(parent = self, id = wx.ID_ANY, label = ">>>")
+        self.btn['rshiftu'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = ">>>")
         self.btn['rshiftu'].SetToolTipString(_('right shift (unsigned)'))
-        self.btn['gt'] = wx.Button(parent = self, id = wx.ID_ANY, label = ">")
+        self.btn['gt'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = ">")
         self.btn['gt'].SetToolTipString(_('greater than'))
-        self.btn['gteq'] = wx.Button(parent = self, id = wx.ID_ANY, label = ">=")
+        self.btn['gteq'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = ">=")
         self.btn['gteq'].SetToolTipString(_('greater than or equal to'))
-        self.btn['lt'] = wx.Button(parent = self, id = wx.ID_ANY, label = "<")
+        self.btn['lt'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "<")
         self.btn['lt'].SetToolTipString(_('less than or equal to'))
-        self.btn['lteq'] = wx.Button(parent = self, id = wx.ID_ANY, label = "<=")
+        self.btn['lteq'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "<=")
         self.btn['lteq'].SetToolTipString(_('less than'))
-        self.btn['eq'] = wx.Button(parent = self, id = wx.ID_ANY, label = "==")
+        self.btn['eq'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "==")
         self.btn['eq'].SetToolTipString(_('equal to'))
-        self.btn['noteq'] = wx.Button(parent = self, id = wx.ID_ANY, label = "!=")
+        self.btn['noteq'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "!=")
         self.btn['noteq'].SetToolTipString(_('not equal to'))
 
-        self.btn['compl'] = wx.Button(parent = self, id = wx.ID_ANY, label = "~")
+        self.btn['compl'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "~")
         self.btn['compl'].SetToolTipString(_('one\'s complement'))
-        self.btn['not'] = wx.Button(parent = self, id = wx.ID_ANY, label = "!")
+        self.btn['not'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "!")
         self.btn['not'].SetToolTipString(_('NOT'))
-        self.btn['andbit'] = wx.Button(parent = self, id = wx.ID_ANY, label = '&')
+        self.btn['andbit'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = '&')
         self.btn['andbit'].SetToolTipString(_('bitwise AND'))
-        self.btn['orbit'] = wx.Button(parent = self, id = wx.ID_ANY, label = "|")
+        self.btn['orbit'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "|")
         self.btn['orbit'].SetToolTipString(_('bitwise OR'))
-        self.btn['and'] = wx.Button(parent = self, id = wx.ID_ANY, label = "&&&")
+        self.btn['and'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "&&&")
         self.btn['and'].SetToolTipString(_('logical AND'))
-        self.btn['andnull'] = wx.Button(parent = self, id = wx.ID_ANY, label = "&&&&&")
+        self.btn['andnull'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "&&&&&")
         self.btn['andnull'].SetToolTipString(_('logical AND (ignores NULLs'))
-        self.btn['or'] = wx.Button(parent = self, id = wx.ID_ANY, label = "||")
+        self.btn['or'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "||")
         self.btn['or'].SetToolTipString(_('logical OR'))
-        self.btn['ornull'] = wx.Button(parent = self, id = wx.ID_ANY, label = "|||")
+        self.btn['ornull'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "|||")
         self.btn['ornull'].SetToolTipString(_('logical OR (ignores NULLs'))
-        self.btn['cond'] = wx.Button(parent = self, id = wx.ID_ANY, label = "?:") 
+        self.btn['cond'] = wx.Button(parent = self.panel, id = wx.ID_ANY, label = "?:") 
         self.btn['cond'].SetToolTipString(_('conditional'))
         
         #
         # Text area
         #
-        self.text_mcalc = wx.TextCtrl(parent = self, id = wx.ID_ANY, size = (-1, 75),
+        self.text_mcalc = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY, size = (-1, 75),
                                       style = wx.TE_MULTILINE)
         
         #
         # Map and function insertion text and ComboBoxes
-        self.newmaplabel = wx.StaticText(parent = self, id = wx.ID_ANY,
+        self.newmaplabel = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
                                          label= _('Name for new %s to create') % maplabel)
-        self.newmaptxt = wx.TextCtrl(parent = self, id = wx.ID_ANY, size=(250, -1))
-        self.mapsellabel = wx.StaticText(parent = self, id = wx.ID_ANY,
+        self.newmaptxt = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY, size=(250, -1))
+        self.mapsellabel = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
                                          label = _('Insert existing %s') % maplabel)
-        self.mapselect = gselect.Select(self, wx.ID_ANY, size = (250, -1),
+        self.mapselect = gselect.Select(parent = self.panel, id = wx.ID_ANY, size = (250, -1),
                                         type = element, multiple = False)
-        self.functlabel = wx.StaticText(parent = self, id = wx.ID_ANY,
+        self.functlabel = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
                                         label = _('Insert mapcalc function'))
-        self.function = wx.ComboBox(parent = self, id = wx.ID_ANY, 
+        self.function = wx.ComboBox(parent = self.panel, id = wx.ID_ANY, 
                                     size = (250, -1), choices = self.funct_list,
                                     style = wx.CB_DROPDOWN |
                                     wx.CB_READONLY | wx.TE_PROCESS_ENTER)
@@ -297,10 +299,11 @@
         sizer.Add(item = buttonSizer4, proportion = 0,
                       flag = wx.ALIGN_RIGHT | wx.ALL, border = 1)
         
-        self.SetAutoLayout(True)
-        self.SetSizer(sizer)
-        sizer.Fit(self)
+        self.panel.SetAutoLayout(True)        
+        self.panel.SetSizer(sizer)
+        sizer.Fit(self.panel)
         
+        self.Fit()
         self.Layout()
         
     def AddMark(self,event):



More information about the grass-commit mailing list