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
|
.. 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.FileHistory:
==========================================================================================================================================
|phoenix_title| **wx.FileHistory**
==========================================================================================================================================
The :ref:`wx.FileHistory` encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the File menu).
:ref:`wx.FileHistory` can manage one or more file menus. More than one menu may be required in an MDI application, where the file history should appear on each MDI child menu as well as the MDI parent frame.
.. seealso:: :ref:`Document/View Framework <document/view framework>`, :ref:`DocManager`
|
|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>FileHistory</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.FileHistory_inheritance.png" alt="Inheritance diagram of FileHistory" 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.FileHistory.html" title="wx.FileHistory" alt="" coords="5,83,120,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="19,5,106,35"/> </map>
</p>
</div>
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.FileHistory.__init__` Constructor.
:meth:`~wx.FileHistory.AddFileToHistory` Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
:meth:`~wx.FileHistory.AddFilesToMenu` Appends the files in the history list, to all menus managed by the file history object.
:meth:`~wx.FileHistory.GetBaseId` Returns the base identifier for the range used for appending items.
:meth:`~wx.FileHistory.GetCount` Returns the number of files currently stored in the file history.
:meth:`~wx.FileHistory.GetHistoryFile` Returns the file at this index (zero-based).
:meth:`~wx.FileHistory.GetMaxFiles` Returns the maximum number of files that can be stored.
:meth:`~wx.FileHistory.GetMenuPathStyle` Get the current style of the menu item labels.
:meth:`~wx.FileHistory.GetMenus` Returns the list of menus that are managed by this file history object.
:meth:`~wx.FileHistory.Load` Loads the file history from the given config object.
:meth:`~wx.FileHistory.RemoveFileFromHistory` Removes the specified file from the history.
:meth:`~wx.FileHistory.RemoveMenu` Removes this menu from the list of those managed by this object.
:meth:`~wx.FileHistory.Save` Saves the file history into the given config object.
:meth:`~wx.FileHistory.SetBaseId` Sets the base identifier for the range used for appending items.
:meth:`~wx.FileHistory.SetMenuPathStyle` Set the style of the menu item labels.
:meth:`~wx.FileHistory.UseMenu` Adds this menu to the list of those menus that are managed by this file history object.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.FileHistory.BaseId` See :meth:`~wx.FileHistory.GetBaseId` and :meth:`~wx.FileHistory.SetBaseId`
:attr:`~wx.FileHistory.Count` See :meth:`~wx.FileHistory.GetCount`
:attr:`~wx.FileHistory.MaxFiles` See :meth:`~wx.FileHistory.GetMaxFiles`
:attr:`~wx.FileHistory.MenuPathStyle` See :meth:`~wx.FileHistory.GetMenuPathStyle` and :meth:`~wx.FileHistory.SetMenuPathStyle`
:attr:`~wx.FileHistory.Menus` See :meth:`~wx.FileHistory.GetMenus`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.FileHistory(Object)
**Possible constructors**::
FileHistory(maxFiles=9, idBase=ID_FILE1)
The FileHistory encapsulates a user interface convenience, the list
of most recently visited files as shown on a menu (usually the File
menu).
.. method:: __init__(self, maxFiles=9, idBase=ID_FILE1)
Constructor.
Pass the maximum number of files that should be stored and displayed.
`idBase` defaults to ``wx.ID_FILE1`` and represents the id given to the first history menu item. Since menu items can't share the same ``ID`` you should change `idBase` (to one of your own defined IDs) when using more than one :ref:`wx.FileHistory` in your application.
:param `maxFiles`:
:type `maxFiles`: int
:param `idBase`:
:type `idBase`: wx.WindowID
.. method:: AddFileToHistory(self, filename)
Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
:param `filename`:
:type `filename`: string
.. method:: AddFilesToMenu(self, *args, **kw)
|overload| Overloaded Implementations:
:html:`<hr class="overloadsep" /><br />`
**AddFilesToMenu** `(self)`
Appends the files in the history list, to all menus managed by the file history object.
:html:`<hr class="overloadsep" /><br />`
**AddFilesToMenu** `(self, menu)`
Appends the files in the history list, to the given menu only.
:param `menu`:
:type `menu`: wx.Menu
:html:`<hr class="overloadsep" /><br />`
.. method:: GetBaseId(self)
Returns the base identifier for the range used for appending items.
:rtype: :ref:`wx.WindowID`
.. method:: GetCount(self)
Returns the number of files currently stored in the file history.
:rtype: `int`
.. method:: GetHistoryFile(self, index)
Returns the file at this index (zero-based).
:param `index`:
:type `index`: int
:rtype: `string`
.. method:: GetMaxFiles(self)
Returns the maximum number of files that can be stored.
:rtype: `int`
.. method:: GetMenuPathStyle(self)
Get the current style of the menu item labels.
Initially returns ``FH_PATH_SHOW_IF_DIFFERENT``.
:rtype: :ref:`wx.FileHistoryMenuPathStyle`
.. versionadded:: 4.1/wxWidgets-3.1.5
.. seealso:: :meth:`SetMenuPathStyle`
.. method:: GetMenus(self)
Returns the list of menus that are managed by this file history object.
:rtype: :ref:`FileHistoryMenuList`
.. seealso:: :meth:`UseMenu`
.. method:: Load(self, config)
Loads the file history from the given config object.
This function should be called explicitly by the application.
:param `config`:
:type `config`: wx.ConfigBase
.. seealso:: :ref:`wx.ConfigBase`
.. method:: RemoveFileFromHistory(self, i)
Removes the specified file from the history.
:param `i`:
:type `i`: int
.. method:: RemoveMenu(self, menu)
Removes this menu from the list of those managed by this object.
:param `menu`:
:type `menu`: wx.Menu
.. method:: Save(self, config)
Saves the file history into the given config object.
This must be called explicitly by the application.
:param `config`:
:type `config`: wx.ConfigBase
.. seealso:: :ref:`wx.ConfigBase`
.. method:: SetBaseId(self, baseId)
Sets the base identifier for the range used for appending items.
:param `baseId`:
:type `baseId`: wx.WindowID
.. method:: SetMenuPathStyle(self, style)
Set the style of the menu item labels.
By default, the menu item label style is ``FH_PATH_SHOW_IF_DIFFERENT``.
:param `style`:
:type `style`: wx.FileHistoryMenuPathStyle
.. versionadded:: 4.1/wxWidgets-3.1.5
.. method:: UseMenu(self, menu)
Adds this menu to the list of those menus that are managed by this file history object.
Also see :meth:`AddFilesToMenu` for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.
:param `menu`:
:type `menu`: wx.Menu
.. attribute:: BaseId
See :meth:`~wx.FileHistory.GetBaseId` and :meth:`~wx.FileHistory.SetBaseId`
.. attribute:: Count
See :meth:`~wx.FileHistory.GetCount`
.. attribute:: MaxFiles
See :meth:`~wx.FileHistory.GetMaxFiles`
.. attribute:: MenuPathStyle
See :meth:`~wx.FileHistory.GetMenuPathStyle` and :meth:`~wx.FileHistory.SetMenuPathStyle`
.. attribute:: Menus
See :meth:`~wx.FileHistory.GetMenus`
|