| View previous topic :: View next topic |
| Author |
Message |
pll Newbie

Joined: 09 Feb 2006 Posts: 3
|
Posted: Thu Feb 09, 2006 5:02 am Post subject: how to know which object was selected |
|
|
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 |
|
 |
noranthon Super User

Joined: 07 Jul 2005 Posts: 3318
|
Posted: Thu Feb 09, 2006 7:08 pm Post subject: |
|
|
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 |
|
 |
pll Newbie

Joined: 09 Feb 2006 Posts: 3
|
Posted: Fri Feb 10, 2006 12:15 am Post subject: |
|
|
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 |
|
 |
|