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

how to know which object was selected

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


Joined: 09 Feb 2006
Posts: 3

PostPosted: Thu Feb 09, 2006 5:02 am    Post subject: how to know which object was selected Reply with quote

Hello!
I'm just begin with building macros!
I'm trying to know in a slide show which object was pointed to know his name
Here is my program:

oDocument = ThisComponent
oSelection = oDocument.getCurrentController().getSelection()
oTarget = oSelection.getByIndex(0)
oString = oTarget.getName()

But the problem is in a slide show, when event is mouse clicked, it's not a selection
So i'm looking for a different function than getSelection()
something like getPointedObject for example!!

If you can help me, don't hesitate
Thanks
Pierre
Back to top
View user's profile Send private message
noranthon
Super User
Super User


Joined: 07 Jul 2005
Posts: 3318

PostPosted: Thu Feb 09, 2006 7:08 pm    Post subject: Reply with quote

Are you after the current page? If so :
Code:
ThisComponent.CurrentController.CurrentPage


(I assume you are talking about a presentation.)
If you haven't got the Xray tool, I recommend that you get it. It helps a lot in finding objects. The link is http://www.oooforum.org/forum/viewtopic.phtml?t=30018
Back to top
View user's profile Send private message
pll
Newbie
Newbie


Joined: 09 Feb 2006
Posts: 3

PostPosted: Fri Feb 10, 2006 12:15 am    Post subject: Reply with quote

I also tried to do

oPage = oDocument.getCurrentController().getCurrentPage()

I can access all objects liike this
for i=0 to oPage.getCount() -1
oTarget = oPage.getByIndex(i)

But not the pointed one!
And in a presentation, you can't select an object but just point it.
So I need really to know the current object pointed!
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