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

Joined: 28 Nov 2005 Posts: 8
|
Posted: Sun Dec 04, 2005 4:25 pm Post subject: How to force a particular draw page to the foreground |
|
|
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 |
|
 |
Laurent Godard General User


Joined: 16 Mar 2003 Posts: 47 Location: Grenoble (France)
|
Posted: Mon Dec 05, 2005 12:32 am Post subject: |
|
|
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 |
|
 |
IamSpOOk General User

Joined: 28 Nov 2005 Posts: 8
|
Posted: Thu Dec 08, 2005 4:43 pm Post subject: |
|
|
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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Fri Dec 09, 2005 2:43 am Post subject: |
|
|
| 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 |
|
 |
IamSpOOk General User

Joined: 28 Nov 2005 Posts: 8
|
Posted: Mon Dec 12, 2005 8:30 pm Post subject: re crash |
|
|
| 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 |
|
 |
|