wxSpinCtrl(Double)-like wxGrid Cell Editor

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
freudi74
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Aug 30, 2019 9:03 am

wxSpinCtrl(Double)-like wxGrid Cell Editor

Post 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!
freudi74
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Aug 30, 2019 9:03 am

Re: wxSpinCtrl(Double)-like wxGrid Cell Editor

Post 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?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxSpinCtrl(Double)-like wxGrid Cell Editor

Post 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.
Post Reply