Hi devs,
working on g.gui.tplot I have problems with gselect.Select in the Vector panel.
Right now there is a wx.EVT_TEXT event and it works well if the vector
temporal dataset is selected by the scroll down menu but it return
errors if the user try to write him self the name of the temporal
dataset, because for each added character it run the connected
function
GRASS_INFO_MESSAGE(13258,1): ERROR: Space time vector dataset <p> not found
GRASS_INFO_END(13258,1)
Traceback (most recent call last):
File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-unknown-linux-gnu/gui/wxpython/tplot/frame.py",
line 842, in OnVectorSelected
column='name')
File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/script/core.py",
line 461, in read_command
return handle_errors(returncode, stdout, args, kwargs)
File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/script/core.py",
line 329, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: L'esecuzione del modulo None
['t.vect.list', '-s', 'column=name', 'input=p'] è terminata con errori
Processo terminato con codice di return diverso da zero 1. Vedi gli
errori nel (error) output.
So I tried to change the event in wx.EVT_TEXT_ENTER this not working
at all, no error and no call to the function.
Instead if I use wx.EVT_COMBOBOX_CLOSEUP it works when I select the
temporal dataset but no when the user types the name.
My idea is to replace wx.EVT_TEXT with both wx.EVT_TEXT_ENTER and
wx.EVT_COMBOBOX_CLOSEUP as suggested in the attached patch but I would
like why wx.EVT_TEXT_ENTER is not working at all, do you have any
idea?
thanks
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
(attachments)
tplot_frame.diff (1.62 KB)
On Wed, Dec 30, 2015 at 9:54 AM, Luca Delucchi <lucadeluge@gmail.com> wrote:
Hi devs,
working on g.gui.tplot I have problems with gselect.Select in the Vector
panel.
Right now there is a wx.EVT_TEXT event and it works well if the vector
temporal dataset is selected by the scroll down menu but it return
errors if the user try to write him self the name of the temporal
dataset, because for each added character it run the connected
function
GRASS_INFO_MESSAGE(13258,1): ERROR: Space time vector dataset <p> not found
GRASS_INFO_END(13258,1)
Traceback (most recent call last):
File
"/home/lucadelu/compilati/grass_trunk/dist.x86_64-unknown-linux-gnu/gui/wxpython/tplot/frame.py",
line 842, in OnVectorSelected
column='name')
File
"/home/lucadelu/compilati/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/script/core.py",
line 461, in read_command
return handle_errors(returncode, stdout, args, kwargs)
File
"/home/lucadelu/compilati/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/script/core.py",
line 329, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: L'esecuzione del modulo None
['t.vect.list', '-s', 'column=name', 'input=p'] è terminata con errori
Processo terminato con codice di return diverso da zero 1. Vedi gli
errori nel (error) output.
So I tried to change the event in wx.EVT_TEXT_ENTER this not working
at all, no error and no call to the function.
Instead if I use wx.EVT_COMBOBOX_CLOSEUP it works when I select the
temporal dataset but no when the user types the name.
My idea is to replace wx.EVT_TEXT with both wx.EVT_TEXT_ENTER and
wx.EVT_COMBOBOX_CLOSEUP as suggested in the attached patch but I would
like why wx.EVT_TEXT_ENTER is not working at all, do you have any
idea?
The TextCtrl must have wx.TE_PROCESS_ENTER style set, that might be the
problem.
I was dealing with this by checking the existence of the typed map after
every typed letter. This can slow it down little bit during typing, so I am
not sure which solution is actually better. With the event bound to Enter,
users sometimes don't understand they have to press Enter.
Anna
thanks
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Hi,
Anna sorry for the delay in the answer
On 30 December 2015 at 16:51, Anna Petrášová <kratochanna@gmail.com> wrote:
The TextCtrl must have wx.TE_PROCESS_ENTER style set, that might be the
problem.
ok, in my case I'm speaking about a wx.combo.ComboCtrl but probably is
the same. Could I add an option style (set by default to None) in
Select class of gselect.py?
I was dealing with this by checking the existence of the typed map after
every typed letter. This can slow it down little bit during typing, so I am
not sure which solution is actually better. With the event bound to Enter,
users sometimes don't understand they have to press Enter.
I agree with this, I also have no clear idea about the better
solution, other opinions?
Anna
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
On Tue, Jan 12, 2016 at 7:50 AM, Luca Delucchi <lucadeluge@gmail.com> wrote:
Hi,
Anna sorry for the delay in the answer
On 30 December 2015 at 16:51, Anna Petrášová <kratochanna@gmail.com>
wrote:
>
>
> The TextCtrl must have wx.TE_PROCESS_ENTER style set, that might be the
> problem.
>
ok, in my case I'm speaking about a wx.combo.ComboCtrl but probably is
the same. Could I add an option style (set by default to None) in
Select class of gselect.py?
Yes. I have some doubts it will work consistently across all platforms,
but I can test on Windows if you need.
> I was dealing with this by checking the existence of the typed map after
> every typed letter. This can slow it down little bit during typing, so I
am
> not sure which solution is actually better. With the event bound to
Enter,
> users sometimes don't understand they have to press Enter.
>
I agree with this, I also have no clear idea about the better
solution, other opinions?
> Anna
>
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
On 14 January 2016 at 04:07, Anna Petrášová <kratochanna@gmail.com> wrote:
ok, in my case I'm speaking about a wx.combo.ComboCtrl but probably is
the same. Could I add an option style (set by default to None) in
Select class of gselect.py?
Yes. I have some doubts it will work consistently across all platforms, but
I can test on Windows if you need.
Yes please, could you test the attached diff on Windows?
Is there anyone could test it also on mac?
I tested it on Linux/Debian with wx python version 3.0.1.1 and it
works correctly.
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
(attachments)
tplot_frame.diff (9.97 KB)
On Thu, Jan 14, 2016 at 3:50 AM, Luca Delucchi <lucadeluge@gmail.com> wrote:
On 14 January 2016 at 04:07, Anna Petrášová <kratochanna@gmail.com> wrote:
>
>> ok, in my case I'm speaking about a wx.combo.ComboCtrl but probably is
>> the same. Could I add an option style (set by default to None) in
>> Select class of gselect.py?
>>
> Yes. I have some doubts it will work consistently across all platforms,
but
> I can test on Windows if you need.
>
Yes please, could you test the attached diff on Windows?
Is there anyone could test it also on mac?
I tested it on Linux/Debian with wx python version 3.0.1.1 and it
works correctly.
Hi,
I didn't even get to testing it on Windows, it doesn't work on my Ubuntu:
Traceback (most recent call last):
File
"/home/anna/dev/grass/trunk1/dist.x86_64-pc-linux-gnu/scripts/g.gui.tplot",
line 135, in <module>
main()
File
"/home/anna/dev/grass/trunk1/dist.x86_64-pc-linux-gnu/scripts/g.gui.tplot",
line 116, in main
frame = TplotFrame(parent=None, giface=StandaloneGrassInterface())
File
"/home/anna/dev/grass/trunk1/dist.x86_64-pc-linux-gnu/gui/wxpython/tplot/frame.py",
line 105, in __init__
self._layout()
File
"/home/anna/dev/grass/trunk1/dist.x86_64-pc-linux-gnu/gui/wxpython/tplot/frame.py",
line 230, in _layout
self.datasetSelectV.Bind(wx.EVT_COMBOBOX_CLOSEUP,
AttributeError: 'module' object has no attribute 'EVT_COMBOBOX_CLOSEUP'
I have wxpython 2.8.12.1. EVT_COMBOBOX_CLOSEUP was added for wxpython 3, so
I don't think we can use that yet. If you really want it there, you have to
ask for wx version in the code and have two different codes.
Anna
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org