wxPython 4.3.2__cp315-cp315-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wx/WebView2Loader.dll +0 -0
- wx/__init__.py +22 -0
- wx/__init__.pyi +10 -0
- wx/__version__.py +9 -0
- wx/__version__.pyi +15 -0
- wx/_adv.cp315-win_amd64.pyd +0 -0
- wx/_aui.cp315-win_amd64.pyd +0 -0
- wx/_core.cp315-win_amd64.pyd +0 -0
- wx/_dataview.cp315-win_amd64.pyd +0 -0
- wx/_glcanvas.cp315-win_amd64.pyd +0 -0
- wx/_grid.cp315-win_amd64.pyd +0 -0
- wx/_html.cp315-win_amd64.pyd +0 -0
- wx/_html2.cp315-win_amd64.pyd +0 -0
- wx/_media.cp315-win_amd64.pyd +0 -0
- wx/_msw.cp315-win_amd64.pyd +0 -0
- wx/_propgrid.cp315-win_amd64.pyd +0 -0
- wx/_ribbon.cp315-win_amd64.pyd +0 -0
- wx/_richtext.cp315-win_amd64.pyd +0 -0
- wx/_stc.cp315-win_amd64.pyd +0 -0
- wx/_xml.cp315-win_amd64.pyd +0 -0
- wx/_xrc.cp315-win_amd64.pyd +0 -0
- wx/adv.py +127 -0
- wx/adv.pyi +5931 -0
- wx/aui.py +70 -0
- wx/aui.pyi +4805 -0
- wx/core.py +3417 -0
- wx/core.pyi +62949 -0
- wx/dataview.py +176 -0
- wx/dataview.pyi +3828 -0
- wx/gizmos.py +18 -0
- wx/glcanvas.py +13 -0
- wx/glcanvas.pyi +544 -0
- wx/grid.py +237 -0
- wx/grid.pyi +5678 -0
- wx/html.py +38 -0
- wx/html.pyi +3283 -0
- wx/html2.py +46 -0
- wx/html2.pyi +1301 -0
- wx/include/wxPython/sip.h +1938 -0
- wx/include/wxPython/wxpy_api.h +418 -0
- wx/lib/CDate.py +201 -0
- wx/lib/ClickableHtmlWindow.py +57 -0
- wx/lib/__init__.py +0 -0
- wx/lib/activex.py +178 -0
- wx/lib/activexwrapper.py +153 -0
- wx/lib/agw/__init__.py +128 -0
- wx/lib/agw/advancedsplash.py +563 -0
- wx/lib/agw/aquabutton.py +1127 -0
- wx/lib/agw/artmanager.py +2110 -0
- wx/lib/agw/aui/__init__.py +295 -0
- wx/lib/agw/aui/aui_constants.py +2616 -0
- wx/lib/agw/aui/aui_switcherdialog.py +1232 -0
- wx/lib/agw/aui/aui_utilities.py +648 -0
- wx/lib/agw/aui/auibar.py +4045 -0
- wx/lib/agw/aui/auibook.py +6288 -0
- wx/lib/agw/aui/dockart.py +1198 -0
- wx/lib/agw/aui/framemanager.py +10485 -0
- wx/lib/agw/aui/tabart.py +2749 -0
- wx/lib/agw/aui/tabmdi.py +679 -0
- wx/lib/agw/balloontip.py +1157 -0
- wx/lib/agw/buttonpanel.py +2787 -0
- wx/lib/agw/cubecolourdialog.py +3529 -0
- wx/lib/agw/customtreectrl.py +9908 -0
- wx/lib/agw/data/ShortcutEditor_1.png +0 -0
- wx/lib/agw/data/ShortcutEditor_1_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_2.png +0 -0
- wx/lib/agw/data/ShortcutEditor_2_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_3.png +0 -0
- wx/lib/agw/data/ShortcutEditor_3_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_4.png +0 -0
- wx/lib/agw/data/ShortcutEditor_4_thumb.png +0 -0
- wx/lib/agw/data/default_help_text.html +105 -0
- wx/lib/agw/flatmenu.py +7392 -0
- wx/lib/agw/flatnotebook.py +6669 -0
- wx/lib/agw/floatspin.py +1820 -0
- wx/lib/agw/fmcustomizedlg.py +535 -0
- wx/lib/agw/fmresources.py +407 -0
- wx/lib/agw/foldpanelbar.py +2282 -0
- wx/lib/agw/fourwaysplitter.py +1130 -0
- wx/lib/agw/genericmessagedialog.py +1549 -0
- wx/lib/agw/gradientbutton.py +731 -0
- wx/lib/agw/hyperlink.py +664 -0
- wx/lib/agw/hypertreelist.py +5756 -0
- wx/lib/agw/infobar.py +885 -0
- wx/lib/agw/knobctrl.py +944 -0
- wx/lib/agw/labelbook.py +3028 -0
- wx/lib/agw/multidirdialog.py +581 -0
- wx/lib/agw/peakmeter.py +1028 -0
- wx/lib/agw/persist/__init__.py +188 -0
- wx/lib/agw/persist/persist_constants.py +283 -0
- wx/lib/agw/persist/persist_handlers.py +2614 -0
- wx/lib/agw/persist/persistencemanager.py +863 -0
- wx/lib/agw/piectrl.py +1082 -0
- wx/lib/agw/pybusyinfo.py +399 -0
- wx/lib/agw/pycollapsiblepane.py +940 -0
- wx/lib/agw/pygauge.py +570 -0
- wx/lib/agw/pyprogress.py +916 -0
- wx/lib/agw/ribbon/__init__.py +198 -0
- wx/lib/agw/ribbon/art.py +219 -0
- wx/lib/agw/ribbon/art_aui.py +1283 -0
- wx/lib/agw/ribbon/art_default.py +81 -0
- wx/lib/agw/ribbon/art_internal.py +248 -0
- wx/lib/agw/ribbon/art_msw.py +2735 -0
- wx/lib/agw/ribbon/art_osx.py +52 -0
- wx/lib/agw/ribbon/bar.py +1259 -0
- wx/lib/agw/ribbon/buttonbar.py +1317 -0
- wx/lib/agw/ribbon/control.py +205 -0
- wx/lib/agw/ribbon/gallery.py +973 -0
- wx/lib/agw/ribbon/page.py +946 -0
- wx/lib/agw/ribbon/panel.py +1170 -0
- wx/lib/agw/ribbon/toolbar.py +1441 -0
- wx/lib/agw/rulerctrl.py +1885 -0
- wx/lib/agw/scrolledthumbnail.py +2116 -0
- wx/lib/agw/shapedbutton.py +1809 -0
- wx/lib/agw/shortcuteditor.py +2642 -0
- wx/lib/agw/speedmeter.py +1800 -0
- wx/lib/agw/supertooltip.py +1443 -0
- wx/lib/agw/thumbnailctrl.py +529 -0
- wx/lib/agw/toasterbox.py +1327 -0
- wx/lib/agw/ultimatelistctrl.py +13671 -0
- wx/lib/agw/xlsgrid.py +2111 -0
- wx/lib/agw/zoombar.py +1336 -0
- wx/lib/analogclock/__init__.py +140 -0
- wx/lib/analogclock/analogclock.py +630 -0
- wx/lib/analogclock/helpers.py +986 -0
- wx/lib/analogclock/lib_setup/__init__.py +0 -0
- wx/lib/analogclock/lib_setup/buttontreectrlpanel.py +297 -0
- wx/lib/analogclock/lib_setup/fontselect.py +57 -0
- wx/lib/analogclock/setup.py +490 -0
- wx/lib/analogclock/styles.py +47 -0
- wx/lib/anchors.py +103 -0
- wx/lib/art/__init__.py +4 -0
- wx/lib/art/flagart.py +1583 -0
- wx/lib/art/img2pyartprov.py +56 -0
- wx/lib/busy.py +152 -0
- wx/lib/buttons.py +1140 -0
- wx/lib/calendar.py +1596 -0
- wx/lib/checkbox.py +837 -0
- wx/lib/colourchooser/__init__.py +36 -0
- wx/lib/colourchooser/canvas.py +145 -0
- wx/lib/colourchooser/intl.py +24 -0
- wx/lib/colourchooser/pycolourbox.py +89 -0
- wx/lib/colourchooser/pycolourchooser.py +626 -0
- wx/lib/colourchooser/pycolourslider.py +98 -0
- wx/lib/colourchooser/pypalette.py +208 -0
- wx/lib/colourdb.py +740 -0
- wx/lib/colourselect.py +385 -0
- wx/lib/colourutils.py +118 -0
- wx/lib/combotreebox.py +944 -0
- wx/lib/delayedresult.py +420 -0
- wx/lib/dialogs.py +510 -0
- wx/lib/docview.py +3210 -0
- wx/lib/dragscroller.py +79 -0
- wx/lib/editor/README.txt +77 -0
- wx/lib/editor/__init__.py +24 -0
- wx/lib/editor/editor.py +974 -0
- wx/lib/editor/images.py +15 -0
- wx/lib/editor/selection.py +44 -0
- wx/lib/embeddedimage.py +76 -0
- wx/lib/eventStack.py +136 -0
- wx/lib/eventwatcher.py +440 -0
- wx/lib/evtmgr.py +521 -0
- wx/lib/expando.py +393 -0
- wx/lib/fancytext.py +494 -0
- wx/lib/filebrowsebutton.py +461 -0
- wx/lib/flashwin.py +262 -0
- wx/lib/flashwin_old.py +651 -0
- wx/lib/floatcanvas/FCEvents.py +53 -0
- wx/lib/floatcanvas/FCObjects.py +2910 -0
- wx/lib/floatcanvas/FloatCanvas.py +1025 -0
- wx/lib/floatcanvas/GUIMode.py +396 -0
- wx/lib/floatcanvas/NavCanvas.py +162 -0
- wx/lib/floatcanvas/Resources.py +319 -0
- wx/lib/floatcanvas/ScreenShot.py +1788 -0
- wx/lib/floatcanvas/Utilities/BBox.py +313 -0
- wx/lib/floatcanvas/Utilities/Colors.py +137 -0
- wx/lib/floatcanvas/Utilities/GUI.py +91 -0
- wx/lib/floatcanvas/Utilities/__init__.py +7 -0
- wx/lib/floatcanvas/__init__.py +124 -0
- wx/lib/foldmenu.py +89 -0
- wx/lib/gestures.py +310 -0
- wx/lib/gizmos/__init__.py +18 -0
- wx/lib/gizmos/dynamicsash.py +1202 -0
- wx/lib/gizmos/ledctrl.py +299 -0
- wx/lib/gizmos/treelistctrl.py +87 -0
- wx/lib/graphics.py +1942 -0
- wx/lib/gridmovers.py +516 -0
- wx/lib/iewin.py +249 -0
- wx/lib/iewin_old.py +894 -0
- wx/lib/imagebrowser.py +853 -0
- wx/lib/imageutils.py +163 -0
- wx/lib/infoframe.py +490 -0
- wx/lib/inspection.py +1254 -0
- wx/lib/intctrl.py +990 -0
- wx/lib/itemspicker.py +256 -0
- wx/lib/langlistctrl.py +480 -0
- wx/lib/layoutf.py +271 -0
- wx/lib/masked/__init__.py +27 -0
- wx/lib/masked/combobox.py +839 -0
- wx/lib/masked/ctrl.py +108 -0
- wx/lib/masked/ipaddrctrl.py +241 -0
- wx/lib/masked/maskededit.py +7262 -0
- wx/lib/masked/numctrl.py +2000 -0
- wx/lib/masked/textctrl.py +465 -0
- wx/lib/masked/timectrl.py +1465 -0
- wx/lib/mixins/__init__.py +17 -0
- wx/lib/mixins/grid.py +47 -0
- wx/lib/mixins/gridlabelrenderer.py +277 -0
- wx/lib/mixins/imagelist.py +77 -0
- wx/lib/mixins/inspection.py +184 -0
- wx/lib/mixins/listctrl.py +893 -0
- wx/lib/mixins/rubberband.py +403 -0
- wx/lib/mixins/treemixin.py +678 -0
- wx/lib/msgpanel.py +95 -0
- wx/lib/multisash.py +746 -0
- wx/lib/myole4ax.idl +178 -0
- wx/lib/myole4ax.tlb +0 -0
- wx/lib/newevent.py +229 -0
- wx/lib/newevent.pyi +25 -0
- wx/lib/nvdlg.py +156 -0
- wx/lib/ogl/__init__.py +13 -0
- wx/lib/ogl/basic.py +3989 -0
- wx/lib/ogl/bmpshape.py +86 -0
- wx/lib/ogl/canvas.py +467 -0
- wx/lib/ogl/composit.py +1576 -0
- wx/lib/ogl/diagram.py +230 -0
- wx/lib/ogl/divided.py +482 -0
- wx/lib/ogl/drawn.py +898 -0
- wx/lib/ogl/lines.py +1809 -0
- wx/lib/ogl/oglmisc.py +607 -0
- wx/lib/pdfviewer/__init__.py +113 -0
- wx/lib/pdfviewer/bitmaps/ArrowLeft.png +0 -0
- wx/lib/pdfviewer/bitmaps/ArrowRight.png +0 -0
- wx/lib/pdfviewer/bitmaps/DirectionH.png +0 -0
- wx/lib/pdfviewer/bitmaps/DirectionV.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerFirst.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerLast.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerNext.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerPrev.png +0 -0
- wx/lib/pdfviewer/bitmaps/Printer.png +0 -0
- wx/lib/pdfviewer/bitmaps/ReadMe.txt +28 -0
- wx/lib/pdfviewer/bitmaps/Save.png +0 -0
- wx/lib/pdfviewer/bitmaps/ZoomIn.png +0 -0
- wx/lib/pdfviewer/bitmaps/ZoomOut.png +0 -0
- wx/lib/pdfviewer/bitmaps/encode_bitmaps.py +37 -0
- wx/lib/pdfviewer/buttonpanel.py +285 -0
- wx/lib/pdfviewer/images.py +240 -0
- wx/lib/pdfviewer/viewer.py +1118 -0
- wx/lib/pdfwin.py +295 -0
- wx/lib/pdfwin_old.py +789 -0
- wx/lib/platebtn.py +789 -0
- wx/lib/plot/CHANGELOG.md +150 -0
- wx/lib/plot/README.md +16 -0
- wx/lib/plot/__init__.py +46 -0
- wx/lib/plot/__main__.py +5 -0
- wx/lib/plot/examples/__init__.py +0 -0
- wx/lib/plot/examples/demo.py +1010 -0
- wx/lib/plot/examples/simple_example.py +56 -0
- wx/lib/plot/plotcanvas.py +2985 -0
- wx/lib/plot/polyobjects.py +1524 -0
- wx/lib/plot/utils.py +334 -0
- wx/lib/popupctl.py +251 -0
- wx/lib/printout.py +1155 -0
- wx/lib/progressindicator.py +151 -0
- wx/lib/pubsub/LICENSE_BSD_Simple.txt +23 -0
- wx/lib/pubsub/README_WxPython.txt +22 -0
- wx/lib/pubsub/RELEASE_NOTES.txt +71 -0
- wx/lib/pubsub/__init__.py +25 -0
- wx/lib/pubsub/core/__init__.py +92 -0
- wx/lib/pubsub/core/arg1/__init__.py +16 -0
- wx/lib/pubsub/core/arg1/listenerimpl.py +97 -0
- wx/lib/pubsub/core/arg1/publisher.py +40 -0
- wx/lib/pubsub/core/arg1/publishermixin.py +34 -0
- wx/lib/pubsub/core/arg1/topicargspecimpl.py +66 -0
- wx/lib/pubsub/core/arg1/topicmgrimpl.py +19 -0
- wx/lib/pubsub/core/callables.py +198 -0
- wx/lib/pubsub/core/imp2.py +62 -0
- wx/lib/pubsub/core/itopicdefnprovider.py +0 -0
- wx/lib/pubsub/core/kwargs/__init__.py +16 -0
- wx/lib/pubsub/core/kwargs/datamsg.py +27 -0
- wx/lib/pubsub/core/kwargs/listenerimpl.py +93 -0
- wx/lib/pubsub/core/kwargs/publisher.py +77 -0
- wx/lib/pubsub/core/kwargs/publishermixin.py +65 -0
- wx/lib/pubsub/core/kwargs/topicargspecimpl.py +216 -0
- wx/lib/pubsub/core/kwargs/topicmgrimpl.py +13 -0
- wx/lib/pubsub/core/listener.py +40 -0
- wx/lib/pubsub/core/listenerbase.py +185 -0
- wx/lib/pubsub/core/notificationmgr.py +185 -0
- wx/lib/pubsub/core/publisherbase.py +189 -0
- wx/lib/pubsub/core/topicargspec.py +77 -0
- wx/lib/pubsub/core/topicdefnprovider.py +631 -0
- wx/lib/pubsub/core/topicexc.py +72 -0
- wx/lib/pubsub/core/topicmgr.py +454 -0
- wx/lib/pubsub/core/topicobj.py +472 -0
- wx/lib/pubsub/core/topictreetraverser.py +143 -0
- wx/lib/pubsub/core/topicutils.py +119 -0
- wx/lib/pubsub/core/treeconfig.py +21 -0
- wx/lib/pubsub/core/validatedefnargs.py +29 -0
- wx/lib/pubsub/core/weakmethod.py +102 -0
- wx/lib/pubsub/policies.py +24 -0
- wx/lib/pubsub/pub.py +199 -0
- wx/lib/pubsub/setuparg1.py +47 -0
- wx/lib/pubsub/setupkwargs.py +29 -0
- wx/lib/pubsub/utils/__init__.py +27 -0
- wx/lib/pubsub/utils/exchandling.py +100 -0
- wx/lib/pubsub/utils/misc.py +99 -0
- wx/lib/pubsub/utils/notification.py +331 -0
- wx/lib/pubsub/utils/topictreeprinter.py +195 -0
- wx/lib/pubsub/utils/xmltopicdefnprovider.py +286 -0
- wx/lib/pydocview.py +3300 -0
- wx/lib/rcsizer.py +227 -0
- wx/lib/resizewidget.py +357 -0
- wx/lib/scrolledpanel.py +243 -0
- wx/lib/sheet.py +350 -0
- wx/lib/sized_controls.py +691 -0
- wx/lib/softwareupdate.py +355 -0
- wx/lib/splitter.py +925 -0
- wx/lib/statbmp.py +199 -0
- wx/lib/stattext.py +321 -0
- wx/lib/throbber.py +424 -0
- wx/lib/ticker.py +306 -0
- wx/lib/ticker_xrc.py +48 -0
- wx/lib/utils.py +89 -0
- wx/lib/wordwrap.py +97 -0
- wx/lib/wxcairo/__init__.py +139 -0
- wx/lib/wxcairo/wx_cairocffi.py +200 -0
- wx/lib/wxcairo/wx_pycairo.py +455 -0
- wx/lib/wxpTag.py +274 -0
- wx/libcairo-2.dll +0 -0
- wx/locale/af/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/an/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ar/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ca/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ca@valencia/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/co/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/cs/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/da/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/de/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/el/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/es/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/eu/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fa_IR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/gl_ES/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hu/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/id/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/it/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ja/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ka/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ko_KR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/lt/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/lv/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ms/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/nb/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ne/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/nl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pt/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pt_BR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ro/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ru/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sk/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sq/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sv/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ta/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/tr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/uk/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/vi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/zh_CN/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/zh_TW/LC_MESSAGES/wxstd.mo +0 -0
- wx/media.py +30 -0
- wx/media.pyi +272 -0
- wx/msw.py +16 -0
- wx/msw.pyi +91 -0
- wx/propgrid.py +498 -0
- wx/propgrid.pyi +7427 -0
- wx/py/CHANGES.txt +796 -0
- wx/py/Py.ico +0 -0
- wx/py/PyAlaCarte.py +34 -0
- wx/py/PyAlaMode.py +34 -0
- wx/py/PyAlaModeTest.py +33 -0
- wx/py/PyCrust.ico +0 -0
- wx/py/PyCrust.py +78 -0
- wx/py/PyCrust_16.png +0 -0
- wx/py/PyCrust_32.png +0 -0
- wx/py/PyFilling.py +35 -0
- wx/py/PyShell.py +78 -0
- wx/py/PySlices.ico +0 -0
- wx/py/PySlices.py +98 -0
- wx/py/PySlicesShell.py +94 -0
- wx/py/PySlices_16.png +0 -0
- wx/py/PySlices_32.png +0 -0
- wx/py/PyWrap.py +52 -0
- wx/py/README.txt +77 -0
- wx/py/__init__.py +20 -0
- wx/py/buffer.py +136 -0
- wx/py/crust.py +403 -0
- wx/py/crustslices.py +403 -0
- wx/py/dispatcher.py +259 -0
- wx/py/document.py +37 -0
- wx/py/editor.py +844 -0
- wx/py/editwindow.py +316 -0
- wx/py/filling.py +358 -0
- wx/py/frame.py +976 -0
- wx/py/images.py +212 -0
- wx/py/interpreter.py +161 -0
- wx/py/introspect.py +402 -0
- wx/py/magic.py +98 -0
- wx/py/parse.py +134 -0
- wx/py/path.py +36 -0
- wx/py/pseudo.py +99 -0
- wx/py/shell.py +1579 -0
- wx/py/sliceshell.py +3805 -0
- wx/py/tests/test_interpreter.py +71 -0
- wx/py/tests/test_introspect.py +810 -0
- wx/py/tests/test_pseudo.py +70 -0
- wx/py/tests/test_version.py +36 -0
- wx/py/tests/testall.py +22 -0
- wx/py/version.py +7 -0
- wx/py.typed +0 -0
- wx/ribbon.py +48 -0
- wx/ribbon.pyi +3099 -0
- wx/richtext.py +141 -0
- wx/richtext.pyi +13581 -0
- wx/siplib.cp315-win_amd64.pyd +0 -0
- wx/siplib.pyi +19 -0
- wx/stc.py +59 -0
- wx/stc.pyi +9918 -0
- wx/svg/__init__.py +363 -0
- wx/svg/_nanosvg.cp315-win_amd64.pyd +0 -0
- wx/tools/__init__.py +18 -0
- wx/tools/dbg.py +268 -0
- wx/tools/genaxmodule.py +50 -0
- wx/tools/helpviewer.py +92 -0
- wx/tools/img2img.py +85 -0
- wx/tools/img2png.py +54 -0
- wx/tools/img2py.py +306 -0
- wx/tools/img2xpm.py +54 -0
- wx/tools/pywxrc.py +951 -0
- wx/tools/wxget.py +254 -0
- wx/tools/wxget_docs_demo.py +183 -0
- wx/wxbase334u_net_vc140_x64.dll +0 -0
- wx/wxbase334u_vc140_x64.dll +0 -0
- wx/wxbase334u_xml_vc140_x64.dll +0 -0
- wx/wxmsw334u_adv_vc140_x64.dll +0 -0
- wx/wxmsw334u_aui_vc140_x64.dll +0 -0
- wx/wxmsw334u_core_vc140_x64.dll +0 -0
- wx/wxmsw334u_gl_vc140_x64.dll +0 -0
- wx/wxmsw334u_html_vc140_x64.dll +0 -0
- wx/wxmsw334u_media_vc140_x64.dll +0 -0
- wx/wxmsw334u_propgrid_vc140_x64.dll +0 -0
- wx/wxmsw334u_qa_vc140_x64.dll +0 -0
- wx/wxmsw334u_ribbon_vc140_x64.dll +0 -0
- wx/wxmsw334u_richtext_vc140_x64.dll +0 -0
- wx/wxmsw334u_stc_vc140_x64.dll +0 -0
- wx/wxmsw334u_webview_vc140_x64.dll +0 -0
- wx/wxmsw334u_xrc_vc140_x64.dll +0 -0
- wx/xml.py +18 -0
- wx/xml.pyi +728 -0
- wx/xrc.py +68 -0
- wx/xrc.pyi +896 -0
- wxpython-4.3.2.dist-info/METADATA +71 -0
- wxpython-4.3.2.dist-info/RECORD +472 -0
- wxpython-4.3.2.dist-info/WHEEL +5 -0
- wxpython-4.3.2.dist-info/entry_points.txt +13 -0
- wxpython-4.3.2.dist-info/licenses/LICENSE.txt +610 -0
- wxpython-4.3.2.dist-info/top_level.txt +1 -0
wx/lib/agw/zoombar.py
ADDED
|
@@ -0,0 +1,1336 @@
|
|
|
1
|
+
# --------------------------------------------------------------------------------- #
|
|
2
|
+
# ZoomBar wxPython IMPLEMENTATION
|
|
3
|
+
#
|
|
4
|
+
# Andrea Gavana @ 19 Dec 2012, 21.00 GMT
|
|
5
|
+
#
|
|
6
|
+
#
|
|
7
|
+
# For all kind of problems, requests of enhancements and bug reports, please write
|
|
8
|
+
# to me at:
|
|
9
|
+
#
|
|
10
|
+
# andrea.gavana@gmail.com
|
|
11
|
+
# andrea.gavana@maerskoil.com
|
|
12
|
+
#
|
|
13
|
+
# Or, obviously, to the wxPython mailing list!!!
|
|
14
|
+
#
|
|
15
|
+
# Tags: phoenix-port, documented, unittest, py3-port
|
|
16
|
+
#
|
|
17
|
+
# End of comments
|
|
18
|
+
# --------------------------------------------------------------------------------- #
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
:class:`~wx.lib.agw.zoombar.ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
|
|
22
|
+
inside a :class:`Panel`.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Description
|
|
26
|
+
===========
|
|
27
|
+
|
|
28
|
+
:class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
|
|
29
|
+
inside a :class:`Panel`.
|
|
30
|
+
|
|
31
|
+
Once you hover mouse over the :class:`ZoomBar` correct button will bubble up, grow to
|
|
32
|
+
predefined size, so you can easily see the button you are about to click and
|
|
33
|
+
have larger area to click. Difference this makes is amazing.
|
|
34
|
+
|
|
35
|
+
The buttons are able to be zoomed from the bottom up (bottom fixed) as well
|
|
36
|
+
as to zoom from a central point. Also the container is able to move the
|
|
37
|
+
remaining buttons around the zoomed button.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Usage
|
|
41
|
+
=====
|
|
42
|
+
|
|
43
|
+
Usage example::
|
|
44
|
+
|
|
45
|
+
import os
|
|
46
|
+
import random
|
|
47
|
+
import glob
|
|
48
|
+
|
|
49
|
+
import wx
|
|
50
|
+
import wx.lib.agw.zoombar as ZB
|
|
51
|
+
|
|
52
|
+
class MyFrame(wx.Frame):
|
|
53
|
+
|
|
54
|
+
def __init__(self, parent):
|
|
55
|
+
|
|
56
|
+
wx.Frame.__init__(self, parent, -1, "ZoomBar Demo")
|
|
57
|
+
|
|
58
|
+
panel = wx.Panel(self)
|
|
59
|
+
|
|
60
|
+
bar = ZB.ZoomBar(panel, -1)
|
|
61
|
+
|
|
62
|
+
standard = glob.glob(bitmapDir + "/*96.png")
|
|
63
|
+
reflections = glob.glob(bitmapDir + "/*96Flip40.png")
|
|
64
|
+
|
|
65
|
+
separatorImage = bitmapDir + "/separator.gif"
|
|
66
|
+
separatorReflection = bitmapDir + "/separatorFlip.png"
|
|
67
|
+
count = 0
|
|
68
|
+
|
|
69
|
+
for std, ref in zip(standard, reflections):
|
|
70
|
+
if random.randint(0, 1) == 1 and count > 0:
|
|
71
|
+
sep1 = wx.Bitmap(separatorImage, wx.BITMAP_TYPE_GIF)
|
|
72
|
+
sep2 = wx.Bitmap(separatorReflection, wx.BITMAP_TYPE_PNG)
|
|
73
|
+
bar.AddSeparator(sep1, sep2)
|
|
74
|
+
|
|
75
|
+
bname = os.path.split(std)[1][0:-6]
|
|
76
|
+
bar.AddButton(wx.Bitmap(std, wx.BITMAP_TYPE_PNG), wx.Bitmap(ref, wx.BITMAP_TYPE_PNG), bname)
|
|
77
|
+
count += 1
|
|
78
|
+
|
|
79
|
+
bar.ResetSize()
|
|
80
|
+
|
|
81
|
+
sizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
82
|
+
sizer.Add(bar, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 15)
|
|
83
|
+
panel.SetSizer(sizer)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# our normal wxApp-derived class, as usual
|
|
87
|
+
|
|
88
|
+
app = wx.App(0)
|
|
89
|
+
|
|
90
|
+
frame = MyFrame(None)
|
|
91
|
+
app.SetTopWindow(frame)
|
|
92
|
+
frame.Show()
|
|
93
|
+
|
|
94
|
+
app.MainLoop()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Supported Platforms
|
|
98
|
+
===================
|
|
99
|
+
|
|
100
|
+
:class:`ZoomBar` has been tested on the following platforms:
|
|
101
|
+
* Windows (Windows XP).
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
Window Styles
|
|
105
|
+
=============
|
|
106
|
+
|
|
107
|
+
`No particular window styles are available for this class.`
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Events Processing
|
|
111
|
+
=================
|
|
112
|
+
|
|
113
|
+
This class processes the following events:
|
|
114
|
+
|
|
115
|
+
============================== ==================================================
|
|
116
|
+
Event Name Description
|
|
117
|
+
============================== ==================================================
|
|
118
|
+
``EVT_ZOOMBAR`` Process a ``wxEVT_ZOOMBAR`` event, when a :class:`ZoomBar` button is clicked.
|
|
119
|
+
============================== ==================================================
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
License And Version
|
|
123
|
+
===================
|
|
124
|
+
|
|
125
|
+
:class:`ZoomBar` is distributed under the wxPython license.
|
|
126
|
+
|
|
127
|
+
Latest Revision: Andrea Gavana @ 19 Dec 2012, 21.00 GMT
|
|
128
|
+
|
|
129
|
+
Version 0.1
|
|
130
|
+
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
import wx
|
|
134
|
+
import sys
|
|
135
|
+
|
|
136
|
+
from wx.lib.embeddedimage import PyEmbeddedImage
|
|
137
|
+
|
|
138
|
+
zoombackgrey = PyEmbeddedImage(
|
|
139
|
+
"iVBORw0KGgoAAAANSUhEUgAAAjkAAAAyCAYAAAC+s8qHAAAABHNCSVQICAgIfAhkiAAAIABJ"
|
|
140
|
+
"REFUeJzVXUuv5Udxr/O4xrzEAtvIAnYevkDAJp8piRfeeIGSsEFiY96QbUyiWRgn9reIieTx"
|
|
141
|
+
"YIGsAWQZCQkJz3h83/e8s0jquG7Nr17dfeY6JR2dc/rfXVXdXY9f9f88JpPpjEbTL37+s91u"
|
|
142
|
+
"tyN+EBF8XenDZPWR1yXp65rktclkAtv5tbwueU+nU5cXv9dtuq81xpLP77VcS45ci+12+8h1"
|
|
143
|
+
"OQ/Jg9u9uVk6ete5fTqdXtOb5cs2a66IJ1oDqYMe662Zlpnpg3hZdjqZTGg+n9MTTzxBn/nM"
|
|
144
|
+
"Z+jJJ5+k+XxO0+mUttstrVYrWiwWdHV1RVdXV7RYLGi9Xu/HTqdTmk6ntNvtaLPZ0Hq9Nm3e"
|
|
145
|
+
"WhO0FtoGJGl7IPrEnuQ1zy/1uvAckH7WONTH20ePpB8TfTIPtDba7lCfaLyUhWxQjtfXrHiI"
|
|
146
|
+
"rk0mE5rNZjSbzfa2wv622+1ou93Ser3ePzabDW232zDGWjYuydK5lby91jHGi1l6TXVskjEy"
|
|
147
|
+
"ylloblHOQetixXbrPfJBj6QcFPu5T7RPkR8zbbdbGLPRax672WxotVrRP/7TP7c5sUGTUSDn"
|
|
148
|
+
"3//tl7urqyu6uLig5XK5X0jPKNiI5GT1swVyvDHS4HW7pgzIschL7IhQsLISteyfdRivTZLc"
|
|
149
|
+
"m8w4rbeXBKv66Lmidi0XtVvj9BgLECIeco4jgjSyYwly+MEgZ7fb7UHOYrGg5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313
|
+
"YXRw/LRQa2LLjIv8rgXY9xJK8jrRZm3007qnEd1EPDnkej5OMCmpchoeEcfP9XpNRET/Ax6j"
|
|
314
|
+
"kIck2UJrAAAAAElFTkSuQmCC")
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
# ----------------------------------------------------------------------------
|
|
318
|
+
# ZoomBar events and binding for handling them
|
|
319
|
+
# ----------------------------------------------------------------------------
|
|
320
|
+
|
|
321
|
+
wxEVT_ZOOMBAR = wx.NewEventType()
|
|
322
|
+
EVT_ZOOMBAR = wx.PyEventBinder(wxEVT_ZOOMBAR, 1)
|
|
323
|
+
""" Process a `wxEVT_ZOOMBAR` event, when a :class:`ZoomBar` button is clicked. """
|
|
324
|
+
|
|
325
|
+
# ----------------------------------------------------------------------------
|
|
326
|
+
|
|
327
|
+
def MakeDisabledBitmap(original):
|
|
328
|
+
"""
|
|
329
|
+
Creates a disabled-looking bitmap starting from the input one.
|
|
330
|
+
|
|
331
|
+
:param `original`: an instance of :class:`wx.Bitmap` to be greyed-out.
|
|
332
|
+
"""
|
|
333
|
+
|
|
334
|
+
img = original.ConvertToImage()
|
|
335
|
+
return wx.Bitmap(img.ConvertToGreyscale())
|
|
336
|
+
|
|
337
|
+
# ----------------------------------------------------------------------------
|
|
338
|
+
|
|
339
|
+
class ZoomBarImage(object):
|
|
340
|
+
"""
|
|
341
|
+
This simple class holds information about a :class:`ZoomBar` button, such as normal
|
|
342
|
+
bitmaps, disabled bitmap, button label, etc...
|
|
343
|
+
"""
|
|
344
|
+
|
|
345
|
+
def __init__(self, parent, bitmap, disabledBmp=wx.NullBitmap, label=""):
|
|
346
|
+
"""
|
|
347
|
+
Default class constructor.
|
|
348
|
+
|
|
349
|
+
:param `parent`: the main :class:`ZoomBar` window;
|
|
350
|
+
:param `bitmap`: the button bitmap, an instance of :class:`wx.Bitmap`;
|
|
351
|
+
:param `disabledBmp`: the button bitmap when the button is in a disabled
|
|
352
|
+
state;
|
|
353
|
+
:param `label`: the button label.
|
|
354
|
+
"""
|
|
355
|
+
|
|
356
|
+
self._parent = parent
|
|
357
|
+
self._bitmap = bitmap
|
|
358
|
+
|
|
359
|
+
if not disabledBmp.IsOk():
|
|
360
|
+
disabledBmp = MakeDisabledBitmap(bitmap)
|
|
361
|
+
|
|
362
|
+
self._disabledBmp = disabledBmp
|
|
363
|
+
self._label = label
|
|
364
|
+
|
|
365
|
+
self._height = 36
|
|
366
|
+
self._width = 36
|
|
367
|
+
|
|
368
|
+
self._oldnx = 0
|
|
369
|
+
self._oldLeft = 0
|
|
370
|
+
self._oldTop = 0
|
|
371
|
+
self._oldWidth = 0
|
|
372
|
+
self._oldBottom = 0
|
|
373
|
+
self._oldHeight = 0
|
|
374
|
+
self._vCenter = 0
|
|
375
|
+
self._hCenter = 0
|
|
376
|
+
self._oldInc = -sys.maxsize
|
|
377
|
+
self._isSeparator = False
|
|
378
|
+
self._enabled = True
|
|
379
|
+
|
|
380
|
+
# Larger number gives a greater zoom effect
|
|
381
|
+
self._zoomFactor = 3
|
|
382
|
+
|
|
383
|
+
# Whether this is a reflection or not
|
|
384
|
+
self._isAReflection = False
|
|
385
|
+
|
|
386
|
+
self._cachedBitmaps = {}
|
|
387
|
+
self._cachedDisabledBitmaps = {}
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def SetZoomFactor(self, zoom):
|
|
391
|
+
"""
|
|
392
|
+
Sets the zoom factor for the button. Larger number gives a greater zoom
|
|
393
|
+
effect.
|
|
394
|
+
|
|
395
|
+
:param `zoom`: a floating point number, greater than or equal to 1.0.
|
|
396
|
+
"""
|
|
397
|
+
|
|
398
|
+
self._zoomFactor = zoom
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def SetCenterZoom(self, center=True):
|
|
402
|
+
"""
|
|
403
|
+
Sets to zoom from the center.
|
|
404
|
+
|
|
405
|
+
:param `center`: if ``True`` button zooms upwards.
|
|
406
|
+
"""
|
|
407
|
+
|
|
408
|
+
self._centerZoom = center
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
def ZoomImage(self, nxcoord):
|
|
412
|
+
"""
|
|
413
|
+
Zooms the button bitmap depending on the mouse x position.
|
|
414
|
+
|
|
415
|
+
:param `nxcoord`: the mouse x position relative to the button center.
|
|
416
|
+
"""
|
|
417
|
+
|
|
418
|
+
if nxcoord < self._vCenter:
|
|
419
|
+
inc = int(((nxcoord - self._oldLeft)*10.0)/(self._oldWidth/2.0)) + 1
|
|
420
|
+
else:
|
|
421
|
+
inc = int(((self._oldLeft + self._oldWidth - nxcoord)*10.0)/(self._oldWidth/2)) + 1
|
|
422
|
+
|
|
423
|
+
if self._isSeparator:
|
|
424
|
+
return False
|
|
425
|
+
|
|
426
|
+
if abs(inc - self._oldInc) < 2:
|
|
427
|
+
return False
|
|
428
|
+
|
|
429
|
+
self._oldInc = inc
|
|
430
|
+
|
|
431
|
+
if not self._isAReflection:
|
|
432
|
+
# original button
|
|
433
|
+
inc = inc*self._zoomFactor
|
|
434
|
+
self._width = self._oldWidth + inc
|
|
435
|
+
self._left = self._vCenter - self._width/2
|
|
436
|
+
self._height = self._oldHeight + inc
|
|
437
|
+
self._top = self._oldBottom - self._height
|
|
438
|
+
|
|
439
|
+
else:
|
|
440
|
+
# the reflection
|
|
441
|
+
self._height = self._oldHeight + inc
|
|
442
|
+
self._width = self._oldWidth + inc
|
|
443
|
+
self._top = self._top + self._height
|
|
444
|
+
|
|
445
|
+
self._oldnx = nxcoord
|
|
446
|
+
return True
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
def SetSize(self, width, height):
|
|
450
|
+
"""
|
|
451
|
+
Sets the button size.
|
|
452
|
+
|
|
453
|
+
:param `width`: the button width;
|
|
454
|
+
:param `height`: the button height.
|
|
455
|
+
"""
|
|
456
|
+
|
|
457
|
+
self._width = width
|
|
458
|
+
self._height = height
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
def GetPosition(self):
|
|
462
|
+
""" Returns the button position. """
|
|
463
|
+
|
|
464
|
+
return wx.Point(int(self._left), int(self._top))
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def GetSize(self):
|
|
468
|
+
""" Returns the button size. """
|
|
469
|
+
|
|
470
|
+
return wx.Size(self._width, self._height)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def GetBitmap(self):
|
|
474
|
+
"""
|
|
475
|
+
Returns the button bitmap, which may be a scaled up version of the original
|
|
476
|
+
bitmap is the button is being zoomed.
|
|
477
|
+
"""
|
|
478
|
+
|
|
479
|
+
if self._isAReflection:
|
|
480
|
+
return self._paintBitmap
|
|
481
|
+
|
|
482
|
+
if self._enabled:
|
|
483
|
+
return self._cachedBitmaps[self._width]
|
|
484
|
+
|
|
485
|
+
return self._cachedDisabledBitmaps[self._width]
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def SetupProps(self, buttonSize):
|
|
489
|
+
"""
|
|
490
|
+
Set up the button position and size.
|
|
491
|
+
|
|
492
|
+
:param `buttonSize`: the button original size (not zoomed), in pixels.
|
|
493
|
+
"""
|
|
494
|
+
|
|
495
|
+
self._width = self._oldWidth = buttonSize
|
|
496
|
+
self._height = self._oldHeight = buttonSize
|
|
497
|
+
|
|
498
|
+
self._oldLeft = self._left
|
|
499
|
+
self._oldTop = self._top
|
|
500
|
+
self._vCenter = self._oldLeft + int(self._oldWidth/2.0)
|
|
501
|
+
self._hCenter = self._oldTop + int(self._oldHeight/2.0)
|
|
502
|
+
self._oldBottom = self._top + self._height
|
|
503
|
+
|
|
504
|
+
if self._isAReflection:
|
|
505
|
+
img = self._bitmap.ConvertToImage()
|
|
506
|
+
img = img.Scale(self._width, self._height, wx.IMAGE_QUALITY_HIGH)
|
|
507
|
+
self._paintBitmap = img.ConvertToBitmap()
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
def GetLabel(self):
|
|
511
|
+
""" Returns the button label (if any). """
|
|
512
|
+
|
|
513
|
+
return self._label
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
def SetLabel(self, label):
|
|
517
|
+
"""
|
|
518
|
+
Sets the button label.
|
|
519
|
+
|
|
520
|
+
:param `label`: a string specifying the button label. May be an empty string
|
|
521
|
+
for no label.
|
|
522
|
+
"""
|
|
523
|
+
|
|
524
|
+
self._label = label
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
def IsZoomed(self):
|
|
528
|
+
""" Returns ``True`` if the button is zoomed, ``False`` otherwise. """
|
|
529
|
+
|
|
530
|
+
return self._width/float(self._oldWidth) >= 1.25
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
def LoopScales(self, size):
|
|
534
|
+
"""
|
|
535
|
+
Caches the bitmaps at various zoom levels to avoid calling every time
|
|
536
|
+
`image.Scale` on the button bitmap.
|
|
537
|
+
|
|
538
|
+
:param `size`: the original button size, in pixels.
|
|
539
|
+
"""
|
|
540
|
+
|
|
541
|
+
if self._isAReflection:
|
|
542
|
+
return
|
|
543
|
+
|
|
544
|
+
for scale in range(size-10*self._zoomFactor, size+15*self._zoomFactor, self._zoomFactor):
|
|
545
|
+
if scale in self._cachedBitmaps or scale <= 0:
|
|
546
|
+
continue
|
|
547
|
+
|
|
548
|
+
img = self._bitmap.ConvertToImage()
|
|
549
|
+
img = img.Scale(scale, scale, wx.IMAGE_QUALITY_HIGH)
|
|
550
|
+
bmp = img.ConvertToBitmap()
|
|
551
|
+
self._cachedBitmaps[scale] = bmp
|
|
552
|
+
|
|
553
|
+
img = self._disabledBmp.ConvertToImage()
|
|
554
|
+
img = img.Scale(scale, scale, wx.IMAGE_QUALITY_HIGH)
|
|
555
|
+
bmp = img.ConvertToBitmap()
|
|
556
|
+
self._cachedDisabledBitmaps[scale] = bmp
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
def Enable(self, enable=True):
|
|
560
|
+
"""
|
|
561
|
+
Enables/disables a button.
|
|
562
|
+
|
|
563
|
+
:param `enable`: ``True`` to enable a button, ``False`` to disable it.
|
|
564
|
+
"""
|
|
565
|
+
|
|
566
|
+
self._enabled = enable
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
def IsEnabled(self):
|
|
570
|
+
""" Returns ``True`` if the button is enabled, ``False`` otherwise. """
|
|
571
|
+
|
|
572
|
+
return self._enabled
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
class ImageBar(object):
|
|
576
|
+
""" This class holds the background button bar on which the buttons float. """
|
|
577
|
+
|
|
578
|
+
def __init__(self, bitmap=None):
|
|
579
|
+
"""
|
|
580
|
+
Default class constructor.
|
|
581
|
+
|
|
582
|
+
:param `bitmap`: if not ``None``, the bitmap to use as a background button
|
|
583
|
+
bar on which the buttons float. It should be an instance of :class:`wx.Image`.
|
|
584
|
+
"""
|
|
585
|
+
|
|
586
|
+
if bitmap and bitmap.IsOk():
|
|
587
|
+
self._bitmap = bitmap
|
|
588
|
+
self._hasBitmap = bitmap
|
|
589
|
+
else:
|
|
590
|
+
self._bitmap = zoombackgrey.GetImage()
|
|
591
|
+
self._hasBitmap = None
|
|
592
|
+
|
|
593
|
+
self._left = 23
|
|
594
|
+
self._top = 53
|
|
595
|
+
self._startColour = wx.Colour(97, 97, 97)
|
|
596
|
+
self._endColour = wx.Colour(97, 97, 97)
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
def GetPosition(self):
|
|
600
|
+
""" Returns the position of :class:`wx.ImageBar`, as a :class:`wx.Point`. """
|
|
601
|
+
|
|
602
|
+
return wx.Point(int(self._left), int(self._top))
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
def GetSize(self):
|
|
606
|
+
""" Returns the size of :class:`wx.ImageBar`, as a :class:`wx.Size`. """
|
|
607
|
+
|
|
608
|
+
return wx.Size(self._bitmap.GetWidth(), self._bitmap.GetHeight())
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
def GetBitmap(self):
|
|
612
|
+
""" Returns the background button bar on which the buttons float. """
|
|
613
|
+
if isinstance(self._bitmap, wx.Image):
|
|
614
|
+
return wx.Bitmap(self._bitmap)
|
|
615
|
+
return self._bitmap
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
def SetPosition(self, xpos, ypos):
|
|
619
|
+
"""
|
|
620
|
+
Sets the position of :class:`wx.ImageBar`.
|
|
621
|
+
|
|
622
|
+
:param `xpos`: the `x` position of the bar;
|
|
623
|
+
:param `ypos`: the `y` position of the bar.
|
|
624
|
+
"""
|
|
625
|
+
|
|
626
|
+
self._left = xpos
|
|
627
|
+
self._top = ypos
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
def SetSize(self, xSize, ySize):
|
|
631
|
+
"""
|
|
632
|
+
Sets the size of :class:`wx.ImageBar`.
|
|
633
|
+
|
|
634
|
+
:param `xSize`: the width of the bar, in pixels;
|
|
635
|
+
:param `ySize`: the height of the bar, in pixels.
|
|
636
|
+
"""
|
|
637
|
+
|
|
638
|
+
self.SetBarColour(self._startColour, xSize, ySize)
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
def SetBarColour(self, colour, xSize=None, ySize=None):
|
|
642
|
+
"""
|
|
643
|
+
Sets the background button bar colour.
|
|
644
|
+
|
|
645
|
+
:param `colour`: an instance of :class:`wx.Colour`;
|
|
646
|
+
:param `xSize`: if not ``None``, the new :class:`wx.ImageBar` width;
|
|
647
|
+
:param `ySize`: if not ``None``, the new :class:`wx.ImageBar` height.
|
|
648
|
+
"""
|
|
649
|
+
|
|
650
|
+
if not isinstance(colour, wx.Colour):
|
|
651
|
+
colour = wx.Colour(colour)
|
|
652
|
+
|
|
653
|
+
if self._hasBitmap:
|
|
654
|
+
bitmap = self._hasBitmap
|
|
655
|
+
else:
|
|
656
|
+
bitmap = zoombackgrey.GetImage()
|
|
657
|
+
|
|
658
|
+
if xSize is not None:
|
|
659
|
+
self._size = wx.Size(xSize, ySize)
|
|
660
|
+
|
|
661
|
+
bitmap.Rescale(self._size.width, self._size.height//2)
|
|
662
|
+
|
|
663
|
+
r1, g1, b1 = self._startColour.Red(), self._startColour.Green(), self._startColour.Blue()
|
|
664
|
+
r2, g2, b2 = colour.Red(), colour.Green(), colour.Blue()
|
|
665
|
+
|
|
666
|
+
fr = (r1 > 0 and [float(r2)/r1] or [0])[0]
|
|
667
|
+
fg = (g1 > 0 and [float(g2)/g1] or [0])[0]
|
|
668
|
+
fb = (b1 > 0 and [float(b2)/b1] or [0])[0]
|
|
669
|
+
|
|
670
|
+
bitmap = bitmap.AdjustChannels(fr, fg, fb, 1)
|
|
671
|
+
self._bitmap = bitmap.ConvertToBitmap()
|
|
672
|
+
self._endColour = colour
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
def GetBarColour(self):
|
|
676
|
+
""" Returns the background button bar colour. """
|
|
677
|
+
|
|
678
|
+
return self._endColour
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
class ZoomBarEvent(wx.PyCommandEvent):
|
|
682
|
+
""" Event sent from the :class:`ZoomBar` when a button is activated. """
|
|
683
|
+
|
|
684
|
+
def __init__(self, eventType, eventId=1):
|
|
685
|
+
"""
|
|
686
|
+
Default class constructor.
|
|
687
|
+
|
|
688
|
+
:param `eventType`: the event type;
|
|
689
|
+
:param `eventId`: the event identifier.
|
|
690
|
+
"""
|
|
691
|
+
|
|
692
|
+
wx.PyCommandEvent.__init__(self, eventType, eventId)
|
|
693
|
+
self._eventType = eventType
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
def SetSelection(self, selection):
|
|
697
|
+
"""
|
|
698
|
+
Sets the index of the selected button.
|
|
699
|
+
|
|
700
|
+
:param `selection`: an integer indicating the current selected button.
|
|
701
|
+
"""
|
|
702
|
+
|
|
703
|
+
self._selection = selection
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
def GetSelection(self):
|
|
707
|
+
""" Returns the index of the selected button. """
|
|
708
|
+
|
|
709
|
+
return self._selection
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
def GetLabel(self):
|
|
713
|
+
""" Returns the text label of the selected button. """
|
|
714
|
+
|
|
715
|
+
return self._label
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
def SetLabel(self, label):
|
|
719
|
+
"""
|
|
720
|
+
Sets the text label of the selected button.
|
|
721
|
+
|
|
722
|
+
:param `label`: the text label of the selected button.
|
|
723
|
+
"""
|
|
724
|
+
|
|
725
|
+
self._label = label
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
class ZoomBar(wx.Control):
|
|
729
|
+
"""
|
|
730
|
+
:class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
|
|
731
|
+
inside a :class:`Panel`.
|
|
732
|
+
|
|
733
|
+
This is the main class implementation.
|
|
734
|
+
"""
|
|
735
|
+
|
|
736
|
+
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
|
|
737
|
+
name="ZoomBar"):
|
|
738
|
+
"""
|
|
739
|
+
Default class constructor.
|
|
740
|
+
|
|
741
|
+
:param `parent`: the :class:`ZoomBar` parent. Must not be ``None``;
|
|
742
|
+
:param `id`: window identifier. A value of -1 indicates a default value;
|
|
743
|
+
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
|
|
744
|
+
chosen by either the windowing system or wxPython, depending on platform;
|
|
745
|
+
:param `size`: the control size. A value of (-1, -1) indicates a default size,
|
|
746
|
+
chosen by either the windowing system or wxPython, depending on platform;
|
|
747
|
+
:param `name`: the window name.
|
|
748
|
+
"""
|
|
749
|
+
|
|
750
|
+
wx.Control.__init__(self, parent, id, pos, size, style=wx.BORDER_THEME)
|
|
751
|
+
|
|
752
|
+
# Zoom from the center. If True button zooms upwards.
|
|
753
|
+
self._centerZoom = False
|
|
754
|
+
# Whether you want reflections or not
|
|
755
|
+
self._showReflections = True
|
|
756
|
+
# Allows us to nudge a reflection closer to original
|
|
757
|
+
self._nudgeReflection = 0
|
|
758
|
+
# Extension of the reflection. BMP or PNG etc.
|
|
759
|
+
# Initial size of the buttons
|
|
760
|
+
self._buttonSize = 48
|
|
761
|
+
# Show labels on hovering
|
|
762
|
+
self._showLabels = True
|
|
763
|
+
# used internally
|
|
764
|
+
self._noResize = False
|
|
765
|
+
self._buttons = []
|
|
766
|
+
self._reflectionButtons = []
|
|
767
|
+
|
|
768
|
+
self._imgBar = ImageBar()
|
|
769
|
+
self._previousHit = -1
|
|
770
|
+
self._currentHit = -1
|
|
771
|
+
|
|
772
|
+
wx.CallLater(200, self.OnLeaveWindow, None)
|
|
773
|
+
|
|
774
|
+
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
|
775
|
+
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
|
776
|
+
self.Bind(wx.EVT_SIZE, self.OnSize)
|
|
777
|
+
self.Bind(wx.EVT_MOTION, self.OnMotion)
|
|
778
|
+
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
|
|
779
|
+
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
|
|
780
|
+
self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
|
|
781
|
+
|
|
782
|
+
if wx.Platform == "__WXMSW__":
|
|
783
|
+
self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
|
|
784
|
+
|
|
785
|
+
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
def DoGetBestSize(self):
|
|
789
|
+
"""
|
|
790
|
+
Gets the size which best suits the window: for a control, it would be the
|
|
791
|
+
minimal size which doesn't truncate the control, for a panel - the same size
|
|
792
|
+
as it would have after a call to `Fit()`.
|
|
793
|
+
|
|
794
|
+
:note: Overridden from :class:`wx.Control`.
|
|
795
|
+
"""
|
|
796
|
+
|
|
797
|
+
xSize = self._buttonSize*len(self._buttons) + len(self._buttons) + self._buttonSize
|
|
798
|
+
ySize = self._buttonSize*2
|
|
799
|
+
if self._showLabels:
|
|
800
|
+
dc = wx.ClientDC(self)
|
|
801
|
+
dummy, yextent = dc.GetTextExtent("Ajgt")
|
|
802
|
+
ySize += yextent
|
|
803
|
+
|
|
804
|
+
return wx.Size(xSize+50, ySize+20)
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
# reposition the buttons
|
|
808
|
+
def Reposition(self, toButton):
|
|
809
|
+
"""
|
|
810
|
+
Repositions all the buttons inside the :class:`ZoomBar`.
|
|
811
|
+
|
|
812
|
+
:param `toButton`: the button currently hovered by the mouse (and hence zoomed).
|
|
813
|
+
"""
|
|
814
|
+
|
|
815
|
+
nLeft = toButton._left
|
|
816
|
+
nRight = toButton._left + toButton._width + 1
|
|
817
|
+
nButton = self._buttons.index(toButton)
|
|
818
|
+
|
|
819
|
+
# do any buttons on the right
|
|
820
|
+
for n in range(nButton + 1, len(self._buttons)):
|
|
821
|
+
oButton = self._buttons[n]
|
|
822
|
+
oButton._left = nRight
|
|
823
|
+
|
|
824
|
+
if self._showReflections:
|
|
825
|
+
oButtonR = self._reflectionButtons[n]
|
|
826
|
+
oButtonR._left = nRight
|
|
827
|
+
|
|
828
|
+
nRight = nRight + oButton._width + 1
|
|
829
|
+
|
|
830
|
+
# Reset
|
|
831
|
+
nLeft = toButton._left
|
|
832
|
+
|
|
833
|
+
# now to the left
|
|
834
|
+
if nButton > 0:
|
|
835
|
+
# only for 2nd and more
|
|
836
|
+
for n in range(nButton-1, -1, -1):
|
|
837
|
+
oButton = self._buttons[n]
|
|
838
|
+
oButton._left = nLeft - (oButton._width + 1)
|
|
839
|
+
if self._showReflections:
|
|
840
|
+
oButtonR = self._reflectionButtons[n]
|
|
841
|
+
oButtonR._left = oButton._left
|
|
842
|
+
|
|
843
|
+
nLeft = oButton._left
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
# method to add required buttons
|
|
847
|
+
def AddButton(self, normalBmp, reflectionBmp=wx.NullBitmap, label="", disabledBmp=wx.NullBitmap,
|
|
848
|
+
disabledReflectionBmp=wx.NullBitmap):
|
|
849
|
+
"""
|
|
850
|
+
Adds a button to :class:`ZoomBar`.
|
|
851
|
+
|
|
852
|
+
:param `normalBmp`: the button main bitmap, an instance of :class:`wx.Bitmap`;
|
|
853
|
+
:param `reflectionBmp`: a bitmap representing a reflection of the main bitmap,
|
|
854
|
+
an instance of :class:`wx.Bitmap`;
|
|
855
|
+
:param `label`: the button label;
|
|
856
|
+
:param `disabledBmp`: the button main bitmap when the button is in a disabled
|
|
857
|
+
state, an instance of :class:`wx.Bitmap`;
|
|
858
|
+
:param `disabledReflectionBmp`: a bitmap representing a reflection of the main bitmap,
|
|
859
|
+
when the button is in a disabled state, an instance of :class:`wx.Bitmap`.
|
|
860
|
+
"""
|
|
861
|
+
|
|
862
|
+
button = ZoomBarImage(self, normalBmp, disabledBmp, label)
|
|
863
|
+
|
|
864
|
+
button.SetSize(self._buttonSize, self._buttonSize)
|
|
865
|
+
button._centerZoom = (self._showReflections and [False] or [self._centerZoom])[0]
|
|
866
|
+
self._buttons.append(button)
|
|
867
|
+
|
|
868
|
+
self.InitialReposition()
|
|
869
|
+
|
|
870
|
+
if self._showReflections and reflectionBmp.IsOk():
|
|
871
|
+
|
|
872
|
+
rbutton = ZoomBarImage(self, reflectionBmp, disabledReflectionBmp)
|
|
873
|
+
rbutton.SetSize(self._buttonSize, self._buttonSize)
|
|
874
|
+
rbutton._centerzoom = False
|
|
875
|
+
rbutton._isAReflection = True
|
|
876
|
+
self._reflectionButtons.append(rbutton)
|
|
877
|
+
|
|
878
|
+
return button
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
def AddSeparator(self, normalBmp, reflectionBmp=wx.NullBitmap):
|
|
882
|
+
"""
|
|
883
|
+
Adds a separator to :class:`ZoomBar`.
|
|
884
|
+
|
|
885
|
+
:param `normalBmp`: the separator main bitmap, an instance of :class:`wx.Bitmap`;
|
|
886
|
+
:param `reflectionBmp`: a bitmap representing a reflection of the main bitmap,
|
|
887
|
+
an instance of :class:`wx.Bitmap`.
|
|
888
|
+
"""
|
|
889
|
+
|
|
890
|
+
button = self.AddButton(normalBmp, reflectionBmp)
|
|
891
|
+
button._isSeparator = True
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
def SetZoomFactor(self, zoom):
|
|
895
|
+
"""
|
|
896
|
+
Sets the zoom factor for all the buttons. Larger number gives a greater zoom
|
|
897
|
+
effect.
|
|
898
|
+
|
|
899
|
+
:param `zoom`: a floating point number, greater than or equal to 1.0.
|
|
900
|
+
"""
|
|
901
|
+
|
|
902
|
+
if zoom < 1:
|
|
903
|
+
raise Exception("The zoom factor must be greater or equal to 1")
|
|
904
|
+
|
|
905
|
+
for button in self._buttons:
|
|
906
|
+
button._zoomFactor = zoom
|
|
907
|
+
|
|
908
|
+
self._zoomFactor = zoom
|
|
909
|
+
self.DoLayout()
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
def GetZoomFactor(self):
|
|
913
|
+
""" Returns the current zoom factor. """
|
|
914
|
+
|
|
915
|
+
return self._zoomFactor
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
def SetCenterZoom(self, center=True):
|
|
919
|
+
"""
|
|
920
|
+
Sets to zoom from the center.
|
|
921
|
+
|
|
922
|
+
:param `center`: if ``True`` button zooms upwards.
|
|
923
|
+
"""
|
|
924
|
+
|
|
925
|
+
self._centerZoom = center
|
|
926
|
+
|
|
927
|
+
for button in self._buttons:
|
|
928
|
+
button._centerZoom = (self._showReflections and [False] or [self._centerZoom])[0]
|
|
929
|
+
|
|
930
|
+
self.DoLayout()
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
def GetCenterZoom(self):
|
|
934
|
+
""" Returns ``True`` if buttons zoom upwards. """
|
|
935
|
+
|
|
936
|
+
return self._centerZoom
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
def SetShowReflections(self, show):
|
|
940
|
+
"""
|
|
941
|
+
Sets whether to show reflections or not.
|
|
942
|
+
|
|
943
|
+
:param `show`: ``True`` to show reflections, ``False`` otherwise.
|
|
944
|
+
"""
|
|
945
|
+
|
|
946
|
+
self._showReflections = show
|
|
947
|
+
self.DoLayout()
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
def GetShowReflections(self):
|
|
951
|
+
""" Returns ``True`` if reflections bitmap are currently shown. """
|
|
952
|
+
|
|
953
|
+
return self._showReflections
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
def SetShowLabels(self, show):
|
|
957
|
+
"""
|
|
958
|
+
Sets whether to show button labels or not.
|
|
959
|
+
|
|
960
|
+
:param `show`: ``True`` to show button labels, ``False`` otherwise.
|
|
961
|
+
"""
|
|
962
|
+
|
|
963
|
+
self._showLabels = show
|
|
964
|
+
self.DoLayout()
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
def GetShowLabels(self):
|
|
968
|
+
""" Returns ``True`` if button labels are currently shown. """
|
|
969
|
+
|
|
970
|
+
return self._showLabels
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
def SetBarColour(self, colour):
|
|
974
|
+
"""
|
|
975
|
+
Sets the background button bar colour.
|
|
976
|
+
|
|
977
|
+
:param `colour`: an instance of :class:`wx.Colour`;
|
|
978
|
+
"""
|
|
979
|
+
|
|
980
|
+
self._imgBar.SetBarColour(colour)
|
|
981
|
+
self.Refresh()
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
def GetBarColour(self):
|
|
985
|
+
""" Returns the background button bar colour. """
|
|
986
|
+
|
|
987
|
+
return self._imgBar.GetBarColour()
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
def SetButtonSize(self, size):
|
|
991
|
+
"""
|
|
992
|
+
Sets the original button size.
|
|
993
|
+
|
|
994
|
+
:param `size`: the new (not-zoomed) button size, in pixels.
|
|
995
|
+
"""
|
|
996
|
+
|
|
997
|
+
self._buttonSize = size
|
|
998
|
+
self.DoLayout()
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
def GetButtonSize(self):
|
|
1002
|
+
""" Returns the original (not zoomed) button size, in pixels. """
|
|
1003
|
+
|
|
1004
|
+
return self._buttonSize
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
def EnableButton(self, index, enable=True):
|
|
1008
|
+
"""
|
|
1009
|
+
Enables/disables the button at position `index`.
|
|
1010
|
+
|
|
1011
|
+
:param `index`: the index of the button to enable/disable;
|
|
1012
|
+
:param `enable`: ``True`` to enable the button, ``False`` to disable it.
|
|
1013
|
+
"""
|
|
1014
|
+
|
|
1015
|
+
if index < 0 or index >= len(self._buttons):
|
|
1016
|
+
return False
|
|
1017
|
+
|
|
1018
|
+
self._buttons[index].Enable(enable)
|
|
1019
|
+
self.Refresh()
|
|
1020
|
+
|
|
1021
|
+
return True
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
def IsButtonEnabled(self, index):
|
|
1025
|
+
"""
|
|
1026
|
+
Returns ``True`` if the button at position `index` is enabled, ``False``
|
|
1027
|
+
otherwise.
|
|
1028
|
+
|
|
1029
|
+
:param `index`: the index of the button to check.
|
|
1030
|
+
"""
|
|
1031
|
+
|
|
1032
|
+
if index < 0 or index >= len(self._buttons):
|
|
1033
|
+
return False
|
|
1034
|
+
|
|
1035
|
+
return self._buttons[index].IsEnabled()
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
def DoLayout(self):
|
|
1039
|
+
""" Common method to re-layout :class:`ZoomBar`. """
|
|
1040
|
+
|
|
1041
|
+
self.ResetSize()
|
|
1042
|
+
self.GetContainingSizer().Layout()
|
|
1043
|
+
self.Refresh()
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
def ResetSize(self):
|
|
1047
|
+
"""
|
|
1048
|
+
Resets all the button sizes and positions, recalculating the optimal :class:`ZoomBar`
|
|
1049
|
+
size.
|
|
1050
|
+
"""
|
|
1051
|
+
|
|
1052
|
+
xSize = self._buttonSize*len(self._buttons) + len(self._buttons) + self._buttonSize
|
|
1053
|
+
ySize = self._buttonSize*2
|
|
1054
|
+
|
|
1055
|
+
self._imgBar.SetSize(xSize+self._buttonSize, ySize)
|
|
1056
|
+
|
|
1057
|
+
for button in self._buttons:
|
|
1058
|
+
button.LoopScales(self._buttonSize)
|
|
1059
|
+
|
|
1060
|
+
if self._showLabels:
|
|
1061
|
+
dc = wx.ClientDC(self)
|
|
1062
|
+
dummy, yextent = dc.GetTextExtent("Ajgt")
|
|
1063
|
+
ySize += yextent
|
|
1064
|
+
|
|
1065
|
+
if self._showReflections:
|
|
1066
|
+
ySize += self._buttonSize//2
|
|
1067
|
+
if self._centerZoom:
|
|
1068
|
+
ySize += self._buttonSize
|
|
1069
|
+
|
|
1070
|
+
size = wx.Size(xSize+50, ySize)
|
|
1071
|
+
self.SetInitialSize(size)
|
|
1072
|
+
self.SnapToBottom(size)
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
# Sets up the initial buttons and sizes them from the center
|
|
1076
|
+
def InitialReposition(self):
|
|
1077
|
+
"""
|
|
1078
|
+
Sets up the initial buttons and sizes them from the center.
|
|
1079
|
+
"""
|
|
1080
|
+
|
|
1081
|
+
# repositions the button centrally
|
|
1082
|
+
# odd buttons one is central - even, half by half
|
|
1083
|
+
|
|
1084
|
+
if not self._buttons:
|
|
1085
|
+
return
|
|
1086
|
+
|
|
1087
|
+
size = self.GetSize()
|
|
1088
|
+
oButton = self._buttons[0]
|
|
1089
|
+
totalWidth = oButton._width*len(self._buttons) + len(self._buttons)
|
|
1090
|
+
center = size.GetWidth()/2
|
|
1091
|
+
nbCenter = totalWidth/2
|
|
1092
|
+
nLeft = center - nbCenter
|
|
1093
|
+
|
|
1094
|
+
if self._showReflections:
|
|
1095
|
+
nTop = self._imgBar._top - (oButton._height/2)
|
|
1096
|
+
else:
|
|
1097
|
+
if self._centerZoom:
|
|
1098
|
+
nTop = size.height/2 - oButton._height/2
|
|
1099
|
+
else:
|
|
1100
|
+
nTop = size.height - oButton._height - 5
|
|
1101
|
+
|
|
1102
|
+
for oButton in self._buttons:
|
|
1103
|
+
oButton._left = nLeft
|
|
1104
|
+
oButton._top = nTop
|
|
1105
|
+
oButton.SetupProps(self._buttonSize)
|
|
1106
|
+
nLeft = nLeft + oButton._width+1
|
|
1107
|
+
|
|
1108
|
+
# And the reflection if any
|
|
1109
|
+
if self._showReflections:
|
|
1110
|
+
nLeft = center - nbCenter
|
|
1111
|
+
nudge = self._nudgeReflection
|
|
1112
|
+
for oButton in self._reflectionButtons:
|
|
1113
|
+
oButton._left = nLeft
|
|
1114
|
+
oButton._top = (nTop + oButton._height - 2) - nudge
|
|
1115
|
+
oButton.SetupProps(self._buttonSize)
|
|
1116
|
+
nLeft = nLeft + oButton._width + 1
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
def OnLeaveWindow(self, event):
|
|
1120
|
+
"""
|
|
1121
|
+
Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`ZoomBar`.
|
|
1122
|
+
|
|
1123
|
+
:param `event`: a :class:`MouseEvent` event to be processed.
|
|
1124
|
+
"""
|
|
1125
|
+
|
|
1126
|
+
if self.GetScreenRect().Contains(wx.GetMousePosition()):
|
|
1127
|
+
return
|
|
1128
|
+
|
|
1129
|
+
for button in self._buttons:
|
|
1130
|
+
button.SetSize(self._buttonSize, self._buttonSize)
|
|
1131
|
+
|
|
1132
|
+
self.InitialReposition()
|
|
1133
|
+
self.Refresh()
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
def OnSize(self, event):
|
|
1137
|
+
"""
|
|
1138
|
+
Handles the ``wx.EVT_SIZE`` event for :class:`ZoomBar`.
|
|
1139
|
+
|
|
1140
|
+
:param `event`: a :class:`wx.SizeEvent` event to be processed.
|
|
1141
|
+
"""
|
|
1142
|
+
|
|
1143
|
+
self.SnapToBottom(event.GetSize())
|
|
1144
|
+
self.Refresh()
|
|
1145
|
+
event.Skip()
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
def SnapToBottom(self, size):
|
|
1149
|
+
"""
|
|
1150
|
+
Snaps the background button bar bitmap and all the buttons to the bottom
|
|
1151
|
+
of :class:`ZoomBar`.
|
|
1152
|
+
|
|
1153
|
+
:param `size`: the current :class:`ZoomBar` size.
|
|
1154
|
+
"""
|
|
1155
|
+
|
|
1156
|
+
backgroundSize = self._imgBar.GetSize()
|
|
1157
|
+
xPos = (size.width - backgroundSize.width)/2
|
|
1158
|
+
yPos = (size.height - backgroundSize.height)
|
|
1159
|
+
|
|
1160
|
+
self._imgBar.SetPosition(xPos, yPos)
|
|
1161
|
+
self.InitialReposition()
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
def OnPaint(self, event):
|
|
1165
|
+
"""
|
|
1166
|
+
Handles the ``wx.EVT_PAINT`` event for :class:`ZoomBar`.
|
|
1167
|
+
|
|
1168
|
+
:param `event`: a :class:`PaintEvent` event to be processed.
|
|
1169
|
+
"""
|
|
1170
|
+
|
|
1171
|
+
dc = wx.AutoBufferedPaintDC(self)
|
|
1172
|
+
|
|
1173
|
+
dc.SetBackground(wx.WHITE_BRUSH)
|
|
1174
|
+
dc.Clear()
|
|
1175
|
+
|
|
1176
|
+
background = self._imgBar.GetBitmap()
|
|
1177
|
+
pos = self._imgBar.GetPosition()
|
|
1178
|
+
|
|
1179
|
+
dc.DrawBitmap(background, pos.x, pos.y, True)
|
|
1180
|
+
|
|
1181
|
+
if not self._buttons:
|
|
1182
|
+
return
|
|
1183
|
+
|
|
1184
|
+
self.DrawButtons(dc)
|
|
1185
|
+
self.DrawReflections(dc)
|
|
1186
|
+
self.DrawLabels(dc)
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
def DrawButtons(self, dc):
|
|
1190
|
+
"""
|
|
1191
|
+
Draws all the main button bitmaps on the :class:`ZoomBar` client window.
|
|
1192
|
+
|
|
1193
|
+
:param `dc`: an instance of :class:`wx.DC`.
|
|
1194
|
+
"""
|
|
1195
|
+
|
|
1196
|
+
for button in self._buttons:
|
|
1197
|
+
pos = button.GetPosition()
|
|
1198
|
+
bitmap = button.GetBitmap()
|
|
1199
|
+
|
|
1200
|
+
dc.DrawBitmap(bitmap, pos.x, pos.y, True)
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
def DrawReflections(self, dc):
|
|
1204
|
+
"""
|
|
1205
|
+
Draws all the reflection button bitmaps on the :class:`ZoomBar` client window.
|
|
1206
|
+
|
|
1207
|
+
:param `dc`: an instance of :class:`wx.DC`.
|
|
1208
|
+
"""
|
|
1209
|
+
|
|
1210
|
+
if self._showReflections:
|
|
1211
|
+
for button in self._reflectionButtons:
|
|
1212
|
+
pos = button.GetPosition()
|
|
1213
|
+
bitmap = button.GetBitmap()
|
|
1214
|
+
|
|
1215
|
+
dc.DrawBitmap(bitmap, pos.x, pos.y, True)
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
def DrawLabels(self, dc):
|
|
1219
|
+
"""
|
|
1220
|
+
Draws all the button labels on the :class:`ZoomBar` client window.
|
|
1221
|
+
|
|
1222
|
+
:param `dc`: an instance of :class:`wx.DC`.
|
|
1223
|
+
"""
|
|
1224
|
+
|
|
1225
|
+
if not self._showLabels:
|
|
1226
|
+
return
|
|
1227
|
+
|
|
1228
|
+
dc.SetBrush(wx.WHITE_BRUSH)
|
|
1229
|
+
dc.SetPen(wx.BLACK_PEN)
|
|
1230
|
+
|
|
1231
|
+
for button in self._buttons:
|
|
1232
|
+
if not button.IsZoomed():
|
|
1233
|
+
continue
|
|
1234
|
+
label = button.GetLabel()
|
|
1235
|
+
if not label:
|
|
1236
|
+
continue
|
|
1237
|
+
|
|
1238
|
+
textWidth, textHeight = dc.GetTextExtent(label)
|
|
1239
|
+
buttonPos = button.GetPosition()
|
|
1240
|
+
buttonSize = button.GetSize()
|
|
1241
|
+
xpos = buttonPos.x + (buttonSize.width - textWidth)//2
|
|
1242
|
+
ypos = buttonPos.y - textHeight - 2
|
|
1243
|
+
|
|
1244
|
+
dc.DrawRectangle(xpos-2, ypos-1, textWidth+4, textHeight+2)
|
|
1245
|
+
dc.DrawText(label, xpos, ypos)
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
def OnEraseBackground(self, event):
|
|
1249
|
+
"""
|
|
1250
|
+
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`ZoomBar`.
|
|
1251
|
+
|
|
1252
|
+
:param `event`: a :class:`EraseEvent` event to be processed.
|
|
1253
|
+
|
|
1254
|
+
:note: This method is intentionally empty to avoid flicker.
|
|
1255
|
+
"""
|
|
1256
|
+
|
|
1257
|
+
pass
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
def OnMotion(self, event):
|
|
1261
|
+
"""
|
|
1262
|
+
Handles the ``wx.EVT_MOTION`` event for :class:`ZoomBar`.
|
|
1263
|
+
|
|
1264
|
+
:param `event`: a :class:`MouseEvent` event to be processed.
|
|
1265
|
+
"""
|
|
1266
|
+
|
|
1267
|
+
pos = event.GetPosition()
|
|
1268
|
+
hit = self.HitTest(pos)
|
|
1269
|
+
|
|
1270
|
+
if hit >= 0:
|
|
1271
|
+
button = self._buttons[hit]
|
|
1272
|
+
if not button.ZoomImage(pos.x):
|
|
1273
|
+
return
|
|
1274
|
+
|
|
1275
|
+
self.Reposition(button)
|
|
1276
|
+
else:
|
|
1277
|
+
|
|
1278
|
+
if self._previousHit < 0:
|
|
1279
|
+
return
|
|
1280
|
+
|
|
1281
|
+
for button in self._buttons:
|
|
1282
|
+
button.SetSize(self._buttonSize, self._buttonSize)
|
|
1283
|
+
|
|
1284
|
+
self.InitialReposition()
|
|
1285
|
+
|
|
1286
|
+
self._previousHit = hit
|
|
1287
|
+
self.Refresh()
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
def OnLeftDown(self, event):
|
|
1291
|
+
"""
|
|
1292
|
+
Handles the ``wx.EVT_LEFT_DOWN`` and ``wx.EVT_LEFT_DCLICK`` events for :class:`ZoomBar`.
|
|
1293
|
+
|
|
1294
|
+
:param `event`: a :class:`MouseEvent` event to be processed.
|
|
1295
|
+
"""
|
|
1296
|
+
|
|
1297
|
+
self._currentHit = self.HitTest(event.GetPosition())
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
def OnLeftUp(self, event):
|
|
1301
|
+
"""
|
|
1302
|
+
Handles the ``wx.EVT_LEFT_UP`` event for :class:`ZoomBar`.
|
|
1303
|
+
|
|
1304
|
+
:param `event`: a :class:`MouseEvent` event to be processed.
|
|
1305
|
+
"""
|
|
1306
|
+
|
|
1307
|
+
if self.HitTest(event.GetPosition()) != self._currentHit:
|
|
1308
|
+
return
|
|
1309
|
+
|
|
1310
|
+
if not self.IsButtonEnabled(self._currentHit):
|
|
1311
|
+
return
|
|
1312
|
+
|
|
1313
|
+
eventOut = ZoomBarEvent(wxEVT_ZOOMBAR, self.GetId())
|
|
1314
|
+
eventOut.SetSelection(self._currentHit)
|
|
1315
|
+
eventOut.SetLabel(self._buttons[self._currentHit].GetLabel())
|
|
1316
|
+
eventOut.SetEventObject(self)
|
|
1317
|
+
self.GetEventHandler().ProcessEvent(eventOut)
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
def HitTest(self, pos):
|
|
1321
|
+
"""
|
|
1322
|
+
HitTest method for :class:`ZoomBar`.
|
|
1323
|
+
|
|
1324
|
+
:param `pos`: the current mouse position.
|
|
1325
|
+
|
|
1326
|
+
:return: an index representing the button on which the mouse is hovering,
|
|
1327
|
+
or ``wx.NOT_FOUND`` if no button has been hit.
|
|
1328
|
+
"""
|
|
1329
|
+
|
|
1330
|
+
for index, button in enumerate(self._buttons):
|
|
1331
|
+
buttonPos = button.GetPosition()
|
|
1332
|
+
if pos.x >= buttonPos.x and pos.x <= buttonPos.x + button._width:
|
|
1333
|
+
return index
|
|
1334
|
+
|
|
1335
|
+
return wx.NOT_FOUND
|
|
1336
|
+
|