Skip to content

Commit

Permalink
wxGUI: fix GCP manager for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Dec 9, 2019
1 parent ad0e965 commit 931490c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
9 changes: 4 additions & 5 deletions gui/wxpython/gcp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
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
Expand All @@ -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()
Expand Down Expand Up @@ -2174,7 +2174,7 @@ def _Create(self):
_('Forward error'),
_('Backward error')):
info.SetText(lbl)
self.InsertColumnInfo(idx_col, info)
self.InsertColumn(idx_col, info)
idx_col += 1

def LoadData(self):
Expand Down Expand Up @@ -2682,11 +2682,10 @@ def __CreateSymbologyPage(self, notebook):
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,
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/image2target/ii2t_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
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
Expand All @@ -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()
Expand Down
25 changes: 12 additions & 13 deletions gui/wxpython/mapwin/buffered.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,19 +1557,18 @@ def OnLeftUp(self, event):
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])

Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/photo2image/ip2i_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
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
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/vnet/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def getSmallUpArrowImage(self):
'small_up_arrow.png'),
'rb')
try:
img = wx.ImageFromStream(stream)
img = wx.Image(stream)
finally:
stream.close()
return img
Expand All @@ -449,7 +449,7 @@ def getSmallDnArrowImage(self):
'small_down_arrow.png'),
'rb')
try:
img = wx.ImageFromStream(stream)
img = wx.Image(stream)
finally:
stream.close()
return img
Expand Down

0 comments on commit 931490c

Please sign in to comment.