macro to activate/deactivate a button on customize toolbar
macro to activate/deactivate a button on customize toolbar
I am looking for a Basic macro code to activate/deactivate a button (with assign macro) in customize toolbar.
Like "Form Controls" toolbar, when turning "Design Mode On/Off" button, some other buttons are activated while default is deactivated.
I appreciate it very much if somebody can help! Thank you.
Like "Form Controls" toolbar, when turning "Design Mode On/Off" button, some other buttons are activated while default is deactivated.
I appreciate it very much if somebody can help! Thank you.
Last edited by acknak on Sat Oct 26, 2013 2:02 pm, edited 1 time in total.
Reason: add "macro" to subject
Reason: add "macro" to subject
OpenOffice.org 3.4.1 on MacOS 10.5
Re: macro to activate/deactivate a button on customize toolb
Is there anybody can help? Thanks.
OpenOffice.org 3.4.1 on MacOS 10.5
Re: macro to activate/deactivate a button on customize toolb
So you want to create toggle button. You have to implement css.frame.XDispatch interface to update the status of your toolbar button.
Once you implement it for your dispatch command, you can use some functions for complex toolbars. This means you need own UNO component implementation.
To change the state of your toggle button on some toolbar, set boolean value for State element of css.frame.FeatureStateEvent that passed to css.frame.XStatusListener::statusChanged method of control set through css.frame.XDispatch::addStatusListener method of your dispatcher.
Once you implement it for your dispatch command, you can use some functions for complex toolbars. This means you need own UNO component implementation.
To change the state of your toggle button on some toolbar, set boolean value for State element of css.frame.FeatureStateEvent that passed to css.frame.XStatusListener::statusChanged method of control set through css.frame.XDispatch::addStatusListener method of your dispatcher.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: macro to activate/deactivate a button on customize toolb
Thanks for your sharing, Hanya!
Based on your guidance, I will try to look for css.frame.FeatureStateEvent code.
If possible, could you share some sample code so that I can implement it quickly?
Thank you so much.
Based on your guidance, I will try to look for css.frame.FeatureStateEvent code.
If possible, could you share some sample code so that I can implement it quickly?
Thank you so much.
OpenOffice.org 3.4.1 on MacOS 10.5
Re: macro to activate/deactivate a button on customize toolb
This thread may be of assistance
http://comments.gmane.org/gmane.comp.op ... .api/20770
http://comments.gmane.org/gmane.comp.op ... .api/20770
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: macro to activate/deactivate a button on customize toolb
Thanks for your sharing, RoryOF!
OpenOffice.org 3.4.1 on MacOS 10.5
Re: macro to activate/deactivate a button on customize toolb
There is an example for complex toolbar in SDK/examples/cpp/complextoolbarcontrols, and the document:
https://wiki.openoffice.org/wiki/Framew ... r_controls
https://wiki.openoffice.org/wiki/Framew ... r_controls
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
-
- Posts: 4
- Joined: Sun Apr 04, 2021 11:46 am
Re: macro to activate/deactivate a button on customize toolb
Please has anybody code for Basic (or Python)? Thanks a lot.
LibreOffice 7.1.2.2 Win10
Re: macro to activate/deactivate a button on customize toolb
What exactly are you asking KamilLanda that isn't answered by the links in this ancient thread already?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: macro to activate/deactivate a button on customize toolb
There was an example/sample where someone put a dialog in a toolbar by setting the toolbar as its parent - so you can have whatever buttons you want and the same control over them that you have in any other dialog.
I can't find it unfortunately - maybe someone else can/remembers it...
I can't find it unfortunately - maybe someone else can/remembers it...
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 4
- Joined: Sun Apr 04, 2021 11:46 am
Re: macro to activate/deactivate a button on customize toolb
I also looking for a Basic code.winhthai wrote:I am looking for a Basic macro code to activate/deactivate a button (with assign macro) in customize toolbar.
But the link from RoryOF comment doesn't exists, and the link from Hanya is for C++.
LibreOffice 7.1.2.2 Win10
Re: macro to activate/deactivate a button on customize toolb
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 4
- Joined: Sun Apr 04, 2021 11:46 am
Re: macro to activate/deactivate a button on customize toolb
But it is depended on BeanShell . Maybe it is not possible to create necessary Listeners in Basic, I don't know.
LibreOffice 7.1.2.2 Win10
Re: macro to activate/deactivate a button on customize toolb
We're back to what you want to do? Do you want a toggle button? You can easily create a toolbar button to run a macro that changes the label on the toolbar button from "off" to "on" or something similar.
Edit:
It could be a label that is a unicode tick ballot box switching to an empty ballot box - something like that.
Edit:
It could be a label that is a unicode tick ballot box switching to an empty ballot box - something like that.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 4
- Joined: Sun Apr 04, 2021 11:46 am
Re: macro to activate/deactivate a button on customize toolb
Originally I hoped somebody has a code for complextoolbar (like in Hanya link for C++), but purely in Basic. But nevermind.
LibreOffice 7.1.2.2 Win10
Re: macro to activate/deactivate a button on customize toolb
Some sample code on activating/deactivating a button is at
https://wiki.openoffice.org/wiki/Docume ... and_Button
I have not studied how this relates to a User toolbar.
https://wiki.openoffice.org/wiki/Docume ... and_Button
I have not studied how this relates to a User toolbar.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: macro to activate/deactivate a button on customize toolb
Not at all. This refers to a button on a user-defined dialog or a form control button attached to a document.RoryOF wrote:I have not studied how this relates to a User toolbar.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice