if ( event.GetCommand()->GetCommandId() == &a2dCommand_SetFont::Id )
    {
         a2dDrawTextTool* textTool = wxDynamicCast( tool, a2dDrawTextTool
);
          if ( textTool )
               textTool->SetFont( a2dGetCmdh()->GetFont() );
     }

What 's the difference with ?

a2dStToolContr* toolCtrl = (a2dStToolContr*)
canvasView->GetCanvasToolContr();
       a2dBaseTool * tool = toolCtrl->GetFirstTool ();

       //check if it s a text tool
       if(tool->IsKindOf(CLASSINFO(a2dDrawTextTool )))
       {
           a2dDrawTextTool* textTool = (a2dDrawTextTool*) tool;

textTool->SetFont(m_currentFontInfo.CreateFont(m_currentFontInfo.GetSize()));
       }


It's more cleaner ?
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wxart2d-users_dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

Reply via email to