Discussion:
[Gambas-user] Problem with tableview when in edit mode
Doriano Blengino
2009-12-03 15:49:24 UTC
Permalink
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.

With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).

Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.

When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key is
Left or Right, the cell walking goes even further, wrapping to the next
or previous row and restarting.

I created an executable, and it behaves the same.

Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.

The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from
a third machine running an X11 server (XMing). So it seems the problem
is related to gambas.

I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor
will travel in the requested direction 'til the end of the grid.

What can I do about this? I was very very reluctant to upgrade gambas;
but I reached a point where I could no more install or upgrade my
system. Even when trying to install a simple htop(1) from debian
repositories, I was told to upgrade some fu*ing library, which in turn
meant to upgrade gambas, which in turn meant to upgrade QT, GTK,
poppler, libc, libc-bin... well, *hundreds* of packages. I will contact
the debian mantainer about this - I don't care about postgres, firebird,
curl, smtp, opengl, sdl, v4l, xml and things. It seems that to install
gambas on debian one must pull in all the world. The other machine,
having the old version of gambas, has no problems - I copied the gambas
binaries directly, instead of installing them from packages. I can
install and upgrade, and everything runs smoothly. Sorry for the
debian-related blow.

Regards,
Doriano
Dimitris Anogiatis
2009-12-03 17:04:08 UTC
Permalink
This post might be inappropriate. Click to display it.
Doriano Blengino
2009-12-03 17:24:30 UTC
Permalink
Post by Dimitris Anogiatis
Doriano,
from the sample project you posted, I can verify the behavior you described
when you use the arrow keys.
If you click on individual cells it jumps fine. But if you try and type
something on one cell and then click on the next one
the text you typed before disappears.
Perhaps this is because there is no "save" event implemented. But the
complain was about another error: even without writing, but simply
changing the focused cell with the cursor keys, do you see something
strange or not?
Post by Dimitris Anogiatis
So perhaps a few more changes happened in the tableview control from 2.0 to
2.15 (the one you upgraded to) that are
not yet documented and you just might have to consider using a different
approach.
Which different approach? I would like to identify the cause of this
problem. If it is gambas 2.15, and gambas 2.16 or 2.17 solves, I switch.
If all gambas versions above 2.0.0 have the problem, I stick with 2.0.0.
If the problem are QT libraries, I change them. But surely I don't want
to change a painful code made to compile an invoice through a tableview
with something else...
Post by Dimitris Anogiatis
I use Debian Lenny 5.0.3 and Gambas 2.16
I hope this helps.
...it would help if you told me if the error is still there in 2.16 or
not...
BTW: my debian version (cat /etc/debian_version) shows 5.0.2, and is
fully updated. How it goes you have 5.0.3?
Post by Dimitris Anogiatis
Regards,
Dimitris
On Thu, Dec 3, 2009 at 8:49 AM, Doriano Blengino <
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1), running
on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor slips
on every possible cell in the request direction, until it finds the end of
the tableview. But this is not enough: if the cursor key is Left or Right,
the cell walking goes even further, wrapping to the next or previous row and
restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version 2.0.0,
and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from a
third machine running an X11 server (XMing). So it seems the problem is
related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor will
travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas; but
I reached a point where I could no more install or upgrade my system. Even
when trying to install a simple htop(1) from debian repositories, I was told
to upgrade some fu*ing library, which in turn meant to upgrade gambas, which
in turn meant to upgrade QT, GTK, poppler, libc, libc-bin... well,
*hundreds* of packages. I will contact the debian mantainer about this - I
don't care about postgres, firebird, curl, smtp, opengl, sdl, v4l, xml and
things. It seems that to install gambas on debian one must pull in all the
world. The other machine, having the old version of gambas, has no problems
- I copied the gambas binaries directly, instead of installing them from
packages. I can install and upgrade, and everything runs smoothly. Sorry for
the debian-related blow.
Regards,
Doriano
Charlie Reinl
2009-12-03 17:31:13 UTC
Permalink
Post by Doriano Blengino
Post by Dimitris Anogiatis
Doriano,
from the sample project you posted, I can verify the behavior you described
when you use the arrow keys.
If you click on individual cells it jumps fine. But if you try and type
something on one cell and then click on the next one
the text you typed before disappears.
Perhaps this is because there is no "save" event implemented. But the
complain was about another error: even without writing, but simply
changing the focused cell with the cursor keys, do you see something
strange or not?
Post by Dimitris Anogiatis
So perhaps a few more changes happened in the tableview control from 2.0 to
2.15 (the one you upgraded to) that are
not yet documented and you just might have to consider using a different
approach.
Which different approach? I would like to identify the cause of this
problem. If it is gambas 2.15, and gambas 2.16 or 2.17 solves, I switch.
If all gambas versions above 2.0.0 have the problem, I stick with 2.0.0.
If the problem are QT libraries, I change them. But surely I don't want
to change a painful code made to compile an invoice through a tableview
with something else...
Post by Dimitris Anogiatis
I use Debian Lenny 5.0.3 and Gambas 2.16
I hope this helps.
...it would help if you told me if the error is still there in 2.16 or
not...
BTW: my debian version (cat /etc/debian_version) shows 5.0.2, and is
fully updated. How it goes you have 5.0.3?
Post by Dimitris Anogiatis
Regards,
Dimitris
On Thu, Dec 3, 2009 at 8:49 AM, Doriano Blengino <
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1), running
on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor slips
on every possible cell in the request direction, until it finds the end of
the tableview. But this is not enough: if the cursor key is Left or Right,
the cell walking goes even further, wrapping to the next or previous row and
restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version 2.0.0,
and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from a
third machine running an X11 server (XMing). So it seems the problem is
related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor will
travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas; but
I reached a point where I could no more install or upgrade my system. Even
when trying to install a simple htop(1) from debian repositories, I was told
to upgrade some fu*ing library, which in turn meant to upgrade gambas, which
in turn meant to upgrade QT, GTK, poppler, libc, libc-bin... well,
*hundreds* of packages. I will contact the debian mantainer about this - I
don't care about postgres, firebird, curl, smtp, opengl, sdl, v4l, xml and
things. It seems that to install gambas on debian one must pull in all the
world. The other machine, having the old version of gambas, has no problems
- I copied the gambas binaries directly, instead of installing them from
packages. I can install and upgrade, and everything runs smoothly. Sorry for
the debian-related blow.
Regards,
Doriano
No same with

