hi,
i'm using wxWidgets 2.9.5 under windows 7.
i would like to get the events EVT_SPIN_UP and EVT_SPIN_DOWN using wxSpintCtrl. on windows 7 those events are not being posted. i need to change the values by more than 1 when the user presses the arrows. if i can't use the events listed previously on windows 7 is there another way to capture the arrow press events or change by how much the spin control advances the value? is the simple solution to use a pair of wxSpinButton and wxTextCtrl?
thanks,
vince
capturing spin up/down events for wxSpinCtrl
Re: capturing spin up/down events for wxSpinCtrl
What about the wxEVT_SPINCTRL event?
Use the source, Luke!
Re: capturing spin up/down events for wxSpinCtrl
wxEVT_SPINCTRL comes after the controls have been updated. i don't see how the this event tells me if the up key has been pressed or the down key so that i can update the value based on an increment amount. i was hoping that i would not need to implement my own version of the spin control class so that i can update the spin value based on an increment amount that is greater than 1.
thanks,
vince
thanks,
vince
Re: capturing spin up/down events for wxSpinCtrl
Hi,
Can you reproduce it in the widgets sample?
Can you try the (recently released) 3.1?
Thank you.
Can you reproduce it in the widgets sample?
Can you try the (recently released) 3.1?
Thank you.
Re: capturing spin up/down events for wxSpinCtrl
hi,
thank you for your response.
i did run the sample program controls w/ the same result. only OnSpinCtrl and OnSpinCtrlText were called. the two methods for the spin up/down events were not called.
i tried w/ release 3.1.0 but that also didn't work. the documentation for 3.1.1 states that the event macros for wxSpinButton may be used but not all platforms are supported. a list of supported platforms was not provided.
cheers,
vince
thank you for your response.
i did run the sample program controls w/ the same result. only OnSpinCtrl and OnSpinCtrlText were called. the two methods for the spin up/down events were not called.
i tried w/ release 3.1.0 but that also didn't work. the documentation for 3.1.1 states that the event macros for wxSpinButton may be used but not all platforms are supported. a list of supported platforms was not provided.
cheers,
vince
Re: capturing spin up/down events for wxSpinCtrl
Hi,
Could you please file a bug at trac.wxwidgets.org about this?
Explain how this can be reproduced, state you platform, compiler and toolkit.
Also, if you modified the sample attach a patch to the sample. It will help with the reproduction and also with testing the fix.
Thank you.
Could you please file a bug at trac.wxwidgets.org about this?
Explain how this can be reproduced, state you platform, compiler and toolkit.
Also, if you modified the sample attach a patch to the sample. It will help with the reproduction and also with testing the fix.
Thank you.
Re: capturing spin up/down events for wxSpinCtrl
This is the code that generates the wxEVT_SPINCTRL event under Windows:
This means that the control still has the old value and the event tells you the new value. From that you can determine the "direction". You can also see that the control does not get updated with the new value if the event is vetoed.
In conclusion: You can veto the event and change the value of the control directly as you like.
Code: Select all
void wxSpinCtrl::SendSpinUpdate(int value)
{
wxSpinEvent event(wxEVT_SPINCTRL, GetId());
event.SetEventObject(this);
event.SetInt(value);
(void)HandleWindowEvent(event);
if ( event.IsAllowed() )
m_oldValue = value;
}
In conclusion: You can veto the event and change the value of the control directly as you like.
Use the source, Luke!