Get properties of menu items (Like tooltip of button 'save')
-
- Posts: 9
- Joined: Sun Aug 11, 2019 2:17 am
Get properties of menu items (Like tooltip of button 'save')
Is possible to get informations of menu items trought UNO API? I'd like to get a tooltip/HelpText of menu items trought UNO API, using any language. Some idea? I researched a lot about it and found no results. Someone with a way to indicate?
Best regards,
Best regards,
MX Linux, LibreOffice 6
Re: Get properties of menu items (Like tooltip of button 'sa
Same question asked at https://ask.libreoffice.org/en/question ... f-uno-api/
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
Re: Get properties of menu items (Like tooltip of button 'sa
Here is Charlie Young's macro example: how to modify the context menu in the Calc application.
viewtopic.php?f=9&t=36641&p=168101&hili ... ds#p168101
(In my opinion only the Toolbar icons have tooltips, but the menu items have not. )
viewtopic.php?f=9&t=36641&p=168101&hili ... ds#p168101
(In my opinion only the Toolbar icons have tooltips, but the menu items have not. )
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Get properties of menu items (Like tooltip of button 'sa
That information should be available in the registry. This gets the label of the Save Command but haven't been able to find the Tooltip in OO.
In LibreOffice you can inspect the registry by going to Tools/Options/Advanced/Open Expert Configuration and search for whatever you want.
Code: Select all
GlobalScope.BasicLibraries.LoadLibrary("Tools")
c= GetRegistryKeyContent("org.openoffice.Office.UI.GenericCommands")
msgbox c.getbyname("UserInterface").getbyname("Commands").getbyname(".uno:Save").Label
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 9
- Joined: Sun Aug 11, 2019 2:17 am
Re: Get properties of menu items (Like tooltip of button 'sa
Hi,
Thank you very much for your answers!
@JeJe, you know how the stretch:
can be reproduced in Python?
Do you know if there is a way to catch/inspecting the "helptext/tooltip popup" event when it is triggered? Can I inspect this event somewhere? This event occurs exactly when the user places the mouse over an item (like the 'save' button).
I just tested this extension:
https://wiki.openoffice.org/wiki/Object ... ource_code
But it doesn't seem to serve that purpose.
Best Regards,
Thank you very much for your answers!
@JeJe, you know how the stretch:
Code: Select all
"GlobalScope.BasicLibraries.LoadLibrary (" Tools ")"
Do you know if there is a way to catch/inspecting the "helptext/tooltip popup" event when it is triggered? Can I inspect this event somewhere? This event occurs exactly when the user places the mouse over an item (like the 'save' button).
I just tested this extension:
https://wiki.openoffice.org/wiki/Object ... ource_code
But it doesn't seem to serve that purpose.
Best Regards,
MX Linux, LibreOffice 6
Re: Get properties of menu items (Like tooltip of button 'sa
This is the Basic routine from the Tools library which can be translated to Python:MiguelTeixeira wrote:can be reproduced in Python?
Code: Select all
Function GetRegistryKeyContent(sKeyName as string, Optional bforUpdate as Boolean)
Dim oConfigProvider as Object
Dim aNodePath(0) as new com.sun.star.beans.PropertyValue
oConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
aNodePath(0).Name = "nodepath"
aNodePath(0).Value = sKeyName
If IsMissing(bForUpdate) Then
GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath())
Else
If bForUpdate Then
GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aNodePath())
Else
GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath())
End If
End If
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
Re: Get properties of menu items (Like tooltip of button 'sa
What menu are you talking about?
You can create your own popupmenu and set the help text for the menu item.
https://www.openoffice.org/api/docs/com ... pMenu.html
https://www.openoffice.org/api/docs/com ... XMenu.html
You can examine the visible windows using Accessibility if its a Toolbar item you're interested in
https://www.openoffice.org/api/docs/com ... le-ix.html
You can intercept context menus. Don't know about the main menubar.
You can create your own popupmenu and set the help text for the menu item.
https://www.openoffice.org/api/docs/com ... pMenu.html
https://www.openoffice.org/api/docs/com ... XMenu.html
You can examine the visible windows using Accessibility if its a Toolbar item you're interested in
https://www.openoffice.org/api/docs/com ... le-ix.html
You can intercept context menus. Don't know about the main menubar.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 9
- Joined: Sun Aug 11, 2019 2:17 am
Re: Get properties of menu items (Like tooltip of button 'sa
I apologize,JeJe wrote:What menu are you talking about?
I'm talking about the toolbar (the one with the save, open, print, paste buttons ...)
MX Linux, LibreOffice 6
Re: Get properties of menu items (Like tooltip of button 'sa
That might be easier... what are you trying to do?
Edit: Is this a re-run of this thread?
viewtopic.php?t=98949
Edit: Is this a re-run of this thread?
viewtopic.php?t=98949
Last edited by JeJe on Sat Feb 08, 2020 8:51 pm, edited 1 time in total.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 9
- Joined: Sun Aug 11, 2019 2:17 am
Re: Get properties of menu items (Like tooltip of button 'sa
When the user places the mouse over a button, a popup with help text is displayed. This action is implemented here:
https://github.com/LibreOffice/core/blo ... p.cxx#L480
I would like to access the 'rHelpText' parameter through the UNO API.
I want to identify when the user places the mouse over some tool (save ... open ... print ...)
https://github.com/LibreOffice/core/blo ... p.cxx#L480
I would like to access the 'rHelpText' parameter through the UNO API.
I want to identify when the user places the mouse over some tool (save ... open ... print ...)
MX Linux, LibreOffice 6
Re: Get properties of menu items (Like tooltip of button 'sa
I edited my post to say is this a re-run of this thread just as you posted?
viewtopic.php?t=98949
Anyway... have a look at this thread... you can put a dialog in a toolbar with buttons and probably have a mouseover popup.
viewtopic.php?f=21&t=4352
viewtopic.php?t=98949
Anyway... have a look at this thread... you can put a dialog in a toolbar with buttons and probably have a mouseover popup.
viewtopic.php?f=21&t=4352
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 9
- Joined: Sun Aug 11, 2019 2:17 am
Re: Get properties of menu items (Like tooltip of button 'sa
Yes. I didn't get any more answers on that topic. I believe I was not being clear enough about what I was looking for.JeJe wrote:Edit: Is this a re-run of this thread?
MX Linux, LibreOffice 6
Re: Get properties of menu items (Like tooltip of button 'sa
Its better for everyone if you 'bump' the thread up... do another post saying you're still looking for the solution. They usually seems to get unsolved if there isn't a solution or no-one here knows the answer.
Controls in a dialog have a mouseinside event so setting a timer when that happens to show your own popup window might be possible... and having a dialog that mimics a toolbar... floating or like that link above put inside a toolbar. All I can think of, don't know the proper answer here.
Controls in a dialog have a mouseinside event so setting a timer when that happens to show your own popup window might be possible... and having a dialog that mimics a toolbar... floating or like that link above put inside a toolbar. All I can think of, don't know the proper answer here.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Get properties of menu items (Like tooltip of button 'sa
I confirm that the Basic code provided by JeJe
reports the tool tip of the save command. Simply use Basic or translate that little snippet to Python.
Code: Select all
GlobalScope.BasicLibraries.LoadLibrary("Tools")
c= GetRegistryKeyContent("org.openoffice.Office.UI.GenericCommands")
msgbox c.getbyname("UserInterface").getbyname("Commands").getbyname(".uno:Save").Label
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
Re: Get properties of menu items (Like tooltip of button 'sa
Villeroy - I think in LibreOffice that may be the case because the tool tip copies the label with the shortcut added (Ctrl + S).
Its not the case in my OO the tool tip text for Save is "Saves the current document" both in the menu and toolbar button. (In my LO there is no tool tip for the menu Save item)
As the OP is using LibreOffice it will work though - for that button anyway.
Its not the case in my OO the tool tip text for Save is "Saves the current document" both in the menu and toolbar button. (In my LO there is no tool tip for the menu Save item)
As the OP is using LibreOffice it will work though - for that button anyway.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Get properties of menu items (Like tooltip of button 'sa
The Expert Configuration in LO is really useful here... it shows all the values for the save command are null except for label.
The correct code in LO is something like:
Edit: Or
The correct code in LO is something like:
Code: Select all
GlobalScope.BasicLibraries.LoadLibrary("Tools")
c= GetRegistryKeyContent("org.openoffice.Office.UI.GenericCommands")
cc=c.getbyname("UserInterface").getbyname("Commands").getbyname(".uno:Save")
lbl = cc.ToolTipLabel
if lbl=nullstring then lbl= cc.Label
msgbox lbl
Edit: Or
Code: Select all
GlobalScope.BasicLibraries.LoadLibrary("Tools")
cc= GetRegistryKeyContent("/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/org.openoffice.Office.UI.Commands:LabelType['.uno:Save']")
lbl = cc.ToolTipLabel
if lbl=nullstring then lbl= cc.Label
msgbox lbl
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)