Browse Source

wxGUI/vdigit: color settings for new segment (line/boundary)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50999 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 years ago
parent
commit
90789f3939

+ 8 - 0
gui/wxpython/core/settings.py

@@ -277,6 +277,14 @@ class Settings:
             'vdigit' : {
                 # symbology
                 'symbol' : {
+                    'newSegment' : {
+                        'enabled' : None,
+                        'color' : (255, 0, 0, 255)
+                        }, # red
+                    'newLine' : {
+                        'enabled' : None,
+                        'color' : (0, 86, 45, 255)
+                        }, # dark green
                     'highlight' : {
                         'enabled' : None,
                         'color' : (255, 255, 0, 255)

+ 7 - 3
gui/wxpython/vdigit/mapwindow.py

@@ -520,9 +520,13 @@ class VDigitWindow(BufferedWindow):
                           "removeVertex",
                           "editLine"):
             # set pen
-            self.pen = wx.Pen(colour = 'Red', width = 2, style = wx.SHORT_DASH)
-            self.polypen = wx.Pen(colour = 'dark green', width = 2, style = wx.SOLID)
-            
+            self.pen = wx.Pen(colour = UserSettings.Get(group = 'vdigit', key = 'symbol',
+                                                        subkey = ['newSegment', 'color']),
+                              width = 2, style = wx.SHORT_DASH)
+            self.polypen = wx.Pen(colour = UserSettings.Get(group = 'vdigit', key = 'symbol',
+                                                            subkey = ['newLine', 'color']),
+                                  width = 2, style = wx.SOLID)
+        
         if action in ("addVertex",
                       "removeVertex",
                       "splitLines"):

+ 5 - 3
gui/wxpython/vdigit/preferences.py

@@ -36,9 +36,9 @@ class VDigitSettingsDialog(wx.Dialog):
         
         # notebook
         notebook = wx.Notebook(parent = self, id = wx.ID_ANY, style = wx.BK_DEFAULT)
+        self._createGeneralPage(notebook)
         self._createSymbologyPage(notebook)
         self.digit.SetCategory()
-        self._createGeneralPage(notebook)
         self._createAttributesPage(notebook)
         self._createQueryPage(notebook)
 
@@ -89,7 +89,8 @@ class VDigitSettingsDialog(wx.Dialog):
             textLabel = wx.StaticText(panel, wx.ID_ANY, label)
             color = csel.ColourSelect(panel, id = wx.ID_ANY,
                                       colour = UserSettings.Get(group = 'vdigit', key = 'symbol',
-                                                              subkey = [key, 'color']), size = globalvar.DIALOG_COLOR_SIZE)
+                                                                subkey = [key, 'color']),
+                                      size = (40, 25))
             isEnabled = UserSettings.Get(group = 'vdigit', key = 'symbol',
                                          subkey = [key, 'enabled'])
             if isEnabled is not None:
@@ -508,7 +509,8 @@ class VDigitSettingsDialog(wx.Dialog):
         """
 
         return (
-            #            ("Background", "symbolBackground"),
+            (_("Digitize new line segment"), "newSegment"),
+            (_("Digitize new line/boundary"), "newLine"),
             (_("Highlight"), "highlight"),
             (_("Highlight (duplicates)"), "highlightDupl"),
             (_("Point"), "point"),