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 force a particular draw page to the foreground

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


Joined: 28 Nov 2005
Posts: 8

PostPosted: Sun Dec 04, 2005 4:25 pm    Post subject: How to force a particular draw page to the foreground Reply with quote

Hi,

I'd like to be able to click on a button inside one page of a draw document, and make it force a different page of the same document to the user's focus. I've used Xray to look at the properties of form and forms() but can't see anything like .focus or .show which is what I would expect to be available. Any ideas?

Thanks.
Back to top
View user's profile Send private message
Laurent Godard
General User
General User


Joined: 16 Mar 2003
Posts: 47
Location: Grenoble (France)

PostPosted: Mon Dec 05, 2005 12:32 am    Post subject: Reply with quote

Hi

try this
Code:
theTarget = thiscomponent.drawpages.getByName("TheTargetSheet")
thiscomponent.currentcontroller.select(theTarget)

where "TheTargetSheet" is the name of your sheet

Laurent
Back to top
View user's profile Send private message Visit poster's website
IamSpOOk
General User
General User


Joined: 28 Nov 2005
Posts: 8

PostPosted: Thu Dec 08, 2005 4:43 pm    Post subject: Reply with quote

Thanks for that. It crashes star office, but you lead me to the following which does work as expected. I've reported the crash as a bug because it should handle it gracefully.

Code:

   dim oTarget as Object
   oTarget = ThisComponent.getDrawPages().getByName("PA")   
   ThisComponent.currentcontroller.setFocus(oTarget)
   ThisComponent.currentcontroller.setCurrentPage(oTarget)


If you don't do the setFocus, then the next line crashes star office
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Fri Dec 09, 2005 2:43 am    Post subject: Reply with quote

Quote:
If you don't do the setFocus, then the next line crashes star office

I disagree. I tested it on OOo 1.1.4 and 1.9.130 on Windows XP and it works without the setFocus.
Code:
dim oTarget as Object
oTarget = ThisComponent.getDrawPages().getByName("PA")   
ThisComponent.currentcontroller.tCurrentPage = oTarget

I use this sort of code in my add-on MultiPages
______
Bernard
Back to top
View user's profile Send private message Visit poster's website
IamSpOOk
General User
General User


Joined: 28 Nov 2005
Posts: 8

PostPosted: Mon Dec 12, 2005 8:30 pm    Post subject: re crash Reply with quote

My system is substantially different. StarOffice evaluation 2.0 inside Linux personality realm running on Unixware. It would be interesting to find out if its stable on other systems.
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