diff options
author | Alain Romedenne <alain.romedenne@libreoffice.org> | 2023-06-26 13:27:08 +0200 |
---|---|---|
committer | Alain Romedenne <alain.romedenne@libreoffice.org> | 2023-06-28 17:16:45 +0200 |
commit | 114401853f335d1e85edee8229c4450c575f1f0c (patch) | |
tree | 5ee6282d2b7783bf658fe61b33daf020b38be794 /source/text/sbasic | |
parent | d380411c947e8fcc3887889497349f45f01c28ac (diff) |
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 <alain.romedenne@libreoffice.org>
Diffstat (limited to 'source/text/sbasic')
-rw-r--r-- | source/text/sbasic/shared/00000002.xhp | 6 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_dialog.xhp | 39 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_dialogcontrol.xhp | 147 |
3 files changed, 106 insertions, 86 deletions
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 @@ <bookmark xml-lang="en-US" branch="index" id="bm_id3145801"><bookmark_value>twips; definition</bookmark_value> </bookmark> <h2 id="hd_id3145801">Twips</h2> -<paragraph role="paragraph" id="par_id3154731" xml-lang="en-US">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.</paragraph> +<paragraph role="paragraph" id="par_id3154731" xml-lang="en-US">A <emph>twip</emph> 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.</paragraph> +</section> +<section id="MapAppFontUnits"> +<h2 id="hd_id3153951"><variable id="AppFontUnits">AppFont Units</variable></h2> +<paragraph role="paragraph" id="par_id3153514" xml-lang="en-US"><emph>Map AppFont units</emph> 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.</paragraph> </section> <section id="urlnotation"> <h2 id="hd_id3153159">URL Notation</h2> 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 @@ </tablerow> </table> <h2 id="hd_id421612628828054" xml-lang="en-US">Event properties</h2> - <paragraph role="paragraph" id="par_id41612629140856" xml-lang="en-US">Returns a URI string with the reference to the script triggered by the event. Read its specification in the <link href="https://wiki.documentfoundation.org/Documentation/DevGuide/Scripting_Framework#Scripting_Framework_URI_Specification">scripting framework URI specification</link>.</paragraph> + <section id="OnEventsDefinition"> + <paragraph role="paragraph" id="par_id41612629140856" xml-lang="en-US"><literal>On…</literal> properties return a URI string with the reference to the script triggered by the event. <literal>On…</literal> properties can be set programmatically.<br/>Read its specification in the <link href="https://wiki.documentfoundation.org/Documentation/DevGuide/Scripting_Framework#Scripting_Framework_URI_Specification">scripting framework URI specification</link>.</paragraph> + </section> <table id="tab_id951612628879819"> <tablerow> <tablecell> <paragraph id="par_id961612628879819" role="tablehead" xml-lang="en-US">Name</paragraph> </tablecell> <tablecell> - <paragraph id="par_id401612628879819" role="tablehead" xml-lang="en-US">ReadOnly</paragraph> + <paragraph id="par_id401612628879819" role="tablehead" xml-lang="en-US">Read/Write</paragraph> </tablecell> <tablecell> <paragraph id="par_id281612628879819" role="tablehead" xml-lang="en-US">Basic IDE Description</paragraph> @@ -299,7 +301,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id431612629836735" localize="false" role="tablecontent" xml-lang="en-US">OnFocusGained</paragraph> + <paragraph id="par_id431612629836735" localize="false" role="tablecontent">OnFocusGained</paragraph> </tablecell> <tablecell> <paragraph id="par_id111612629836630" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -310,7 +312,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id701612629836389" localize="false" role="tablecontent" xml-lang="en-US">OnFocusLost</paragraph> + <paragraph id="par_id701612629836389" localize="false" role="tablecontent">OnFocusLost</paragraph> </tablecell> <tablecell> <paragraph id="par_id291612629836294" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -321,7 +323,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id241612629836863" localize="false" role="tablecontent" xml-lang="en-US">OnKeyPressed</paragraph> + <paragraph id="par_id241612629836863" localize="false" role="tablecontent">OnKeyPressed</paragraph> </tablecell> <tablecell> <paragraph id="par_id81612629836634" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -332,7 +334,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id201612629836996" localize="false" role="tablecontent" xml-lang="en-US">OnKeyReleased</paragraph> + <paragraph id="par_id201612629836996" localize="false" role="tablecontent">OnKeyReleased</paragraph> </tablecell> <tablecell> <paragraph id="par_id591612629836830" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -343,18 +345,18 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id111612629836950" localize="false" role="tablecontent" xml-lang="en-US">OnMouseDragged</paragraph> + <paragraph id="par_id111612629836950" localize="false" role="tablecontent">OnMouseDragged</paragraph> </tablecell> <tablecell> <paragraph id="par_id891612629836630" role="tablecontent" xml-lang="en-US">Yes</paragraph> </tablecell> <tablecell> - <paragraph id="par_id461612629836679" role="tablecontent" xml-lang="en-US">Mouse moved while key presses</paragraph> + <paragraph id="par_id461612629836679" role="tablecontent">Mouse moved while key presses</paragraph> </tablecell> </tablerow> <tablerow> <tablecell> - <paragraph id="par_id711612629836495" localize="false" role="tablecontent" xml-lang="en-US">OnMouseEntered</paragraph> + <paragraph id="par_id711612629836495" localize="false" role="tablecontent">OnMouseEntered</paragraph> </tablecell> <tablecell> <paragraph id="par_id131612629836291" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -365,7 +367,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id971612629836286" localize="false" role="tablecontent" xml-lang="en-US">OnMouseExited</paragraph> + <paragraph id="par_id971612629836286" localize="false" role="tablecontent">OnMouseExited</paragraph> </tablecell> <tablecell> <paragraph id="par_id211612629836725" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -376,7 +378,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id721612629836537" localize="false" role="tablecontent" xml-lang="en-US">OnMouseMoved</paragraph> + <paragraph id="par_id721612629836537" localize="false" role="tablecontent">OnMouseMoved</paragraph> </tablecell> <tablecell> <paragraph id="par_id311612629836481" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -387,7 +389,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id55161262983695" localize="false" role="tablecontent" xml-lang="en-US">OnMousePressed</paragraph> + <paragraph id="par_id55161262983695" localize="false" role="tablecontent">OnMousePressed</paragraph> </tablecell> <tablecell> <paragraph id="par_id981612629836116" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -398,7 +400,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph id="par_id621612629836155" localize="false" role="tablecontent" xml-lang="en-US">OnMouseReleased</paragraph> + <paragraph id="par_id621612629836155" localize="false" role="tablecontent">OnMouseReleased</paragraph> </tablecell> <tablecell> <paragraph id="par_id711612629836704" role="tablecontent" xml-lang="en-US">Yes</paragraph> @@ -408,6 +410,9 @@ </tablecell> </tablerow> </table> + <section id="OnEventsWarning"> + <warning id="par_id401687779361420">Assigning events via the Basic IDE and assigning events via macros are mutually exclusive.</warning> + </section> </section> <section id="methods_toc"> <table id="tab_id891606472825856"> @@ -442,6 +447,10 @@ </table> </section> +<section id="DialogUnits"> +<note id="par_id161660427825856">Dimensioning a dialog is done by using Map <link href="text/CHANGE ME(path/to/xhp/file#select id)">AppFont units</link>. A dialog or control model also uses AppFont units. While their views use pixels.</note> +</section> + <section id="Activate"> <comment> Activate -------------------------------------------------------------------------------------------------------------------------- </comment> <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id721583933076548"> @@ -661,7 +670,7 @@ <bookmark_value>Dialog service;Resize</bookmark_value> </bookmark> <h2 id="hd_id101598187953210" localize="false">Resize</h2> - <paragraph role="paragraph" id="par_id21598187953697">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 <literal>True</literal> if the resize was successful.</paragraph> + <paragraph role="paragraph" id="par_id21598187953697">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 <literal>True</literal> if the resize was successful.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <paragraph role="paragraph" localize="false" id="par_id711619628389339"><input>svc.Resize(opt Left: num, opt Top: num, opt Width: num, opt Height: num): bool</input></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> @@ -669,7 +678,7 @@ <paragraph role="paragraph" id="par_id721651236674379"><emph>Top</emph>: the vertical distance from the top-left corner</paragraph> <paragraph role="paragraph" id="par_id991651236674995"><emph>Width</emph>: the width of the rectangle containing the dialog</paragraph> <paragraph role="paragraph" id="par_id771651236675564"><emph>Height</emph>: the height of the rectangle containing the dialog</paragraph> - <paragraph role="paragraph" id="par_id211651236676180">Negative or missing arguments are left unchanged</paragraph> + <paragraph role="paragraph" id="par_id211651236676180">Missing arguments are left unchanged</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/> <bascode> 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 @@ <paragraph role="pycode" id="pyc_id416708660557072"> # The object "bas" below is an instance of the Basic service</paragraph> <paragraph role="pycode" localize="false" id="pyc_id491670866556877"> bas.MsgBox(str(e))</paragraph> </pycode> + <h2 id="hd_id71598455687512" xml-lang="en-US">Control types</h2> <paragraph role="paragraph" id="par_id851598455863395" xml-lang="en-US">The <literal>DialogControl</literal> service is available for these control types:</paragraph> - <list type="unordered"> - <listitem> - <paragraph id="par_id121598455880500" localize="false" role="listitem">Button</paragraph> - </listitem> - <listitem> - <paragraph id="par_id441598455934376" localize="false" role="listitem">CheckBox</paragraph> - </listitem> - <listitem> - <paragraph id="par_id471598455940400" localize="false" role="listitem">ComboBox</paragraph> - </listitem> - <listitem> - <paragraph id="par_id181598455945642" localize="false" role="listitem">CurrencyField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id181598455949653" localize="false" role="listitem">DateField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id541598455953714" localize="false" role="listitem">FileControl</paragraph> - </listitem> - <listitem> - <paragraph id="par_id441598455957858" localize="false" role="listitem">FixedLine</paragraph> - </listitem> - <listitem> - <paragraph id="par_id971598455961404" localize="false" role="listitem">FixedText</paragraph> - </listitem> - <listitem> - <paragraph id="par_id721598455965612" localize="false" role="listitem">FormattedField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id291598455969826" localize="false" role="listitem">GroupBox</paragraph> - </listitem> - <listitem> - <paragraph id="par_id861598455974724" localize="false" role="listitem">ImageControl</paragraph> - </listitem> - <listitem> - <paragraph id="par_id851598455979572" localize="false" role="listitem">ListBox</paragraph> - </listitem> - <listitem> - <paragraph id="par_id321598455984243" localize="false" role="listitem">NumericField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id981598455990524" localize="false" role="listitem">PatternField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id991598455998589" localize="false" role="listitem">ProgressBar</paragraph> - </listitem> - <listitem> - <paragraph id="par_id281598456002561" localize="false" role="listitem">RadioButton</paragraph> - </listitem> - <listitem> - <paragraph id="par_id91598456007438" localize="false" role="listitem">ScrollBar</paragraph> - </listitem> - <listitem> - <paragraph id="par_id171612698897041" localize="false" role="listitem">TableControl</paragraph> - </listitem> - <listitem> - <paragraph id="par_id271598456011504" localize="false" role="listitem">TextField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id661598456015339" localize="false" role="listitem">TimeField</paragraph> - </listitem> - <listitem> - <paragraph id="par_id171612698897514" localize="false" role="listitem">TreeControl</paragraph> - </listitem> - </list> + <table id="tab_ControlTypes"> + <tablerow> + <tablecell> + <paragraph id="par_id891687788755743" role="tablecontent" localize="false">• Button<br/>• CheckBox<br/>• ComboBox<br/>• CurrencyField<br/>• DateField<br/>• FileControl</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id461687788755743" role="tablecontent" localize="false">• FixedLine<br/>• FixedText<br/>• FormattedField<br/>• GroupBox<br/>• Hyperlink<br/>• ImageControl</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id641687788755743" role="tablecontent" localize="false">• ListBox<br/>• NumericField<br/>• PatternField<br/>• ProgressBar<br/>• RadioButton<br/>• ScrollBar</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id271687789435391" role="tablecontent">• TableControl<br/>• TextField<br/>• TimeField<br/>• TreeControl<br/> <br/> </paragraph> + </tablecell> + </tablerow> + </table> + <h2 id="hd_id651583668365757" xml-lang="en-US">Properties</h2> <section id="properties_toc"> <table id="tab_id381583668386455"> @@ -209,7 +162,7 @@ <paragraph id="par_id751583839708362" role="tablecontent" localize="false">String</paragraph> </tablecell> <tablecell> - <paragraph id="par_id351598538934413" role="tablecontent" localize="false">Button, CheckBox, FixedLine, FixedText, GroupBox, RadioButton</paragraph> + <paragraph id="par_id351598538934413" role="tablecontent" localize="false">Button, CheckBox, FixedLine, FixedText, GroupBox, Hyperlink, RadioButton</paragraph> </tablecell> <tablecell> <paragraph id="par_id731583839708412" role="tablecontent" xml-lang="en-US">Specifies the text associated with the control.</paragraph> @@ -527,6 +480,23 @@ </tablerow> <tablerow> <tablecell> + <paragraph id="par_id31598517671451" role="tablecontent" localize="false">URL</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id701598517671337" role="tablecontent" xml-lang="en-US">No</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id2159851767131" role="tablecontent" localize="false">String</paragraph> + </tablecell> + <tablecell> + <paragraph role="paragraph" id="par_id481687785271551">Hyperlink</paragraph> + </tablecell> + <tablecell> + <paragraph id="par_id1001598540024252" role="tablecontent" xml-lang="en-US">The URL to open when the control is clicked.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell> <paragraph id="par_id31598517671415" role="tablecontent" localize="false">Value</paragraph> </tablecell> <tablecell> @@ -537,7 +507,7 @@ </tablecell> <tablecell></tablecell> <tablecell> - <paragraph id="par_id1001598540024225" role="tablecontent" xml-lang="en-US">Refer to <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#hd_id81598540704978">Value property</link></paragraph> + <paragraph id="par_id1001598540024225" role="tablecontent" xml-lang="en-US">Refer to <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#hd_ValueProperty">Value property</link></paragraph> </tablecell> </tablerow> <tablerow> @@ -611,7 +581,7 @@ </table> </section> - <h2 id="hd_id81598540704978" xml-lang="en-US">The <variable id="ValueProperty">Value property</variable></h2> + <h2 id="hd_ValueProperty" xml-lang="en-US">The <variable id="ValueProperty">Value property</variable></h2> <table id="tab_id48159854325479"> <tablerow> <tablecell> @@ -795,8 +765,10 @@ </tablecell> </tablerow> </table> + <note id="par_id61687963745108">There's no <literal>Value</literal> property for GroupBox, Hyperlink, ImageControl and TreeControl dialog controls.</note> + <h2 id="hd_id421612628828054" xml-lang="en-US">Event properties</h2> - <paragraph role="paragraph" id="par_id41612629140856" xml-lang="en-US">Returns a URI string with the reference to the script triggered by the event. Read its specification in the <link href="https://wiki.documentfoundation.org/Documentation/DevGuide/Scripting_Framework#Scripting_Framework_URI_Specification">scripting framework URI specification</link>.</paragraph> + <embed href="text/sbasic/shared/03/sf_dialog.xhp#OnEventsDefinition"/> <table id="tab_id951612628879819"> <tablerow> <tablecell> @@ -986,6 +958,7 @@ </tablecell> </tablerow> </table> + <embed href="text/sbasic/shared/03/sf_dialog.xhp#OnEventsWarning"/> <h2 id="hd_id421583670049913" xml-lang="en-US">Methods</h2> <section id="methods_toc"> @@ -1006,7 +979,8 @@ <tablecell> <paragraph id="par_id63161270911712" role="tablecontent" localize="false"> <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#FindNode">FindNode</link><br/> - <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#SetFocus">SetFocus</link><br/><br/> + <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#Resize">Resize</link><br/> + <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#SetFocus">SetFocus</link><br/> </paragraph> </tablecell> <tablecell> @@ -1178,6 +1152,39 @@ </pycode> </section> +<section id="Resize"> + <comment> Resize ---------------------------------------------------------------------------------------------- </comment> + <bookmark localize="false" branch="index" id="bm_id721583393076548"> + <bookmark_value>DialogControl service;Resize</bookmark_value> + </bookmark> + <h2 id="hd_id681583933067692" localize="false">Resize</h2> + <paragraph role="paragraph" id="par_id871583933076484">Move the top-left corner of a dialog control to new coordinates and/or modify its dimensions. Return <literal>True</literal> if resizing was successful.</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> + <paragraph role="paragraph" localize="false" id="par_id11620310322534"> + <input>svc.Resize(opt Left: int, opt Top: int, opt Width: int, opt Height: int): bool</input> + </paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> + <paragraph role="paragraph" id="par_id351687783159237">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.</paragraph> + <paragraph role="paragraph" id="par_id911687783094143"><emph>Left</emph>: The horizontal distance from the top-left corner</paragraph> + <paragraph role="paragraph" id="par_id251687783287236"><emph>Top</emph>: The vertical distance from the top-left corner</paragraph> + <paragraph role="paragraph" id="par_id291687783328508"><emph>Width</emph>: the horizontal width of the rectangle containing the control</paragraph> + <paragraph role="paragraph" id="par_id901687783339292"><emph>Height</emph>: the vertical height of the rectangle containing the control</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/> + <bascode> + <paragraph role="bascode" localize="false" id="bas_id221598179015596">Dim oControl As Object</paragraph> + <paragraph role="bascode" localize="false" id="bas_id171598171911121">Set oDlg = CreateScriptService("SFDialogs.Dialog",,, "myDialog")</paragraph> + <paragraph role="bascode" localize="false" id="bas_id681598179132436">Set oControl = oDlg.Controls("thisControl")</paragraph> + <paragraph role="bascode" xml-lang="en-US" id="bas_id361598179153096">oControl.Resize(100, 200, Height:=6000) ' Width is unchanged</paragraph> + </bascode> + <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> + <pycode> + <paragraph role="pycode" localize="false" id="pyc_id591620319189602">dlg = CreateScriptService('Dialog', None, None, 'myDialog')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id201620319172098">ctrl = dlg.Controls('thisControl')</paragraph> + <paragraph role="pycode" xml-lang="en-US" id="pyc_id821620319176082">ctrl.Resize(300, 200, 1500) # Height is unchanged</paragraph> + </pycode> +</section> + <section id="SetFocus"> <comment> SetFocus ---------------------------------------------------------------------------------------------- </comment> <bookmark localize="false" branch="index" id="bm_id721583933076548"> |