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.
Files changed (472) hide show
  1. wx/WebView2Loader.dll +0 -0
  2. wx/__init__.py +22 -0
  3. wx/__init__.pyi +10 -0
  4. wx/__version__.py +9 -0
  5. wx/__version__.pyi +15 -0
  6. wx/_adv.cp315-win_amd64.pyd +0 -0
  7. wx/_aui.cp315-win_amd64.pyd +0 -0
  8. wx/_core.cp315-win_amd64.pyd +0 -0
  9. wx/_dataview.cp315-win_amd64.pyd +0 -0
  10. wx/_glcanvas.cp315-win_amd64.pyd +0 -0
  11. wx/_grid.cp315-win_amd64.pyd +0 -0
  12. wx/_html.cp315-win_amd64.pyd +0 -0
  13. wx/_html2.cp315-win_amd64.pyd +0 -0
  14. wx/_media.cp315-win_amd64.pyd +0 -0
  15. wx/_msw.cp315-win_amd64.pyd +0 -0
  16. wx/_propgrid.cp315-win_amd64.pyd +0 -0
  17. wx/_ribbon.cp315-win_amd64.pyd +0 -0
  18. wx/_richtext.cp315-win_amd64.pyd +0 -0
  19. wx/_stc.cp315-win_amd64.pyd +0 -0
  20. wx/_xml.cp315-win_amd64.pyd +0 -0
  21. wx/_xrc.cp315-win_amd64.pyd +0 -0
  22. wx/adv.py +127 -0
  23. wx/adv.pyi +5931 -0
  24. wx/aui.py +70 -0
  25. wx/aui.pyi +4805 -0
  26. wx/core.py +3417 -0
  27. wx/core.pyi +62949 -0
  28. wx/dataview.py +176 -0
  29. wx/dataview.pyi +3828 -0
  30. wx/gizmos.py +18 -0
  31. wx/glcanvas.py +13 -0
  32. wx/glcanvas.pyi +544 -0
  33. wx/grid.py +237 -0
  34. wx/grid.pyi +5678 -0
  35. wx/html.py +38 -0
  36. wx/html.pyi +3283 -0
  37. wx/html2.py +46 -0
  38. wx/html2.pyi +1301 -0
  39. wx/include/wxPython/sip.h +1938 -0
  40. wx/include/wxPython/wxpy_api.h +418 -0
  41. wx/lib/CDate.py +201 -0
  42. wx/lib/ClickableHtmlWindow.py +57 -0
  43. wx/lib/__init__.py +0 -0
  44. wx/lib/activex.py +178 -0
  45. wx/lib/activexwrapper.py +153 -0
  46. wx/lib/agw/__init__.py +128 -0
  47. wx/lib/agw/advancedsplash.py +563 -0
  48. wx/lib/agw/aquabutton.py +1127 -0
  49. wx/lib/agw/artmanager.py +2110 -0
  50. wx/lib/agw/aui/__init__.py +295 -0
  51. wx/lib/agw/aui/aui_constants.py +2616 -0
  52. wx/lib/agw/aui/aui_switcherdialog.py +1232 -0
  53. wx/lib/agw/aui/aui_utilities.py +648 -0
  54. wx/lib/agw/aui/auibar.py +4045 -0
  55. wx/lib/agw/aui/auibook.py +6288 -0
  56. wx/lib/agw/aui/dockart.py +1198 -0
  57. wx/lib/agw/aui/framemanager.py +10485 -0
  58. wx/lib/agw/aui/tabart.py +2749 -0
  59. wx/lib/agw/aui/tabmdi.py +679 -0
  60. wx/lib/agw/balloontip.py +1157 -0
  61. wx/lib/agw/buttonpanel.py +2787 -0
  62. wx/lib/agw/cubecolourdialog.py +3529 -0
  63. wx/lib/agw/customtreectrl.py +9908 -0
  64. wx/lib/agw/data/ShortcutEditor_1.png +0 -0
  65. wx/lib/agw/data/ShortcutEditor_1_thumb.png +0 -0
  66. wx/lib/agw/data/ShortcutEditor_2.png +0 -0
  67. wx/lib/agw/data/ShortcutEditor_2_thumb.png +0 -0
  68. wx/lib/agw/data/ShortcutEditor_3.png +0 -0
  69. wx/lib/agw/data/ShortcutEditor_3_thumb.png +0 -0
  70. wx/lib/agw/data/ShortcutEditor_4.png +0 -0
  71. wx/lib/agw/data/ShortcutEditor_4_thumb.png +0 -0
  72. wx/lib/agw/data/default_help_text.html +105 -0
  73. wx/lib/agw/flatmenu.py +7392 -0
  74. wx/lib/agw/flatnotebook.py +6669 -0
  75. wx/lib/agw/floatspin.py +1820 -0
  76. wx/lib/agw/fmcustomizedlg.py +535 -0
  77. wx/lib/agw/fmresources.py +407 -0
  78. wx/lib/agw/foldpanelbar.py +2282 -0
  79. wx/lib/agw/fourwaysplitter.py +1130 -0
  80. wx/lib/agw/genericmessagedialog.py +1549 -0
  81. wx/lib/agw/gradientbutton.py +731 -0
  82. wx/lib/agw/hyperlink.py +664 -0
  83. wx/lib/agw/hypertreelist.py +5756 -0
  84. wx/lib/agw/infobar.py +885 -0
  85. wx/lib/agw/knobctrl.py +944 -0
  86. wx/lib/agw/labelbook.py +3028 -0
  87. wx/lib/agw/multidirdialog.py +581 -0
  88. wx/lib/agw/peakmeter.py +1028 -0
  89. wx/lib/agw/persist/__init__.py +188 -0
  90. wx/lib/agw/persist/persist_constants.py +283 -0
  91. wx/lib/agw/persist/persist_handlers.py +2614 -0
  92. wx/lib/agw/persist/persistencemanager.py +863 -0
  93. wx/lib/agw/piectrl.py +1082 -0
  94. wx/lib/agw/pybusyinfo.py +399 -0
  95. wx/lib/agw/pycollapsiblepane.py +940 -0
  96. wx/lib/agw/pygauge.py +570 -0
  97. wx/lib/agw/pyprogress.py +916 -0
  98. wx/lib/agw/ribbon/__init__.py +198 -0
  99. wx/lib/agw/ribbon/art.py +219 -0
  100. wx/lib/agw/ribbon/art_aui.py +1283 -0
  101. wx/lib/agw/ribbon/art_default.py +81 -0
  102. wx/lib/agw/ribbon/art_internal.py +248 -0
  103. wx/lib/agw/ribbon/art_msw.py +2735 -0
  104. wx/lib/agw/ribbon/art_osx.py +52 -0
  105. wx/lib/agw/ribbon/bar.py +1259 -0
  106. wx/lib/agw/ribbon/buttonbar.py +1317 -0
  107. wx/lib/agw/ribbon/control.py +205 -0
  108. wx/lib/agw/ribbon/gallery.py +973 -0
  109. wx/lib/agw/ribbon/page.py +946 -0
  110. wx/lib/agw/ribbon/panel.py +1170 -0
  111. wx/lib/agw/ribbon/toolbar.py +1441 -0
  112. wx/lib/agw/rulerctrl.py +1885 -0
  113. wx/lib/agw/scrolledthumbnail.py +2116 -0
  114. wx/lib/agw/shapedbutton.py +1809 -0
  115. wx/lib/agw/shortcuteditor.py +2642 -0
  116. wx/lib/agw/speedmeter.py +1800 -0
  117. wx/lib/agw/supertooltip.py +1443 -0
  118. wx/lib/agw/thumbnailctrl.py +529 -0
  119. wx/lib/agw/toasterbox.py +1327 -0
  120. wx/lib/agw/ultimatelistctrl.py +13671 -0
  121. wx/lib/agw/xlsgrid.py +2111 -0
  122. wx/lib/agw/zoombar.py +1336 -0
  123. wx/lib/analogclock/__init__.py +140 -0
  124. wx/lib/analogclock/analogclock.py +630 -0
  125. wx/lib/analogclock/helpers.py +986 -0
  126. wx/lib/analogclock/lib_setup/__init__.py +0 -0
  127. wx/lib/analogclock/lib_setup/buttontreectrlpanel.py +297 -0
  128. wx/lib/analogclock/lib_setup/fontselect.py +57 -0
  129. wx/lib/analogclock/setup.py +490 -0
  130. wx/lib/analogclock/styles.py +47 -0
  131. wx/lib/anchors.py +103 -0
  132. wx/lib/art/__init__.py +4 -0
  133. wx/lib/art/flagart.py +1583 -0
  134. wx/lib/art/img2pyartprov.py +56 -0
  135. wx/lib/busy.py +152 -0
  136. wx/lib/buttons.py +1140 -0
  137. wx/lib/calendar.py +1596 -0
  138. wx/lib/checkbox.py +837 -0
  139. wx/lib/colourchooser/__init__.py +36 -0
  140. wx/lib/colourchooser/canvas.py +145 -0
  141. wx/lib/colourchooser/intl.py +24 -0
  142. wx/lib/colourchooser/pycolourbox.py +89 -0
  143. wx/lib/colourchooser/pycolourchooser.py +626 -0
  144. wx/lib/colourchooser/pycolourslider.py +98 -0
  145. wx/lib/colourchooser/pypalette.py +208 -0
  146. wx/lib/colourdb.py +740 -0
  147. wx/lib/colourselect.py +385 -0
  148. wx/lib/colourutils.py +118 -0
  149. wx/lib/combotreebox.py +944 -0
  150. wx/lib/delayedresult.py +420 -0
  151. wx/lib/dialogs.py +510 -0
  152. wx/lib/docview.py +3210 -0
  153. wx/lib/dragscroller.py +79 -0
  154. wx/lib/editor/README.txt +77 -0
  155. wx/lib/editor/__init__.py +24 -0
  156. wx/lib/editor/editor.py +974 -0
  157. wx/lib/editor/images.py +15 -0
  158. wx/lib/editor/selection.py +44 -0
  159. wx/lib/embeddedimage.py +76 -0
  160. wx/lib/eventStack.py +136 -0
  161. wx/lib/eventwatcher.py +440 -0
  162. wx/lib/evtmgr.py +521 -0
  163. wx/lib/expando.py +393 -0
  164. wx/lib/fancytext.py +494 -0
  165. wx/lib/filebrowsebutton.py +461 -0
  166. wx/lib/flashwin.py +262 -0
  167. wx/lib/flashwin_old.py +651 -0
  168. wx/lib/floatcanvas/FCEvents.py +53 -0
  169. wx/lib/floatcanvas/FCObjects.py +2910 -0
  170. wx/lib/floatcanvas/FloatCanvas.py +1025 -0
  171. wx/lib/floatcanvas/GUIMode.py +396 -0
  172. wx/lib/floatcanvas/NavCanvas.py +162 -0
  173. wx/lib/floatcanvas/Resources.py +319 -0
  174. wx/lib/floatcanvas/ScreenShot.py +1788 -0
  175. wx/lib/floatcanvas/Utilities/BBox.py +313 -0
  176. wx/lib/floatcanvas/Utilities/Colors.py +137 -0
  177. wx/lib/floatcanvas/Utilities/GUI.py +91 -0
  178. wx/lib/floatcanvas/Utilities/__init__.py +7 -0
  179. wx/lib/floatcanvas/__init__.py +124 -0
  180. wx/lib/foldmenu.py +89 -0
  181. wx/lib/gestures.py +310 -0
  182. wx/lib/gizmos/__init__.py +18 -0
  183. wx/lib/gizmos/dynamicsash.py +1202 -0
  184. wx/lib/gizmos/ledctrl.py +299 -0
  185. wx/lib/gizmos/treelistctrl.py +87 -0
  186. wx/lib/graphics.py +1942 -0
  187. wx/lib/gridmovers.py +516 -0
  188. wx/lib/iewin.py +249 -0
  189. wx/lib/iewin_old.py +894 -0
  190. wx/lib/imagebrowser.py +853 -0
  191. wx/lib/imageutils.py +163 -0
  192. wx/lib/infoframe.py +490 -0
  193. wx/lib/inspection.py +1254 -0
  194. wx/lib/intctrl.py +990 -0
  195. wx/lib/itemspicker.py +256 -0
  196. wx/lib/langlistctrl.py +480 -0
  197. wx/lib/layoutf.py +271 -0
  198. wx/lib/masked/__init__.py +27 -0
  199. wx/lib/masked/combobox.py +839 -0
  200. wx/lib/masked/ctrl.py +108 -0
  201. wx/lib/masked/ipaddrctrl.py +241 -0
  202. wx/lib/masked/maskededit.py +7262 -0
  203. wx/lib/masked/numctrl.py +2000 -0
  204. wx/lib/masked/textctrl.py +465 -0
  205. wx/lib/masked/timectrl.py +1465 -0
  206. wx/lib/mixins/__init__.py +17 -0
  207. wx/lib/mixins/grid.py +47 -0
  208. wx/lib/mixins/gridlabelrenderer.py +277 -0
  209. wx/lib/mixins/imagelist.py +77 -0
  210. wx/lib/mixins/inspection.py +184 -0
  211. wx/lib/mixins/listctrl.py +893 -0
  212. wx/lib/mixins/rubberband.py +403 -0
  213. wx/lib/mixins/treemixin.py +678 -0
  214. wx/lib/msgpanel.py +95 -0
  215. wx/lib/multisash.py +746 -0
  216. wx/lib/myole4ax.idl +178 -0
  217. wx/lib/myole4ax.tlb +0 -0
  218. wx/lib/newevent.py +229 -0
  219. wx/lib/newevent.pyi +25 -0
  220. wx/lib/nvdlg.py +156 -0
  221. wx/lib/ogl/__init__.py +13 -0
  222. wx/lib/ogl/basic.py +3989 -0
  223. wx/lib/ogl/bmpshape.py +86 -0
  224. wx/lib/ogl/canvas.py +467 -0
  225. wx/lib/ogl/composit.py +1576 -0
  226. wx/lib/ogl/diagram.py +230 -0
  227. wx/lib/ogl/divided.py +482 -0
  228. wx/lib/ogl/drawn.py +898 -0
  229. wx/lib/ogl/lines.py +1809 -0
  230. wx/lib/ogl/oglmisc.py +607 -0
  231. wx/lib/pdfviewer/__init__.py +113 -0
  232. wx/lib/pdfviewer/bitmaps/ArrowLeft.png +0 -0
  233. wx/lib/pdfviewer/bitmaps/ArrowRight.png +0 -0
  234. wx/lib/pdfviewer/bitmaps/DirectionH.png +0 -0
  235. wx/lib/pdfviewer/bitmaps/DirectionV.png +0 -0
  236. wx/lib/pdfviewer/bitmaps/PlayerFirst.png +0 -0
  237. wx/lib/pdfviewer/bitmaps/PlayerLast.png +0 -0
  238. wx/lib/pdfviewer/bitmaps/PlayerNext.png +0 -0
  239. wx/lib/pdfviewer/bitmaps/PlayerPrev.png +0 -0
  240. wx/lib/pdfviewer/bitmaps/Printer.png +0 -0
  241. wx/lib/pdfviewer/bitmaps/ReadMe.txt +28 -0
  242. wx/lib/pdfviewer/bitmaps/Save.png +0 -0
  243. wx/lib/pdfviewer/bitmaps/ZoomIn.png +0 -0
  244. wx/lib/pdfviewer/bitmaps/ZoomOut.png +0 -0
  245. wx/lib/pdfviewer/bitmaps/encode_bitmaps.py +37 -0
  246. wx/lib/pdfviewer/buttonpanel.py +285 -0
  247. wx/lib/pdfviewer/images.py +240 -0
  248. wx/lib/pdfviewer/viewer.py +1118 -0
  249. wx/lib/pdfwin.py +295 -0
  250. wx/lib/pdfwin_old.py +789 -0
  251. wx/lib/platebtn.py +789 -0
  252. wx/lib/plot/CHANGELOG.md +150 -0
  253. wx/lib/plot/README.md +16 -0
  254. wx/lib/plot/__init__.py +46 -0
  255. wx/lib/plot/__main__.py +5 -0
  256. wx/lib/plot/examples/__init__.py +0 -0
  257. wx/lib/plot/examples/demo.py +1010 -0
  258. wx/lib/plot/examples/simple_example.py +56 -0
  259. wx/lib/plot/plotcanvas.py +2985 -0
  260. wx/lib/plot/polyobjects.py +1524 -0
  261. wx/lib/plot/utils.py +334 -0
  262. wx/lib/popupctl.py +251 -0
  263. wx/lib/printout.py +1155 -0
  264. wx/lib/progressindicator.py +151 -0
  265. wx/lib/pubsub/LICENSE_BSD_Simple.txt +23 -0
  266. wx/lib/pubsub/README_WxPython.txt +22 -0
  267. wx/lib/pubsub/RELEASE_NOTES.txt +71 -0
  268. wx/lib/pubsub/__init__.py +25 -0
  269. wx/lib/pubsub/core/__init__.py +92 -0
  270. wx/lib/pubsub/core/arg1/__init__.py +16 -0
  271. wx/lib/pubsub/core/arg1/listenerimpl.py +97 -0
  272. wx/lib/pubsub/core/arg1/publisher.py +40 -0
  273. wx/lib/pubsub/core/arg1/publishermixin.py +34 -0
  274. wx/lib/pubsub/core/arg1/topicargspecimpl.py +66 -0
  275. wx/lib/pubsub/core/arg1/topicmgrimpl.py +19 -0
  276. wx/lib/pubsub/core/callables.py +198 -0
  277. wx/lib/pubsub/core/imp2.py +62 -0
  278. wx/lib/pubsub/core/itopicdefnprovider.py +0 -0
  279. wx/lib/pubsub/core/kwargs/__init__.py +16 -0
  280. wx/lib/pubsub/core/kwargs/datamsg.py +27 -0
  281. wx/lib/pubsub/core/kwargs/listenerimpl.py +93 -0
  282. wx/lib/pubsub/core/kwargs/publisher.py +77 -0
  283. wx/lib/pubsub/core/kwargs/publishermixin.py +65 -0
  284. wx/lib/pubsub/core/kwargs/topicargspecimpl.py +216 -0
  285. wx/lib/pubsub/core/kwargs/topicmgrimpl.py +13 -0
  286. wx/lib/pubsub/core/listener.py +40 -0
  287. wx/lib/pubsub/core/listenerbase.py +185 -0
  288. wx/lib/pubsub/core/notificationmgr.py +185 -0
  289. wx/lib/pubsub/core/publisherbase.py +189 -0
  290. wx/lib/pubsub/core/topicargspec.py +77 -0
  291. wx/lib/pubsub/core/topicdefnprovider.py +631 -0
  292. wx/lib/pubsub/core/topicexc.py +72 -0
  293. wx/lib/pubsub/core/topicmgr.py +454 -0
  294. wx/lib/pubsub/core/topicobj.py +472 -0
  295. wx/lib/pubsub/core/topictreetraverser.py +143 -0
  296. wx/lib/pubsub/core/topicutils.py +119 -0
  297. wx/lib/pubsub/core/treeconfig.py +21 -0
  298. wx/lib/pubsub/core/validatedefnargs.py +29 -0
  299. wx/lib/pubsub/core/weakmethod.py +102 -0
  300. wx/lib/pubsub/policies.py +24 -0
  301. wx/lib/pubsub/pub.py +199 -0
  302. wx/lib/pubsub/setuparg1.py +47 -0
  303. wx/lib/pubsub/setupkwargs.py +29 -0
  304. wx/lib/pubsub/utils/__init__.py +27 -0
  305. wx/lib/pubsub/utils/exchandling.py +100 -0
  306. wx/lib/pubsub/utils/misc.py +99 -0
  307. wx/lib/pubsub/utils/notification.py +331 -0
  308. wx/lib/pubsub/utils/topictreeprinter.py +195 -0
  309. wx/lib/pubsub/utils/xmltopicdefnprovider.py +286 -0
  310. wx/lib/pydocview.py +3300 -0
  311. wx/lib/rcsizer.py +227 -0
  312. wx/lib/resizewidget.py +357 -0
  313. wx/lib/scrolledpanel.py +243 -0
  314. wx/lib/sheet.py +350 -0
  315. wx/lib/sized_controls.py +691 -0
  316. wx/lib/softwareupdate.py +355 -0
  317. wx/lib/splitter.py +925 -0
  318. wx/lib/statbmp.py +199 -0
  319. wx/lib/stattext.py +321 -0
  320. wx/lib/throbber.py +424 -0
  321. wx/lib/ticker.py +306 -0
  322. wx/lib/ticker_xrc.py +48 -0
  323. wx/lib/utils.py +89 -0
  324. wx/lib/wordwrap.py +97 -0
  325. wx/lib/wxcairo/__init__.py +139 -0
  326. wx/lib/wxcairo/wx_cairocffi.py +200 -0
  327. wx/lib/wxcairo/wx_pycairo.py +455 -0
  328. wx/lib/wxpTag.py +274 -0
  329. wx/libcairo-2.dll +0 -0
  330. wx/locale/af/LC_MESSAGES/wxstd.mo +0 -0
  331. wx/locale/an/LC_MESSAGES/wxstd.mo +0 -0
  332. wx/locale/ar/LC_MESSAGES/wxstd.mo +0 -0
  333. wx/locale/ca/LC_MESSAGES/wxstd.mo +0 -0
  334. wx/locale/ca@valencia/LC_MESSAGES/wxstd.mo +0 -0
  335. wx/locale/co/LC_MESSAGES/wxstd.mo +0 -0
  336. wx/locale/cs/LC_MESSAGES/wxstd.mo +0 -0
  337. wx/locale/da/LC_MESSAGES/wxstd.mo +0 -0
  338. wx/locale/de/LC_MESSAGES/wxstd.mo +0 -0
  339. wx/locale/el/LC_MESSAGES/wxstd.mo +0 -0
  340. wx/locale/es/LC_MESSAGES/wxstd.mo +0 -0
  341. wx/locale/eu/LC_MESSAGES/wxstd.mo +0 -0
  342. wx/locale/fa_IR/LC_MESSAGES/wxstd.mo +0 -0
  343. wx/locale/fi/LC_MESSAGES/wxstd.mo +0 -0
  344. wx/locale/fr/LC_MESSAGES/wxstd.mo +0 -0
  345. wx/locale/gl_ES/LC_MESSAGES/wxstd.mo +0 -0
  346. wx/locale/hi/LC_MESSAGES/wxstd.mo +0 -0
  347. wx/locale/hr/LC_MESSAGES/wxstd.mo +0 -0
  348. wx/locale/hu/LC_MESSAGES/wxstd.mo +0 -0
  349. wx/locale/id/LC_MESSAGES/wxstd.mo +0 -0
  350. wx/locale/it/LC_MESSAGES/wxstd.mo +0 -0
  351. wx/locale/ja/LC_MESSAGES/wxstd.mo +0 -0
  352. wx/locale/ka/LC_MESSAGES/wxstd.mo +0 -0
  353. wx/locale/ko_KR/LC_MESSAGES/wxstd.mo +0 -0
  354. wx/locale/lt/LC_MESSAGES/wxstd.mo +0 -0
  355. wx/locale/lv/LC_MESSAGES/wxstd.mo +0 -0
  356. wx/locale/ms/LC_MESSAGES/wxstd.mo +0 -0
  357. wx/locale/nb/LC_MESSAGES/wxstd.mo +0 -0
  358. wx/locale/ne/LC_MESSAGES/wxstd.mo +0 -0
  359. wx/locale/nl/LC_MESSAGES/wxstd.mo +0 -0
  360. wx/locale/pl/LC_MESSAGES/wxstd.mo +0 -0
  361. wx/locale/pt/LC_MESSAGES/wxstd.mo +0 -0
  362. wx/locale/pt_BR/LC_MESSAGES/wxstd.mo +0 -0
  363. wx/locale/ro/LC_MESSAGES/wxstd.mo +0 -0
  364. wx/locale/ru/LC_MESSAGES/wxstd.mo +0 -0
  365. wx/locale/sk/LC_MESSAGES/wxstd.mo +0 -0
  366. wx/locale/sl/LC_MESSAGES/wxstd.mo +0 -0
  367. wx/locale/sq/LC_MESSAGES/wxstd.mo +0 -0
  368. wx/locale/sr/LC_MESSAGES/wxstd.mo +0 -0
  369. wx/locale/sv/LC_MESSAGES/wxstd.mo +0 -0
  370. wx/locale/ta/LC_MESSAGES/wxstd.mo +0 -0
  371. wx/locale/tr/LC_MESSAGES/wxstd.mo +0 -0
  372. wx/locale/uk/LC_MESSAGES/wxstd.mo +0 -0
  373. wx/locale/vi/LC_MESSAGES/wxstd.mo +0 -0
  374. wx/locale/zh_CN/LC_MESSAGES/wxstd.mo +0 -0
  375. wx/locale/zh_TW/LC_MESSAGES/wxstd.mo +0 -0
  376. wx/media.py +30 -0
  377. wx/media.pyi +272 -0
  378. wx/msw.py +16 -0
  379. wx/msw.pyi +91 -0
  380. wx/propgrid.py +498 -0
  381. wx/propgrid.pyi +7427 -0
  382. wx/py/CHANGES.txt +796 -0
  383. wx/py/Py.ico +0 -0
  384. wx/py/PyAlaCarte.py +34 -0
  385. wx/py/PyAlaMode.py +34 -0
  386. wx/py/PyAlaModeTest.py +33 -0
  387. wx/py/PyCrust.ico +0 -0
  388. wx/py/PyCrust.py +78 -0
  389. wx/py/PyCrust_16.png +0 -0
  390. wx/py/PyCrust_32.png +0 -0
  391. wx/py/PyFilling.py +35 -0
  392. wx/py/PyShell.py +78 -0
  393. wx/py/PySlices.ico +0 -0
  394. wx/py/PySlices.py +98 -0
  395. wx/py/PySlicesShell.py +94 -0
  396. wx/py/PySlices_16.png +0 -0
  397. wx/py/PySlices_32.png +0 -0
  398. wx/py/PyWrap.py +52 -0
  399. wx/py/README.txt +77 -0
  400. wx/py/__init__.py +20 -0
  401. wx/py/buffer.py +136 -0
  402. wx/py/crust.py +403 -0
  403. wx/py/crustslices.py +403 -0
  404. wx/py/dispatcher.py +259 -0
  405. wx/py/document.py +37 -0
  406. wx/py/editor.py +844 -0
  407. wx/py/editwindow.py +316 -0
  408. wx/py/filling.py +358 -0
  409. wx/py/frame.py +976 -0
  410. wx/py/images.py +212 -0
  411. wx/py/interpreter.py +161 -0
  412. wx/py/introspect.py +402 -0
  413. wx/py/magic.py +98 -0
  414. wx/py/parse.py +134 -0
  415. wx/py/path.py +36 -0
  416. wx/py/pseudo.py +99 -0
  417. wx/py/shell.py +1579 -0
  418. wx/py/sliceshell.py +3805 -0
  419. wx/py/tests/test_interpreter.py +71 -0
  420. wx/py/tests/test_introspect.py +810 -0
  421. wx/py/tests/test_pseudo.py +70 -0
  422. wx/py/tests/test_version.py +36 -0
  423. wx/py/tests/testall.py +22 -0
  424. wx/py/version.py +7 -0
  425. wx/py.typed +0 -0
  426. wx/ribbon.py +48 -0
  427. wx/ribbon.pyi +3099 -0
  428. wx/richtext.py +141 -0
  429. wx/richtext.pyi +13581 -0
  430. wx/siplib.cp315-win_amd64.pyd +0 -0
  431. wx/siplib.pyi +19 -0
  432. wx/stc.py +59 -0
  433. wx/stc.pyi +9918 -0
  434. wx/svg/__init__.py +363 -0
  435. wx/svg/_nanosvg.cp315-win_amd64.pyd +0 -0
  436. wx/tools/__init__.py +18 -0
  437. wx/tools/dbg.py +268 -0
  438. wx/tools/genaxmodule.py +50 -0
  439. wx/tools/helpviewer.py +92 -0
  440. wx/tools/img2img.py +85 -0
  441. wx/tools/img2png.py +54 -0
  442. wx/tools/img2py.py +306 -0
  443. wx/tools/img2xpm.py +54 -0
  444. wx/tools/pywxrc.py +951 -0
  445. wx/tools/wxget.py +254 -0
  446. wx/tools/wxget_docs_demo.py +183 -0
  447. wx/wxbase334u_net_vc140_x64.dll +0 -0
  448. wx/wxbase334u_vc140_x64.dll +0 -0
  449. wx/wxbase334u_xml_vc140_x64.dll +0 -0
  450. wx/wxmsw334u_adv_vc140_x64.dll +0 -0
  451. wx/wxmsw334u_aui_vc140_x64.dll +0 -0
  452. wx/wxmsw334u_core_vc140_x64.dll +0 -0
  453. wx/wxmsw334u_gl_vc140_x64.dll +0 -0
  454. wx/wxmsw334u_html_vc140_x64.dll +0 -0
  455. wx/wxmsw334u_media_vc140_x64.dll +0 -0
  456. wx/wxmsw334u_propgrid_vc140_x64.dll +0 -0
  457. wx/wxmsw334u_qa_vc140_x64.dll +0 -0
  458. wx/wxmsw334u_ribbon_vc140_x64.dll +0 -0
  459. wx/wxmsw334u_richtext_vc140_x64.dll +0 -0
  460. wx/wxmsw334u_stc_vc140_x64.dll +0 -0
  461. wx/wxmsw334u_webview_vc140_x64.dll +0 -0
  462. wx/wxmsw334u_xrc_vc140_x64.dll +0 -0
  463. wx/xml.py +18 -0
  464. wx/xml.pyi +728 -0
  465. wx/xrc.py +68 -0
  466. wx/xrc.pyi +896 -0
  467. wxpython-4.3.2.dist-info/METADATA +71 -0
  468. wxpython-4.3.2.dist-info/RECORD +472 -0
  469. wxpython-4.3.2.dist-info/WHEEL +5 -0
  470. wxpython-4.3.2.dist-info/entry_points.txt +13 -0
  471. wxpython-4.3.2.dist-info/licenses/LICENSE.txt +610 -0
  472. 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
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QXnzxRZr/9re/pbfeeotOT0/3"
312
+ "t6ZQgOw5ZqouRuviRcgSnSSMoh4QMFoXKW8k79ZA0xOQRgezx5HgKoTW00pk1a/k3gSxjXjJ"
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
+