2.18.0
Revision: 2447
--
Amicalement
Charlie
Doriano Blengino
2009-12-03 17:47:16 UTC
Permalink
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Doriano,
from the sample project you posted, I can verify the behavior you described
when you use the arrow keys.
If you click on individual cells it jumps fine. But if you try and type
something on one cell and then click on the next one
the text you typed before disappears.
Perhaps this is because there is no "save" event implemented. But the
complain was about another error: even without writing, but simply
changing the focused cell with the cursor keys, do you see something
strange or not?
Post by Dimitris Anogiatis
So perhaps a few more changes happened in the tableview control from 2.0 to
2.15 (the one you upgraded to) that are
not yet documented and you just might have to consider using a different
approach.
Which different approach? I would like to identify the cause of this
problem. If it is gambas 2.15, and gambas 2.16 or 2.17 solves, I switch.
If all gambas versions above 2.0.0 have the problem, I stick with 2.0.0.
If the problem are QT libraries, I change them. But surely I don't want
to change a painful code made to compile an invoice through a tableview
with something else...
Post by Dimitris Anogiatis
I use Debian Lenny 5.0.3 and Gambas 2.16
I hope this helps.
...it would help if you told me if the error is still there in 2.16 or
not...
BTW: my debian version (cat /etc/debian_version) shows 5.0.2, and is
fully updated. How it goes you have 5.0.3?
Post by Dimitris Anogiatis
Regards,
Dimitris
On Thu, Dec 3, 2009 at 8:49 AM, Doriano Blengino <
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1), running
on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor slips
on every possible cell in the request direction, until it finds the end of
the tableview. But this is not enough: if the cursor key is Left or Right,
the cell walking goes even further, wrapping to the next or previous row and
restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version 2.0.0,
and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from a
third machine running an X11 server (XMing). So it seems the problem is
related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor will
travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas; but
I reached a point where I could no more install or upgrade my system. Even
when trying to install a simple htop(1) from debian repositories, I was told
to upgrade some fu*ing library, which in turn meant to upgrade gambas, which
in turn meant to upgrade QT, GTK, poppler, libc, libc-bin... well,
*hundreds* of packages. I will contact the debian mantainer about this - I
don't care about postgres, firebird, curl, smtp, opengl, sdl, v4l, xml and
things. It seems that to install gambas on debian one must pull in all the
world. The other machine, having the old version of gambas, has no problems
- I copied the gambas binaries directly, instead of installing them from
packages. I can install and upgrade, and everything runs smoothly. Sorry for
the debian-related blow.
Regards,
Doriano
No same with
2.18.0
Revision: 2447
Sorry Charlie - I don't understand... "no" what? :-)
Does the cursor travel a lot, or the 2.18 version is exempt (ie, has no
bug?)?

Thank you,
Doriano
Dimitris Anogiatis
2009-12-03 18:20:11 UTC
Permalink
Doriano,

On my system, when I use the mouse and click on a different cell it jumps
just fine.
The behavior (the error) that you described occurs when I use the cursor
keys.

