Skip to content

Commit

Permalink
g.gui.example: fix broken module (#3233)
Browse files Browse the repository at this point in the history
* fix the broken module
* update its outdated docs
  • Loading branch information
pesekon2 committed Apr 30, 2024
1 parent 37a74d0 commit dd1a9b6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
9 changes: 3 additions & 6 deletions doc/gui/wxpython/example/README
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ or it can be launched from the console.

3. Edit ./gui/wxpython/Makefile:

SRCFILES := $(wildcard icons/*.* scripts/* xml/*) \
- $(wildcard core/* dbmgr/* gcp/* gmodeler/* ... \
+ $(wildcard core/* dbmgr/* example/* gcp/* gmodeler/* ... \

-PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,core dbmgr gcp gmodeler ... \
+PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,core dbmgr example gcp gmodeler ... \
SUBDIRS: Add example
SRCFILES: Add example/*py
PYDSTDIRS: Add example

4. Run make (in ./gui/wxpython)

Expand Down
2 changes: 1 addition & 1 deletion doc/gui/wxpython/example/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, parent, title=_("Choose raster map")):
def _layout(self):
"""!Do layout"""
self.dataSizer.Add(
item=wx.StaticText(parent=self.panel, label=_("Name of raster map:")),
wx.StaticText(parent=self.panel, label=_("Name of raster map:")),
proportion=0,
flag=wx.ALL,
border=1,
Expand Down
4 changes: 2 additions & 2 deletions doc/gui/wxpython/example/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _setStyle(self, style):
else:
return

self.textCtrl.SetDefaultStyle(wx.TextAttr(font=self.font))
self.textCtrl.SetFont(self.font)

def _writeLine(self, title, value):
"""!Formats text (key, value pair) with styles."""
Expand All @@ -436,5 +436,5 @@ def WriteStatistics(self, name, statDict):
"""
self.GetControl().Clear()
self._writeRasterTitle(name=name)
for key, value in statDict.iteritems():
for key, value in statDict.items():
self._writeLine(title=key, value=value)
30 changes: 17 additions & 13 deletions doc/gui/wxpython/example/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ def _toolbarData(self):
"""!Toolbar data"""
return self._getToolbarData(
(
("addRaster", BaseIcons["addRast"].label),
BaseIcons["addRast"],
self.parent.OnSelectRaster,
),
(
("addRaster", BaseIcons["addRast"].label),
BaseIcons["addRast"],
self.parent.OnSelectRaster,
),
)
)


Expand All @@ -135,13 +137,15 @@ def _toolbarData(self):
icons = BaseIcons
return self._getToolbarData(
(
("help", icons["help"].label),
icons["help"],
self.parent.OnHelp,
),
(
("quit", icons["quit"].label),
icons["quit"],
self.parent.OnCloseWindow,
),
(
("help", icons["help"].label),
icons["help"],
self.parent.OnHelp,
),
(
("quit", icons["quit"].label),
icons["quit"],
self.parent.OnCloseWindow,
),
)
)

0 comments on commit dd1a9b6

Please sign in to comment.