[GRASS-SVN] r47029 - in grass/branches/develbranch_6/gui/wxpython: gui_modules icons

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 6 12:07:31 EDT 2011


Author: martinl
Date: 2011-07-06 09:07:31 -0700 (Wed, 06 Jul 2011)
New Revision: 47029

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
   grass/branches/develbranch_6/gui/wxpython/icons/icon.py
Log:
wxGUI: resize vdigit toolbar, change default map window size
      (merge r47027 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2011-07-06 16:04:45 UTC (rev 47028)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2011-07-06 16:07:31 UTC (rev 47029)
@@ -104,7 +104,7 @@
 DIALOG_LAYER_SIZE = (100, -1)
 DIALOG_COLOR_SIZE = (30, 30)
 
-MAP_WINDOW_SIZE = (674, 600)
+MAP_WINDOW_SIZE = (700, 600)
 HIST_WINDOW_SIZE = (500, 350)
 GM_WINDOW_SIZE = (500, 600)
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-07-06 16:04:45 UTC (rev 47028)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-07-06 16:07:31 UTC (rev 47029)
@@ -241,7 +241,7 @@
         
         self.combo = wx.ComboBox(parent = self, id = wx.ID_ANY,
                                  choices = choices,
-                                 style = wx.CB_READONLY, size = (90, -1))
+                                 style = wx.CB_READONLY, size = (110, -1))
         self.combo.SetSelection(0)
         
         self.comboid = self.AddControl(self.combo)
@@ -532,9 +532,6 @@
                                      ("removeVertex", icons["removeVertex"],
                                       self.OnRemoveVertex,
                                       wx.ITEM_CHECK),
-                                     ("splitLine", icons["splitLine"],
-                                      self.OnSplitLine,
-                                      wx.ITEM_CHECK),
                                      ("editLine", icons["editLine"],
                                       self.OnEditLine,
                                       wx.ITEM_CHECK),
@@ -547,9 +544,6 @@
                                      ("displayCats", icons["displayCats"],
                                       self.OnDisplayCats,
                                       wx.ITEM_CHECK),
-                                     ("copyCats", icons["copyCats"],
-                                      self.OnCopyCA,
-                                      wx.ITEM_CHECK),
                                      ("displayAttr", icons["displayAttr"],
                                       self.OnDisplayAttr,
                                       wx.ITEM_CHECK),
@@ -685,13 +679,6 @@
                         'id'   : self.removeVertex }
         self.parent.MapWindow.mouse['box'] = 'point'
 
-    def OnSplitLine(self, event):
-        """!Split line"""
-        Debug.msg(2, "Digittoolbar.OnSplitLine():")
-        self.action = { 'desc' : "splitLine",
-                        'id'   : self.splitLine }
-        self.parent.MapWindow.mouse['box'] = 'point'
-
     def OnEditLine(self, event):
         """!Edit line"""
         Debug.msg(2, "Digittoolbar.OnEditLine():")
@@ -726,61 +713,7 @@
         self.action = { 'desc' : "displayAttrs",
                         'id'   : self.displayAttr }
         self.parent.MapWindow.mouse['box'] = 'point'
-
-    def OnCopyCA(self, event):
-        """!Copy categories/attributes menu"""
-        point = wx.GetMousePosition()
-        toolMenu = wx.Menu()
-        # Add items to the menu
-        cats = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                           text = _('Copy categories'),
-                           kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(cats)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopyCats, cats)
-        if self.action['desc'] == "copyCats":
-            cats.Check(True)
         
-        attrb = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                            text = _('Duplicate attributes'),
-                            kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(attrb)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopyAttrb, attrb)
-        if self.action['desc'] == "copyAttrs":
-            attrb.Check(True)
-        
-        # Popup the menu.  If an item is selected then its handler
-        # will be called before PopupMenu returns.
-        self.parent.MapWindow.PopupMenu(toolMenu)
-        toolMenu.Destroy()
-        
-        if self.action['desc'] == "addPoint":
-            self.ToggleTool(self.copyCats, False)
-        
-    def OnCopyCats(self, event):
-        """!Copy categories"""
-        if self.action['desc'] == 'copyCats': # select previous action
-            self.ToggleTool(self.addPoint, True)
-            self.ToggleTool(self.copyCats, False)
-            self.OnAddPoint(event)
-            return
-        
-        Debug.msg(2, "Digittoolbar.OnCopyCats():")
-        self.action = { 'desc' : "copyCats",
-                        'id'   : self.copyCats }
-        self.parent.MapWindow.mouse['box'] = 'point'
-
-    def OnCopyAttrb(self, event):
-        if self.action['desc'] == 'copyAttrs': # select previous action
-            self.ToggleTool(self.addPoint, True)
-            self.ToggleTool(self.copyCats, False)
-            self.OnAddPoint(event)
-            return
-        
-        Debug.msg(2, "Digittoolbar.OnCopyAttrb():")
-        self.action = { 'desc' : "copyAttrs",
-                        'id'   : self.copyCats }
-        self.parent.MapWindow.mouse['box'] = 'point'
-        
     def OnUndo(self, event):
         """!Undo previous changes"""
         self.digit.Undo()
