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 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.agw.thumbnailctrl
.. highlight:: python
.. _wx.lib.agw.thumbnailctrl.ScrolledThumbnail:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.thumbnailctrl.ScrolledThumbnail**
==========================================================================================================================================
This is the main class implementation of :class:`ThumbnailCtrl`.
|
|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>ScrolledThumbnail</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.lib.agw.thumbnailctrl.ScrolledThumbnail_inheritance.png" alt="Inheritance diagram of ScrolledThumbnail" usemap="#dummy" class="inheritance"/></center>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="44,5,145,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="96,83,207,112"/> <area shape="rect" id="node4" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="91,160,212,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="169,5,251,35"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="107,237,196,267"/> <area shape="rect" id="node6" href="wx.ScrolledWindow.html" title="wx.ScrolledWindow" alt="" coords="82,392,221,421"/> <area shape="rect" id="node8" href="wx.lib.agw.thumbnailctrl.ScrolledThumbnail.html" title="wx.lib.agw.thumbnailctrl.ScrolledThumbnail" alt="" coords="5,469,299,499"/> </map>
</p>
|
|super_classes| Known Superclasses
==================================
:class:`wx.ScrolledWindow`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.__init__` Default class constructor.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.CalculateBestCaption` Calculates the best caption string to show based on the actual zoom factor.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.Clear` Clears :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.DeleteFiles` Deletes the selected thumbnails and their associated files.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.DrawThumbnail` Draws a visible thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.EnableDragging` Enables/disables thumbnails drag and drop.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.EnableToolTips` Globally enables/disables thumbnail file information.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetCaption` Returns the thumbnail caption.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetCaptionFont` Returns the font for all the thumbnail captions.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetCaptionHeight` Returns the height for the file name caption.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetDropShadow` Returns whether to drop a shadow behind thumbnails or not.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetGlobalPopupMenu` Returns the global thumbnailss popup menu (no need of thumbnail selection).
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetHighlightPointed` Returns whether the thumbnail pointed should be highlighted or not.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetItem` Returns the item at position `index`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetItemCount` Returns the number of thumbnails.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetItemIndex` Returns the thumbnail index at position (x, y).
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetOriginalImage` Returns the original image associated to a thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetPaintRect` Returns the paint bounding rect for the :meth:`~ScrolledThumbnail.OnPaint` method.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetPointed` Returns the pointed thumbnail index.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetPointedItem` Returns the pointed thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetPopupMenu` Returns the thumbnails popup menu when at least one thumbnail is selected.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetSelectedItem` Returns the selected thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetSelection` Returns the selected thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetSelectionColour` Returns the colour used to indicate a selected thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetShowDir` Returns the working directory with images.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetThumbBorder` Returns the thumbnail border.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetThumbHeight` Returns the thumbnail height.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetThumbInfo` Returns the thumbnail information.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetThumbOutline` Returns the thumbnail outline style on selection.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetThumbSize` Returns the thumbnail size as width, height and border.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetThumbWidth` Returns the thumbnail width.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.GetZoomFactor` Returns the zoom factor.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.InsertItem` Inserts a thumbnail in the specified position.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.IsAudio` Returns ``True`` if a file contains audio data.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.IsAudioVideo` Returns ``True`` if a file contains either audio or video data.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.IsSelected` Returns whether a thumbnail is selected or not.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.IsVideo` Returns ``True`` if a file contains video data.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ListDirectory` Returns list of file info objects for files of particular extensions.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.LoadImages` Threaded method to load images. Used internally.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnChar` Handles the ``wx.EVT_CHAR`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnMouseDClick` Handles the ``wx.EVT_LEFT_DCLICK`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnMouseDown` Handles the ``wx.EVT_LEFT_DOWN`` and ``wx.EVT_RIGHT_DOWN`` events for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnMouseLeave` Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnMouseMove` Handles the ``wx.EVT_MOTION`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnMouseUp` Handles the ``wx.EVT_LEFT_UP`` and ``wx.EVT_RIGHT_UP`` events for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnMouseWheel` Handles the ``wx.EVT_MOUSEWHEEL`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnPaint` Handles the ``wx.EVT_PAINT`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnResize` Handles the ``wx.EVT_SIZE`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.OnThumbChanged` Handles the ``EVT_THUMBNAILS_THUMB_CHANGED`` event for :class:`ThumbnailCtrl`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.RemoveItemAt` Removes a thumbnail at the specified position.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.Rotate` Rotates the selected thumbnails by the angle specified by `angle`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ScrollToSelected` Scrolls the :class:`ScrolledWindow` to the selected thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetCaption` Sets the current caption string.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetCaptionFont` Sets the font for all the thumbnail captions.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetDropShadow` Sets whether to drop a shadow behind thumbnails or not.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetGlobalPopupMenu` Sets the global thumbnails popup menu (no need of thumbnail selection).
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetHighlightPointed` Sets whether the thumbnail pointed should be highlighted or not.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetLabelControl` Sets the thumbnail label as :class:`StaticText`.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetOrientation` Set the :class:`ThumbnailCtrl` orientation (partially implemented).
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetPopupMenu` Sets the thumbnails popup menu when at least one thumbnail is selected.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetSelection` Sets thumbnail selection.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetSelectionColour` Sets the colour used to indicate a selected thumbnail.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetThumbOutline` Sets the thumbnail outline style on selection.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetThumbSize` Sets the thumbnail size as width, height and border.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SetZoomFactor` Sets the zoom factor.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ShowDir` Shows thumbnails for a particular folder.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ShowFileNames` Sets whether the user wants to show file names under the thumbnails or not.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ShowThumbs` Shows all the thumbnails.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.SortItems` Sorts the items accordingly to the :func:`~CmpThumb` function.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ThreadImage` Threaded method to load images. Used internally.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.UpdateItems` Updates thumbnail items.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.UpdateProp` Updates :class:`ThumbnailCtrl` and its visible thumbnails.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.UpdateShow` Updates thumbnail items.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ZoomIn` Zooms the thumbnails in.
:meth:`~wx.lib.agw.thumbnailctrl.ScrolledThumbnail.ZoomOut` Zooms the thumbnails out.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: ScrolledThumbnail(wx.ScrolledWindow)
This is the main class implementation of :class:`ThumbnailCtrl`.
.. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, thumboutline=THUMB_OUTLINE_IMAGE, thumbfilter=THUMB_FILTER_IMAGES, imagehandler=PILImageHandler)
Default class constructor.
:param `parent`: parent window. Must not be ``None``;
:param `id`: window identifier. A value of -1 indicates a default value;
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
:param `size`: the control size. A value of (-1, -1) indicates a default size,
chosen by either the windowing system or wxPython, depending on platform;
:param `thumboutline`: outline style for :class:`ScrolledThumbnail`, which may be:
=========================== ======= ==================================
Outline Flag Value Description
=========================== ======= ==================================
``THUMB_OUTLINE_NONE`` 0 No outline is drawn on selection
``THUMB_OUTLINE_FULL`` 1 Full outline (image+caption) is drawn on selection
``THUMB_OUTLINE_RECT`` 2 Only thumbnail bounding rectangle is drawn on selection (default)
``THUMB_OUTLINE_IMAGE`` 4 Only image bounding rectangle is drawn.
=========================== ======= ==================================
:param `thumbfilter`: filter for image/video/audio files. Actually only
``THUMB_FILTER_IMAGES`` is implemented;
:param `imagehandler`: can be :class:`PILImageHandler` if PIL is installed (faster), or
:class:`NativeImageHandler` which only uses wxPython image methods.
.. method:: CalculateBestCaption(self, dc, caption, sw, width)
Calculates the best caption string to show based on the actual zoom factor.
:param `dc`: an instance of :class:`wx.DC`;
:param `caption`: the original caption string;
:param `sw`: the maximum width allowed for the caption string, in pixels;
:param `width`: the caption string width, in pixels.
.. method:: Clear(self)
Clears :class:`ThumbnailCtrl`.
.. method:: DeleteFiles(self)
Deletes the selected thumbnails and their associated files.
.. warning:: This method deletes the original files too.
.. method:: DrawThumbnail(self, bmp, thumb, index)
Draws a visible thumbnail.
:param `bmp`: the thumbnail version of the original image;
:param `thumb`: an instance of :class:`Thumb`;
:param `index`: the index of the thumbnail to draw.
.. method:: EnableDragging(self, enable=True)
Enables/disables thumbnails drag and drop.
:param `enable`: ``True`` to enable drag and drop, ``False`` to disable it.
.. method:: EnableToolTips(self, enable=True)
Globally enables/disables thumbnail file information.
:param `enable`: ``True`` to enable thumbnail file information, ``False`` to disable it.
.. method:: GetCaption(self)
Returns the thumbnail caption.
.. method:: GetCaptionFont(self)
Returns the font for all the thumbnail captions.
.. method:: GetCaptionHeight(self, begRow, count=1)
Returns the height for the file name caption.
:param `begRow`: the caption line at which we start measuring the height;
:param `count`: the number of lines to measure.
.. method:: GetDropShadow(self)
Returns whether to drop a shadow behind thumbnails or not.
.. method:: GetGlobalPopupMenu(self)
Returns the global thumbnailss popup menu (no need of thumbnail selection).
.. method:: GetHighlightPointed(self)
Returns whether the thumbnail pointed should be highlighted or not.
:note: Please be aware that this functionality may be slow on slower computers.
.. method:: GetItem(self, index)
Returns the item at position `index`.
:param `index`: the thumbnail index position.
.. method:: GetItemCount(self)
Returns the number of thumbnails.
.. method:: GetItemIndex(self, x, y)
Returns the thumbnail index at position (x, y).
:param `x`: the mouse `x` position;
:param `y`: the mouse `y` position.
.. method:: GetOriginalImage(self, index=None)
Returns the original image associated to a thumbnail.
:param `index`: the index of the thumbnail. If defaulted to ``None``, the current
selection is used.
.. method:: GetPaintRect(self)
Returns the paint bounding rect for the :meth:`~ScrolledThumbnail.OnPaint` method.
.. method:: GetPointed(self)
Returns the pointed thumbnail index.
.. method:: GetPointedItem(self)
Returns the pointed thumbnail.
.. method:: GetPopupMenu(self)
Returns the thumbnails popup menu when at least one thumbnail is selected.
.. method:: GetSelectedItem(self, index)
Returns the selected thumbnail.
:param `index`: the thumbnail index (i.e., the selection).
.. method:: GetSelection(self, selIndex=-1)
Returns the selected thumbnail.
:param `selIndex`: if not equal to -1, the index of the selected thumbnail.
.. method:: GetSelectionColour(self)
Returns the colour used to indicate a selected thumbnail.
.. method:: GetShowDir(self)
Returns the working directory with images.
.. method:: GetThumbBorder(self)
Returns the thumbnail border.
.. method:: GetThumbHeight(self)
Returns the thumbnail height.
.. method:: GetThumbInfo(self, thumb=-1)
Returns the thumbnail information.
:param `thumb`: the index of the thumbnail for which we are collecting information.
.. method:: GetThumbOutline(self)
Returns the thumbnail outline style on selection.
:see: :meth:`~ScrolledThumbnail.SetThumbOutline` for a list of possible return values.
.. method:: GetThumbSize(self)
Returns the thumbnail size as width, height and border.
.. method:: GetThumbWidth(self)
Returns the thumbnail width.
.. method:: GetZoomFactor(self)
Returns the zoom factor.
.. method:: InsertItem(self, thumb, pos)
Inserts a thumbnail in the specified position.
:param `pos`: the index at which we wish to insert the new thumbnail.
.. method:: IsAudio(self, fname)
Returns ``True`` if a file contains audio data.
Currently unused as :class:`ThumbnailCtrl` recognizes only image files.
:param `fname`: a file name.
.. todo:: Find a way to create thumbnails of video, audio and other formats.
.. method:: IsAudioVideo(self, fname)
Returns ``True`` if a file contains either audio or video data.
Currently unused as :class:`ThumbnailCtrl` recognizes only image files.
:param `fname`: a file name.
.. todo:: Find a way to create thumbnails of video, audio and other formats.
.. method:: IsSelected(self, indx)
Returns whether a thumbnail is selected or not.
:param `indx`: the index of the thumbnail to check for selection.
.. method:: IsVideo(self, fname)
Returns ``True`` if a file contains video data.
Currently unused as :class:`ThumbnailCtrl` recognizes only image files.
:param `fname`: a file name.
.. todo:: Find a way to create thumbnails of video, audio and other formats.
.. method:: ListDirectory(self, directory, fileExtList)
Returns list of file info objects for files of particular extensions.
:param `directory`: the folder containing the images to thumbnail;
:param `fileExtList`: a Python list of file extensions to consider.
.. method:: LoadImages(self, newfile, imagecount)
Threaded method to load images. Used internally.
:param `newfile`: a file name containing an image to thumbnail;
:param `imagecount`: the number of images loaded until now.
.. method:: OnChar(self, event)
Handles the ``wx.EVT_CHAR`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`KeyEvent` event to be processed.
:note: You have these choices:
(1) ``d`` key rotates 90 degrees clockwise the selected thumbnails;
(2) ``s`` key rotates 90 degrees counter-clockwise the selected thumbnails;
(3) ``a`` key rotates 180 degrees the selected thumbnails;
(4) ``Del`` key deletes the selected thumbnails;
(5) ``+`` key zooms in;
(6) ``-`` key zooms out.
.. method:: OnMouseDClick(self, event)
Handles the ``wx.EVT_LEFT_DCLICK`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseDown(self, event)
Handles the ``wx.EVT_LEFT_DOWN`` and ``wx.EVT_RIGHT_DOWN`` events for :class:`ThumbnailCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseLeave(self, event)
Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseMove(self, event)
Handles the ``wx.EVT_MOTION`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseUp(self, event)
Handles the ``wx.EVT_LEFT_UP`` and ``wx.EVT_RIGHT_UP`` events for :class:`ThumbnailCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseWheel(self, event)
Handles the ``wx.EVT_MOUSEWHEEL`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
:note: If you hold down the ``Ctrl`` key, you can zoom in/out with the mouse wheel.
.. method:: OnPaint(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`PaintEvent` event to be processed.
.. method:: OnResize(self, event)
Handles the ``wx.EVT_SIZE`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`wx.SizeEvent` event to be processed.
.. method:: OnThumbChanged(self, event)
Handles the ``EVT_THUMBNAILS_THUMB_CHANGED`` event for :class:`ThumbnailCtrl`.
:param `event`: a :class:`ThumbnailEvent` event to be processed.
.. method:: RemoveItemAt(self, pos)
Removes a thumbnail at the specified position.
:param `pos`: the index at which we wish to remove the thumbnail.
.. method:: Rotate(self, angle=90)
Rotates the selected thumbnails by the angle specified by `angle`.
:param `angle`: the rotation angle for the thumbnail, in degrees.
.. method:: ScrollToSelected(self)
Scrolls the :class:`ScrolledWindow` to the selected thumbnail.
.. method:: SetCaption(self, caption="")
Sets the current caption string.
:param `caption`: the current caption string.
.. method:: SetCaptionFont(self, font=None)
Sets the font for all the thumbnail captions.
:param `font`: a valid :class:`wx.Font` object. If defaulted to ``None``, a standard
font will be generated.
.. method:: SetDropShadow(self, drop)
Sets whether to drop a shadow behind thumbnails or not.
:param `drop`: ``True`` to drop a shadow behind each thumbnail, ``False`` otheriwise.
.. method:: SetGlobalPopupMenu(self, gpmenu)
Sets the global thumbnails popup menu (no need of thumbnail selection).
:param `gpmenu`: an instance of :class:`wx.Menu`.
.. method:: SetHighlightPointed(self, highlight=True)
Sets whether the thumbnail pointed should be highlighted or not.
:param `highlight`: ``True`` to enable highlight-on-point with the mouse,
``False`` otherwise.
:note: Please be aware that this functionality may be slow on slower computers.
.. method:: SetLabelControl(self, statictext)
Sets the thumbnail label as :class:`StaticText`.
:param `statictext`: an instance of :class:`StaticText`.
.. method:: SetOrientation(self, orient=THUMB_VERTICAL)
Set the :class:`ThumbnailCtrl` orientation (partially implemented).
:param `orient`: one of ``THUMB_VERTICAL``, ``THUMB_HORIZONTAL``.
.. todo:: Correctly implement the ``THUMB_HORIZONTAL`` orientation.
.. method:: SetPopupMenu(self, menu)
Sets the thumbnails popup menu when at least one thumbnail is selected.
:param `menu`: an instance of :class:`wx.Menu`.
.. method:: SetSelection(self, value=-1)
Sets thumbnail selection.
:param `value`: the thumbnail index to select.
.. method:: SetSelectionColour(self, colour=None)
Sets the colour used to indicate a selected thumbnail.
:param `colour`: a valid :class:`wx.Colour` object. If defaulted to ``None``, it
will be taken from the system settings.
.. method:: SetThumbOutline(self, outline)
Sets the thumbnail outline style on selection.
:param `outline`: the outline to use on selection. This can be one of the following
bits:
=========================== ======= ==================================
Outline Flag Value Description
=========================== ======= ==================================
``THUMB_OUTLINE_NONE`` 0 No outline is drawn on selection
``THUMB_OUTLINE_FULL`` 1 Full outline (image+caption) is drawn on selection
``THUMB_OUTLINE_RECT`` 2 Only thumbnail bounding rectangle is drawn on selection (default)
``THUMB_OUTLINE_IMAGE`` 4 Only image bounding rectangle is drawn.
=========================== ======= ==================================
.. method:: SetThumbSize(self, width, height, border=6)
Sets the thumbnail size as width, height and border.
:param `width`: the desired thumbnail width;
:param `height`: the desired thumbnail height;
:param `border`: the spacing between thumbnails.
.. method:: SetZoomFactor(self, zoom=1.4)
Sets the zoom factor.
:param `zoom`: a floating point number representing the zoom factor. Must be
greater than or equal to 1.0.
.. method:: ShowDir(self, folder, filter=THUMB_FILTER_IMAGES)
Shows thumbnails for a particular folder.
:param `folder`: a directory containing the images to thumbnail;
:param `filter`: filter images, video audio (currently implemented only for
images).
.. todo:: Find a way to create thumbnails of video, audio and other formats.
.. method:: ShowFileNames(self, show=True)
Sets whether the user wants to show file names under the thumbnails or not.
:param `show`: ``True`` to show file names under the thumbnails, ``False`` otherwise.
.. method:: ShowThumbs(self, thumbs, caption)
Shows all the thumbnails.
:param `thumbs`: should be a sequence with instances of :class:`Thumb`;
:param `caption`: the caption text for the current selected thumbnail.
.. method:: SortItems(self)
Sorts the items accordingly to the :func:`~CmpThumb` function.
.. method:: ThreadImage(self, filenames)
Threaded method to load images. Used internally.
:param `filenames`: a Python list of file names containing images.
.. method:: UpdateItems(self)
Updates thumbnail items.
.. method:: UpdateProp(self, checkSize=True)
Updates :class:`ThumbnailCtrl` and its visible thumbnails.
:param `checkSize`: ``True`` to update the items visibility if the window
size has changed.
.. method:: UpdateShow(self)
Updates thumbnail items.
.. method:: ZoomIn(self)
Zooms the thumbnails in.
.. method:: ZoomOut(self)
Zooms the thumbnails out.
|