sorry for that....thanks for ur advice. I'll try it.
Actually, the main problem is I want to catch mouse event in my canvas.
There are three possible states:
1. if mouse is clicked in a2dImage object, I will display information
related to image like image path
2. if mouse is clicked in a2dText object, I will display information about
text input
3. if mouse is not clicked inside object, There is no information displayed.
I click the objects using a2dRecursiveEditTool. I was fail because the mouse
event is interrupted by a2dRecursiveEditTool.
btw, I'm still finding to know the best method to achieve this.
On Thu, Oct 16, 2008 at 8:16 PM, Klaas Holwerda <[EMAIL PROTECTED]>wrote:
> bluedee wrote:
>
>> Sorry for wrong title, Klaas. :)
>>
>> Actually, the tools that I only want to use are a2dRecursiveEditTool and
>> a2dDeleteTool.
>>
>
> Well i see no relation what you write down here.
> Also do not intercept events in your canvas, the controller set well
> redirect them to pushed tools.
>
> Study sample_editor_editmdi
>
> This here adds a toolcontroller:
>
> m_contr = new a2dStToolContr(m_canvas->GetCanvasView(),this);
>
> And many samples in there to push tool on the controller.
>
> a2dDrawPolygonLTool* draw = new a2dDrawPolygonLTool( m_contr, polygon );
> m_contr->PushTool(draw);
>
> And pop them too:
>
> a2dSmrtPtr< a2dBaseTool > tool;
> m_contr->PopTool( tool );
>
> And here how to use the tools you seem to need.
>
> void MDIEditorFrame::SetDeleteTool( wxCommandEvent& event )
> {
> a2dDeleteTool* tool = new a2dDeleteTool( m_contr );
> tool->SetShowAnotation( false );
> m_contr->PushTool(tool);
> }
>
> void MDIEditorFrame::SetEditTool( wxCommandEvent& event )
> {
> a2dRecursiveEditTool* draw = new a2dRecursiveEditTool( m_contr );
> draw->SetShowAnotation( false );
> a2dFill fill = a2dFill(wxColour(29,225,164 ),a2dFILL_SOLID );
> fill.SetAlpha( 230 );
>
> draw->SetFill( fill );
>
> a2dStroke stroke = a2dStroke( wxColour(39,235,64
> ),5.0,a2dSTROKE_LONG_DASH);
>
> draw->SetStroke( stroke );
>
> //if you want just a one time action of editing one object
> // draw->SetOneShot();
>
> m_contr->PushTool(draw);
> }
>
> Regards,
>
> Klaas
>
>
>> On Thu, Oct 16, 2008 at 7:01 PM, bluedee <[EMAIL PROTECTED] <mailto:
>> [EMAIL PROTECTED]>> wrote:
>>
>> Hello Klaas,
>>
>> I have one a2dText and one a2dImage in my a2dCanvasView. In left
>> panel, I have some information related to that object for example if
>> it is a2dImage, it has its path information. In other words,
>> different information for different type of object.
>>
>> I was difficult to determine which type of object which I clicked on
>> canvas.
>>
>> I created MyImage derived from a2dImage, MyText derived from a2dText
>> and MyCanvas derived from a2dCanvasView.
>>
>> I have tried to catch mouse event in each class and I only
>> succesfully in catching MyImage and MyText mouse event but MyCanvas.
>> I totally can't catch mouse event in my canvas. It is needed to
>> hide
>> information in left panel if there is no object clicked.
>>
>> Would u mind giving me some clue to handle this?
>>
>> Thank you very much
>>
>>
>> --
> Unclassified
>
>
>
> ------------------------------------------------------------------------------------------------------------
> Disclaimer:
>
> If you are not the intended recipient of this email, please notify the
> sender and delete it. Any unauthorized copying, disclosure or distribution
> of this email or its attachment(s) is forbidden. Thales Nederland BV will
> not accept liability for any damage caused by this email or its
> attachment(s). Thales Nederland BV is seated in Hengelo and is registered at
> the Chamber of Commerce under number 06061578.
>
> ------------------------------------------------------------------------------------------------------------
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev