Kaynağa Gözat

wxGUI: fix for wxPython 4, see https://trac.osgeo.org/grass/ticket/3681

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73552 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 6 yıl önce
ebeveyn
işleme
cffa33e4ed

+ 2 - 2
gui/wxpython/gui_core/gselect.py

@@ -79,7 +79,7 @@ from core.settings import UserSettings
 from core.debug import Debug
 from gui_core.vselect import VectorSelectBase
 from gui_core.wrap import TreeCtrl, Button, StaticText, StaticBox, \
-    TextCtrl
+    TextCtrl, Panel
 
 from grass.pydispatch.signal import Signal
 
@@ -2368,7 +2368,7 @@ class OgrTypeSelect(wx.Panel):
             return 'boundary'
 
 
-class CoordinatesSelect(wx.Panel):
+class CoordinatesSelect(Panel):
 
     def __init__(self, parent, giface, multiple=False, **kwargs):
         """Widget to get coordinates from map window  by mouse click

+ 13 - 0
gui/wxpython/gui_core/wrap.py

@@ -74,6 +74,19 @@ class Window(wx.Window):
                 wx.Window.SetToolTipString(self, tip)
 
 
+class Panel(wx.Panel):
+    """Wrapper around wx.Panel to have more control
+    over the widget on different platforms/wxpython versions"""
+    def __init__(self, *args, **kwargs):
+        wx.Panel.__init__(self, *args, **kwargs)
+
+    def SetToolTip(self, tip):
+        if wxPythonPhoenix:
+            wx.Panel.SetToolTip(self, tipString=tip)
+        else:
+            wx.Panel.SetToolTipString(self, tip)
+
+
 class SpinCtrl(wx.SpinCtrl):
     """Wrapper around wx.SpinCtrl to have more control
     over the widget on different platforms"""