What I meant by different approach was perhaps you should use something else
other than the GotFocus event and LAST.Edit. if it works on 2.0 but doesn't
work
in 2.15, 2.16 and 2.18 (Charlie users 2.18, I use 2.16 and the problem is
probably
not solved in 2.17) then it seems to me (and it's just my opinion) that your
code
needs to be somewhat revised.

BTW 5.0.3 is the latest Debian stable (Check
http://www.debian.org/CD/http-ftp/#stable).
Perhaps we use different repositories.

Regards,
Dimitris

On Thu, Dec 3, 2009 at 10:47 AM, Doriano Blengino <
Post by Dimitris Anogiatis
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Doriano,
from the sample project you posted, I can verify the behavior you
described
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
when you use the arrow keys.
If you click on individual cells it jumps fine. But if you try and type
something on one cell and then click on the next one
the text you typed before disappears.
Perhaps this is because there is no "save" event implemented. But the
complain was about another error: even without writing, but simply
changing the focused cell with the cursor keys, do you see something
strange or not?
Post by Dimitris Anogiatis
So perhaps a few more changes happened in the tableview control from
2.0 to
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
2.15 (the one you upgraded to) that are
not yet documented and you just might have to consider using a
different
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
approach.
Which different approach? I would like to identify the cause of this
problem. If it is gambas 2.15, and gambas 2.16 or 2.17 solves, I switch.
If all gambas versions above 2.0.0 have the problem, I stick with 2.0.0.
If the problem are QT libraries, I change them. But surely I don't want
to change a painful code made to compile an invoice through a tableview
with something else...
Post by Dimitris Anogiatis
I use Debian Lenny 5.0.3 and Gambas 2.16
I hope this helps.
...it would help if you told me if the error is still there in 2.16 or
not...
BTW: my debian version (cat /etc/debian_version) shows 5.0.2, and is
fully updated. How it goes you have 5.0.3?
Post by Dimitris Anogiatis
Regards,
Dimitris
On Thu, Dec 3, 2009 at 8:49 AM, Doriano Blengino <
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
on every possible cell in the request direction, until it finds the
end of
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
the tableview. But this is not enough: if the cursor key is Left or
Right,
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
the cell walking goes even further, wrapping to the next or previous
row and
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0,
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines
from a
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
third machine running an X11 server (XMing). So it seems the problem
is
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
related to gambas.
I send a sample project that shows the problem. Launch the
application,
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
click on the Tableview to focus it, and press a cursor key. The cursor
will
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas;
but
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
I reached a point where I could no more install or upgrade my system.
Even
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
when trying to install a simple htop(1) from debian repositories, I
was told
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
to upgrade some fu*ing library, which in turn meant to upgrade gambas,
which
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
in turn meant to upgrade QT, GTK, poppler, libc, libc-bin... well,
*hundreds* of packages. I will contact the debian mantainer about this
- I
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
don't care about postgres, firebird, curl, smtp, opengl, sdl, v4l, xml
and
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
things. It seems that to install gambas on debian one must pull in all
the
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
world. The other machine, having the old version of gambas, has no
problems
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
- I copied the gambas binaries directly, instead of installing them
from
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
packages. I can install and upgrade, and everything runs smoothly.
Sorry for
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Post by Doriano Blengino
the debian-related blow.
Regards,
Doriano
No same with
2.18.0
Revision: 2447
Sorry Charlie - I don't understand... "no" what? :-)
Does the cursor travel a lot, or the 2.18 version is exempt (ie, has no
bug?)?
Thank you,
Doriano
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Charlie Reinl
2009-12-03 19:48:28 UTC
Permalink
Post by Doriano Blengino
Post by Charlie Reinl
Post by Doriano Blengino
Post by Dimitris Anogiatis
Doriano,
from the sample project you posted, I can verify the behavior you described
when you use the arrow keys.
If you click on individual cells it jumps fine. But if you try and type
something on one cell and then click on the next one
the text you typed before disappears.
Perhaps this is because there is no "save" event implemented. But the
complain was about another error: even without writing, but simply
changing the focused cell with the cursor keys, do you see something
strange or not?
Post by Dimitris Anogiatis
So perhaps a few more changes happened in the tableview control from 2.0 to
2.15 (the one you upgraded to) that are
not yet documented and you just might have to consider using a different
approach.
Which different approach? I would like to identify the cause of this
problem. If it is gambas 2.15, and gambas 2.16 or 2.17 solves, I switch.
If all gambas versions above 2.0.0 have the problem, I stick with 2.0.0.
If the problem are QT libraries, I change them. But surely I don't want
to change a painful code made to compile an invoice through a tableview
with something else...
Post by Dimitris Anogiatis
I use Debian Lenny 5.0.3 and Gambas 2.16
I hope this helps.
...it would help if you told me if the error is still there in 2.16 or
not...
BTW: my debian version (cat /etc/debian_version) shows 5.0.2, and is
fully updated. How it goes you have 5.0.3?
Post by Dimitris Anogiatis
Regards,
Dimitris
On Thu, Dec 3, 2009 at 8:49 AM, Doriano Blengino <
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1), running
on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor slips
on every possible cell in the request direction, until it finds the end of
the tableview. But this is not enough: if the cursor key is Left or Right,
the cell walking goes even further, wrapping to the next or previous row and
restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version 2.0.0,
and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from a
third machine running an X11 server (XMing). So it seems the problem is
related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor will
travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas; but
I reached a point where I could no more install or upgrade my system. Even
when trying to install a simple htop(1) from debian repositories, I was told
to upgrade some fu*ing library, which in turn meant to upgrade gambas, which
in turn meant to upgrade QT, GTK, poppler, libc, libc-bin... well,
*hundreds* of packages. I will contact the debian mantainer about this - I
don't care about postgres, firebird, curl, smtp, opengl, sdl, v4l, xml and
things. It seems that to install gambas on debian one must pull in all the
world. The other machine, having the old version of gambas, has no problems
- I copied the gambas binaries directly, instead of installing them from
packages. I can install and upgrade, and everything runs smoothly. Sorry for
the debian-related blow.
Regards,
Doriano
No same with
2.18.0
Revision: 2447
Sorry Charlie - I don't understand... "no" what? :-)
Does the cursor travel a lot, or the 2.18 version is exempt (ie, has no
bug?)?
Thank you,
Doriano
Sorry Dariano,

no meant, has not changed, even in 2.18.0 Revision: 2447 , the cursor
moves from top left to bottom right and return if using left/right arrow
key, or top to bottom and return if using up/down arrow key.

Oh, tableview is a gambas written component in gb.form there I think
you find the problem.
--
Amicalement
Charlie
Doriano Blengino
2009-12-03 20:32:45 UTC
Permalink
Post by Charlie Reinl
Sorry Dariano,
no meant, has not changed, even in 2.18.0 Revision: 2447 , the cursor
moves from top left to bottom right and return if using left/right arrow
key, or top to bottom and return if using up/down arrow key.
Oh, tableview is a gambas written component in gb.form there I think
you find the problem.
Thanks to you and Dimitri.

It seems that the gambas byte-code generated by 2.15 is compatible with
2.0, so I can stick with version 2.0.0.
I would like to hear Benoit about this.
Post by Charlie Reinl
What I meant by different approach was perhaps you should use something else
other than the GotFocus event and LAST.Edit. if it works on 2.0 but doesn't
work
in 2.15, 2.16 and 2.18 (Charlie users 2.18, I use 2.16 and the problem is
probably
not solved in 2.17) then it seems to me (and it's just my opinion) that your
code
needs to be somewhat revised.
No, it is not my code that has to be revised: the problem is not the
GotFocus event, is that when in edit mode, if you press a cursor key the
tableview goes crazy. Whatever way I choose to enter edit mode, I need
to edit cells - otherwise what is tableview for? And when in edit mode,
you must be allowed to use the cursor keys... or not? Moreover, I use
the tableview Click event - that event gets called every time the
focused cell changes; by pressing a cursor key once, I see this click
event called over and over. Clearly, there is something wrong in tableview.
Post by Charlie Reinl
BTW 5.0.3 is the latest Debian stable (Check
http://www.debian.org/CD/http-ftp/#stable).
Perhaps we use different repositories.
Yes we do - I use the fastweb (an italian company) repository (because
it is free, for me). But they should be simply mirrors. Who knows?

Again, thanks to you two. I will investigate more - but I don't want to
peek and poke with gambas sources.

Regards,
--
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."
Charlie Reinl
2009-12-03 21:10:47 UTC
Permalink
Post by Doriano Blengino
Post by Charlie Reinl
Sorry Dariano,
no meant, has not changed, even in 2.18.0 Revision: 2447 , the cursor
moves from top left to bottom right and return if using left/right arrow
key, or top to bottom and return if using up/down arrow key.
Oh, tableview is a gambas written component in gb.form there I think
you find the problem.
Thanks to you and Dimitri.
It seems that the gambas byte-code generated by 2.15 is compatible with
2.0, so I can stick with version 2.0.0.
I would like to hear Benoit about this.
Post by Charlie Reinl
What I meant by different approach was perhaps you should use something else
other than the GotFocus event and LAST.Edit. if it works on 2.0 but doesn't
work
in 2.15, 2.16 and 2.18 (Charlie users 2.18, I use 2.16 and the problem is
probably
not solved in 2.17) then it seems to me (and it's just my opinion) that your
code
needs to be somewhat revised.
No, it is not my code that has to be revised: the problem is not the
GotFocus event, is that when in edit mode, if you press a cursor key the
tableview goes crazy. Whatever way I choose to enter edit mode, I need
to edit cells - otherwise what is tableview for? And when in edit mode,
you must be allowed to use the cursor keys... or not? Moreover, I use
the tableview Click event - that event gets called every time the
focused cell changes; by pressing a cursor key once, I see this click
event called over and over. Clearly, there is something wrong in tableview.
Post by Charlie Reinl
BTW 5.0.3 is the latest Debian stable (Check
http://www.debian.org/CD/http-ftp/#stable).
Perhaps we use different repositories.
Yes we do - I use the fastweb (an italian company) repository (because
it is free, for me). But they should be simply mirrors. Who knows?
Again, thanks to you two. I will investigate more - but I don't want to
peek and poke with gambas sources.
Regards,
Have a look at ChangeLog 2.13 - 14 May 2009

GB.FORM

* BUG: TableView now handle the Return/Enter key by raising the
Click event instead of automatically editing the cell, so that
non-editable cells are not edited by mistake.
* BUG: The same fix was applied to the way TableView handles arrow
keys.
* BUG: The TableView editor now has the same font as the master
TableView.
*
*
*
*
*
*
Charlie Reinl
2009-12-03 21:14:23 UTC
Permalink
Post by Doriano Blengino
Post by Charlie Reinl
Sorry Dariano,
no meant, has not changed, even in 2.18.0 Revision: 2447 , the cursor
moves from top left to bottom right and return if using left/right arrow
key, or top to bottom and return if using up/down arrow key.
Oh, tableview is a gambas written component in gb.form there I think
you find the problem.
Thanks to you and Dimitri.
It seems that the gambas byte-code generated by 2.15 is compatible with
2.0, so I can stick with version 2.0.0.
I would like to hear Benoit about this.
Post by Charlie Reinl
What I meant by different approach was perhaps you should use something else
other than the GotFocus event and LAST.Edit. if it works on 2.0 but doesn't
work
in 2.15, 2.16 and 2.18 (Charlie users 2.18, I use 2.16 and the problem is
probably
not solved in 2.17) then it seems to me (and it's just my opinion) that your
code
needs to be somewhat revised.
No, it is not my code that has to be revised: the problem is not the
GotFocus event, is that when in edit mode, if you press a cursor key the
tableview goes crazy. Whatever way I choose to enter edit mode, I need
to edit cells - otherwise what is tableview for? And when in edit mode,
you must be allowed to use the cursor keys... or not? Moreover, I use
the tableview Click event - that event gets called every time the
focused cell changes; by pressing a cursor key once, I see this click
event called over and over. Clearly, there is something wrong in tableview.
Post by Charlie Reinl
BTW 5.0.3 is the latest Debian stable (Check
http://www.debian.org/CD/http-ftp/#stable).
Perhaps we use different repositories.
Yes we do - I use the fastweb (an italian company) repository (because
it is free, for me). But they should be simply mirrors. Who knows?
Again, thanks to you two. I will investigate more - but I don't want to
peek and poke with gambas sources.
Regards,
Have a look at ChangeLog 2.13 - 14 May 2009

GB.FORM

* BUG: TableView now handle the Return/Enter key by raising the
Click event instead of automatically editing the cell, so that
non-editable cells are not edited by mistake.
* BUG: The same fix was applied to the way TableView handles arrow
keys.
* BUG: The TableView editor now has the same font as the master
TableView.
*

sorry leaded by a bad key stroke CTRL+Enter in Evolution last mail left
me to early, before fished it.

So now that's done.
--
Amicalement
Charlie
Doriano Blengino
2009-12-03 22:11:45 UTC
Permalink
Post by Charlie Reinl
Post by Doriano Blengino
Post by Charlie Reinl
Sorry Dariano,
no meant, has not changed, even in 2.18.0 Revision: 2447 , the cursor
moves from top left to bottom right and return if using left/right arrow
key, or top to bottom and return if using up/down arrow key.
Oh, tableview is a gambas written component in gb.form there I think
you find the problem.
Again, thanks to you two. I will investigate more - but I don't want to
peek and poke with gambas sources.
Regards,
Have a look at ChangeLog 2.13 - 14 May 2009
GB.FORM
* BUG: TableView now handle the Return/Enter key by raising the
Click event instead of automatically editing the cell, so that
non-editable cells are not edited by mistake.
* BUG: The same fix was applied to the way TableView handles arrow
keys.
* BUG: The TableView editor now has the same font as the master
TableView.
*
This is what I mean by "investigating"!

May be that by correcting a bug, a different one has been generated. In
fact I see many click events, one for every cell visited. This is the
desirable behaviour, if only, a single keypress would generate a single
movement. Sigh.

This changelog talks about a bug I've never seen - apart from the Return
key one, I think that in versions prior than 2.13 there was nothing
wrong with arrow keys. Well, we can wait for Benoit -or- I could in the
end take a look at gb.form (but I hate to do it).

Thanks again Charlie, the fog is getting lighter.

Good night (oder gute nacht, ou bonne nuit? I'm still trying to figure
out what is your real preferred language...),
--
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."
EA7DFH
2010-03-03 19:32:34 UTC
Permalink
Post by Doriano Blengino
Post by Charlie Reinl
Post by Doriano Blengino
Post by Charlie Reinl
Sorry Dariano,
no meant, has not changed, even in 2.18.0 Revision: 2447 , the cursor
moves from top left to bottom right and return if using left/right arrow
key, or top to bottom and return if using up/down arrow key.
Oh, tableview is a gambas written component in gb.form there I think
you find the problem.
Again, thanks to you two. I will investigate more - but I don't want to
peek and poke with gambas sources.
Regards,
Have a look at ChangeLog 2.13 - 14 May 2009
GB.FORM
* BUG: TableView now handle the Return/Enter key by raising the
Click event instead of automatically editing the cell, so that
non-editable cells are not edited by mistake.
* BUG: The same fix was applied to the way TableView handles arrow
keys.
* BUG: The TableView editor now has the same font as the master
TableView.
*
This is what I mean by "investigating"!
May be that by correcting a bug, a different one has been generated. In
fact I see many click events, one for every cell visited. This is the
desirable behaviour, if only, a single keypress would generate a single
movement. Sigh.
This changelog talks about a bug I've never seen - apart from the Return
key one, I think that in versions prior than 2.13 there was nothing
wrong with arrow keys. Well, we can wait for Benoit -or- I could in the
end take a look at gb.form (but I hate to do it).
Thanks again Charlie, the fog is getting lighter.
Good night (oder gute nacht, ou bonne nuit? I'm still trying to figure
out what is your real preferred language...),
Hi all

I'm still getting this weird behavior when I push Enter or arrow keys in
edit mode. TableView goes crazy and all cells are traveled to the end.
Was this bug fixed or is it a regression?

In the meantime, TableView is still unusable for editing/saving data.

(Using Gambas 2.20 SVN 2741 on Ubuntu Karmic)

Regards,

Jesus
EA7DFH
2010-03-03 20:23:25 UTC
Permalink
Sorry, I haven't read the whole thread...

Now I'm calling Edit from the click event, and no more crazy traveling :-)

However, I'm getting a "Combobox is readonly" error when obviously I set
the second arg to TRUE:

Edit(getList(), TRUE)

But this error isn't catched (by the CATCH clause), and program hangs.

Furthermore, I'd like to begin editing when user "activates" the
control, by double clicking in the desired cell, not directly in a
single click.

If I use Edit from the _Activate event, all goes wrong again.

Is there a workaround to accomplish it?

Regards,
Jesus
Post by EA7DFH
Hi all
I'm still getting this weird behavior when I push Enter or arrow keys in
edit mode. TableView goes crazy and all cells are traveled to the end.
Was this bug fixed or is it a regression?
In the meantime, TableView is still unusable for editing/saving data.
(Using Gambas 2.20 SVN 2741 on Ubuntu Karmic)
Regards,
Jesus
Benoît Minisini
2009-12-03 22:26:35 UTC
Permalink
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key is
Left or Right, the cell walking goes even further, wrapping to the next
or previous row and restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from
a third machine running an X11 server (XMing). So it seems the problem
is related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor
will travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas;
but I reached a point where I could no more install or upgrade my
system. Even when trying to install a simple htop(1) from debian
repositories, I was told to upgrade some fu*ing library, which in turn
meant to upgrade gambas, which in turn meant to upgrade QT, GTK,
poppler, libc, libc-bin... well, *hundreds* of packages. I will contact
the debian mantainer about this - I don't care about postgres, firebird,
curl, smtp, opengl, sdl, v4l, xml and things. It seems that to install
gambas on debian one must pull in all the world. The other machine,
having the old version of gambas, has no problems - I copied the gambas
binaries directly, instead of installing them from packages. I can
install and upgrade, and everything runs smoothly. Sorry for the
debian-related blow.
Regards,
Doriano
OK, I understand the problem.

The TableView is designed so that editing a cell must be decided in the Click
event. Otherwise, if the Edit method is not called during a Click event,
keyboard events automatically jump them.

You must call the Edit method inside the Click event, not the GotFocus event.

Before, keyboard events never ignored cells, so things were working normally.

Regards,
--
Benoît Minisini
Benoît Minisini
2009-12-03 22:31:51 UTC
Permalink
Post by Benoît Minisini
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key is
Left or Right, the cell walking goes even further, wrapping to the next
or previous row and restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from
a third machine running an X11 server (XMing). So it seems the problem
is related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor
will travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas;
but I reached a point where I could no more install or upgrade my
system. Even when trying to install a simple htop(1) from debian
repositories, I was told to upgrade some fu*ing library, which in turn
meant to upgrade gambas, which in turn meant to upgrade QT, GTK,
poppler, libc, libc-bin... well, *hundreds* of packages. I will contact
the debian mantainer about this - I don't care about postgres, firebird,
curl, smtp, opengl, sdl, v4l, xml and things. It seems that to install
gambas on debian one must pull in all the world. The other machine,
having the old version of gambas, has no problems - I copied the gambas
binaries directly, instead of installing them from packages. I can
install and upgrade, and everything runs smoothly. Sorry for the
debian-related blow.
Regards,
Doriano
OK, I understand the problem.
The TableView is designed so that editing a cell must be decided in the
Click event. Otherwise, if the Edit method is not called during a Click
event, keyboard events automatically jump them.
You must call the Edit method inside the Click event, not the GotFocus event.
Before, keyboard events never ignored cells, so things were working normally.
Regards,
I filled the documentation with that information for other having the same
problem.

Regards,
--
Benoît Minisini
Doriano Blengino
2009-12-04 10:41:52 UTC
Permalink
Post by Benoît Minisini
Post by Benoît Minisini
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key is
Left or Right, the cell walking goes even further, wrapping to the next
or previous row and restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines from
a third machine running an X11 server (XMing). So it seems the problem
is related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor
will travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas;
but I reached a point where I could no more install or upgrade my
system. Even when trying to install a simple htop(1) from debian
repositories, I was told to upgrade some fu*ing library, which in turn
meant to upgrade gambas, which in turn meant to upgrade QT, GTK,
poppler, libc, libc-bin... well, *hundreds* of packages. I will contact
the debian mantainer about this - I don't care about postgres, firebird,
curl, smtp, opengl, sdl, v4l, xml and things. It seems that to install
gambas on debian one must pull in all the world. The other machine,
having the old version of gambas, has no problems - I copied the gambas
binaries directly, instead of installing them from packages. I can
install and upgrade, and everything runs smoothly. Sorry for the
debian-related blow.
Regards,
Doriano
OK, I understand the problem.
The TableView is designed so that editing a cell must be decided in the
Click event. Otherwise, if the Edit method is not called during a Click
event, keyboard events automatically jump them.
You must call the Edit method inside the Click event, not the GotFocus event.
Before, keyboard events never ignored cells, so things were working normally.
Regards,
I filled the documentation with that information for other having the same
problem.
Did you try the attached project?

I tried it once more on another machine: debian stable version 5.0.3,
libqt-mt.so.3.3.8, and gambas version 2.15.2; the error *does not* show
up, with the edit call in the GotFocus event. I just used the project
attached in the previous mail.

So the same project, in one of my offices with two different machines
shows up the problem. Other users on this list confirmed the problem;
but now, on another machine but basically the same (included the XMing
remote X server), works well. I am getting pretty confused - but I will
go till the end.

Apart from this, I can not see the point in your explanation. The
GotFocus event gets executed only once, and from there the edit method
is called. All ok - there are no problems up to now. Then, if you press
once a cursor key, several click events fire without any further
intervention, as the cells are traveled. So I think your explanation
does not fit. Unfortunately, in this office the problem does not show,
so I must wait to investigate more.

Just now, looking better at class file, I notice that the edit method is
called once in Form_Open and once in Tableview1_GotFocus. F5... error
11. Strange... just a few minutes ago it worked. I relaunch gambas and
start again.

...

Well, tried several different setups - no problems. Implemented the Save
event, and all is work as intended. The edit call can be either in the
click event or the save event, or even the GotFocus event: it is exactly
the same. I attach the new project, but I think that if the problem
shows up somewhere, it is totally unrelated to the place where the edit
call is put.

I will try better on the other office. The problem is that this kind of
works must be done on the other office, not the one I am currently in...

Regards,
Doriano
Benoît Minisini
2009-12-04 13:47:43 UTC
Permalink
Post by Doriano Blengino
Post by Benoît Minisini
Post by Benoît Minisini
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key is
Left or Right, the cell walking goes even further, wrapping to the next
or previous row and restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines
from a third machine running an X11 server (XMing). So it seems the
problem is related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor
will travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas;
but I reached a point where I could no more install or upgrade my
system. Even when trying to install a simple htop(1) from debian
repositories, I was told to upgrade some fu*ing library, which in turn
meant to upgrade gambas, which in turn meant to upgrade QT, GTK,
poppler, libc, libc-bin... well, *hundreds* of packages. I will contact
the debian mantainer about this - I don't care about postgres,
firebird, curl, smtp, opengl, sdl, v4l, xml and things. It seems that
to install gambas on debian one must pull in all the world. The other
machine, having the old version of gambas, has no problems - I copied
the gambas binaries directly, instead of installing them from packages.
I can install and upgrade, and everything runs smoothly. Sorry for the
debian-related blow.
Regards,
Doriano
OK, I understand the problem.
The TableView is designed so that editing a cell must be decided in the
Click event. Otherwise, if the Edit method is not called during a Click
event, keyboard events automatically jump them.
You must call the Edit method inside the Click event, not the GotFocus event.
Before, keyboard events never ignored cells, so things were working normally.
Regards,
I filled the documentation with that information for other having the
same problem.
Did you try the attached project?
Yes. Did you try what I told you to do?
Post by Doriano Blengino
I tried it once more on another machine: debian stable version 5.0.3,
libqt-mt.so.3.3.8, and gambas version 2.15.2; the error *does not* show
up, with the edit call in the GotFocus event. I just used the project
attached in the previous mail.
The problem is not in the GotFocus event handler. You must call Edit in the
Click event handler, otherwise, when pressing an arrow key, all cells will be
assumed as not editable.

Then, you can use Edit() in the GotFocus event handler if you want too. But
that is optional.

Regards,
--
Benoît Minisini
Doriano Blengino
2009-12-04 18:02:24 UTC
Permalink
Post by Benoît Minisini
Post by Doriano Blengino
Post by Benoît Minisini
Post by Benoît Minisini
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key is
Left or Right, the cell walking goes even further, wrapping to the next
or previous row and restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines
from a third machine running an X11 server (XMing). So it seems the
problem is related to gambas.
I send a sample project that shows the problem. Launch the application,
click on the Tableview to focus it, and press a cursor key. The cursor
will travel in the requested direction 'til the end of the grid.
What can I do about this? I was very very reluctant to upgrade gambas;
but I reached a point where I could no more install or upgrade my
system. Even when trying to install a simple htop(1) from debian
repositories, I was told to upgrade some fu*ing library, which in turn
meant to upgrade gambas, which in turn meant to upgrade QT, GTK,
poppler, libc, libc-bin... well, *hundreds* of packages. I will contact
the debian mantainer about this - I don't care about postgres,
firebird, curl, smtp, opengl, sdl, v4l, xml and things. It seems that
to install gambas on debian one must pull in all the world. The other
machine, having the old version of gambas, has no problems - I copied
the gambas binaries directly, instead of installing them from packages.
I can install and upgrade, and everything runs smoothly. Sorry for the
debian-related blow.
Regards,
Doriano
OK, I understand the problem.
The TableView is designed so that editing a cell must be decided in the
Click event. Otherwise, if the Edit method is not called during a Click
event, keyboard events automatically jump them.
You must call the Edit method inside the Click event, not the GotFocus event.
Before, keyboard events never ignored cells, so things were working normally.
Regards,
I filled the documentation with that information for other having the
same problem.
Did you try the attached project?
Yes. Did you try what I told you to do?
Post by Doriano Blengino
I tried it once more on another machine: debian stable version 5.0.3,
libqt-mt.so.3.3.8, and gambas version 2.15.2; the error *does not* show
up, with the edit call in the GotFocus event. I just used the project
attached in the previous mail.
The problem is not in the GotFocus event handler. You must call Edit in the
Click event handler, otherwise, when pressing an arrow key, all cells will be
assumed as not editable.
Then, you can use Edit() in the GotFocus event handler if you want too. But
that is optional.
Regards,
I repeat.
Post by Benoît Minisini
Well, tried several different setups - no problems. Implemented the
Save event, and all is work as intended. The edit call can be either
in the click event or the save event, or even the GotFocus event: it
is exactly the same. I attach the new project, but I think that if the
problem shows up somewhere, it is totally unrelated to the place where
the edit call is put.
This means that I tried what you told me, and even more.

I can say more. I took the original program, not the short sample I
brought to the list, and it works as well. The edit call is in three
places: the gotfocus event, the btInsert_Click and btDelete_Click
events. The last two serve to insert and delete whole rows of the tableview.

But, this is half the problem, because in this office there is no
problem (not *that* problem). As I can not prove anything right now, I
will try once more where the problem appears: in the other office. Then
I will try again what you say, and I will report results.

Just to keep in the point: what happens if a cell is assumed as not
editable? Does it happen that all the cells are traversed up to the end
of the grid? Because is that that is happening to me, and others on this
list have confirmed; I am not sure we are understanding each other.

Anyway, I will investigate and let you know (if you are interested).

Regards,
Doriano
Benoît Minisini
2009-12-04 23:03:56 UTC
Permalink
Post by Doriano Blengino
Post by Benoît Minisini
Post by Doriano Blengino
Post by Benoît Minisini
Post by Benoît Minisini
Post by Doriano Blengino
I am modifying an old program, which uses a TableView to construct an
invoice.
The tableview is almost always in edit mode.
With gambas version 2.0.0, the original version I used to write the
program, there is no problem (not this one).
Now I upgraded to gambas v. 2.15 (debian package gambas2 2.15.2-1),
running on a debian "stable" release.
When in the tableview (in edit mode) I press an arrow key, the cursor
slips on every possible cell in the request direction, until it finds
the end of the tableview. But this is not enough: if the cursor key
is Left or Right, the cell walking goes even further, wrapping to the
next or previous row and restarting.
I created an executable, and it behaves the same.
Then I copied the executable to another machine, having gbx2 version
2.0.0, and the problem does not show up.
The program uses explicitly QT; both machines have libqt-mt.so.3.3.8
installed, and the same debian "stable" os, and I use both machines
from a third machine running an X11 server (XMing). So it seems the
problem is related to gambas.
I send a sample project that shows the problem. Launch the
application, click on the Tableview to focus it, and press a cursor
key. The cursor will travel in the requested direction 'til the end
of the grid.
What can I do about this? I was very very reluctant to upgrade
gambas; but I reached a point where I could no more install or
upgrade my system. Even when trying to install a simple htop(1) from
debian repositories, I was told to upgrade some fu*ing library, which
in turn meant to upgrade gambas, which in turn meant to upgrade QT,
GTK, poppler, libc, libc-bin... well, *hundreds* of packages. I will
contact the debian mantainer about this - I don't care about
postgres, firebird, curl, smtp, opengl, sdl, v4l, xml and things. It
seems that to install gambas on debian one must pull in all the
world. The other machine, having the old version of gambas, has no
problems - I copied the gambas binaries directly, instead of
installing them from packages. I can install and upgrade, and
everything runs smoothly. Sorry for the debian-related blow.
Regards,
Doriano
OK, I understand the problem.
The TableView is designed so that editing a cell must be decided in
the Click event. Otherwise, if the Edit method is not called during a
Click event, keyboard events automatically jump them.
You must call the Edit method inside the Click event, not the GotFocus event.
Before, keyboard events never ignored cells, so things were working normally.
Regards,
I filled the documentation with that information for other having the
same problem.
Did you try the attached project?
Yes. Did you try what I told you to do?
Post by Doriano Blengino
I tried it once more on another machine: debian stable version 5.0.3,
libqt-mt.so.3.3.8, and gambas version 2.15.2; the error *does not* show
up, with the edit call in the GotFocus event. I just used the project
attached in the previous mail.
The problem is not in the GotFocus event handler. You must call Edit in
the Click event handler, otherwise, when pressing an arrow key, all cells
will be assumed as not editable.
Then, you can use Edit() in the GotFocus event handler if you want too.
But that is optional.
Regards,
I repeat.
Post by Benoît Minisini
Well, tried several different setups - no problems. Implemented the
Save event, and all is work as intended. The edit call can be either
in the click event or the save event, or even the GotFocus event: it
is exactly the same. I attach the new project, but I think that if the
problem shows up somewhere, it is totally unrelated to the place where
the edit call is put.
This means that I tried what you told me, and even more.
I can say more. I took the original program, not the short sample I
brought to the list, and it works as well. The edit call is in three
places: the gotfocus event, the btInsert_Click and btDelete_Click
events. The last two serve to insert and delete whole rows of the tableview.
But, this is half the problem, because in this office there is no
problem (not *that* problem). As I can not prove anything right now, I
will try once more where the problem appears: in the other office. Then
I will try again what you say, and I will report results.
Just to keep in the point: what happens if a cell is assumed as not
editable? Does it happen that all the cells are traversed up to the end
of the grid? Because is that that is happening to me, and others on this
list have confirmed; I am not sure we are understanding each other.
Anyway, I will investigate and let you know (if you are interested).
Regards,
Doriano
For sure there is somewhere we don't understand each other. :-)

I used a few TableView in the IDE: look at the project property dialog, in the
environment tab. You will see how I implemented them: the insert and delete
button, the Click, Data, Insert and Save event handlers... Please tell me the
difference between what I did there and what you did.

When you sent me your little example, I just added a Click event handler with
a call to Edit() inside, and everything worked as expected.

And if things works on some computers without change, maybe they use an old
version of Gambas (< 2.13).

Regards,
--
Benoît Minisini
Doriano Blengino
2009-12-05 19:33:05 UTC
Permalink
Post by Benoît Minisini
=20
When in the tableview (in edit mode) I press an arrow key, the cu=
rsor
Post by Benoît Minisini
slips on every possible cell in the request direction, until it f=
inds
Post by Benoît Minisini
the end of the tableview. But this is not enough: if the cursor k=
ey
Post by Benoît Minisini
is Left or Right, the cell walking goes even further, wrapping to=
the
Post by Benoît Minisini
next or previous row and restarting.
=20
For sure there is somewhere we don't understand each other. :-)
I used a few TableView in the IDE: look at the project property dialog,=
in the=20
Post by Benoît Minisini
environment tab. You will see how I implemented them: the insert and de=
lete=20
Post by Benoît Minisini
button, the Click, Data, Insert and Save event handlers... Please tell =
me the=20
Post by Benoît Minisini
difference between what I did there and what you did.
When you sent me your little example, I just added a Click event handle=
r with=20
Post by Benoît Minisini
a call to Edit() inside, and everything worked as expected.
And if things works on some computers without change, maybe they use an=
old=20
Post by Benoît Minisini
version of Gambas (< 2.13).
=20
Don't take me wrong. Sometimes it seems to me that you don't read the=20
whole message before replying, and sometimes it seems to me that the=20
real problem is not in evidence (english language plays a role in=20
this...). You say that you just added a Click event handler to get the=20
program work. Well, this is not the problem. The program *is* correct=20
(it does practically nothing). The sample program, without=20
modifications, on some machine runs well, and on other machines shows a=20
problem that I will explain better. When you say "old version of gambas=20
(<2.13)", again it seems that you didn't read carefully what I've=20
posted. In every post I specified precisely what gambas version was=20
installed, what os was running on, and the QT library.

Now the problem. The problem is that, when the grid is in edit mode, if=20
you press a cursor key the cursor does not move to the adiacent cell; it=20
does not stop: it travels all the cells until it stops on the upper-left=20
cell, or the lower-right one. By doing this, it scrolls the tableview up=20
or down, and if the cursor key was Left or Right, it goes to the=20
right-most or left-most, then wraps around and restarts. For every=20
visited cell a Click event is generated. Note that in the sample program=20
there was no Click handler, just to shows precisely that my program does=20
nothing strange in the click handler (by doing nothing, you can't do=20
anything strange). Now you see that I was not complaining about=20
gotfocus, or "not editable" cells, or anything else. I say that a single=20
key press should move the cursor by a single cell, not travel the whole=20
tableview.

Now the history.

1. I discovered the error on one machine, with an updated debian stable,=20
gambas v. 2.15.2, libqt-mt.so.3.3.8, while working on an old=20
application. Suspecting that the complexity of the application could=20
have hide something, I wrote a new project (the sample program). Same=20
error. Then I tried it on the other machine: same OS, same libraries,=20
same X server - only gambas different: version 2.0.0. No error.

2. I posted a message on the list, to ask if someone else saw the same=20
error. Two users confirmed it - one gambas 2.16, another with gambas=20
2.17. So the problem is alive, on at least three machines.

3. I tried on a third machine. Same os, same libraries, gambas 2.15,=20
same remote X server. Identical situation. No error.

4. Now I am at home. Same os, same libraries, gambas 2.0.0. No error.

At this point, if someone tells me that I have to modify the program to=20
make it work, I ask myself _why_ it works (I have seen more machines on=20
which the program works well than machines where the problem shows up).=20
On my machines, which are four, I've seen the problem only once. But two=20
users on this list confirmed the error. So, it seems to be an error=20
which shows up rarely, if we want to say so.

The only idea I have now is to go back to my first machine and=20
investigate more. It is very difficult to investigate on an error if=20
that error does not show up...

Now I ask you: you say you added a Click event to make the program work=20
properly. Why you did so? Why you say this event handler was missing?=20
What was the "wrong" behaviour, when the event handler was missing?

I wait for your reply; the next week I will work again on the original=20
machine (the only one where I saw the problem), and I am determined to=20
see over the fog.

Regards,

--=20
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."
Benoît Minisini
2009-12-05 20:04:59 UTC
Permalink
This post might be inappropriate. Click to display it.
Doriano Blengino
2009-12-05 21:49:23 UTC
Permalink
Post by Doriano Blengino
Don't take me wrong. Sometimes it seems to me that you don't read the
whole message before replying, and sometimes it seems to me that the
real problem is not in evidence (english language plays a role in
this...). You say that you just added a Click event handler to get the
program work. Well, this is not the problem. The program *is* correct
(it does practically nothing). The sample program, without
modifications, on some machine runs well, and on other machines shows =
a
Post by Doriano Blengino
problem that I will explain better. When you say "old version of gamba=
s
Post by Doriano Blengino
(<2.13)", again it seems that you didn't read carefully what I've
posted. In every post I specified precisely what gambas version was
installed, what os was running on, and the QT library.
Now the problem. The problem is that, when the grid is in edit mode, i=
f
Post by Doriano Blengino
you press a cursor key the cursor does not move to the adiacent cell; =
it
Post by Doriano Blengino
does not stop: it travels all the cells until it stops on the upper-le=
ft
Post by Doriano Blengino
cell, or the lower-right one. By doing this, it scrolls the tableview =
up
Post by Doriano Blengino
or down, and if the cursor key was Left or Right, it goes to the
right-most or left-most, then wraps around and restarts. For every
visited cell a Click event is generated. Note that in the sample progr=
am
Post by Doriano Blengino
there was no Click handler, just to shows precisely that my program do=
es
Post by Doriano Blengino
nothing strange in the click handler (by doing nothing, you can't do
anything strange). Now you see that I was not complaining about
gotfocus, or "not editable" cells, or anything else. I say that a sing=
le
Post by Doriano Blengino
key press should move the cursor by a single cell, not travel the whol=
e
Post by Doriano Blengino
tableview.
Now the history.
1. I discovered the error on one machine, with an updated debian stabl=
e,
Post by Doriano Blengino
gambas v. 2.15.2, libqt-mt.so.3.3.8, while working on an old
application. Suspecting that the complexity of the application could
have hide something, I wrote a new project (the sample program). Same
error. Then I tried it on the other machine: same OS, same libraries,
same X server - only gambas different: version 2.0.0. No error.
2. I posted a message on the list, to ask if someone else saw the same
error. Two users confirmed it - one gambas 2.16, another with gambas
2.17. So the problem is alive, on at least three machines.
3. I tried on a third machine. Same os, same libraries, gambas 2.15,
same remote X server. Identical situation. No error.
4. Now I am at home. Same os, same libraries, gambas 2.0.0. No error.
At this point, if someone tells me that I have to modify the program t=
o
Post by Doriano Blengino
make it work, I ask myself _why_ it works (I have seen more machines o=
n
Post by Doriano Blengino
which the program works well than machines where the problem shows up)=
=2E
Post by Doriano Blengino
On my machines, which are four, I've seen the problem only once. But t=
wo
Post by Doriano Blengino
users on this list confirmed the error. So, it seems to be an error
which shows up rarely, if we want to say so.
The only idea I have now is to go back to my first machine and
investigate more. It is very difficult to investigate on an error if
that error does not show up...
Now I ask you: you say you added a Click event to make the program wor=
k
Post by Doriano Blengino
properly. Why you did so? Why you say this event handler was missing?
What was the "wrong" behaviour, when the event handler was missing?
I wait for your reply; the next week I will work again on the original
machine (the only one where I saw the problem), and I am determined to
see over the fog.
Regards,
=20
No, no. I think I read you correctly. I am going to try to explain the =
things=20
differently...
Before Gambas 2.13, when you hit an arrow key in the TableView control,=
the=20
TableView cursor was move by one cell only, and the Edit method was cal=
led=20
automatically. So things were working *only* for TableView whose all ce=
lls are=20
editable. For TableView having some cells read-only, the keyboard manag=
ement=20
was flawed.
So, in Gambas 2.13, the Edit method is not called automatically anymore=
, and I=20
decided that a cell will be considered as "non-editable" if the Edit me=
thod=20
was not called during the Click event. And "non-editable" cells are=20
automatically ignored when using the arrow key.
That explains the behaviour you noticed in computers using Gambas >=3D =
2.13.=20
(Let's ignore the computer #3 at the moment): for example, if you are o=
n the=20
top of the TableView, and if you hit the "down arrow" key, the current =
cell=20
will be moved one by one until an editable cell is found. As you don't =
call=20
the Edit method inside the Click event handler, no cell is considered a=
s=20
editable, and so the TableView cursor is moved down to the bottom. I ho=
pe I=20
was clear!
As for the computer #3: I don't understand that you don't have the prob=
lem, as=20
the Gambas version is >=3D 2.15.
To fix your problem, you *have to* call the Edit() method inside the Cl=
ick=20
event handler. It will tell TableView that your cell are editable when =
the=20
user use the arrow keys. But, of course, you *can* use the Edit() metho=
d=20
outside of the Click event handler.
Then things will work for Gambas >=3D 2.13, and stay the same for Gamba=
s < 2.13.
Regards,
=20
Ok, so we are talking about the same thing :-)

But this does not explain why the program works well the other times=20
(computer #3, for example).

Knowing what there is behind, I will experiment (try to call edit in the=20
click event: this should stop the crazy traveling).

But, I think that traveling many cells is anyway wrong - it is too easy=20
to get the wrong behaviour. Would not it be more predictable to move=20
just one cell, and simply avoid to enter the edit mode? This way, a=20
programmer could understand that he should call edit() again.

Thanks for the more clear reply.

Regards,

--=20
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."
Loading...