Browse Source

wxGUI: fix GCP manager for py3

Anna Petrasova 5 years ago
parent
commit
931490c369

+ 4 - 5
gui/wxpython/gcp/manager.py

@@ -79,7 +79,7 @@ maptype = 'raster'
 def getSmallUpArrowImage():
     stream = open(os.path.join(globalvar.IMGDIR, 'small_up_arrow.png'), 'rb')
     try:
-        img = wx.ImageFromStream(stream)
+        img = wx.Image(stream)
     finally:
         stream.close()
     return img
@@ -88,7 +88,7 @@ def getSmallUpArrowImage():
 def getSmallDnArrowImage():
     stream = open(os.path.join(globalvar.IMGDIR, 'small_down_arrow.png'), 'rb')
     try:
-        img = wx.ImageFromStream(stream)
+        img = wx.Image(stream)
     finally:
         stream.close()
     stream.close()
@@ -2174,7 +2174,7 @@ class GCPList(ListCtrl,
                         _('Forward error'),
                         _('Backward error')):
                 info.SetText(lbl)
-                self.InsertColumnInfo(idx_col, info)
+                self.InsertColumn(idx_col, info)
                 idx_col += 1
 
     def LoadData(self):
@@ -2682,11 +2682,10 @@ class GrSettingsDialog(wx.Dialog):
             parent=panel, id=wx.ID_ANY,
             label=_("Highlight RMS error > M + SD * factor:"))
         rmslabel.SetToolTip(
-            wx.ToolTip(
                 _(
                     "Highlight GCPs with an RMS error larger than \n"
                     "mean + standard deviation * given factor. \n"
-                    "Recommended values for this factor are between 1 and 2.")))
+                    "Recommended values for this factor are between 1 and 2."))
         rmsgridSizer.Add(
             rmslabel,
             flag=wx.ALIGN_CENTER_VERTICAL,

+ 2 - 2
gui/wxpython/image2target/ii2t_manager.py

@@ -82,7 +82,7 @@ maptype = 'raster'
 def getSmallUpArrowImage():
     stream = open(os.path.join(globalvar.IMGDIR, 'small_up_arrow.png'), 'rb')
     try:
-        img = wx.ImageFromStream(stream)
+        img = wx.Image(stream)
     finally:
         stream.close()
     return img
@@ -91,7 +91,7 @@ def getSmallUpArrowImage():
 def getSmallDnArrowImage():
     stream = open(os.path.join(globalvar.IMGDIR, 'small_down_arrow.png'), 'rb')
     try:
-        img = wx.ImageFromStream(stream)
+        img = wx.Image(stream)
     finally:
         stream.close()
     stream.close()

+ 12 - 13
gui/wxpython/mapwin/buffered.py

@@ -1557,19 +1557,18 @@ class BufferedMapWindow(MapWindowBase, Window):
                 self.digit:
             self._onLeftUp(event)
 
-        elif (self.mouse['use'] == 'pointer' and
-                self.dragid and int(self.dragid) >= 0):
-            # end drag of overlay decoration
-
-            if self.overlays and self.dragid in self.overlays:
-                self.overlays[
-                    self.dragid].coords = self.pdc.GetIdBounds(
-                    self.dragid)
-            elif self.dragid in self.textdict:
-                self.textdict[self.dragid]['bbox'] = self.pdc.GetIdBounds(self.dragid)
-            else:
-                pass
-            self.dragid = None
+        elif self.mouse['use'] == 'pointer':
+            if self.dragid and int(self.dragid) >= 0:
+                # end drag of overlay decoration
+                if self.overlays and self.dragid in self.overlays:
+                    self.overlays[
+                        self.dragid].coords = self.pdc.GetIdBounds(
+                        self.dragid)
+                elif self.dragid in self.textdict:
+                    self.textdict[self.dragid]['bbox'] = self.pdc.GetIdBounds(self.dragid)
+                else:
+                    pass
+                self.dragid = None
 
             self.mouseLeftUpPointer.emit(x=coordinates[0], y=coordinates[1])
 

+ 2 - 2
gui/wxpython/photo2image/ip2i_manager.py

@@ -73,7 +73,7 @@ maptype = 'raster'
 def getSmallUpArrowImage():
     stream = open(os.path.join(globalvar.IMGDIR, 'small_up_arrow.png'), 'rb')
     try:
-        img = wx.ImageFromStream(stream)
+        img = wx.Image(stream)
     finally:
         stream.close()
     return img
@@ -82,7 +82,7 @@ def getSmallUpArrowImage():
 def getSmallDnArrowImage():
     stream = open(os.path.join(globalvar.IMGDIR, 'small_down_arrow.png'), 'rb')
     try:
-        img = wx.ImageFromStream(stream)
+        img = wx.Image(stream)
     finally:
         stream.close()
     stream.close()

+ 2 - 2
gui/wxpython/vnet/widgets.py

@@ -436,7 +436,7 @@ class PointsList(ListCtrl,
                 'small_up_arrow.png'),
             'rb')
         try:
-            img = wx.ImageFromStream(stream)
+            img = wx.Image(stream)
         finally:
             stream.close()
         return img
@@ -449,7 +449,7 @@ class PointsList(ListCtrl,
                 'small_down_arrow.png'),
             'rb')
         try:
-            img = wx.ImageFromStream(stream)
+            img = wx.Image(stream)
         finally:
             stream.close()
         return img