Skip to content

Commit

Permalink
wxGUI/location_wizard: add 'GridBagSizerTitledPage' class (#824)
Browse files Browse the repository at this point in the history
which defines 'wx.GridBagSizer', as subclass of the 'TitledPage' class
  • Loading branch information
tmszi committed Jul 24, 2020
1 parent bccf537 commit 57cb19e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gui/wxpython/gcp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage, CheckListCtrlMixin

from location_wizard.wizard import TitledPage as TitledPage
from location_wizard.wizard import GridBagSizerTitledPage as TitledPage

#
# global variables
Expand Down
8 changes: 4 additions & 4 deletions gui/wxpython/image2target/ii2t_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
@author Original version improved by Martin Landa <landa.martin gmail.com>
@author Rewritten by Markus Metz redesign georectfier -> GCP Manage
@author Support for GraphicsSet added by Stepan Turek <stepan.turek seznam.cz> (2012)
@author port i.image.2target (v6) to version 7 in 2017 by Yann
@author port i.image.2target (v6) to version 7 in 2017 by Yann
"""

#TODO: i.ortho.transform has 6 appearances, check each of them and configure
#TODO: i.ortho.transform looks for REF_POINTS/CONTROL_POINTS and not POINTS
#TODO: i.ortho.transform looks for REF_POINTS/CONTROL_POINTS and not POINTS
#TODO: CHECK CONTROL_POINTS format and create it for i.ortho.transform to use.

from __future__ import print_function
Expand Down Expand Up @@ -65,7 +65,7 @@
from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage, CheckListCtrlMixin

from location_wizard.wizard import TitledPage as TitledPage
from location_wizard.wizard import GridBagSizerTitledPage as TitledPage

#
# global variables
Expand Down Expand Up @@ -122,7 +122,7 @@ class GCPWizard(object):
# self.extension = extension
# self.src_maps = self.src_map
# # location for xy map to georectify
# self.newlocation = self.srcloc
# self.newlocation = self.srcloc
# # mapset for xy map to georectify
# self.newmapset = self.srcmpt
def __init__(self, parent, giface):
Expand Down
12 changes: 11 additions & 1 deletion gui/wxpython/location_wizard/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Classes:
- wizard::TitledPage
- wizard::GridBagSizerTitledPage
- wizard::DatabasePage
- wizard::CoordinateSystemPage
- wizard::ProjectionsPage
Expand Down Expand Up @@ -72,7 +73,6 @@
global wizerror
global translist


class TitledPage(WizardPageSimple):
"""Class to make wizard pages. Generic methods to make labels,
text entries, and buttons.
Expand Down Expand Up @@ -148,6 +148,16 @@ def MakeCheckBox(self, text, id=wx.ID_ANY, size=(-1, -1),
return chbox


class GridBagSizerTitledPage(TitledPage):
"""GridBagSizer declaration for TitledPage class"""
def __init__(self, parent, title):
super().__init__(parent, title)

self.sizer = wx.GridBagSizer(vgap=0, hgap=0)
self.sizer.SetCols(5)
self.sizer.SetRows(8)


class DatabasePage(TitledPage):
"""Wizard page for setting GIS data directory and location name"""

Expand Down
12 changes: 6 additions & 6 deletions gui/wxpython/photo2image/ip2i_manager.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
@package photo2image.ip2i_manager
@brief Scanning distortion correction of a photo for GRASS GIS.
Includes ground control point management and interactive point
@brief Scanning distortion correction of a photo for GRASS GIS.
Includes ground control point management and interactive point
and click GCP creation
Classes:
Expand Down Expand Up @@ -49,7 +49,7 @@
from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
TextCtrl, Menu, ListCtrl, BitmapFromImage, CheckListCtrlMixin

from location_wizard.wizard import TitledPage as TitledPage
from location_wizard.wizard import GridBagSizerTitledPage as TitledPage

#
# global variables
Expand Down Expand Up @@ -151,7 +151,7 @@ def __init__(self, parent, giface, group, raster, raster1, camera, order, extens

#
# add layer to source map
#
#
try:
# set computational region to match selected map and zoom display
# to region
Expand Down Expand Up @@ -279,7 +279,7 @@ def __init__(self, parent, giface, grwiz=None, id=wx.ID_ANY,
self.show_target = False
else:
self.show_target = True

self.camera = camera

#wx.Frame.__init__(self, parent, id, title, size = size, name = "GCPFrame")
Expand Down Expand Up @@ -394,7 +394,7 @@ def __init__(self, parent, giface, grwiz=None, id=wx.ID_ANY,
if fc_count > storeLine :
dataFiducialX.append(line.split()[1])
dataFiducialY.append(line.split()[2])

except IOError as err:
GError(
parent=self,
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/rlisetup/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from gui_core import gselect
from gui_core.wrap import Button, StaticText, TextCtrl
from location_wizard.wizard import TitledPage as TitledPage
from location_wizard.wizard import GridBagSizerTitledPage as TitledPage
from rlisetup.functions import checkValue, retRLiPath
from rlisetup.sampling_frame import RLiSetupMapPanel
from grass.script import core as grass
Expand Down

0 comments on commit 57cb19e

Please sign in to comment.