Age | Commit message (Collapse) | Author |
|
Each component has its own set of toolbars, depending
on the component type (Calc, Writer, Basic IDE, ...).
In the context of the actual class, a toolbar
is presumed defined statically:
- either by the application
- or by a customization done by the user.
The definition of a toolbar can be stored
in the application configuration files
or in the current document.
Changes made by scripts to toolbars stored
in the application are persistent. They are valid
for all documents of the same type.
Note that the menubar and the statusbar
are not considered toolbars in this context.
A toolbar consists in a series of graphical
controls to trigger actions.
The "Toolbar" service gives access to the "ToolbarButton" service to manage
the individual buttons belonging to the toolbar.
The "Toolbar" service is triggered from next
services: Document, Calc, Writer, Base, FormDocument
and Datasheet. All those components might host toolbars.
Proposed properties in the Toolbar service:
BuiltIn
Docked
HasGlobalScope
Name
ResourceURL
Visible (r/w)
XUIElement
Proposed method:
ToolbarButtons()
Proposed properties in the ToolbarButton service:
Caption
Height
Index
OnClick (r/w)
Parent
TipText (r/w)
Visible (r/w)
X
Y
(The Height, Width, X, Y properties allow for
easy hook of a popup menu to tye button)
Proposed method:
Execute()
Both services are available both from Basic and Python user scripts.
An update of the dcumentation help is required.
Change-Id: I43cb523b52e3d6362994557d74c4ef9faa220507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147925
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Display a menu in the menubar of a document (form document to be done)
After use, the menu will not be saved neither in the application settings,
nor in the document. The menu setting does not affect the modified status of the
document.
The menu will be displayed, as usual, when its header in the menubar is clicked.
When one of its items is selected, there are 3 alternative options:
- a UNO command (like ".uno:About") is triggered
- a user script is run receiving a standard argument defined in this service
- one of above combined with a toggle of the status of the item
The menu is described from top to bottom.
Each menu item receives a numeric and a string identifier.
Each menu item may be decorated with a tooltip and/or an icon.
The AddItem(), AddCheckBox() and AddRadioButton() methods, when
coompared with their equivalents in the SF_PopupMenu service,
receive 2 additional arguments: Command and Script.
The various document services receive 2 additional methods:
CreateMenu(), returning a Menu service instance
RemoveMenu()
Very short example:
menu = doc.CreateMenu("My menu", Before := "Help")
menu.AddItem("First Item", Command := "About")
menu.AddItem('2nd Item", Script := "... URI notation ...")
menu.Dispose() ' Once set the menu object may ve erased, listeners stay tuned
Later in the lifecycle of the document, one may run:
doc.RemoveMenu("My menu") ' doc.RemoveMenu("File") works as well !!!
All the functionalities are available both in Basic and Python user scripts.
Change-Id: Iabd157573693e9648fcb06d36c90af9a22b17a6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126309
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
The SFWidgets library is intended to host the Toolbar,
ToolbarControl (both future) and PopupMenu services.
A popup menu is usually triggered by a mouse action
(typically a right-click) on a dialog, a form, or one of their controls.
In these cases the menu will be displayed below the clicked area.
When triggered by other events, including in the normal flow
of a user script, the script should provide the coordinates
of the topleft edge of the menu versus the actual component.
The menu is described from top to bottom with next methods:
AddItem()
AddCheckBox()
AddRadioButton()
Example:
.AddCheckBox("View>Toolbars>Dialog")
.AddCheckBox("View>Toolbars>Find", Status := True)
.AddCheckBox("View>Status Bar", Status := True)
.AddItem("View>Full Screen", Name := "FULLSCREEN")
The SubmenuCharacter (Default = ">") is modifiable.
Each menu item receives a numeric and a string identifier.
The execute() method returns the item selected by the user.
The service is available both from Basic and Python user scripts.
The commit includes the review of build files to include
the new library and the new modules.
Change-Id: I2940be25313cc8fff7b337766edd348b04a20584
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123654
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|