hello,
a few days back I posted queries about wx.grid and had asked for a
simple example.
I could follow that example but few questions still remain.
firstly, I will like to create a grid with a few cells already filled
with data and some empty.
secondly, I want to validate the grid.
for example, if the empty cells are not filled, the first empty cell
should get the focus and a mesage should appear before the focus
shifts.
this should happen when the user presses the save button.
one more thing,
I want to add the grid directly to a panel with a vertical box sizer
and also put a horizontal line of buttons at the bottom of the grid
just above the status bar.
is vertical box sizer the right thing to use or should I go for some
grid bag sizer with 1 column and 2 rows?
please explain.
regards.
Krishnakant.
If I did it, I'd probably use a vertical BoxSizer for the grid widget and
a horizontal BoxSizer to hold the row of buttons and then but that
horizontal sizer in the vertical sizer.
You'll need to run some kind of function that iterates through the cells
and checks to see if they're empty. I've heard there's some way to build
this kind of thing in by subclassing the grid widget's methods, but I
never figured it out. Good luck!
Mike
···
-----Original Message-----
From: krishnakant Mane [mailto:researchbase@gmail.com]
Sent: Tuesday, September 25, 2007 1:16 PM
To: wxPython-users@lists.wxwidgets.org
Subject: wx.grid cell focus confusionhello,
a few days back I posted queries about wx.grid and had asked
for a simple example.
I could follow that example but few questions still remain.
firstly, I will like to create a grid with a few cells
already filled with data and some empty.
secondly, I want to validate the grid.
for example, if the empty cells are not filled, the first
empty cell should get the focus and a mesage should appear
before the focus shifts.
this should happen when the user presses the save button.
one more thing,
I want to add the grid directly to a panel with a vertical
box sizer and also put a horizontal line of buttons at the
bottom of the grid just above the status bar.
is vertical box sizer the right thing to use or should I go
for some grid bag sizer with 1 column and 2 rows?
please explain.
regards.
Krishnakant.
krishnakant Mane wrote:
hello,
a few days back I posted queries about wx.grid and had asked for a
simple example.
I could follow that example but few questions still remain.
firstly, I will like to create a grid with a few cells already filled
with data and some empty.
No problem, just put the data you need where you need it.
secondly, I want to validate the grid.
for example, if the empty cells are not filled, the first empty cell
should get the focus and a mesage should appear before the focus
shifts.
this should happen when the user presses the save button.
When the button is clicked it will get the focus, but in your button event handler you can check the data and put the focus back to the grid if needed, also moving the current cell to the one you want edited.
one more thing,
I want to add the grid directly to a panel with a vertical box sizer
and also put a horizontal line of buttons at the bottom of the grid
just above the status bar.
is vertical box sizer the right thing to use or should I go for some
grid bag sizer with 1 column and 2 rows?
Box sizers (plural) would work. You put the buttons in a horizontal box sizer, and then put that sizer in the vertical box sizer.
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!