diff options
author | LibreOfficiant <LibreOfficiant@sfr.fr> | 2019-03-02 14:19:29 +0100 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2019-03-02 16:00:44 +0100 |
commit | 8e550a4a314857e55602979b124a0c8953e7e4c2 (patch) | |
tree | aacd368195221eb2f452e37709aa041ec4172cea /source/text | |
parent | 36a01a03a960bc2e152cb8ecd21844f91cfa46bd (diff) |
minor correction
Change-Id: I900e7175a028599f320d80ff30822fcad55d9046
Reviewed-on: https://gerrit.libreoffice.org/68620
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'source/text')
-rw-r--r-- | source/text/sbasic/python/python_dialogs.xhp | 6 | ||||
-rw-r--r-- | source/text/sbasic/python/python_programming.xhp | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/source/text/sbasic/python/python_dialogs.xhp b/source/text/sbasic/python/python_dialogs.xhp index e11055b29c..6989e48f30 100644 --- a/source/text/sbasic/python/python_dialogs.xhp +++ b/source/text/sbasic/python/python_dialogs.xhp @@ -23,7 +23,7 @@ <section id="pythondialog1"> <h1 id="N0336"><variable id="pythondialog"><link href="text/sbasic/python/python_dialogs.xhp" name="command_name">Opening a Dialog in Python</link></variable></h1> </section> - <paragraph role="paragraph" id="N0337">%PRODUCTNAME static dialogs are created with the <link href="text/sbasic/guide/create_dialog.xhp" name="dialog editor">Dialog editor</link> and are stored in varying places according to their personal (My Macros), shared (%PRODUCTNAME Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from on Basic or Python scripts, or using any other <link href="text/shared/guide/scripting.xhp">%PRODUCTNAME supported language</link> for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.</paragraph> + <paragraph role="paragraph" id="N0337">%PRODUCTNAME static dialogs are created with the <link href="text/sbasic/guide/create_dialog.xhp" name="dialog editor">Dialog editor</link> and are stored in varying places according to their personal (My Macros), shared (%PRODUCTNAME Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from Basic or Python scripts, or using any other <link href="text/shared/guide/scripting.xhp">%PRODUCTNAME supported language</link> for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.</paragraph> <h2 id="N0338">My Macros or %PRODUCTNAME Macros dialogs</h2> <paragraph role="paragraph" id="N0339">The examples below open <literal>Access2Base Trace</literal> console or the imported <literal>TutorialsDialog</literal> dialog with <menuitem>Tools – Macros – Run Macro...</menuitem> menu:</paragraph> <pycode> @@ -65,13 +65,11 @@ <paragraph role="pycode" id="N0379" localize="false"> </paragraph> <paragraph role="pycode" id="N0380" localize="false">g_exportedScripts = (docDialog,)</paragraph> </pycode> + <paragraph role="paragraph" id="N0381">Refer to <literal>msgbox.py</literal> in <literal>{installation}/program/</literal> directory for Python dynamic dialog examples.</paragraph> <section id="relatedtopics" > <embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/> <embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/> <embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/> - <paragraph role="paragraph" id="N0381"> - Refer to <literal>msgbox.py</literal> in <literal>{installation}/program/</literal> directory for Python dynamic dialog examples. - </paragraph> </section> </body> </helpdocument> diff --git a/source/text/sbasic/python/python_programming.xhp b/source/text/sbasic/python/python_programming.xhp index 47ed4a3632..80c5ff5162 100644 --- a/source/text/sbasic/python/python_programming.xhp +++ b/source/text/sbasic/python/python_programming.xhp @@ -260,12 +260,21 @@ <paragraph role="tablecontent" localize="false" id="N0297">ctx = uno.getComponentContext()</paragraph> <paragraph role="tablecontent" localize="false" id="N0298">smgr = ctx.getServiceManager()</paragraph> <paragraph role="tablecontent" localize="false" id="N0299">DESK = 'com.sun.star.frame.Desktop'</paragraph> - <paragraph role="tablecontent" localize="false" id="N0300">obj = smgr.createInstanceWithContext(DESK , ctx)</paragraph> + <paragraph role="tablecontent" localize="false" id="N0300">desktop = smgr.createInstanceWithContext(DESK , ctx)</paragraph> </tablecell> <tablecell> <paragraph role="tablecontent" localize="false" id="N0301">StarDesktop</paragraph> </tablecell> </tablerow> + <tablerow> + <tablecell> + <paragraph role="tablecontent" localize="false" id="N0298">desktop = smgr.createInstanceWithContext(DESK , ctx)</paragraph> + <paragraph role="tablecontent" localize="false" id="N0299">doc = desktop.CurrentComponent</paragraph> + </tablecell> + <tablecell> + <paragraph role="tablecontent" localize="false" id="N0301">ThisComponent</paragraph> + </tablecell> + </tablerow> </table> <h2 id="N0297">Importing an embedded Module</h2> <section id="PythonEmbeddedImport" > |