Hi, friends!
1. Is there ability to make such behavior for wxGrid, like row sorting (ascending/descending) by clicking on a column label in wxListCtrl (with mixins)? Do you have any suggestion or examples?
2. How to implement following: ability to drug column label to right or to left, than drop it and column stay on a new position? i.e. give to the user ability to change column order in a wxGrid. Do you have any suggestion or examples?
Thanks in advance!
···
--
Basil Shubin
Freelance Software Developer
Hi,
1. Is there ability to make such behavior for wxGrid, like row sorting
(ascending/descending) by clicking on a column label in wxListCtrl (with
mixins)? Do you have any suggestion or examples?
Well, I don't think there are built in functions for doing that, but
you can catch wx.grid.EVT_GRID_LABEL_LEFT_CLICK, and then resort your
grid by whatever criteria you want. Also, it would be nice to have a
Grid with that functionality as a part of wxPython demo collection.
2. How to implement following: ability to drug column label to right or
to left, than drop it and column stay on a new position? i.e. give to
the user ability to change column order in a wxGrid. Do you have any
suggestion or examples?
I don't know how they did it, but you can easily find out:
GridDragable.py in wxPython 'demo' directory ;). Too bad 'wxPython in
Action' doesn't mention wx.Grids with draggable columns.
HTH,
···
On 10/21/06, Basil Shubin <bashu@yandex.ru> wrote:
--
Karlo Lozovina -- Mosor
"Parce mihi domine quia Dalmata sum."
Basil Shubin wrote:
Hi, friends!
1. Is there ability to make such behavior for wxGrid, like row sorting (ascending/descending) by clicking on a column label in wxListCtrl (with mixins)? Do you have any suggestion or examples?
2. How to implement following: ability to drug column label to right or to left, than drop it and column stay on a new position? i.e. give to the user ability to change column order in a wxGrid. Do you have any suggestion or examples?
I forget exactly what we did, but both these things exist in dabo's dGrid. dabo.ui wraps wxPython... you can find it at http://dabodev.com. Enjoy!
···
--
pkm ~ http://paulmcnett.com
You're being modest. The Dabo grid comes with all those behaviors and
more (such as typing to jump to the first matching record). I don't
have to code a thing - it just does it!
I don't know why people keep wanting to implement things that have
already been done better than they could ever do it. If you want UI
controls that let you work effectively, dabo.ui is far and away the
best solution.
···
On 10/21/06, Paul McNett <p@ulmcnett.com> wrote:
I forget exactly what we did, but both these things exist in dabo's
dGrid. dabo.ui wraps wxPython... you can find it at http://dabodev.com.
Enjoy!
--
# p.d.
Basil Shubin пишет:
Hi, friends!
1. Is there ability to make such behavior for wxGrid, like row sorting (ascending/descending) by clicking on a column label in wxListCtrl (with mixins)? Do you have any suggestion or examples?
2. How to implement following: ability to drug column label to right or to left, than drop it and column stay on a new position? i.e. give to the user ability to change column order in a wxGrid. Do you have any suggestion or examples?
Alas, Dabo lacks of documentations, guides and tutorials. And it's look incomplete, I think. So, I still search for answers on above question.
···
--
Basil Shubin
Freelance Software Developer
3. How to make following: if I click on a some cell, then an entire row will be selected (like it wxListCtrl)?
···
--
Basil Shubin
Freelance Software Developer
Someday I hope to be able to contribute some documentation to Dabo, in
return for all I've gotten from being able to use it for free. I just
don't feel like I know it well enough to write anything that adds to
what's there already. The Wiki has lots of good stuff, but it could
use more.
I think that the situation on docs is a lot like it was with wxPython
before the book was written. There was API documentation, but not a
lot of "how do I do this?" stuff. Instead, you had Robin here
answering dozens of questions a day, and being the author of wxPython,
he usually had pretty good answers!
The Dabo folks are like that, too. They are always answering questions
on their lists, helping out people new to Dabo, and even adding
features that people have requested that same day! I've seen you
posting on the lists; keep it up and I'm sure you'll be pleased with
the quality of the responses you get from the authors.
···
On 10/22/06, Basil Shubin <bashu@yandex.ru> wrote:
Alas, Dabo lacks of documentations, guides and tutorials. And it's look
incomplete, I think. So, I still search for answers on above question.
--
# p.d.
Re: [wxPython-users] wxGrid, sorting and column position changing?
Hi Basil,
You can change the «selectionmode» of the grid with:
mygrid.SetSelectionMode(wx.grid.Grid.wxGridSelectRows)
AB
···
De: Basil Shubin [mailto:bashu@yandex.ru]
Enviada: dom 22-10-2006 8:59
Para:
wxPython-users@lists.wxwidgets.org
Assunto: Re: [wxPython-users] wxGrid, sorting and column position changing?
- How to make following: if I click on a some cell, then an entire row
will be selected (like it wxListCtrl)?
–
Basil Shubin
Freelance Software Developer
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Thank you for that excellent demonstration of why coding in Dabo is so
much better than coding in raw wxPython. The same command in Dabo
would be:
mygrid.SelectionMode = "row"
Look at both, and tell me which API you'd rather be coding to.
···
On 10/22/06, António Barbosa (GN/dpi) <ab@globalnoticias.pt> wrote:
You can change the «selectionmode» of the grid with:
mygrid.SetSelectionMode(wx.grid.Grid.wxGridSelectRows)
--
# p.d.
Basil Shubin said the following:
Hi, friends!
1. Is there ability to make such behavior for wxGrid, like row sorting (ascending/descending) by clicking on a column label in wxListCtrl (with mixins)? Do you have any suggestion or examples?
2. How to implement following: ability to drug column label to right or to left, than drop it and column stay on a new position? i.e. give to the user ability to change column order in a wxGrid. Do you have any suggestion or examples?
Thanks in advance!
I am surprised no one has suggested that you look at the wxPython demos. Unless I have misunderstood you, both capabilities are demonstrated in the wxGrid samples. Specifically, the grid MegaExample illustrates sorting and one of the grid examples demonstrates dragging rows/columns.
Regards:
···
--
------------------------------------------------------------------------
/*Lawrence Gray */* /lawrence.gray@zing-net.ca/ <mailto:lawrence.gray@zing-net.ca> *
------------------------------------------------------------------------