@@ -816,79 +749,41 @@
         """!Menu for additional tools"""
         point = wx.GetMousePosition()
         toolMenu = wx.Menu()
-        # Add items to the menu
-        copy = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                           text = _('Copy features from (background) vector map'),
-                           kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(copy)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopy, copy)
-        if self.action['desc'] == "copyLine":
-            copy.Check(True)
         
-        flip = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                           text = _('Flip selected lines/boundaries'),
-                           kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(flip)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnFlip, flip)
-        if self.action['desc'] == "flipLine":
-            flip.Check(True)
+        for label, itype, handler, desc in (
+            (_('Break selected lines/boundaries at intersection'),
+             wx.ITEM_CHECK, self.OnBreak, "breakLine"),
+            (_('Connect selected lines/boundaries'),
+             wx.ITEM_CHECK, self.OnConnect, "connectLine"),
+            (_('Copy categories'),
+             wx.ITEM_CHECK, self.OnCopyCats, "copyCats"),
+            (_('Copy features from (background) vector map'),
+             wx.ITEM_CHECK, self.OnCopy, "copyLine"),
+            (_('Duplicate attributes'),
+             wx.ITEM_CHECK, self.OnCopyAttrb, "copyAttrs"),
+            (_('Feature type conversion'),
+             wx.ITEM_CHECK, self.OnTypeConversion, "typeConv"),
+            (_('Flip selected lines/boundaries'),
+             wx.ITEM_CHECK, self.OnFlip, "flipLine"),
+            (_('Merge selected lines/boundaries'),
+             wx.ITEM_CHECK, self.OnMerge, "mergeLine"),
+            (_('Snap selected lines/boundaries (only to nodes)'),
+             wx.ITEM_CHECK, self.OnSnap, "snapLine"),
+            (_('Split line/boundary'),
+             wx.ITEM_CHECK, self.OnSplitLine, "splitLine"),
+            (_('Query features'),
+             wx.ITEM_CHECK, self.OnQuery, "queryLine"),
+            (_('Z bulk-labeling of 3D lines'),
+             wx.ITEM_CHECK, self.OnZBulk, "zbulkLine")):
+            # Add items to the menu
+            item = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                               text = label,
+                               kind = itype)
+            toolMenu.AppendItem(item)
+            self.parent.MapWindow.Bind(wx.EVT_MENU, handler, item)
+            if self.action['desc'] == desc:
+                item.Check(True)
         
-        merge = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                            text = _('Merge selected lines/boundaries'),
-                            kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(merge)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnMerge, merge)
-        if self.action['desc'] == "mergeLine":
-            merge.Check(True)
-        
-        breakL = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                             text = _('Break selected lines/boundaries at intersection'),
-                             kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(breakL)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnBreak, breakL)
-        if self.action['desc'] == "breakLine":
-            breakL.Check(True)
-        
-        snap = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                           text = _('Snap selected lines/boundaries (only to nodes)'),
-                           kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(snap)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnSnap, snap)
-        if self.action['desc'] == "snapLine":
-            snap.Check(True)
-        
-        connect = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                              text = _('Connect selected lines/boundaries'),
-                              kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(connect)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnConnect, connect)
-        if self.action['desc'] == "connectLine":
-            connect.Check(True)
-        
-        query = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                            text = _('Query features'),
-                            kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(query)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnQuery, query)
-        if self.action['desc'] == "queryLine":
-            query.Check(True)
-        
-        zbulk = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                            text = _('Z bulk-labeling of 3D lines'),
-                            kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(zbulk)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnZBulk, zbulk)
-        if self.action['desc'] == "zbulkLine":
-            zbulk.Check(True)
-        
-        typeconv = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
-                               text = _('Feature type conversion'),
-                               kind = wx.ITEM_CHECK)
-        toolMenu.AppendItem(typeconv)
-        self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnTypeConversion, typeconv)
-        if self.action['desc'] == "typeConv":
-            typeconv.Check(True)
-        
         # Popup the menu.  If an item is selected then its handler
         # will be called before PopupMenu returns.
         self.parent.MapWindow.PopupMenu(toolMenu)
