From 114401853f335d1e85edee8229c4450c575f1f0c Mon Sep 17 00:00:00 2001 From: Alain Romedenne Date: Mon, 26 Jun 2023 13:27:08 +0200 Subject: New features of SF_Dialog and SF_DialogControl services (WiP) Change-Id: I5806e7c9cd014bd92e58b2f9aa739a610050ea76 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/153598 Tested-by: Jenkins Reviewed-by: Alain Romedenne --- source/text/sbasic/shared/00000002.xhp | 6 +- source/text/sbasic/shared/03/sf_dialog.xhp | 39 +++--- source/text/sbasic/shared/03/sf_dialogcontrol.xhp | 147 +++++++++++----------- 3 files changed, 106 insertions(+), 86 deletions(-) (limited to 'source') diff --git a/source/text/sbasic/shared/00000002.xhp b/source/text/sbasic/shared/00000002.xhp index 8bc58a475d..43b124e60a 100644 --- a/source/text/sbasic/shared/00000002.xhp +++ b/source/text/sbasic/shared/00000002.xhp @@ -47,7 +47,11 @@ twips; definition

Twips

-A twip is a screen-independent unit which is used to define the uniform position and size of screen elements on all display systems. A twip is 1/1440th of an inch or 1/20 of a printer's point. There are 1440 twips to an inch or about 567 twips to a centimeter. +A twip is a screen-independent unit which is used to define the uniform position and size of screen elements on all display systems. A twip is 1/1440th of an inch or 1/20 of a printer's point. There are 1440 twips to an inch or about 567 twips to a centimeter. + +
+

AppFont Units

+Map AppFont units are device and resolution independent. One Map AppFont unit is equal to one eighth of the average character (Systemfont) height and one quarter of the average character width.

URL Notation

diff --git a/source/text/sbasic/shared/03/sf_dialog.xhp b/source/text/sbasic/shared/03/sf_dialog.xhp index 86a803c906..9de39dbb4a 100644 --- a/source/text/sbasic/shared/03/sf_dialog.xhp +++ b/source/text/sbasic/shared/03/sf_dialog.xhp @@ -284,14 +284,16 @@

Event properties

- Returns a URI string with the reference to the script triggered by the event. Read its specification in the scripting framework URI specification. +
+ On… properties return a URI string with the reference to the script triggered by the event. On… properties can be set programmatically.
Read its specification in the scripting framework URI specification.
+
Name - ReadOnly + Read/Write Basic IDE Description @@ -299,7 +301,7 @@ - OnFocusGained + OnFocusGained Yes @@ -310,7 +312,7 @@ - OnFocusLost + OnFocusLost Yes @@ -321,7 +323,7 @@ - OnKeyPressed + OnKeyPressed Yes @@ -332,7 +334,7 @@ - OnKeyReleased + OnKeyReleased Yes @@ -343,18 +345,18 @@ - OnMouseDragged + OnMouseDragged Yes - Mouse moved while key presses + Mouse moved while key presses - OnMouseEntered + OnMouseEntered Yes @@ -365,7 +367,7 @@ - OnMouseExited + OnMouseExited Yes @@ -376,7 +378,7 @@ - OnMouseMoved + OnMouseMoved Yes @@ -387,7 +389,7 @@ - OnMousePressed + OnMousePressed Yes @@ -398,7 +400,7 @@ - OnMouseReleased + OnMouseReleased Yes @@ -408,6 +410,9 @@
+
+ Assigning events via the Basic IDE and assigning events via macros are mutually exclusive. +
@@ -442,6 +447,10 @@
+
+Dimensioning a dialog is done by using Map AppFont units. A dialog or control model also uses AppFont units. While their views use pixels. +
+
Activate -------------------------------------------------------------------------------------------------------------------------- @@ -661,7 +670,7 @@ Dialog service;Resize

Resize

