OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

cursor inside the annotation's rectangle

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
florinl_ro
General User
General User


Joined: 07 Jul 2006
Posts: 5

PostPosted: Fri Jul 07, 2006 3:45 am    Post subject: cursor inside the annotation's rectangle Reply with quote

Hello !

I am a beginner Open Office developer and I need to know if it is possible to detect if the cursor is inside an annotation (more precisely if the cursor is inside the little yellow rectangle).

Thank you !
Back to top
View user's profile Send private message
cjopp
General User
General User


Joined: 29 Jan 2006
Posts: 22

PostPosted: Wed Jul 12, 2006 11:00 pm    Post subject: Reply with quote

Hello florinl_ro,

yes it is:
Code:

Sub Main
   oDoc = ThisComponent
   oViewCursor = oDoc.getCurrentController.getViewCursor
   If Not IsEmpty(oViewCursor.TextField) Then
      If oViewCursor.TextField.supportsService("com.sun.star.text.TextField.Annotation") Then
         'Do something
      End If
   End If
End Sub


In the preceding code you get the ViewCursor of the currently active Document, check whether it is in a TextField (or contains one if you have selected something) and check whether the TextField is an Annotation.

Hope this helps
Christoph
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group