How to create a way to do a wxChoice in a wxGrid Cell

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Mungo1981
Experienced Solver
Experienced Solver
Posts: 71
Joined: Wed Jan 30, 2019 5:42 pm

How to create a way to do a wxChoice in a wxGrid Cell

Post by Mungo1981 » Fri Jun 14, 2019 3:16 pm

Dear Community,
I have a Idea what I would do, but not a idea how to do it.
I will have a wxGrid, and in the cells of this Grid a wxChoice like Edit option
And it would be of all Cells in a special Column

Anybody a Idea in which way I can dot it.

In expect on help

Mungo1981

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3278
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to create a way to do a wxChoice in a wxGrid Cell

Post by ONEEYEMAN » Fri Jun 14, 2019 3:35 pm

Hi,
Something like this?

Thank you.

Mungo1981
Experienced Solver
Experienced Solver
Posts: 71
Joined: Wed Jan 30, 2019 5:42 pm

Re: How to create a way to do a wxChoice in a wxGrid Cell

Post by Mungo1981 » Fri Jun 14, 2019 3:58 pm

Yes, it's exactly this.
I have do it like this:

Code: Select all

InstrumentGrid->SetColLabelValue(0, "Spur-Name");
   InstrumentGrid->SetColSize( 0, 500-(2*16) );
   // Ausprobieren eines Cell Editors
wxString strChoices[3] = {"one", "two", "three"};
InstrumentGrid->SetCellEditor( 0,0, new wxGridCellChoiceEditor(3, strChoices));
But I have trouble with this.:
When I click into the cell the Choice would display for a few microseconds,
and then the first item will select, and stored in the cell.
So the first thing I would have to do is make this shown for longer time, so the user could select another item.
And it would be a unfortunately to set this Editor for all my Cells in my Column.

A Mungo1981
who think he is on the right way to found the solution.

Mungo1981
Experienced Solver
Experienced Solver
Posts: 71
Joined: Wed Jan 30, 2019 5:42 pm

Re: How to create a way to do a wxChoice in a wxGrid Cell

Post by Mungo1981 » Fri Jun 14, 2019 4:06 pm

Ok, I have a problem with my eyes.
When I click in the cell and push the keys for scroll up and down I could change the selected Item.
But I can not see any selection arrows.
:shock: :shock: :shock:

Mungo1981
Experienced Solver
Experienced Solver
Posts: 71
Joined: Wed Jan 30, 2019 5:42 pm

Re: How to create a way to do a wxChoice in a wxGrid Cell

Post by Mungo1981 » Fri Jun 14, 2019 4:11 pm

So this is my statement of EXCUSE ME I'M TO SILLY
This was the solution.
But I'm to silly to see the field of this arrows in because of a to large Column wide.

SO EXCUSE ME.

A embarrassing

Mungo1981

Post Reply