Grid with any widgets

Hi,
  I try to build a ListCtrl-with-header-like widget that would contains custom widgets in cells. I'm open to any solutions, both Python and C++. Is the simplest solution to build my own grid sizer with ability to set columns sizes?
Thx,

By the way, I haven't followed wxWidgets evolution, but it there planning for support of more composite widgets a la Swing (it would be nice if wx.ListCtrl would take any wx.Control like wx.ToolBar)?

Regards,
Nicolas

Nicolas Fleury wrote:

Hi,
    I try to build a ListCtrl-with-header-like widget that would contains custom widgets in cells. I'm open to any solutions, both Python and C++. Is the simplest solution to build my own grid sizer with ability to set columns sizes?

You would only use a sizer if you are going to make a compoisite widget composed of several others. You probably don't want to do that for something like a ListCtrl as other than when you put widgets in the cells everything will probably be self drawn. Instead I would just manage the size and placement of the child widgets (when used) within the class itself as it knows exactly where all the cells are.

You might want to look at the implementation of the generic wxListCtrl for ideas, (src/generic/listctrl.cpp)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

You would only use a sizer if you are going to make a compoisite widget composed of several others. You probably don't want to do that for something like a ListCtrl as other than when you put widgets in the cells everything will probably be self drawn. Instead I would just manage the size and placement of the child widgets (when used) within the class itself as it knows exactly where all the cells are.

You might want to look at the implementation of the generic wxListCtrl for ideas, (src/generic/listctrl.cpp)

Thx, that's exactly what I needed. I think we definitely need more composite widgets in addition to those bound to native widgets. If the company I work for is willing to change the copyright, I will release my work to the public if it's welcomed. Handling the resize of columns with cursor and drawed line is something I expect others would appreciate to not redo.

Regards,
Nicolas