Opened 6 years ago

Closed 6 years ago

#3621 closed defect (fixed)

Cannot create map frame in cartographic composer

Reported by: cmbarton Owned by: grass-dev@…
Priority: critical Milestone: 7.4.2
Component: wxGUI Version: unspecified
Keywords: map frame, cartographic composer Cc:
CPU: Unspecified Platform: Unspecified

Description (last modified by neteler)

Because the button to save a display to an image file is also broken, there is no way to export a map from GRASS. So I'm elevating both bug reports to blockers. This is broken in at least v. 7.4.1 and up.

I can draw a dotted line rectangle but it does not create a map frame. So nothing else works in the composer.

Here is the error:

Traceback (most recent call last):
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/psmap/frame.py", line 1463, in MouseActions

self.OnLeftUp(event)
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/psmap/frame.py", line 1611, in OnLeftUp

settings=self.instruction, rect=rectPaper)
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 772, in __init__

notebook=False)
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 846, in __init__

self._layout()
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 1122, in _layout

convertRGB(self.mapFrameDict['color']))
  File "/Applications/GRASS-7.5.app/Contents/Resources/gui/w
xpython/psmap/utils.py", line 181, in convertRGB

color = wx.Colour(*color)
TypeError
:
Colour(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 1 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'float'
  overload 4: argument 1 has unexpected type 'float'

Change History (22)

comment:1 by neteler, 6 years ago

Description: modified (diff)

(properly formatting error report)

comment:2 by annakrat, 6 years ago

In 73404:

wxGUI: fix for wxPython 4, see #3621

comment:3 by annakrat, 6 years ago

Please test in trunk, I will then backport it.

comment:4 by martinl, 6 years ago

Priority: blockercritical

@Michael, can you test it please sooner that later? RC1 is planned in the next days. BTW, priority blocker is disputable since it's related to one wxGUI component and wxPython4. I took liberty to decrease priority to avoid blocking release.

comment:5 by cmbarton, 6 years ago

If I get my proposal in early enough I’ll test today. Otherwise tomorrow. Thanks again

comment:6 by cmbarton, 6 years ago

I just tested this in trunk and it works. Thanks much. Is this backported so we can close the ticket?

comment:7 by annakrat, 6 years ago

In 73418:

wxGUI: fix for wxPython 4, see #3621 (merge from trunk, r73404)

comment:8 by annakrat, 6 years ago

In 73419:

wxGUI: fix for wxPython 4, see #3621 (merge from trunk, r73404)

comment:9 by martinl, 6 years ago

Resolution: fixed
Status: newclosed

comment:10 by cmbarton, 6 years ago

Resolution: fixed
Status: closedreopened

We need to reopen this. I just did a checkout and compile of 7.6RB. The rubber band part of the map frame now works to open the dialog where you can pick a map to display. But when you click OK, it generates an error.

Traceback (most recent call last):
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 446, in OnOK

ok = self.OnApply(event)
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 791, in OnApply

self.parent.DialogDataChanged(id=self.id[0])
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/frame.py", line 1120, in DialogDataChanged

bb=rectCanvas)
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/frame.py", line 2194, in Draw

w, h, lh = dc.GetMultiLineTextExtent(text)
ValueError
:
need more than 2 values to unpack

Also, you can load a psmap file but if you try to do anything with it, it will lock up the entire GUI to a point that you must completely quit GRASS to get out of it.

Last edited 6 years ago by cmbarton (previous) (diff)

comment:11 by annakrat, 6 years ago

Try 73434.

comment:12 by cmbarton, 6 years ago

Thanks. I'll try to squeeze it in tomorrow. Otherwise, Friday.

comment:13 by cmbarton, 6 years ago

The issue with setting the map frame is now fixed. I was able to give a full test and ran into 2 other issues which I'll mention here. One is already reported and a serious problem. The other is less so but makes the cartographic composer unusable for most purposes. We can keep this open for these cartographic composer issues or move them to another ticket because they are different from the map frame per se.

Issue 1: Cannot select point symbols. This also affects the vector display, which is very serious. Here is the error when you click on the button to select a symbol.

Traceback (most recent call last):
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 3149, in OnSymbolSelection

currentSymbol=self.symbolName.GetLabel())
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/gui_core/dialogs.py", line 2067, in __init__

self._layout()
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/gui_core/dialogs.py", line 2073, in _layout

fgSizer = wx.FlexGridSizer(rows=2, vgap=5, hgap=5)
TypeError
:
FlexGridSizer(): arguments did not match any overloaded
call:
  overload 1: 'hgap' is not a valid keyword argument
  overload 2: 'hgap' is not a valid keyword argument
  overload 3: 'hgap' is not a valid keyword argument
  overload 4: 'hgap' is not a valid keyword argument

Issue 2. You cannot add a scale bar. All the other items can be added. Just not a scale bar. Here is the error:

Traceback (most recent call last):
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/frame.py", line 686, in OnAddScalebar

dlg = ScalebarDialog(self, id=id, settings=self.instruction)
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 4776, in __init__

self.panel = self._scalebarPanel()
  File "/Applications/GRASS-7.6.app/Contents/Resources/gui/w
xpython/psmap/dialogs.py", line 4947, in _scalebarPanel

self.sbCombo = wx.combo.BitmapComboBox(panel,
style=wx.CB_READONLY)
AttributeError
:
'module' object has no attribute 'combo'

comment:14 by cmbarton, 6 years ago

A bit more info. These 2 issues (symbols for points and scale bar) affect the cartographic composer in trunk too.

comment:15 by annakrat, 6 years ago

Should be fixed now, also backported to 76 and 74.

comment:16 by cmbarton, 6 years ago

I'll test on Monday. Thanks much.

comment:17 by cmbarton, 6 years ago

Everything is fixed in trunk. But not in 7.4. I have not tried 7.6

I updated 7.4 release branch and tested. Am I looking in the right place?

comment:18 by annakrat, 6 years ago

I hope now it should work everywhere (r73479).

comment:19 by cmbarton, 6 years ago

Thanks for all the work on this. I’ll test tomorrow.

comment:20 by cmbarton, 6 years ago

Resolution: fixed
Status: reopenedclosed

This is all working now. I ran across another bug in 7.4 only that kept the preview from working but managed to fix it (r73482). I am closing.

in reply to:  20 comment:21 by annakrat, 6 years ago

Resolution: fixed
Status: closedreopened

Replying to cmbarton:

This is all working now. I ran across another bug in 7.4 only that kept the preview from working but managed to fix it (r73482). I am closing.

You should check in 7.6 and trunk, it's likely it needs to be there changed too.

comment:22 by cmbarton, 6 years ago

Resolution: fixed
Status: reopenedclosed

I did. This was only a problem in 7.4. I ended up using the code from 7.6 to fix 7.4 (message_ becomes just _ in line 388, ../gui/wxpython/psmap/frame.py)

Note: See TracTickets for help on using tickets.