Anyone knows how to simulate press on a spin button? What event I should send to it and how?
Thanks.
Alex.
Generating events for wxSpinButton Topic is solved
Re: Generating events for wxSpinButton
Did you try to have al look at wxSpinEvent, as described in the wxWidgets documentation ?asandler wrote:Anyone knows how to simulate press on a spin button? What event I should send to it and how?
Thanks.
Alex.
Herebelow is a sample of user code sending a "command" event
Code: Select all
void MyWindow::SendEvent()
{
wxCommandEvent event( wxEVT_MY_EVENT, GetId() );
event.SetEventObject( this );
// Give it some contents
event.SetText( wxT("Hallo") );
// Send it
GetEventHandler()->ProcessEvent( event );
}
Just replace the event object class to get your need.
Here's the problem. In MSW wxSpinButton implemented using built into windows control. I.e. windows control holds the counter for the spin button. So when you send event to wxWidgets spin button it will not do anything.
What you have to do is to send event to windows control. Yet you cannot do this in platform independent manner. The only solution for this problem is to sub-class wxSpinButton and do private implementation of the value calculations. This includes what happens when you press and hold one of the control buttons.
Anyway, thanks a lot for trying to help. Unfortunately this issue seems to be unsolvable at the moment.
What you have to do is to send event to windows control. Yet you cannot do this in platform independent manner. The only solution for this problem is to sub-class wxSpinButton and do private implementation of the value calculations. This includes what happens when you press and hold one of the control buttons.
Anyway, thanks a lot for trying to help. Unfortunately this issue seems to be unsolvable at the moment.