Hi, friends!
First look at example code I provide.
There is one little weird thing, when I click in 'Type' cell and make my
choise by mouse there nothing happen. The choice is stay the same that
it was be, but this don't happened if I make choise by keyboard's keys.
With keyboard keys is everything works fine.
The the second problem. How to make that, if the 'Title' cell in the row
is epmty, but I click on a 'Type' cell in this row and select something,
than this choices will be ignored?
The third problem. How to make a autoexpandable colums, so it will be
expanded on full width when I shrink/expand the frame? The something
that can be maked with a wxListCtrl mixins.
Regards, Basil.
PS. Sorry for my english
test.py (5.42 KB)
Basil Shubin пишет:
Hi, friends!
First look at example code I provide.
There is one little weird thing, when I click in 'Type' cell and make my
choise by mouse there nothing happen. The choice is stay the same that
it was be, but this don't happened if I make choise by keyboard's keys.
With keyboard keys is everything works fine.
The the second problem. How to make that, if the 'Title' cell in the row
is epmty, but I click on a 'Type' cell in this row and select something,
than this choices will be ignored?
The third problem. How to make a autoexpandable colums, so it will be
expanded on full width when I shrink/expand the frame? The something
that can be maked with a wxListCtrl mixins.
Regards, Basil.
PS. Sorry for my english
Forget to say:
- wxPython 2.6.1.2,
- Python 2.3.5,
- libgtk 2.6.4,
- Debian GNU/Linux 'Sarge'.
Basil Shubin ÐÉÛÅÔ:
Hi, friends!
First look at example code I provide.
There is one little weird thing, when I click in 'Type' cell and make my
choise by mouse there nothing happen. The choice is stay the same that
it was be, but this don't happened if I make choise by keyboard's keys.
With keyboard keys is everything works fine.
If I recall this was a known bug, but it's already fixed, at least I tried
with wxPython-2.6.3.2 on linux and it's working.
The the second problem. How to make that, if the 'Title' cell in the row
is epmty, but I click on a 'Type' cell in this row and select something,
than this choices will be ignored?
Doesn't understand what you mean here.
···
The third problem. How to make a autoexpandable colums, so it will be
expanded on full width when I shrink/expand the frame? The something
that can be maked with a wxListCtrl mixins.
Regards, Basil.
PS. Sorry for my english
Forget to say:
- wxPython 2.6.1.2,
- Python 2.3.5,
- libgtk 2.6.4,
- Debian GNU/Linux 'Sarge'.
Hi,
Ricardo Pedroso пишет:
Basil Shubin ÐÉÛÅÔ:
Hi, friends!
First look at example code I provide.
There is one little weird thing, when I click in 'Type' cell and make my
choise by mouse there nothing happen. The choice is stay the same that
it was be, but this don't happened if I make choise by keyboard's keys.
With keyboard keys is everything works fine.
If I recall this was a known bug, but it's already fixed, at least I tried
with wxPython-2.6.3.2 on linux and it's working.
Yes! Now its working!
The the second problem. How to make that, if the 'Title' cell in the row
is epmty, but I click on a 'Type' cell in this row and select something,
than this choices will be ignored?
Doesn't understand what you mean here.
Please look at new attachment. I slightly change the SetValue method.
What can you say about it? Is there more elegant solution?
Now there two other problem.
How to delete the row when I change string in 'Title' column to empty string? The question is how to delete rows?
The second is more difficult for me, is how to make 'Type' column autoexpandable by horizontal so it can occupy all empty space in a frame?
test.py (5.73 KB)
···
The third problem. How to make a autoexpandable colums, so it will be
expanded on full width when I shrink/expand the frame? The something
that can be maked with a wxListCtrl mixins.
Regards, Basil.
PS. Sorry for my english
Forget to say:
- wxPython 2.6.1.2,
- Python 2.3.5,
- libgtk 2.6.4,
- Debian GNU/Linux 'Sarge'.
Please look at new attachment. I slightly change the SetValue method.
What can you say about it? Is there more elegant solution?
Now there two other problem.
How to delete the row when I change string in 'Title' column to empty
string? The question is how to delete rows?
To delete rows see the Grid_MegaExample.py in the wxPython demo, and
search for GRIDTABLE_NOTIFY_ROWS_DELETED there.
The second is more difficult for me, is how to make 'Type' column
autoexpandable by horizontal so it can occupy all empty space in a frame?
Maybe somenthing like this:
class ExercisesTableGrid(gridlib.Grid):
"""Exercises table grid"""
def __init__(self, parent):
gridlib.Grid.__init__(self, parent)
(...)
self.Bind(wx.EVT_SIZE, self.OnSize)
def DoColAutoWidth(self):
sx, sy = self.GetClientSize()
vx, vy = self.GetViewStart()
px, py = self.GetScrollPixelsPerUnit()
sx -= ( self.GetColSize(0) + (vx * px) )
self.SetColSize(1, sx)
def OnSize(self, evt):
self.DoColAutoWidth()
evt.Skip()
Ricardo