Activateable cell in wcgrid

29 views
Skip to first unread message

Igor Korot

unread,
Jul 7, 2025, 10:26:33 AMJul 7
to wx-u...@googlegroups.com
Hi,
In the wxGrid::DoShowCellEditControl() the call to TryActivate() is done before the actual editor is created and properly positioned. 

It means that if I want to have an editor based on the wxChoice which is always displayed and the cell becomes editable on the mouse click immediately showing he wxChoice - i will not be able to.

Is there any reason the TryActivate() is done like this?

Thank you.

Vadim Zeitlin

unread,
Jul 8, 2025, 10:21:25 AMJul 8
to wx-u...@googlegroups.com
On Mon, 7 Jul 2025 10:25:56 -0400 Igor Korot wrote:

IK> It means that if I want to have an editor based on the wxChoice which is
IK> always displayed and the cell becomes editable on the mouse click
IK> immediately showing he wxChoice - i will not be able to.

You won't be able to because this is not how "activateable" cells work:
they do not show any editor, they react to the mouse clicks immediately. If
you want to use wxChoice as an editor, you can't use activateable edit
mode.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Igor Korot

unread,
Jul 8, 2025, 11:23:09 AMJul 8
to wx-u...@googlegroups.com
Vadim,


On Tue, Jul 8, 2025, 10:21 AM Vadim Zeitlin <va...@wxwidgets.org> wrote:
On Mon, 7 Jul 2025 10:25:56 -0400 Igor Korot wrote:

IK> It means that if I want to have an editor based on the wxChoice which is
IK> always displayed and the cell becomes editable on the mouse click
IK> immediately showing he wxChoice - i will not be able to.

 You won't be able to because this is not how "activateable" cells work:
they do not show any editor, they react to the mouse clicks immediately. If
you want to use wxChoice as an editor, you can't use activateable edit
mode.

Understood, thx.

So what are my options?

I want to use wxChoice as editor and start editing on the very first click, displaying the list of choices.

Thank you.

Vadim Zeitlin

unread,
Jul 8, 2025, 11:24:37 AMJul 8
to wx-u...@googlegroups.com
On Tue, 8 Jul 2025 11:22:52 -0400 Igor Korot wrote:

IK> So what are my options?
IK>
IK> I want to use wxChoice as editor and start editing on the very first click,
IK> displaying the list of choices.

Use normal editor and call Popup() in your StartingClick().

Igor Korot

unread,
Jul 10, 2025, 7:53:56 AMJul 10
to wx-u...@googlegroups.com
Hi, Vadim,

On Tue, Jul 8, 2025 at 11:24 AM Vadim Zeitlin <va...@wxwidgets.org> wrote:
>
> On Tue, 8 Jul 2025 11:22:52 -0400 Igor Korot wrote:
>
> IK> So what are my options?
> IK>
> IK> I want to use wxChoice as editor and start editing on the very first click,
> IK> displaying the list of choices.
>
> Use normal editor and call Popup() in your StartingClick().

The suggestion was good but it didn't wr

Tried t debug it and found that

[code]
void
wxGrid::DoGridCellLeftUp(wxMouseEvent& event,
const wxGridCellCoords& coords,
wxGridWindow* gridWindow)
{
if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL )
{
if ( coords == m_currentCellCoords && m_waitForSlowClick &&
CanEnableCellControl() )
{
ClearSelection();

if ( DoEnableCellEditControl(wxGridActivationSource::From(event)) )
GetCurrentCellEditorPtr()->StartingClick();

m_waitForSlowClick = false;
}
}
...
[/code]

the variable m_waitForSlowClick is false.

Also the positon f the editor is wrong. The popup
shows at the top left grid coordinate.

Use wx 3.2.6 on Windows.

Thank you.
Reply all
Reply to author
Forward
0 new messages