dynamically created event separation

szurilo szurilo at sch.bme.hu
Sun Feb 3 06:47:15 PST 2008


Maybe i totally misunderstood event handling but here is my code:
const long SRC_SRM_apiDialog::ID_FREQTEXTCTRL = wxNewId();//this create a
new, unique integer number to this ID, isnt it?
Chn_TextCtrl0[i] = new wxTextCtrl(this, ID_FREQTEXTCTRL, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER,
wxDefaultValidator);//In a 'for cyclic' this row create the wxTextCtrls with
the same ID, or not as you said
Connect(ID_FREQTEXTCTRL,wxEVT_COMMAND_TEXT_ENTER,wxCommandEventHandler(SRC_SRM_apiDialog::OnFreqTextCtrlTextEnter));//I
connect these wxTextCtrls with the event handler function

Anyway getId() return with 121 whereever i press <enter> in those
wxTextCtrls. Thats why i said they have the same ID, but i dont understand
than how can be different as you said. sry.

Szurilo



Vadim Zeitlin-4 wrote:
> 
> On Sun, 3 Feb 2008 06:22:21 -0800 (PST) szurilo <szurilo at sch.bme.hu>
> wrote:
> 
> s> Actually these dont help me, because i have the same ID for the
> wxTextCtrls.
> 
>  You can't use the same id for different controls. You must use wxID_ANY
> if
> you don't care about the id.
> 
> s> Should i create an own event class deriving from the wxTextCtrl or
> s> something?
> 
>  What would this change? If you can't use GetEventObject() (why?) I don't
> see how can you ever find out what control sent the event.
> 
>  Regards,
> VZ
> 
> -- 
> TT-Solutions: wxWidgets consultancy and technical support
>                http://www.tt-solutions.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/dynamically-created-event-separation-tp15252679p15254022.html
Sent from the wxWidgets - Users mailing list archive at Nabble.com.





More information about the wx-users mailing list