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
@@ -0,0 +1,893 @@
1
+ #----------------------------------------------------------------------------
2
+ # Name: wx.lib.mixins.listctrl
3
+ # Purpose: Helpful mix-in classes for wxListCtrl
4
+ #
5
+ # Author: Robin Dunn
6
+ #
7
+ # Created: 15-May-2001
8
+ # Copyright: (c) 2001-2020 by Total Control Software
9
+ # Licence: wxWindows license
10
+ # Tags: phoenix-port, py3-port
11
+ #----------------------------------------------------------------------------
12
+ # 12/14/2003 - Jeff Grimmett (grimmtooth@softhome.net)
13
+ #
14
+ # o 2.5 compatibility update.
15
+ # o ListCtrlSelectionManagerMix untested.
16
+ #
17
+ # 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
18
+ #
19
+ # o wxColumnSorterMixin -> ColumnSorterMixin
20
+ # o wxListCtrlAutoWidthMixin -> ListCtrlAutoWidthMixin
21
+ # ...
22
+ # 13/10/2004 - Pim Van Heuven (pim@think-wize.com)
23
+ # o wxTextEditMixin: Support Horizontal scrolling when TAB is pressed on long
24
+ # ListCtrls, support for WXK_DOWN, WXK_UP, performance improvements on
25
+ # very long ListCtrls, Support for virtual ListCtrls
26
+ #
27
+ # 15-Oct-2004 - Robin Dunn
28
+ # o wxTextEditMixin: Added Shift-TAB support
29
+ #
30
+ # 2008-11-19 - raf <raf@raf.org>
31
+ # o ColumnSorterMixin: Added GetSortState()
32
+ #
33
+
34
+ import locale
35
+ import wx
36
+
37
+ def cmp(a, b):
38
+ return (a > b) - (a < b)
39
+
40
+ #----------------------------------------------------------------------------
41
+
42
+ class ColumnSorterMixin:
43
+ """
44
+ A mixin class that handles sorting of a wx.ListCtrl in REPORT mode when
45
+ the column header is clicked on.
46
+
47
+ There are a few requirements needed in order for this to work genericly:
48
+
49
+ 1. The combined class must have a GetListCtrl method that
50
+ returns the wx.ListCtrl to be sorted, and the list control
51
+ must exist at the time the wx.ColumnSorterMixin.__init__
52
+ method is called because it uses GetListCtrl.
53
+
54
+ 2. Items in the list control must have a unique data value set
55
+ with list.SetItemData.
56
+
57
+ 3. The combined class must have an attribute named itemDataMap
58
+ that is a dictionary mapping the data values to a sequence of
59
+ objects representing the values in each column. These values
60
+ are compared in the column sorter to determine sort order.
61
+
62
+ Interesting methods to override are GetColumnSorter,
63
+ GetSecondarySortValues, and GetSortImages. See below for details.
64
+ """
65
+
66
+ def __init__(self, numColumns):
67
+ self.SetColumnCount(numColumns)
68
+ list = self.GetListCtrl()
69
+ if not list:
70
+ raise ValueError("No wx.ListCtrl available")
71
+ list.Bind(wx.EVT_LIST_COL_CLICK, self.__OnColClick, list)
72
+
73
+
74
+ def SetColumnCount(self, newNumColumns):
75
+ self._colSortFlag = [0] * newNumColumns
76
+ self._col = -1
77
+
78
+
79
+ def SortListItems(self, col=-1, ascending=1):
80
+ """Sort the list on demand. Can also be used to set the sort column and order."""
81
+ oldCol = self._col
82
+ if col != -1:
83
+ self._col = col
84
+ self._colSortFlag[col] = ascending
85
+ self.GetListCtrl().SortItems(self.GetColumnSorter())
86
+ self.__updateImages(oldCol)
87
+
88
+
89
+ def GetColumnWidths(self):
90
+ """
91
+ Returns a list of column widths. Can be used to help restore the current
92
+ view later.
93
+ """
94
+ list = self.GetListCtrl()
95
+ rv = []
96
+ for x in range(len(self._colSortFlag)):
97
+ rv.append(list.GetColumnWidth(x))
98
+ return rv
99
+
100
+
101
+ def GetSortImages(self):
102
+ """
103
+ Returns a tuple of image list indexesthe indexes in the image list for an image to be put on the column
104
+ header when sorting in descending order.
105
+ """
106
+ return (-1, -1) # (descending, ascending) image IDs
107
+
108
+
109
+ def GetColumnSorter(self):
110
+ """Returns a callable object to be used for comparing column values when sorting."""
111
+ return self.__ColumnSorter
112
+
113
+
114
+ def GetSecondarySortValues(self, col, key1, key2):
115
+ """Returns a tuple of 2 values to use for secondary sort values when the
116
+ items in the selected column match equal. The default just returns the
117
+ item data values."""
118
+ return (key1, key2)
119
+
120
+
121
+ def __OnColClick(self, evt):
122
+ oldCol = self._col
123
+ self._col = col = evt.GetColumn()
124
+ self._colSortFlag[col] = int(not self._colSortFlag[col])
125
+ self.GetListCtrl().SortItems(self.GetColumnSorter())
126
+ if wx.Platform != "__WXMAC__" or wx.SystemOptions.GetOptionInt("mac.listctrl.always_use_generic") == 1:
127
+ self.__updateImages(oldCol)
128
+ evt.Skip()
129
+ self.OnSortOrderChanged()
130
+
131
+
132
+ def OnSortOrderChanged(self):
133
+ """
134
+ Callback called after sort order has changed (whenever user
135
+ clicked column header).
136
+ """
137
+ pass
138
+
139
+
140
+ def GetSortState(self):
141
+ """
142
+ Return a tuple containing the index of the column that was last sorted
143
+ and the sort direction of that column.
144
+
145
+ Usage::
146
+
147
+ col, ascending = self.GetSortState()
148
+ # Make changes to list items... then resort
149
+ self.SortListItems(col, ascending)
150
+ """
151
+ return (self._col, self._colSortFlag[self._col])
152
+
153
+
154
+ def __ColumnSorter(self, key1, key2):
155
+ col = self._col
156
+ ascending = self._colSortFlag[col]
157
+ item1 = self.itemDataMap[key1][col]
158
+ item2 = self.itemDataMap[key2][col]
159
+
160
+ #--- Internationalization of string sorting with locale module
161
+ if isinstance(item1, str) and isinstance(item2, str):
162
+ # both are unicode (py2) or str (py3)
163
+ cmpVal = locale.strcoll(item1, item2)
164
+ elif isinstance(item1, bytes) or isinstance(item2, bytes):
165
+ # at least one is a str (py2) or byte (py3)
166
+ cmpVal = locale.strcoll(str(item1), str(item2))
167
+ else:
168
+ cmpVal = cmp(item1, item2)
169
+ #---
170
+
171
+ # If the items are equal then pick something else to make the sort value unique
172
+ if cmpVal == 0:
173
+ cmpVal = cmp(*self.GetSecondarySortValues(col, key1, key2))
174
+
175
+ if ascending:
176
+ return cmpVal
177
+ else:
178
+ return -cmpVal
179
+
180
+
181
+ def __updateImages(self, oldCol):
182
+ sortImages = self.GetSortImages()
183
+ if self._col != -1 and sortImages[0] != -1:
184
+ img = sortImages[self._colSortFlag[self._col]]
185
+ list = self.GetListCtrl()
186
+ if oldCol != -1:
187
+ list.ClearColumnImage(oldCol)
188
+ list.SetColumnImage(self._col, img)
189
+
190
+
191
+ #----------------------------------------------------------------------------
192
+ #----------------------------------------------------------------------------
193
+
194
+ class ListCtrlAutoWidthMixin:
195
+ """ A mix-in class that automatically resizes the last column to take up
196
+ the remaining width of the wx.ListCtrl.
197
+
198
+ This causes the wx.ListCtrl to automatically take up the full width of
199
+ the list, without either a horizontal scroll bar (unless absolutely
200
+ necessary) or empty space to the right of the last column.
201
+
202
+ NOTE: This only works for report-style lists.
203
+
204
+ WARNING: If you override the EVT_SIZE event in your wx.ListCtrl, make
205
+ sure you call event.Skip() to ensure that the mixin's
206
+ _OnResize method is called.
207
+
208
+ This mix-in class was written by Erik Westra <ewestra@wave.co.nz>
209
+ """
210
+ def __init__(self):
211
+ """ Standard initialiser.
212
+ """
213
+ self._resizeColMinWidth = None
214
+ self._resizeColStyle = "LAST"
215
+ self._resizeCol = 0
216
+ self.Bind(wx.EVT_SIZE, self._onResize)
217
+ self.Bind(wx.EVT_LIST_COL_END_DRAG, self._onResize, self)
218
+
219
+
220
+ def setResizeColumn(self, col):
221
+ """
222
+ Specify which column that should be autosized. Pass either
223
+ 'LAST' or the column number. Default is 'LAST'.
224
+ """
225
+ if col == "LAST":
226
+ self._resizeColStyle = "LAST"
227
+ else:
228
+ self._resizeColStyle = "COL"
229
+ self._resizeCol = col
230
+
231
+
232
+ def resizeLastColumn(self, minWidth):
233
+ """ Resize the last column appropriately.
234
+
235
+ If the list's columns are too wide to fit within the window, we use
236
+ a horizontal scrollbar. Otherwise, we expand the right-most column
237
+ to take up the remaining free space in the list.
238
+
239
+ This method is called automatically when the wx.ListCtrl is resized;
240
+ you can also call it yourself whenever you want the last column to
241
+ be resized appropriately (eg, when adding, removing or resizing
242
+ columns).
243
+
244
+ 'minWidth' is the preferred minimum width for the last column.
245
+ """
246
+ self.resizeColumn(minWidth)
247
+
248
+
249
+ def resizeColumn(self, minWidth):
250
+ self._resizeColMinWidth = minWidth
251
+ self._doResize()
252
+
253
+
254
+ # =====================
255
+ # == Private Methods ==
256
+ # =====================
257
+
258
+ def _onResize(self, event):
259
+ """ Respond to the wx.ListCtrl being resized.
260
+
261
+ We automatically resize the last column in the list.
262
+ """
263
+ if 'gtk2' in wx.PlatformInfo or 'gtk3' in wx.PlatformInfo:
264
+ self._doResize()
265
+ else:
266
+ wx.CallAfter(self._doResize)
267
+ event.Skip()
268
+
269
+
270
+ def _doResize(self):
271
+ """ Resize the last column as appropriate.
272
+
273
+ If the list's columns are too wide to fit within the window, we use
274
+ a horizontal scrollbar. Otherwise, we expand the right-most column
275
+ to take up the remaining free space in the list.
276
+
277
+ We remember the current size of the last column, before resizing,
278
+ as the preferred minimum width if we haven't previously been given
279
+ or calculated a minimum width. This ensure that repeated calls to
280
+ _doResize() don't cause the last column to size itself too large.
281
+ """
282
+
283
+ if not self: # avoid a PyDeadObject error
284
+ return
285
+
286
+ if self.GetSize().height < 32:
287
+ return # avoid an endless update bug when the height is small.
288
+
289
+ numCols = self.GetColumnCount()
290
+ if numCols == 0: return # Nothing to resize.
291
+
292
+ if(self._resizeColStyle == "LAST"):
293
+ resizeCol = self.GetColumnCount()
294
+ else:
295
+ resizeCol = self._resizeCol
296
+
297
+ resizeCol = max(1, resizeCol)
298
+
299
+ if self._resizeColMinWidth is None:
300
+ self._resizeColMinWidth = self.GetColumnWidth(resizeCol - 1)
301
+
302
+ # Get total width
303
+ listWidth = self.GetClientSize().width
304
+
305
+ totColWidth = 0 # Width of all columns except last one.
306
+ for col in range(numCols):
307
+ if col != (resizeCol-1):
308
+ totColWidth = totColWidth + self.GetColumnWidth(col)
309
+
310
+ resizeColWidth = self.GetColumnWidth(resizeCol - 1)
311
+
312
+ if totColWidth + self._resizeColMinWidth > listWidth:
313
+ # We haven't got the width to show the last column at its minimum
314
+ # width -> set it to its minimum width and allow the horizontal
315
+ # scrollbar to show.
316
+ self.SetColumnWidth(resizeCol-1, self._resizeColMinWidth)
317
+ return
318
+
319
+ # Resize the last column to take up the remaining available space.
320
+
321
+ self.SetColumnWidth(resizeCol-1, listWidth - totColWidth)
322
+
323
+
324
+
325
+
326
+ #----------------------------------------------------------------------------
327
+ #----------------------------------------------------------------------------
328
+
329
+ SEL_FOC = wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED
330
+ def selectBeforePopup(event):
331
+ """Ensures the item the mouse is pointing at is selected before a popup.
332
+
333
+ Works with both single-select and multi-select lists."""
334
+ ctrl = event.GetEventObject()
335
+ if isinstance(ctrl, wx.ListCtrl):
336
+ n, flags = ctrl.HitTest(event.GetPosition())
337
+ if n >= 0:
338
+ if not ctrl.GetItemState(n, wx.LIST_STATE_SELECTED):
339
+ for i in range(ctrl.GetItemCount()):
340
+ ctrl.SetItemState(i, 0, SEL_FOC)
341
+ #for i in getListCtrlSelection(ctrl, SEL_FOC):
342
+ # ctrl.SetItemState(i, 0, SEL_FOC)
343
+ ctrl.SetItemState(n, SEL_FOC, SEL_FOC)
344
+
345
+
346
+ def getListCtrlSelection(listctrl, state=wx.LIST_STATE_SELECTED):
347
+ """ Returns list of item indexes of given state (selected by defaults) """
348
+ res = []
349
+ idx = -1
350
+ while 1:
351
+ idx = listctrl.GetNextItem(idx, wx.LIST_NEXT_ALL, state)
352
+ if idx == -1:
353
+ break
354
+ res.append(idx)
355
+ return res
356
+
357
+ wxEVT_DOPOPUPMENU = wx.NewEventType()
358
+ EVT_DOPOPUPMENU = wx.PyEventBinder(wxEVT_DOPOPUPMENU, 0)
359
+
360
+
361
+ class ListCtrlSelectionManagerMix:
362
+ """Mixin that defines a platform independent selection policy
363
+
364
+ As selection single and multi-select list return the item index or a
365
+ list of item indexes respectively.
366
+ """
367
+ _menu = None
368
+
369
+ def __init__(self):
370
+ self.Bind(wx.EVT_RIGHT_DOWN, self.OnLCSMRightDown)
371
+ self.Bind(EVT_DOPOPUPMENU, self.OnLCSMDoPopup)
372
+ # self.Connect(-1, -1, self.wxEVT_DOPOPUPMENU, self.OnLCSMDoPopup)
373
+
374
+
375
+ def getPopupMenu(self):
376
+ """ Override to implement dynamic menus (create) """
377
+ return self._menu
378
+
379
+
380
+ def setPopupMenu(self, menu):
381
+ """ Must be set for default behaviour """
382
+ self._menu = menu
383
+
384
+
385
+ def afterPopupMenu(self, menu):
386
+ """ Override to implement dynamic menus (destroy) """
387
+ pass
388
+
389
+
390
+ def getSelection(self):
391
+ res = getListCtrlSelection(self)
392
+ if self.GetWindowStyleFlag() & wx.LC_SINGLE_SEL:
393
+ if res:
394
+ return res[0]
395
+ else:
396
+ return -1
397
+ else:
398
+ return res
399
+
400
+
401
+ def OnLCSMRightDown(self, event):
402
+ selectBeforePopup(event)
403
+ event.Skip()
404
+ menu = self.getPopupMenu()
405
+ if menu:
406
+ evt = wx.PyEvent()
407
+ evt.SetEventType(wxEVT_DOPOPUPMENU)
408
+ evt.menu = menu
409
+ evt.pos = event.GetPosition()
410
+ wx.PostEvent(self, evt)
411
+
412
+
413
+ def OnLCSMDoPopup(self, event):
414
+ self.PopupMenu(event.menu, event.pos)
415
+ self.afterPopupMenu(event.menu)
416
+
417
+
418
+ #----------------------------------------------------------------------------
419
+ #----------------------------------------------------------------------------
420
+ from bisect import bisect
421
+
422
+
423
+ class TextEditMixin:
424
+ """
425
+ A mixin class that enables any text in any column of a
426
+ multi-column listctrl to be edited by clicking on the given row
427
+ and column. You close the text editor by hitting the ENTER key or
428
+ clicking somewhere else on the listctrl. You switch to the next
429
+ column by hiting TAB.
430
+
431
+ To use the mixin you have to include it in the class definition
432
+ and call the __init__ function::
433
+
434
+ class TestListCtrl(wx.ListCtrl, TextEditMixin):
435
+ def __init__(self, parent, ID, pos=wx.DefaultPosition,
436
+ size=wx.DefaultSize, style=0):
437
+ wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
438
+ TextEditMixin.__init__(self)
439
+
440
+
441
+ Authors: Steve Zatz, Pim Van Heuven (pim@think-wize.com)
442
+ """
443
+
444
+ editorBgColour = wx.Colour(255,255,175) # Yellow
445
+ editorFgColour = wx.BLACK
446
+
447
+ def __init__(self):
448
+ #editor = wx.TextCtrl(self, -1, pos=(-1,-1), size=(-1,-1),
449
+ # style=wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB \
450
+ # |wx.TE_RICH2)
451
+
452
+ self.make_editor()
453
+ self.Bind(wx.EVT_TEXT_ENTER, self.CloseEditor)
454
+ self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
455
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
456
+ self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self)
457
+
458
+
459
+ def make_editor(self, col_style=wx.LIST_FORMAT_LEFT):
460
+
461
+ style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB
462
+ style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT,
463
+ wx.LIST_FORMAT_RIGHT: wx.TE_RIGHT,
464
+ wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE
465
+ }[col_style]
466
+
467
+ editor = wx.TextCtrl(self, -1, style=style)
468
+ editor.SetBackgroundColour(self.editorBgColour)
469
+ editor.SetForegroundColour(self.editorFgColour)
470
+ font = self.GetFont()
471
+ editor.SetFont(font)
472
+
473
+ self.curRow = 0
474
+ self.curCol = 0
475
+
476
+ editor.Hide()
477
+ if hasattr(self, 'editor'):
478
+ self.editor.Destroy()
479
+ self.editor = editor
480
+
481
+ self.col_style = col_style
482
+ self.editor.Bind(wx.EVT_CHAR, self.OnChar)
483
+ self.editor.Bind(wx.EVT_KILL_FOCUS, self.CloseEditor)
484
+
485
+
486
+ def OnItemSelected(self, evt):
487
+ self.curRow = evt.GetIndex()
488
+ evt.Skip()
489
+
490
+
491
+ def OnChar(self, event):
492
+ ''' Catch the TAB, Shift-TAB, cursor DOWN/UP key code
493
+ so we can open the editor at the next column (if any).'''
494
+
495
+ keycode = event.GetKeyCode()
496
+ if keycode == wx.WXK_TAB and event.ShiftDown():
497
+ self.CloseEditor()
498
+ if self.curCol-1 >= 0:
499
+ self.OpenEditor(self.curCol-1, self.curRow)
500
+
501
+ elif keycode == wx.WXK_TAB:
502
+ self.CloseEditor()
503
+ if self.curCol+1 < self.GetColumnCount():
504
+ self.OpenEditor(self.curCol+1, self.curRow)
505
+
506
+ elif keycode == wx.WXK_ESCAPE:
507
+ self.CloseEditor()
508
+
509
+ elif keycode == wx.WXK_DOWN:
510
+ self.CloseEditor()
511
+ if self.curRow+1 < self.GetItemCount():
512
+ self._SelectIndex(self.curRow+1)
513
+ self.OpenEditor(self.curCol, self.curRow)
514
+
515
+ elif keycode == wx.WXK_UP:
516
+ self.CloseEditor()
517
+ if self.curRow > 0:
518
+ self._SelectIndex(self.curRow-1)
519
+ self.OpenEditor(self.curCol, self.curRow)
520
+
521
+ else:
522
+ event.Skip()
523
+
524
+
525
+ def OnLeftDown(self, evt=None):
526
+ ''' Examine the click and double
527
+ click events to see if a row has been click on twice. If so,
528
+ determine the current row and columnn and open the editor.'''
529
+
530
+ if self.editor.IsShown():
531
+ self.CloseEditor()
532
+
533
+ x,y = evt.GetPosition()
534
+ row,flags = self.HitTest((x,y))
535
+
536
+ if row != self.curRow: # self.curRow keeps track of the current row
537
+ evt.Skip()
538
+ return
539
+
540
+ # the following should really be done in the mixin's init but
541
+ # the wx.ListCtrl demo creates the columns after creating the
542
+ # ListCtrl (generally not a good idea) on the other hand,
543
+ # doing this here handles adjustable column widths
544
+
545
+ self.col_locs = [0]
546
+ loc = 0
547
+ for n in range(self.GetColumnCount()):
548
+ loc = loc + self.GetColumnWidth(n)
549
+ self.col_locs.append(loc)
550
+
551
+
552
+ col = bisect(self.col_locs, x+self.GetScrollPos(wx.HORIZONTAL)) - 1
553
+ self.OpenEditor(col, row)
554
+
555
+
556
+ def OpenEditor(self, col, row):
557
+ ''' Opens an editor at the current position. '''
558
+
559
+ # give the derived class a chance to Allow/Veto this edit.
560
+ evt = wx.ListEvent(wx.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, self.GetId())
561
+ evt.Index = row
562
+ evt.Column = col
563
+ item = self.GetItem(row, col)
564
+ evt.Item.SetId(item.GetId())
565
+ evt.Item.SetColumn(item.GetColumn())
566
+ evt.Item.SetData(item.GetData())
567
+ evt.Item.SetText(item.GetText())
568
+ ret = self.GetEventHandler().ProcessEvent(evt)
569
+ if ret and not evt.IsAllowed():
570
+ return # user code doesn't allow the edit.
571
+
572
+ if self.GetColumn(col).Align != self.col_style:
573
+ self.make_editor(self.GetColumn(col).Align)
574
+
575
+ x0 = self.col_locs[col]
576
+ x1 = self.col_locs[col+1] - x0
577
+
578
+ scrolloffset = self.GetScrollPos(wx.HORIZONTAL)
579
+
580
+ # scroll forward
581
+ if x0+x1-scrolloffset > self.GetSize()[0]:
582
+ if wx.Platform == "__WXMSW__":
583
+ # don't start scrolling unless we really need to
584
+ offset = x0+x1-self.GetSize()[0]-scrolloffset
585
+ # scroll a bit more than what is minimum required
586
+ # so we don't have to scroll every time the user presses TAB
587
+ # which is very tireing to the eye
588
+ addoffset = self.GetSize()[0]//4
589
+ # but be careful at the end of the list
590
+ if addoffset + scrolloffset < self.GetSize()[0]:
591
+ offset += addoffset
592
+
593
+ self.ScrollList(offset, 0)
594
+ scrolloffset = self.GetScrollPos(wx.HORIZONTAL)
595
+ else:
596
+ # Since we can not programmatically scroll the ListCtrl
597
+ # close the editor so the user can scroll and open the editor
598
+ # again
599
+ self.editor.SetValue(self.GetItem(row, col).GetText())
600
+ self.curRow = row
601
+ self.curCol = col
602
+ self.CloseEditor()
603
+ return
604
+
605
+ y0 = self.GetItemRect(row)[1]
606
+
607
+ def _activate_editor(editor):
608
+ editor.SetSize(x0-scrolloffset,y0, x1,-1, wx.SIZE_USE_EXISTING)
609
+ editor.SetValue(self.GetItem(row, col).GetText())
610
+ editor.Show()
611
+ editor.Raise()
612
+ editor.SetSelection(-1,-1)
613
+ editor.SetFocus()
614
+
615
+ wx.CallAfter(_activate_editor, self.editor)
616
+
617
+ self.curRow = row
618
+ self.curCol = col
619
+
620
+
621
+ # FIXME: this function is usually called twice - second time because
622
+ # it is binded to wx.EVT_KILL_FOCUS. Can it be avoided? (MW)
623
+ def CloseEditor(self, evt=None):
624
+ ''' Close the editor and save the new value to the ListCtrl. '''
625
+ if not self.editor.IsShown():
626
+ return
627
+ text = self.editor.GetValue()
628
+ self.editor.Hide()
629
+ self.SetFocus()
630
+
631
+ # post wxEVT_COMMAND_LIST_END_LABEL_EDIT
632
+ # Event can be vetoed. It doesn't has SetEditCanceled(), what would
633
+ # require passing extra argument to CloseEditor()
634
+ evt = wx.ListEvent(wx.wxEVT_COMMAND_LIST_END_LABEL_EDIT, self.GetId())
635
+ evt.Index = self.curRow
636
+ evt.Column = self.curCol
637
+ item = wx.ListItem(self.GetItem(self.curRow, self.curCol))
638
+ item.SetText(text)
639
+ evt.SetItem(item)
640
+
641
+ ret = self.GetEventHandler().ProcessEvent(evt)
642
+ if not ret or evt.IsAllowed():
643
+ if self.IsVirtual():
644
+ # replace by whatever you use to populate the virtual ListCtrl
645
+ # data source
646
+ self.SetVirtualData(self.curRow, self.curCol, text)
647
+ else:
648
+ self.SetItem(self.curRow, self.curCol, text)
649
+ self.RefreshItem(self.curRow)
650
+
651
+ def _SelectIndex(self, row):
652
+ listlen = self.GetItemCount()
653
+ if row < 0 and not listlen:
654
+ return
655
+ if row > (listlen-1):
656
+ row = listlen -1
657
+
658
+ self.SetItemState(self.curRow, ~wx.LIST_STATE_SELECTED,
659
+ wx.LIST_STATE_SELECTED)
660
+ self.EnsureVisible(row)
661
+ self.SetItemState(row, wx.LIST_STATE_SELECTED,
662
+ wx.LIST_STATE_SELECTED)
663
+
664
+
665
+
666
+ #----------------------------------------------------------------------------
667
+ #----------------------------------------------------------------------------
668
+
669
+ """
670
+ FILENAME: CheckListCtrlMixin.py
671
+ AUTHOR: Bruce Who (bruce.who.hk at gmail.com)
672
+ DATE: 2006-02-09
673
+ DESCRIPTION:
674
+ This script provide a mixin for ListCtrl which add a checkbox in the first
675
+ column of each row. It is inspired by limodou's CheckList.py(which can be
676
+ got from his NewEdit) and improved:
677
+ - You can just use InsertStringItem() to insert new items;
678
+ - Once a checkbox is checked/unchecked, the corresponding item is not
679
+ selected;
680
+ - You can use SetItemData() and GetItemData();
681
+ - Interfaces are changed to OnCheckItem(), IsChecked(), CheckItem().
682
+
683
+ You should not set a imagelist for the ListCtrl once this mixin is used.
684
+
685
+ HISTORY:
686
+ 1.3 - You can check/uncheck a group of sequential items by <Shift-click>:
687
+ First click(or <Shift-Click>) item1 to check/uncheck it, then
688
+ Shift-click item2 to check/uncheck it, and you'll find that all
689
+ items between item1 and item2 are check/unchecked!
690
+ 1.2 - Add ToggleItem()
691
+ 1.1 - Initial version
692
+ """
693
+
694
+ _warning = (
695
+ "The CheckListCtrlMixin class has been made redundant by new checkbox features in the "
696
+ "wx.ListCtrl class. It is advised to switch your code to use that instead of this mixin.")
697
+
698
+
699
+ class CheckListCtrlMixin(object):
700
+ """
701
+ This is a mixin for ListCtrl which add a checkbox in the first
702
+ column of each row. It is inspired by limodou's CheckList.py(which
703
+ can be got from his NewEdit) and improved:
704
+
705
+ - You can just use InsertStringItem() to insert new items;
706
+
707
+ - Once a checkbox is checked/unchecked, the corresponding item
708
+ is not selected;
709
+
710
+ - You can use SetItemData() and GetItemData();
711
+
712
+ - Interfaces are changed to OnCheckItem(), IsChecked(),
713
+ CheckItem().
714
+
715
+ You should not set a imagelist for the ListCtrl once this mixin is used.
716
+
717
+ WARNING: This class is obsolete as wx.ListCtrl now includes nearly the same
718
+ functionality.
719
+ """
720
+ def __init__(self, check_image=None, uncheck_image=None, imgsz=(16,16)):
721
+ import warnings
722
+ warnings.warn(_warning)
723
+
724
+ if check_image is not None:
725
+ imgsz = check_image.GetSize()
726
+ elif uncheck_image is not None:
727
+ imgsz = check_image.GetSize()
728
+
729
+ self.__imagelist_ = wx.ImageList(*imgsz)
730
+
731
+ # Create default checkbox images if none were specified
732
+ if check_image is None:
733
+ check_image = self.__CreateBitmap(wx.CONTROL_CHECKED, imgsz)
734
+
735
+ if uncheck_image is None:
736
+ uncheck_image = self.__CreateBitmap(0, imgsz)
737
+
738
+ self.uncheck_image = self.__imagelist_.Add(uncheck_image)
739
+ self.check_image = self.__imagelist_.Add(check_image)
740
+ self.AssignImageList(self.__imagelist_, wx.IMAGE_LIST_SMALL)
741
+ self.__last_check_ = None
742
+
743
+ self.Bind(wx.EVT_LEFT_DOWN, self.__OnLeftDown_)
744
+
745
+ # Monkey-patch in a new InsertItem so we can also set the image ID for the item
746
+ self._origInsertItem = self.InsertItem
747
+ self.InsertItem = self.__InsertItem_
748
+
749
+
750
+ def __InsertItem_(self, *args, **kw):
751
+ index = self._origInsertItem(*args, **kw)
752
+ self.SetItemImage(index, self.uncheck_image)
753
+ return index
754
+
755
+
756
+ def __CreateBitmap(self, flag=0, size=(16, 16)):
757
+ """Create a bitmap of the platforms native checkbox. The flag
758
+ is used to determine the checkboxes state (see wx.CONTROL_*)
759
+
760
+ """
761
+ bmp = wx.Bitmap(*size)
762
+ dc = wx.MemoryDC(bmp)
763
+ dc.SetBackground(wx.WHITE_BRUSH)
764
+ dc.Clear()
765
+ wx.RendererNative.Get().DrawCheckBox(self, dc,
766
+ (0, 0, size[0], size[1]), flag)
767
+ dc.SelectObject(wx.NullBitmap)
768
+ return bmp
769
+
770
+
771
+ def __OnLeftDown_(self, evt):
772
+ (index, flags) = self.HitTest(evt.GetPosition())
773
+ if flags == wx.LIST_HITTEST_ONITEMICON:
774
+ img_idx = self.GetItem(index).GetImage()
775
+ flag_check = img_idx == 0
776
+ begin_index = index
777
+ end_index = index
778
+ if self.__last_check_ is not None \
779
+ and wx.GetKeyState(wx.WXK_SHIFT):
780
+ last_index, last_flag_check = self.__last_check_
781
+ if last_flag_check == flag_check:
782
+ # XXX what if the previous item is deleted or new items
783
+ # are inserted?
784
+ item_count = self.GetItemCount()
785
+ if last_index < item_count:
786
+ if last_index < index:
787
+ begin_index = last_index
788
+ end_index = index
789
+ elif last_index > index:
790
+ begin_index = index
791
+ end_index = last_index
792
+ else:
793
+ assert False
794
+ while begin_index <= end_index:
795
+ self.CheckItem(begin_index, flag_check)
796
+ begin_index += 1
797
+ self.__last_check_ = (index, flag_check)
798
+ else:
799
+ evt.Skip()
800
+
801
+ def OnCheckItem(self, index, flag):
802
+ pass
803
+
804
+ def IsChecked(self, index):
805
+ return self.GetItem(index).GetImage() == 1
806
+
807
+ def CheckItem(self, index, check=True):
808
+ img_idx = self.GetItem(index).GetImage()
809
+ if img_idx == 0 and check:
810
+ self.SetItemImage(index, 1)
811
+ self.OnCheckItem(index, True)
812
+ elif img_idx == 1 and not check:
813
+ self.SetItemImage(index, 0)
814
+ self.OnCheckItem(index, False)
815
+
816
+ def ToggleItem(self, index):
817
+ self.CheckItem(index, not self.IsChecked(index))
818
+
819
+
820
+ #----------------------------------------------------------------------------
821
+ #----------------------------------------------------------------------------
822
+
823
+ # Mode Flags
824
+ HIGHLIGHT_ODD = 1 # Highlight the Odd rows
825
+ HIGHLIGHT_EVEN = 2 # Highlight the Even rows
826
+
827
+ class ListRowHighlighter:
828
+ """Editra Control Library: ListRowHighlighter
829
+ Mixin class that handles automatic background highlighting of alternate
830
+ rows in the a ListCtrl. The background of the rows are highlighted
831
+ automatically as items are added or inserted in the control based on the
832
+ mixins Mode and set Color. By default the Even rows will be highlighted with
833
+ the systems highlight color.
834
+
835
+ """
836
+ def __init__(self, color=None, mode=HIGHLIGHT_EVEN):
837
+ """Initialize the highlighter mixin
838
+ @keyword color: Set a custom highlight color (default uses system color)
839
+ @keyword mode: HIGHLIGHT_EVEN (default) or HIGHLIGHT_ODD
840
+
841
+ """
842
+ # Attributes
843
+ self._color = color
844
+ self._defaultb = wx.SystemSettings.GetColour(wx.SYS_COLOUR_LISTBOX)
845
+ self._mode = mode
846
+
847
+ # Event Handlers
848
+ self.Bind(wx.EVT_LIST_INSERT_ITEM, lambda evt: self.RefreshRows())
849
+ self.Bind(wx.EVT_LIST_DELETE_ITEM, lambda evt: self.RefreshRows())
850
+
851
+ def RefreshRows(self):
852
+ """Re-color all the rows"""
853
+ if self._color is None:
854
+ if wx.Platform in ('__WXGTK__', '__WXMSW__'):
855
+ color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DLIGHT)
856
+ else:
857
+ color = wx.Colour(237, 243, 254)
858
+ else:
859
+ color = self._color
860
+ local_defaultb = self._defaultb
861
+ local_mode = self._mode
862
+ for row in range(self.GetItemCount()):
863
+ if local_mode & HIGHLIGHT_EVEN:
864
+ dohlight = not row % 2
865
+ else:
866
+ dohlight = row % 2
867
+
868
+ if dohlight:
869
+ self.SetItemBackgroundColour(row, color)
870
+ elif local_defaultb:
871
+ self.SetItemBackgroundColour(row, local_defaultb)
872
+ else: # This part of the loop should only happen once if self._defaultb is None.
873
+ local_defaultb = self._defaultb = self.GetItemBackgroundColour(row)
874
+ self.SetItemBackgroundColour(row, local_defaultb)
875
+
876
+ def SetHighlightColor(self, color):
877
+ """Set the color used to highlight the rows. Call :meth:`RefreshRows` after
878
+ this if you wish to update all the rows highlight colors.
879
+ @param color: wx.Color or None to set default
880
+
881
+ """
882
+ self._color = color
883
+
884
+ def SetHighlightMode(self, mode):
885
+ """Set the highlighting mode to either HIGHLIGHT_EVEN or to
886
+ HIGHLIGHT_ODD. Call :meth:`RefreshRows` afterwards to update the list
887
+ state.
888
+ @param mode: HIGHLIGHT_* mode value
889
+
890
+ """
891
+ self._mode = mode
892
+
893
+ #----------------------------------------------------------------------------