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

Joined: 01 Sep 2004 Posts: 14
|
Posted: Wed Sep 01, 2004 6:40 am Post subject: a Macro for granma |
|
|
Hi all, I'm new in this forum
And I'd like to build simplified "open" and "save" dialog boxes for my grand mother:
Open :
A list of documents she can open (restricted to one folder)
OK and cancel buttons
Save
A list of existing documents (restriced too)
OK and cancel buttons
(She definitely needs something simple)
I will then simplify the toolbars for her.
Unfortunately I'm only a beginner in writing macros. Does someone know a similar project that could get me inspired ?
How would you start programming it? Sould I modify the existing dialogs? Should I write my own ones?
Thank you
Martin |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Wed Sep 01, 2004 7:55 am Post subject: |
|
|
I don't believe that you can modify the existing dialogs. Think about it. OOo runs on various platforms, each of which have their own open / save dialog boxes. Mac OS X. Windows. Various Linux.
It seems that the best approach would be to build your own dialog boxes. Customize the menus so that Open and Save call Basic macros which display your dialog boxes. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
Martmel General User

Joined: 01 Sep 2004 Posts: 14
|
Posted: Thu Sep 02, 2004 2:01 am Post subject: |
|
|
Thanks DannyB !
Ok, I've started writing my own open and save macros
I still have a problem trying to open all documents in the same window :
SearchFlags = com.sun.star.frame.FrameSearchFlag.CREATE + _
com.sun.star.frame.FrameSearchFlag.ALL
Doc = StarDesktop.loadComponentFromURL(Url, "framename", SearchFlags, Dummy())
This works well when I'm opening the second document because the framename is allready set to "framename" but I would like to avoid grandma having to deal with multiple windows.
Does someone knows how to get the framename of the current window?
Thanks !
Martin |
|
| Back to top |
|
 |
Martmel General User

Joined: 01 Sep 2004 Posts: 14
|
Posted: Thu Sep 02, 2004 4:47 am Post subject: |
|
|
Also, when I try to save the document I know I have to use this command :
Doc.storeAsURL("file://" + PATH + FileName.Text, Dummy())
but I have no idea of how to initialize the variable Doc ?
How should i initialize it?
Thanks ! |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
Martmel General User

Joined: 01 Sep 2004 Posts: 14
|
Posted: Fri Sep 03, 2004 5:49 am Post subject: |
|
|
Thanks again DannyB !
I managed to program my own open and save dialog boxes.
I would like now to get rid of the menu bar (to keep only the toolbars I created). Do you know if such a thing is possible ? Should I try to find how to hide it ? Is there a config file that can be rewritten in order to make it disappear? Or should I write a macro that will hide it at startup?
I would also remove the contextual menu that appears with the right click. How can such a thing be done?
I really ur apreciate your help.
Thanks
Martin |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Sep 03, 2004 11:36 am Post subject: |
|
|
Tools --> Configure
This lets you change the menu bars.
After you have done this, you may notice some new XML config files in your "user" folder.
On Windows, the "user" folder may be directly under your OOo installation folder, if you did a single user install.
On Windows, the "user" folder may be somewhere in your "home directory" if you did a network install.
On Linux, the "user" folder is in a place such as....
/home/danny/OpenOffice.org1.1.3/user
In your "user" folder see this....
OOo/user/config/soffice.cfg
In this folder, you may see some new files such as...
drawmenubar.xml
drawtoolbar.xml
calcmenubar.xml
etc...
These xml files contain the configuration that you changed from the
Tools --> Configure
dialog box.
In OOo 2.0, the configuration will be officially stored in the Configuration Manager data. Therefore, in 2.0, it will be possible to reconfigure the menus and toolbars programmatically. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
Martmel General User

Joined: 01 Sep 2004 Posts: 14
|
Posted: Mon Oct 11, 2004 7:00 am Post subject: |
|
|
| DannyB wrote: | In your "user" folder see this....
OOo/user/config/soffice.cfg
In this folder, you may see some new files such as...
drawmenubar.xml
drawtoolbar.xml
calcmenubar.xml
etc...
|
Ok, I know it's been a while... I've checked and found writermenubar.xml in the soffice.cfg dir. Unfortunately I did not manage to remove the bar itself. I managed to empty it messing around with the file but didn't succeded removing (hiding) it.
is there an option i should use in that file?
Is there an api for starbasic like javadoc for java?
Thanks,
Martin |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
|