File: wx.HelpControllerBase.txt

package info (click to toggle)
wxpython4.0 4.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 232,540 kB
  • sloc: cpp: 958,937; python: 233,059; ansic: 150,441; makefile: 51,662; sh: 8,687; perl: 1,563; javascript: 584; php: 326; xml: 200
file content (560 lines) | stat: -rw-r--r-- 16,115 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.HelpControllerBase:

==========================================================================================================================================
|phoenix_title|  **wx.HelpControllerBase**
==========================================================================================================================================

This is the abstract base class a family of classes by which applications may invoke a help viewer to provide on-line help.          

A help controller allows an application to display help, at the contents or at a particular topic, and shut the help program down on termination. This avoids proliferation of many instances of the help viewer whenever the user requests a different topic via the application's menus or buttons. 

Typically, an application will create a help controller instance when it starts, and immediately call :meth:`wx.HelpController.Initialize`   to associate a filename with it. The help viewer will only get run, however, just before the first call to display something. 





         



.. seealso:: :ref:`wx.HelpController`, :ref:`wx.html.HtmlHelpController`, :ref:`HTML Overview <html overview>`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>HelpControllerBase</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.HelpControllerBase_inheritance.png" alt="Inheritance diagram of HelpControllerBase" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.HelpControllerBase.html" title="wx.HelpControllerBase" alt="" coords="5,83,176,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="47,5,134,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.adv.ExtHelpController`, :ref:`wx.HelpController`, :ref:`wx.html.HtmlHelpController`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.HelpControllerBase.__init__`                                          Constructs a help instance object, but does not invoke the help viewer.
:meth:`~wx.HelpControllerBase.DisplayBlock`                                      If the help viewer is not running, runs it and displays the file at the given block number.
:meth:`~wx.HelpControllerBase.DisplayContents`                                   If the help viewer is not running, runs it and displays the contents.
:meth:`~wx.HelpControllerBase.DisplayContextPopup`                               Displays the section as a popup window using a context id.
:meth:`~wx.HelpControllerBase.DisplaySection`                                    If the help viewer is not running, runs it and displays the given section.
:meth:`~wx.HelpControllerBase.DisplayTextPopup`                                  Displays the text in a popup window, if possible.
:meth:`~wx.HelpControllerBase.GetFrameParameters`                                For :ref:`wx.html.HtmlHelpController`, returns the latest frame size and position settings and whether a new frame is drawn with each invocation.
:meth:`~wx.HelpControllerBase.GetParentWindow`                                   Returns the window to be used as the parent for the help window.
:meth:`~wx.HelpControllerBase.Initialize`                                        Initializes the help instance with a help filename.
:meth:`~wx.HelpControllerBase.KeywordSearch`                                     If the help viewer is not running, runs it, and searches for sections matching the given keyword.
:meth:`~wx.HelpControllerBase.LoadFile`                                          If the help viewer is not running, runs it and loads the given file.
:meth:`~wx.HelpControllerBase.OnQuit`                                            Overridable member called when this application's viewer is quit by the user.
:meth:`~wx.HelpControllerBase.Quit`                                              If the viewer is running, quits it by disconnecting.
:meth:`~wx.HelpControllerBase.SetFrameParameters`                                Set the parameters of the frame window.
:meth:`~wx.HelpControllerBase.SetParentWindow`                                   Sets the window to be used as the parent for the help window.
:meth:`~wx.HelpControllerBase.SetViewer`                                         Sets detailed viewer information.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.HelpControllerBase.FrameParameters`                                   See :meth:`~wx.HelpControllerBase.GetFrameParameters` and :meth:`~wx.HelpControllerBase.SetFrameParameters`
:attr:`~wx.HelpControllerBase.ParentWindow`                                      See :meth:`~wx.HelpControllerBase.GetParentWindow` and :meth:`~wx.HelpControllerBase.SetParentWindow`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.HelpControllerBase(Object)

   **Possible constructors**::

       HelpControllerBase(parentWindow=None)
       
   
   This is the abstract base class a family of classes by which
   applications may invoke a help viewer to provide on-line help.



   .. method:: __init__(self, parentWindow=None)

      Constructs a help instance object, but does not invoke the help viewer.                  

      If you provide a window, it will be used by some help controller classes, such as CHMHelpController, WinHelpController and :ref:`wx.html.HtmlHelpController`, as the parent for the help window instead of the value of :meth:`wx.App.GetTopWindow` . 

      You can also change the parent window later with :meth:`SetParentWindow` .                  


      :param `parentWindow`: 
      :type `parentWindow`: wx.Window







   .. method:: DisplayBlock(self, blockNo)

      If the help viewer is not running, runs it and displays the file at the given block number.                  



      - `WinHelp:`  Refers to the context number. 
      - `MS`  HTML Help: Refers to the context number. 
      - `External`  HTML help: the same as for :meth:`DisplaySection` . 
      -  ` :ref:`wx.html.HtmlHelpController`: `   `sectionNo`  is an identifier as specified in the :ref:`Help Files Format <help files format>`. 




                


      :param `blockNo`: 
      :type `blockNo`: long




      :rtype: `bool`







      .. wxdeprecated:: 
         This function is for backward compatibility only, and applications should use :meth:`DisplaySection`   instead.    








   .. method:: DisplayContents(self)

      If the help viewer is not running, runs it and displays the contents.                  

      :rtype: `bool`








   .. method:: DisplayContextPopup(self, contextId)

      Displays the section as a popup window using a context id.                  

      Returns ``False`` if unsuccessful or not implemented.                  


      :param `contextId`: 
      :type `contextId`: int




      :rtype: `bool`








   .. method:: DisplaySection(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **DisplaySection** `(self, section)`
      
      If the help viewer is not running, runs it and displays the given section.                  
      
      The interpretation of section differs between help viewers. For most viewers, this call is equivalent to KeywordSearch. For MS HTML Help, HTML help and external HTML help, if section has a .htm or .html extension, that HTML file will be displayed; otherwise a keyword search is done.                  
      
      
      :param `section`: 
      :type `section`: string
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **DisplaySection** `(self, sectionNo)`
      
      If the help viewer is not running, runs it and displays the given section.                  
      
      
      
      - `WinHelp`, MS HTML Help `sectionNo`  is a context id. 
      - `MS`  HTML Help: Pass -1 in `sectionNo`  to display the index. 
      - `External`  HTML help: :ref:`wx.adv.ExtHelpController`  implements `sectionNo`  as an id in a map file, which is of the form: 
      -  ` :ref:`wx.html.HtmlHelpController`: `   `sectionNo`  is an identifier as specified in the :ref:`Help Files Format <help files format>`. See also the help sample for notes on how to specify section numbers for various help file formats.  
      
      
                       
      
      
      :param `sectionNo`: 
      :type `sectionNo`: int
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: DisplayTextPopup(self, text, pos)

      Displays the text in a popup window, if possible.                  

      Returns ``False`` if unsuccessful or not implemented.                  


      :param `text`: 
      :type `text`: string
      :param `pos`: 
      :type `pos`: wx.Point




      :rtype: `bool`








   .. method:: GetFrameParameters(self)

      For :ref:`wx.html.HtmlHelpController`, returns the latest frame size and position settings and whether a new frame is drawn with each invocation.                  

      For all other help controllers, this function does nothing and just returns ``None``. 









      :rtype: `tuple`



                  



      :returns: 

         ( :ref:`wx.Frame`, `size`, `pos`, `newFrameEachTime` ) 








   .. method:: GetParentWindow(self)

      Returns the window to be used as the parent for the help window.                  

      This window is used by CHMHelpController, WinHelpController and :ref:`wx.html.HtmlHelpController`.                  

      :rtype: :ref:`wx.Window`








   .. method:: Initialize(self, file)

      Initializes the help instance with a help filename.                  

      Does not invoke the help viewer. This must be called directly after the help instance object is created and before any attempts to communicate with the viewer. 

      You may omit the file extension and a suitable one will be chosen. For :ref:`wx.html.HtmlHelpController`, the extensions zip, htb and hhp will be appended while searching for a suitable file. For WinHelp, the hlp extension is appended.                  


      :param `file`: 
      :type `file`: string




      :rtype: `bool`








   .. method:: KeywordSearch(self, keyWord, mode=HELP_SEARCH_ALL)

      If the help viewer is not running, runs it, and searches for sections matching the given keyword.                  

      If one match is found, the file is displayed at this section. The optional parameter allows searching the index (wx``wx.HELP_SEARCH_INDEX``) but this currently is only supported by the :ref:`wx.html.HtmlHelpController`. 



      - `WinHelp`, MS HTML Help: If more than one match is found, the first topic is displayed. 
      - `MS`  HTML Help: Pass an empty string to display the search page. 
      - `External`  HTML help, simple HTML help: If more than one match is found, a choice of topics is displayed. 
      -  ` :ref:`wx.html.HtmlHelpController`: `   see :meth:`wx.html.HtmlHelpController.KeywordSearch` .  


                 


      :param `keyWord`: 
      :type `keyWord`: string
      :param `mode`: 
      :type `mode`: wx.HelpSearchMode




      :rtype: `bool`








   .. method:: LoadFile(self, file=EmptyString)

      If the help viewer is not running, runs it and loads the given file.                  

      If the filename is not supplied or is empty, the file specified in :ref:`wx.Initialize`  is used. 

      If the viewer is already displaying the specified file, it will not be reloaded. This member function may be used before each display call in case the user has opened another file. 

      :ref:`wx.html.HtmlHelpController`  ignores this call.                  


      :param `file`: 
      :type `file`: string




      :rtype: `bool`








   .. method:: OnQuit(self)

      Overridable member called when this application's viewer is quit by the user.                  

      This does not work for all help controllers.                   





   .. method:: Quit(self)

      If the viewer is running, quits it by disconnecting.                  

      For Windows Help, the viewer will only close if no other application is using it.                  

      :rtype: `bool`








   .. method:: SetFrameParameters(self, titleFormat, size, pos=DefaultPosition, newFrameEachTime=False)

      Set the parameters of the frame window.                  

      For :ref:`wx.html.HtmlHelpController`, `titleFormat`  specifies the title string format (with  ``s``   being replaced by the actual page title) and  `size`  and `position`  specify the geometry of the frame. 

      For all other help controllers this function has no effect. 

      Finally, `newFrameEachTime`  is always ignored currently.                  


      :param `titleFormat`: 
      :type `titleFormat`: string
      :param `size`: 
      :type `size`: wx.Size
      :param `pos`: 
      :type `pos`: wx.Point
      :param `newFrameEachTime`: 
      :type `newFrameEachTime`: bool







   .. method:: SetParentWindow(self, parentWindow)

      Sets the window to be used as the parent for the help window.                  

      This is used by CHMHelpController, WinHelpController and :ref:`wx.html.HtmlHelpController`.                  


      :param `parentWindow`: 
      :type `parentWindow`: wx.Window







   .. method:: SetViewer(self, viewer, flags=HELP_NETSCAPE)

      Sets detailed viewer information.                  

      So far this is only relevant to :ref:`wx.adv.ExtHelpController`. Some examples of usage: 

      ::

                  self.help.SetViewer("kdehelp")
                  self.help.SetViewer("gnome-help-browser")
                  self.help.SetViewer("netscape", wx.HELP_NETSCAPE)






      :param `viewer`: This defaults to "netscape" for :ref:`wx.adv.ExtHelpController`.   
      :type `viewer`: string
      :param `flags`: This defaults to ``wx.HELP_NETSCAPE`` for :ref:`wx.adv.ExtHelpController`, indicating that the viewer is a variant of Netscape Navigator.  
      :type `flags`: long






                  



      .. todo:: modernize this function with :ref:`wx.LaunchDefaultBrowser`     








   .. attribute:: FrameParameters

      See :meth:`~wx.HelpControllerBase.GetFrameParameters` and :meth:`~wx.HelpControllerBase.SetFrameParameters`


   .. attribute:: ParentWindow

      See :meth:`~wx.HelpControllerBase.GetParentWindow` and :meth:`~wx.HelpControllerBase.SetParentWindow`