| View previous topic :: View next topic |
| Author |
Message |
florinl_ro General User

Joined: 07 Jul 2006 Posts: 5
|
Posted: Fri Jul 07, 2006 3:45 am Post subject: cursor inside the annotation's rectangle |
|
|
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 |
|
 |
cjopp General User

Joined: 29 Jan 2006 Posts: 22
|
Posted: Wed Jul 12, 2006 11:00 pm Post subject: |
|
|
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 |
|
 |
|