@@ -910,6 +805,47 @@
                         'id'   : self.additionalTools }
         self.parent.MapWindow.mouse['box'] = 'box'
 
+    def OnSplitLine(self, event):
+        """!Split line"""
+        if self.action['desc'] == 'splitLine': # select previous action
+            self.ToggleTool(self.addPoint, True)
+            self.ToggleTool(self.additionalTools, False)
+            self.OnAddPoint(event)
+            return
+        
+        Debug.msg(2, "Digittoolbar.OnSplitLine():")
+        self.action = { 'desc' : "splitLine",
+                        'id'   : self.additionalTools }
+        self.parent.MapWindow.mouse['box'] = 'point'
+
+
+    def OnCopyCats(self, event):
+        """!Copy categories"""
+        if self.action['desc'] == 'copyCats': # select previous action
+            self.ToggleTool(self.addPoint, True)
+            self.ToggleTool(self.copyCats, False)
+            self.OnAddPoint(event)
+            return
+        
+        Debug.msg(2, "Digittoolbar.OnCopyCats():")
+        self.action = { 'desc' : "copyCats",
+                        'id'   : self.additionalTools }
+        self.parent.MapWindow.mouse['box'] = 'point'
+
+    def OnCopyAttrb(self, event):
+        """!Copy attributes"""
+        if self.action['desc'] == 'copyAttrs': # select previous action
+            self.ToggleTool(self.addPoint, True)
+            self.ToggleTool(self.copyCats, False)
+            self.OnAddPoint(event)
+            return
+        
+        Debug.msg(2, "Digittoolbar.OnCopyAttrb():")
+        self.action = { 'desc' : "copyAttrs",
+                        'id'   : self.additionalTools }
+        self.parent.MapWindow.mouse['box'] = 'point'
+        
+
     def OnFlip(self, event):
         """!Flip selected lines/boundaries"""
         if self.action['desc'] == 'flipLine': # select previous action
@@ -1224,7 +1160,7 @@
 
             if not self.comboid:
                 self.combo = wx.ComboBox(self, id = wx.ID_ANY, value = value,
-                                         choices = [_('New vector map'), ] + layerNameList, size = (115, -1),
+                                         choices = [_('New vector map'), ] + layerNameList, size = (80, -1),
                                          style = wx.CB_READONLY)
                 self.comboid = self.InsertControl(0, self.combo)
                 self.parent.Bind(wx.EVT_COMBOBOX, self.OnSelectMap, self.comboid)

Modified: grass/branches/develbranch_6/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2011-07-06 16:04:45 UTC (rev 47028)
+++ grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2011-07-06 16:07:31 UTC (rev 47029)
@@ -293,9 +293,6 @@
         'addVertex'       : MetaIcon(img = iconSet.get('vertex-create', wx.ART_ERROR),
                                      label = _('Add new vertex'),
                                      desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
-        'copyCats'        : MetaIcon(img = iconSet.get('cats-copy', wx.ART_ERROR),
-                                     label = _('Copy categories'),
-                                     desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
         'deleteLine'      : MetaIcon(img = iconSet.get('line-delete', wx.ART_ERROR),
                                      label = _('Delete feature(s)'),
                                      desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
@@ -319,9 +316,6 @@
                                      desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
         'settings'        : MetaIcon(img = iconSet.get('settings', wx.ART_ERROR),
                                      label = _('Digitization settings')),
-        'splitLine'       : MetaIcon(img = iconSet.get('line-split', wx.ART_ERROR),
-                                     label = _('Split line/boundary'),
-                                     desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
         'quit'            : MetaIcon(img = iconSet.get('quit', wx.ART_ERROR),
                                      label = _('Quit digitizer'),
                                      desc = _('Quit digitizer and save changes')),



More information about the grass-commit mailing list