Translation

python_document_events.xhp N0747 help.text
English wXN8p
Context English Latvian Actions
python_document_events.xhp
N0688
help.text
''' Monitor document events '''
python_document_events.xhp
N0701
help.text
''' Initialize document events logging '''
python_document_events.xhp
N0705
help.text
Access2Base.Trace.TraceLog("INFO", _txtMsg & "Document events are being logged", UI_PROMPT)
python_document_events.xhp
N0714
help.text
''' Terminate document events logging '''
python_document_events.xhp
N0717
help.text
Access2Base.Trace.TraceLog("INFO", _txtMsg & "Document events have been logged", UI_PROMPT)
python_document_events.xhp
N0719
help.text
Access2Base.Trace.TraceConsole() ' Captured events dialog
python_document_events.xhp
N0722
help.text
' EVENTS
python_document_events.xhp
N0723
help.text
' Your code for handled events goes here
python_document_events.xhp
N0724
help.text
Mind the misspelled <literal>_documentEventOccured</literal> method that inherits a typo from %PRODUCTNAME Application Programming Interface (API).
python_document_events.xhp
N0725
help.text
Discovering Documents Events
python_document_events.xhp
bm_id681622445958242
help.text
<bookmark_value>API;frame.GlobalEventBroadcaster: Monitoring Document Event</bookmark_value>
python_document_events.xhp
N0726
help.text
The broadcaster API object provides the list of events it is responsible for:
python_document_events.xhp
N0727
help.text
With Python
python_document_events.xhp
N0734
help.text
""" Display document events """
python_document_events.xhp
N0736
help.text
adapted from DisplayAvailableEvents() by A. Pitonyak
python_document_events.xhp
N0747
help.text
The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python" name="Alternative Python Script Organizer">Alternative Python Script Organizer (APSO)</link> extension is used to render events information on screen.
python_document_events.xhp
N0748
help.text
With %PRODUCTNAME Basic
python_document_events.xhp
N0750
help.text
''' Display document events '''
python_examples.xhp
tit
help.text
Python examples Python piemēri
python_examples.xhp
bm_id20191031405
help.text
<bookmark_value>Python;examples</bookmark_value> <bookmark_value>Python;shell</bookmark_value> <bookmark_value>Python;platform</bookmark_value> <bookmark_value>Python;session</bookmark_value> <bookmark_value>Python;screen input/output</bookmark_value>
python_examples.xhp
hd_id201901031407
help.text
<variable id="pythonexamples2"><link href="text/sbasic/python/python_examples.xhp" name="python examples">Python programming examples</link></variable>
python_handler.xhp
tit
help.text
Creating A Dialog Handler
python_handler.xhp
N0664
help.text
<bookmark_value>Basic;Dialog Handler</bookmark_value> <bookmark_value>Python;Dialog Handler</bookmark_value> <bookmark_value>Access2Base;dlgTrace</bookmark_value> <bookmark_value>Access2Base;_DumpToFile</bookmark_value> <bookmark_value>API;DialogProvider2</bookmark_value> <bookmark_value>API;XDialogEventHandler</bookmark_value>
python_handler.xhp
N0665
help.text
<variable id="pythonhandler_h1"><link href="text/sbasic/python/python_handler.xhp" name="Creating a Dialog Handler">Creating a Dialog Handler</link></variable>
python_handler.xhp
N0666
help.text
Next to <link href="text/sbasic/shared/01040000.xhp" name="Assigning macros to events">assigning macros to events</link> or <link href="text/sbasic/basic/python/python_listener" name="creating event listeners">creating event listeners</link>, one can use dialog handlers, whose principle is to define UNO keywords, or methods, that are mapped to events to watch for. The event handler is responsible for executing methods using the <literal>vnd.sun.star.UNO:<method_name></literal> protocol. Unlike listeners that require to define all supported methods, even if unused, dialog handlers require only two methods on top of intended control hook scripts.
python_handler.xhp
N0667
help.text
The advantages of this approach are:
python_handler.xhp
N0668
help.text
It packs the code that handles event-driven macros,
python_handler.xhp
N0669
help.text
it decorrelates events from macros names which facilitates maintenance or updates, in particular when moving macros or modules.
python_handler.xhp
N0670
help.text
This mechanism is illustrated herewith for Basic and Python languages using an imported copy of <literal>Access2Base</literal> <literal>dlgTrace</literal> dialog. Exception handling and localisation are omitted for clarity.
python_handler.xhp
N0671
help.text
Assigning Dialog methods
python_handler.xhp
N0672
help.text
Export <literal>Access2Base</literal> <literal>dlgTrace</literal> dialog and import it into <literal>MyLib</literal> application library.

Loading…

No matching activity found.
Browse all component changes

Glossary

English Latvian
No related strings found in the glossary.

String information

Context
python_document_events.xhp
N0747
help.text
Source string description
wXN8p
Source string location
python_document_events.xhp
String age
3 years ago
Source string age
3 years ago
Translation file
lv/helpcontent2/source/text/sbasic/python.po, string 127