How to place wxchoice in a wxgrid header?

More info are here:

http://stackoverflow.com/questions/14498629/how-to-place-wxchoice-in-a-wxgrid-header/14503867#comment20357243_14503867

Please help

Tymoteusz Jankowski

tel. 698 142 927

info@projektalef.pl

http://www.projektalef.pl

Jeśli wysyłasz mi pliki biurowe (dokumenty, arkusze, prezentacje…), upewnij się, że są one w formatach międzysystemowych takich jak: .ODT, .ODS, .ODP. Wszystkie wspomniane formaty można uzyskać dzięki darmowym pakietom biurowym LibreOffice, OpenOffice. Formaty te są obsługiwane przez większość pakietów biurowych i programów.

If you send me office files, please make sure they are in a cross-platform format. For editing this means: .ODT, .ODS and .ODP. All of them can be made by LibreOffice, OpenOffice and most other Office Suites and programs.

···

Tymoteusz Jankowski wrote:

More info are here:

grid - How to place wxChoice in a wxGrid header? - Stack Overflow

Please help

The column header window can be fetched from the grid using grid.GetGridColLabelWindow() and you can then do whatever you want with that window, such as override its paint event or placing widgets on it. Take a look at the wx.lib.mixins.gridlabelrenderer module for some helper classes that would help you with overriding the drawing of the labels.

So while drawing a combobox-like thing yourself would be doable, in your case it would probably make most sense to just put a real widget there. You will have to manage its size and position yourself, and adjust it every time the grid and/or columns are resized, but it should not be too overly difficult. If you look in the gridlabelrenderer you will be able to see some code that calculates the rectangle that represents each label, and you can use something like that to resize and reposition your widget.

···

--
Robin Dunn
Software Craftsman