[wx 2.8.4, GTK+ 2, g++] Problem updating value of wxSpinCtrl in wxSpinEvent

Frank Bennewitz franklyn at gmx.net
Tue Jul 10 03:06:28 PDT 2007


Hi Francesco,

I tried this:

void MyFrame::OnGaussSpin(wxSpinEvent &event) {
	
	//Hier muss die Behandlung der Werte rein: es dürfen nur ungerade Integer sein.
	
	wxSpinCtrl *m_pMySpinCtrl= (wxSpinCtrl*)FindWindowById(PANEL_GAUSS_SPIN);
	int val=event.GetPosition();
  	m_pMySpinCtrl->SetValue(val-2);
}

and it still doesn't work. The Problem is (I guess) that after m_pMySpinCtrl->SetValue(val-2) is called, another EVT_SPINCTRL is fired and MyFrame::OnGaussSpin(wxSpinEvent &event) is called again and so on until the value is min or max of the SpinCtrl. Do you know how to prevent this?

Another Problem that I came up with is how to react on the Up or Down Arrow. I don't find a possibility to seperate these different events with EVT_SPINCTRL. EVT_SPIN_UP(id, func) or EVT_SPIN_DOWN(id, func) don't work with a SpinCtrl. 

Thanks! 
Frank
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger




More information about the wx-users mailing list