Dear Klaas
  I created my own Tool inherited from a2dSelectTool. I overrode the
virtual function GenerateAnotation(). Just now it displayed the
annotation. However there are some problems:
  (1) OnIdle is earlier than OnCommunicationEvent.
  For OnCommunicationEvent, my defined event handler class was
registered by Tool's SetEvtHandler. Inside OnCommunicationEvent event
handler function, I stored the selected element. I planned to show the
information w.r.t the selected element by annotation. Therefore, I
overrode the virtual function GenerateAnotation() to show the
inforamtion w.r.t the selected element. I found that GenerateAnotation()
was invoked by OnIdle event. However, OnIdle event was earlier handled
than OnCommunicationEvent. As a result, the showed information was
always the previous selected, but not the current selected. The
straightforward solution was to show the annotation inside the
OnCommunicationEvent handler. But, as in last thread, I did not know how
to do it.

   (2) quick clicking avoid the appearance of annotation
   If I click quickly, the annotation will not appear. I have to wait
for a moment to release the left mouse key after left mouse key was
pressed down. Is it possible to show the annotation after the click, no
matter how quick I click ?

   (3) How do I move the view region into the highest element of
graphics?

Yours
Faithfully
Long
On Wed, 2013-10-09 at 12:53 +0800, pang long wrote:
> Dear Klaas
>   Could you please tell how to show user-defined annotation when click
> on one element of graphics in wxart2d? 
>   My object is to show a annotation when I click one element of graphs
> shown by wxart2d. The annotation information is computed with respect to
> the clicked element. 
>   The followings are what I have done and what problem I encountered. 
>   I created and added a2dSelectTool to a2dStToolContr. I also created my
> own defined event handler by a2dSelectTool's SetEvtHandler. Its purpose
> is to handle the select change event. When it receives the event, it
> retrieves the selected elements from top element by CollectObjects. Then
> I compute the needed information for this selected element. I want to
> show the information in an annotation. So inside the event handler I
> invoked the following method:
> m_controller->GetDrawingPart()->GetDrawer2D()->DeviceDrawAnnotation...
>    But it reported run-time error that 
> ....../wxArt2D/packages/wxart2d/artbase/src/dcdrawer.cpp(2316): assert
> "m_renderDC" failed in DeviceDrawAnnotation(): no renderDc set
>    Could you please tell me hints to solve this problem?
>    Is it better to create my own tool inherited from a2dSelectTool?
>    The drawing mechanism of wxart2d is quite complex for me. I guess I
> mistake the render method.
>   
> Yours
> Faithfully
> Long
> 



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

Reply via email to