Page 1 of 1

wxSpinCtrl(Double)-like wxGrid Cell Editor

Posted: Fri Aug 30, 2019 9:20 am
by freudi74
I'm looking for wxSpinCtrl and wxSpinCtrlDouble-like cell editors for a wxGrid. A renderer that shows disabled buttons would be nice, too, but is not required.

I know there's always the option to write my own, but this seems so general purpose to me, that I can't believe that no one has created one so far. Actually, I was surprised that it's not part of wxWidgets itself. Google search did not come up with anything useful for me.

Does someone have a stable implementation he could share or know where to find one?
Working cross-platform would be nice, but I really currently require one working on MSW. wxWidgets license style or more permissive.

Thanks, guys!

Re: wxSpinCtrl(Double)-like wxGrid Cell Editor

Posted: Fri Aug 30, 2019 12:53 pm
by freudi74
Checking wxWidgets source code, I found that at least for integers I can get a wxSpinCtrl based editor when manually creating a wxGridCellNumberEditor with a range rather than using SetColFormatNumber(col). Probably works as well if I set a range on individual cells using GetCellEditor(row,col)->SetParameters(wxT("<min>,<max>")) (not tested, my columns all have the same data content so I prefer the SetColFormat...() way).

There doesn't seem to be an equivalent for Floats with wxSpinCtrlDouble, though. Probably going to create my own based on wxGridCellFloatEditor.

Any interest in getting that into the wxWidgets codebase in case I'm successful?

Re: wxSpinCtrl(Double)-like wxGrid Cell Editor

Posted: Fri Aug 30, 2019 3:02 pm
by ONEEYEMAN
Hi,
This is a user forum.
For a questions like this you should send an E-mail to wx-dev ML.

Thank you.