- Moves the topleft corner of a dialog to new coordinates and/or modify its dimensions. All distances are expressed in 1/100 mm. Without arguments, the method resets the initial dimensions. Return True if the resize was successful. + Moves the topleft corner of a dialog to new coordinates and/or modify its dimensions. All distances are expressed in AppFont units. Without arguments, the method resets the initial dimensions. Return True if the resize was successful. svc.Resize(opt Left: num, opt Top: num, opt Width: num, opt Height: num): bool @@ -669,7 +678,7 @@ Top: the vertical distance from the top-left corner Width: the width of the rectangle containing the dialog Height: the height of the rectangle containing the dialog - Negative or missing arguments are left unchanged + Missing arguments are left unchanged diff --git a/source/text/sbasic/shared/03/sf_dialogcontrol.xhp b/source/text/sbasic/shared/03/sf_dialogcontrol.xhp index 94bc90c3be..8df3367c7a 100644 --- a/source/text/sbasic/shared/03/sf_dialogcontrol.xhp +++ b/source/text/sbasic/shared/03/sf_dialogcontrol.xhp @@ -94,73 +94,26 @@ # The object "bas" below is an instance of the Basic service bas.MsgBox(str(e)) +

Control types

The DialogControl service is available for these control types: - - - Button - - - CheckBox - - - ComboBox - - - CurrencyField - - - DateField - - - FileControl - - - FixedLine - - - FixedText - - - FormattedField - - - GroupBox - - - ImageControl - - - ListBox - - - NumericField - - - PatternField - - - ProgressBar - - - RadioButton - - - ScrollBar - - - TableControl - - - TextField - - - TimeField - - - TreeControl - - + + + + • Button
• CheckBox
• ComboBox
• CurrencyField
• DateField
• FileControl
+
+ + • FixedLine
• FixedText
• FormattedField
• GroupBox
• Hyperlink
• ImageControl
+
+ + • ListBox
• NumericField
• PatternField
• ProgressBar
• RadioButton
• ScrollBar
+
+ + • TableControl
• TextField
• TimeField
• TreeControl

+
+
+
+

Properties

@@ -209,7 +162,7 @@ String - Button, CheckBox, FixedLine, FixedText, GroupBox, RadioButton + Button, CheckBox, FixedLine, FixedText, GroupBox, Hyperlink, RadioButton Specifies the text associated with the control. @@ -525,6 +478,23 @@ Specifies if the checkbox control may appear dimmed (grayed) or not. + + + URL + + + No + + + String + + + Hyperlink + + + The URL to open when the control is clicked. + + Value @@ -537,7 +507,7 @@ - Refer to Value property + Refer to Value property @@ -611,7 +581,7 @@
-

The Value property

+

The Value property

@@ -795,8 +765,10 @@
+ There's no Value property for GroupBox, Hyperlink, ImageControl and TreeControl dialog controls. +

Event properties

- Returns a URI string with the reference to the script triggered by the event. Read its specification in the scripting framework URI specification. + @@ -986,6 +958,7 @@
+

Methods

@@ -1006,7 +979,8 @@ FindNode
- SetFocus

+ Resize
+ SetFocus
@@ -1178,6 +1152,39 @@
+
+ Resize ---------------------------------------------------------------------------------------------- + + DialogControl service;Resize + +

Resize

+ Move the top-left corner of a dialog control to new coordinates and/or modify its dimensions. Return True if resizing was successful. + + + svc.Resize(opt Left: int, opt Top: int, opt Width: int, opt Height: int): bool + + + All distances are expressed in AppFonts and are measured from the top-left corner of the parent dialog. Without arguments, the method resets the initial dimensions. Missing arguments are left unchanged. + Left: The horizontal distance from the top-left corner + Top: The vertical distance from the top-left corner + Width: the horizontal width of the rectangle containing the control + Height: the vertical height of the rectangle containing the control + + + + Dim oControl As Object + Set oDlg = CreateScriptService("SFDialogs.Dialog",,, "myDialog") + Set oControl = oDlg.Controls("thisControl") + oControl.Resize(100, 200, Height:=6000) ' Width is unchanged + + + + dlg = CreateScriptService('Dialog', None, None, 'myDialog') + ctrl = dlg.Controls('thisControl') + ctrl.Resize(300, 200, 1500) # Height is unchanged + +
+
SetFocus ---------------------------------------------------------------------------------------------- -- cgit