Hi,

Looks oke, but:


a2dStTool::a2dStTool(a2dStToolContr* 
controller):a2dBaseTool((a2dToolContr*)controller)
{
     m_eventHandler = new a2dStToolEvtHandler( controller );


So you need to set your own derived one now. Find in tools.h:

     void a2dBaseTool::SetEvtHandler( a2dEvtHandler* handler ) { m_eventHandler 
= handler; }

This will set your own event handler.

Next set some breakpoints on the

void a2dStToolEvtHandler::OnComEvent( a2dComEvent& event )
void MyStToolEvtHandler::OnComEvent(a2dComEvent &event)

To see where it goes.

And also here:

bool a2dBaseTool::ProcessEvent( wxEvent& event )

And here:

void a2dBaseTool::OnComEvent( a2dComEvent& event )

The event should go somewhere around these paths ;-)

Klaas






SD wrote:
> Hello Klaas,
> 
> Thank you for your help. I Still dont get events. Can you tell me whats
> wrong with my code.
> 
> ###############################
> .h:
> class MyStToolEvtHandler: public a2dStToolEvtHandler {
> public:
>     MyStToolEvtHandler ();
>     void OnComEvent(a2dComEvent &event);
>     void OnDoEvent( a2dCommandProcessorEvent& event );
> 
>     DECLARE_CLASS(MyStToolEvtHandler)
>     A2D_DECLARE_EVENT_TABLE()
> };
> 
> 
> .cpp:
> A2D_BEGIN_EVENT_TABLE(MyStToolEvtHandler, a2dStToolEvtHandler ) 
> A2D_EVT_COM_EVENT( MyStToolEvtHandler::OnComEvent ) 
> A2D_EVT_DO( MyStToolEvtHandler::OnDoEvent )
> A2D_END_EVENT_TABLE()
> 
> 
> void MyStToolEvtHandler::OnComEvent(a2dComEvent &event) {
>     wxMessageBox ("MyStToolEvtHandler OnComEvent"); }
> 
> void MyStToolEvtHandler::OnDoEvent(a2dCommandProcessorEvent &event) {
>     wxMessageBox ("MyStToolEvtHandler OnEventDo"); }
> 
> ###############################
> 
> 
> In my derieved a2dStToolContr i can get the OnDoEvent.
> 
> A2D_BEGIN_EVENT_TABLE(MyCanvasStToolContr, a2dStToolContr)
> A2D_EVT_MENU                      (
> TC_PROPERTY_XY2,MyCanvasStToolContr::MyEditProperties)
> A2D_EVT_DO                        ( MyCanvasStToolContr::OnDoEvent)
> A2D_END_EVENT_TABLE()
> 
> Regards
> 
> Süleyman Demir
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Im Auftrag von
> klaas.holwerda
> Gesendet: Montag, 22. Oktober 2007 22:04
> An: wxart2d-users_dev@lists.sourceforge.net
> Betreff: Re: [Wxart2d-users_dev] Event after an object has been drawn
> 
> SD wrote:
>> Hello all,
>>
>> how can i get an event after an object has been drawn with a tool?
>> For example, a line after the second left mouse click.
>>
>> I want to assigned this object a name after it is drawn.
>>   
> a2dStTool::AddCurrent() is used to add new object when they are drawn, but
> not at the end but mostly at the start.
> But i think that is oke for you.
> This function sends an event sm_toolComEventAddObject.
> Search this in sttool.cpp, it is for instance intercepted in
> a2dStToolEvtHandler.
> 
> Regards,
> 
> Klaas
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxart2d-users_dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxart2d-users_dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev


-- 
Unclassified

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

Reply via email to