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/printout.py ADDED
@@ -0,0 +1,1155 @@
1
+ #----------------------------------------------------------------------------
2
+ # Name: printout.py
3
+ # Purpose: preview and printing class -> table/grid printing
4
+ #
5
+ # Author: Lorne White (email: lorne.white@telusplanet.net)
6
+ #
7
+ # Created:
8
+ # Version 0.75
9
+ # Date: May 15, 2002
10
+ # Licence: wxWindows license
11
+ # Tags: phoenix-port
12
+ #----------------------------------------------------------------------------
13
+ # Release Notes
14
+
15
+ # fixed bug for string wider than print region
16
+ # add index to data list after parsing total pages for paging
17
+ #----------------------------------------------------------------------------
18
+ # 12/10/2003 - Jeff Grimmett (grimmtooth@softhome.net)
19
+ # o 2.5 compatibility update.
20
+ #----------------------------------------------------------------------------
21
+ # 11/23/2004 - Vernon Cole (wnvcole@peppermillcas.com)
22
+ # o Generalize for non-2-dimensional sequences and non-text data
23
+ # (can use as a simple text printer by supplying a list of strings.)
24
+ # o Add a small _main_ for self test
25
+
26
+ import copy
27
+ import types
28
+ import wx
29
+
30
+ class PrintBase:
31
+ def SetPrintFont(self, font): # set the DC font parameters
32
+ fattr = font["Attr"]
33
+ if fattr[0] == 1:
34
+ weight = wx.FONTWEIGHT_BOLD
35
+ else:
36
+ weight = wx.FONTWEIGHT_NORMAL
37
+
38
+ if fattr[1] == 1:
39
+ set_style = wx.FONTSTYLE_ITALIC
40
+ else:
41
+ set_style = wx.FONTSTYLE_NORMAL
42
+
43
+ underline = fattr[2]
44
+ fcolour = self.GetFontColour(font)
45
+ self.DC.SetTextForeground(fcolour)
46
+
47
+ setfont = wx.Font(font["Size"], wx.FONTFAMILY_SWISS, set_style, weight, underline)
48
+ setfont.SetFaceName(font["Name"])
49
+ self.DC.SetFont(setfont)
50
+
51
+ def GetFontColour(self, font):
52
+ fcolour = font["Colour"]
53
+ return wx.Colour(fcolour[0], fcolour[1], fcolour[2])
54
+
55
+ def OutTextRegion(self, textout, txtdraw = True):
56
+ textlines = textout.split('\n')
57
+ y = copy.copy(self.y) + self.pt_space_before
58
+ for text in textlines:
59
+ remain = 'X'
60
+ while remain != "":
61
+ vout, remain = self.SetFlow(text, self.region)
62
+ if self.draw == True and txtdraw == True:
63
+ test_out = self.TestFull(vout)
64
+ if self.align == wx.ALIGN_LEFT:
65
+ self.DC.DrawText(test_out, int(self.indent+self.pcell_left_margin), int(y))
66
+
67
+ elif self.align == wx.ALIGN_CENTRE:
68
+ diff = self.GetCellDiff(test_out, self.region)
69
+ self.DC.DrawText(test_out, int(self.indent+diff/2), int(y))
70
+
71
+ elif self.align == wx.ALIGN_RIGHT:
72
+ diff = self.GetCellDiff(test_out, self.region)
73
+ self.DC.DrawText(test_out, int(self.indent+diff), int(y))
74
+
75
+ else:
76
+ self.DC.DrawText(test_out, int(self.indent+self.pcell_left_margin), int(y))
77
+ text = remain
78
+ y = y + self.space
79
+ return y - self.space + self.pt_space_after
80
+
81
+ def GetCellDiff(self, text, width): # get the remaining cell size for adjustment
82
+ w, h = self.DC.GetTextExtent(text)
83
+ diff = width - w
84
+ if diff < 0:
85
+ diff = 0
86
+ return diff
87
+
88
+ def TestFull(self, text_test):
89
+ w, h = self.DC.GetTextExtent(text_test)
90
+ if w > self.region: # trouble fitting into cell
91
+ return self.SetChar(text_test, self.region) # fit the text to the cell size
92
+ else:
93
+ return text_test
94
+
95
+ def SetFlow(self, ln_text, width):
96
+ width = width - self.pcell_right_margin
97
+ text = ""
98
+ split = ln_text.split()
99
+ if len(split) == 1:
100
+ return ln_text, ""
101
+
102
+ try:
103
+ w, h = self.DC.GetTextExtent(" " + split[0])
104
+ if w >= width:
105
+ return ln_text, ""
106
+ except:
107
+ pass
108
+
109
+ cnt = 0
110
+ for word in split:
111
+ bword = " " + word # blank + word
112
+ length = len(bword)
113
+
114
+ w, h = self.DC.GetTextExtent(text + bword)
115
+ if w < width:
116
+ text = text + bword
117
+ cnt = cnt + 1
118
+ else:
119
+ remain = ' '.join(split[cnt:])
120
+ text = text.strip()
121
+ return text, remain
122
+
123
+ remain = ' '.join(split[cnt:])
124
+ vout = text.strip()
125
+ return vout, remain
126
+
127
+ def SetChar(self, ln_text, width): # truncate string to fit into width
128
+ width = width - self.pcell_right_margin - self.pcell_left_margin
129
+ text = ""
130
+ for val in ln_text:
131
+ w, h = self.DC.GetTextExtent(text + val)
132
+ if w > width:
133
+ text = text + ".."
134
+ return text # fitted text value
135
+ text = text + val
136
+ return text
137
+
138
+ def OutTextPageWidth(self, textout, y_out, align, indent, txtdraw = True):
139
+ textlines = textout.split('\n')
140
+ y = copy.copy(y_out)
141
+
142
+ pagew = self.parent.page_width * self.pwidth # full page width
143
+ w, h = self.DC.GetTextExtent(textout)
144
+ y_line = h
145
+
146
+ for text in textlines:
147
+ remain = 'X'
148
+ while remain != "":
149
+ vout, remain = self.SetFlow(text, pagew)
150
+ if self.draw == True and txtdraw == True:
151
+ test_out = vout
152
+ if align == wx.ALIGN_LEFT:
153
+ self.DC.DrawText(test_out, int(indent), int(y))
154
+
155
+ elif align == wx.ALIGN_CENTRE:
156
+ diff = self.GetCellDiff(test_out, pagew)
157
+ self.DC.DrawText(test_out, int(indent+diff/2), int(y))
158
+
159
+ elif align == wx.ALIGN_RIGHT:
160
+ diff = self.GetCellDiff(test_out, pagew)
161
+ self.DC.DrawText(test_out, int(indent+diff), int(y))
162
+
163
+ else:
164
+ self.DC.DrawText(test_out, int(indent), int(y_out))
165
+ text = remain
166
+ y = y + y_line
167
+ return y - y_line
168
+
169
+ def GetDate(self):
170
+ date, time = self.GetNow()
171
+ return date
172
+
173
+ def GetDateTime(self):
174
+ date, time = self.GetNow()
175
+ return date + ' ' + time
176
+
177
+ def GetNow(self):
178
+ now = wx.DateTime.Now()
179
+ date = now.FormatDate()
180
+ time = now.FormatTime()
181
+ return date, time
182
+
183
+ def SetPreview(self, preview):
184
+ self.preview = preview
185
+
186
+ def SetPSize(self, width, height):
187
+ self.pwidth = width/self.scale
188
+ self.pheight = height/self.scale
189
+
190
+ def SetScale(self, scale):
191
+ self.scale = scale
192
+
193
+ def SetPTSize(self, width, height):
194
+ self.ptwidth = width
195
+ self.ptheight = height
196
+
197
+ def getWidth(self):
198
+ return self.sizew
199
+
200
+ def getHeight(self):
201
+ return self.sizeh
202
+
203
+
204
+ class PrintTableDraw(wx.ScrolledWindow, PrintBase):
205
+ def __init__(self, parent, DC, size):
206
+ self.parent = parent
207
+ self.DC = DC
208
+ self.scale = parent.scale
209
+ self.width = size[0]
210
+ self.height = size[1]
211
+ self.SetDefaults()
212
+
213
+ def SetDefaults(self):
214
+ self.page = 1
215
+ self.total_pages = None
216
+
217
+ self.page_width = self.parent.page_width
218
+ self.page_height = self.parent.page_height
219
+
220
+ self.left_margin = self.parent.left_margin
221
+ self.right_margin = self.parent.right_margin
222
+
223
+ self.top_margin = self.parent.top_margin
224
+ self.bottom_margin = self.parent.bottom_margin
225
+ self.cell_left_margin = self.parent.cell_left_margin
226
+ self.cell_right_margin = self.parent.cell_right_margin
227
+
228
+ self.label_colour = self.parent.label_colour
229
+
230
+ self.row_line_colour = self.parent.row_line_colour
231
+ self.row_line_size = self.parent.row_line_size
232
+
233
+ self.row_def_line_colour = self.parent.row_def_line_colour
234
+ self.row_def_line_size = self.parent.row_def_line_size
235
+
236
+ self.column_line_colour = self.parent.column_line_colour
237
+ self.column_line_size = self.parent.column_line_size
238
+
239
+ self.column_def_line_size = self.parent.column_def_line_size
240
+ self.column_def_line_colour = self.parent.column_def_line_colour
241
+
242
+ self.text_font = self.parent.text_font
243
+
244
+ self.label_font = self.parent.label_font
245
+
246
+ def AdjustValues(self):
247
+ self.vertical_offset = self.pheight * self.parent.vertical_offset
248
+ self.horizontal_offset = self.pheight * self.parent.horizontal_offset
249
+
250
+ self.pcell_left_margin = self.pwidth * self.cell_left_margin
251
+ self.pcell_right_margin = self.pwidth * self.cell_right_margin
252
+ self.ptop_margin = self.pheight * self.top_margin
253
+ self.pbottom_margin = self.pheight * self.bottom_margin
254
+
255
+ self.pheader_margin = self.pheight * self.parent.header_margin
256
+ self.pfooter_margin = self.pheight * self.parent.footer_margin
257
+
258
+ self.cell_colour = self.parent.set_cell_colour
259
+ self.cell_text = self.parent.set_cell_text
260
+
261
+ self.column = []
262
+ self.column_align = []
263
+ self.column_bgcolour = []
264
+ self.column_txtcolour = []
265
+
266
+ set_column_align = self.parent.set_column_align
267
+ set_column_bgcolour = self.parent.set_column_bgcolour
268
+ set_column_txtcolour = self.parent.set_column_txtcolour
269
+
270
+ pos_x = self.left_margin * self.pwidth + self.horizontal_offset # left margin
271
+ self.column.append(pos_x)
272
+
273
+ #module logic expects two dimensional data -- fix input if needed
274
+ if isinstance(self.data, str):
275
+ self.data = [[copy.copy(self.data)]] # a string becomes a single cell
276
+ try:
277
+ rows = len(self.data)
278
+ except TypeError:
279
+ self.data = [[str(self.data)]] # a non-iterable becomes a single cell
280
+ rows = 1
281
+ first_value = self.data[0]
282
+
283
+ if isinstance(first_value, str): # a sequence of strings
284
+ if self.label == [] and self.set_column == []:
285
+ data = []
286
+ for x in self.data: #becomes one column
287
+ data.append([x])
288
+ else:
289
+ data = [self.data] #becomes one row
290
+ self.data = data
291
+ first_value = data[0]
292
+ try:
293
+ column_total = len(first_value)
294
+ except TypeError: # a sequence of non-iterables
295
+ if self.label == [] and self.set_column == []:
296
+ data = [] #becomes one column
297
+ for x in self.data:
298
+ data.append([str(x)])
299
+ column_total = 1
300
+ else:
301
+ data = [self.data] #becomes one row
302
+ column_total = len(self.data)
303
+ self.data = data
304
+ first_value = data[0]
305
+
306
+ if self.set_column == []:
307
+ table_width = self.page_width - self.left_margin - self.right_margin
308
+ if self.label == []:
309
+ temp = first_value
310
+ else:
311
+ temp = self.label
312
+ width = table_width/(len(temp))
313
+ for val in temp:
314
+ column_width = width * self.pwidth
315
+ pos_x = pos_x + column_width
316
+ self.column.append(pos_x) # position of each column
317
+ else:
318
+ for val in self.set_column:
319
+ column_width = val * self.pwidth
320
+ pos_x = pos_x + column_width
321
+ self.column.append(pos_x) # position of each column
322
+
323
+ if pos_x > self.page_width * self.pwidth: # check if it fits in page
324
+ print("Warning, Too Wide for Page")
325
+ return
326
+
327
+ if self.label != []:
328
+ if len(self.column) -1 != len(self.label):
329
+ print("Column Settings Incorrect", "\nColumn Value: " + str(self.column), "\nLabel Value: " + str(self.label))
330
+ return
331
+
332
+ if column_total != len(self.column) -1:
333
+ print("Cannot fit", first_value, 'in', len(self.column)-1, 'columns.')
334
+ return
335
+
336
+ for col in range(column_total):
337
+ try:
338
+ align = set_column_align[col] # check if custom column alignment
339
+ except:
340
+ align = wx.ALIGN_LEFT
341
+ self.column_align.append(align)
342
+
343
+ try:
344
+ colour = set_column_bgcolour[col] # check if custom column background colour
345
+ except:
346
+ colour = self.parent.column_colour
347
+ self.column_bgcolour.append(colour)
348
+
349
+ try:
350
+ colour = set_column_txtcolour[col] # check if custom column text colour
351
+ except:
352
+ colour = self.GetFontColour(self.parent.text_font)
353
+ self.column_txtcolour.append(colour)
354
+
355
+
356
+ def SetPointAdjust(self):
357
+ f = wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) # setup using 10 point
358
+ self.DC.SetFont(f)
359
+ f.SetFaceName(self.text_font["Name"])
360
+ x, y = self.DC.GetTextExtent("W")
361
+
362
+ self.label_pt_space_before = self.parent.label_pt_adj_before * y/10 # extra spacing for label per point value
363
+ self.label_pt_space_after = self.parent.label_pt_adj_after * y/10
364
+
365
+ self.text_pt_space_before = self.parent.text_pt_adj_before * y/10 # extra spacing for row text per point value
366
+ self.text_pt_space_after = self.parent.text_pt_adj_after * y/10
367
+
368
+ def SetPage(self, page):
369
+ self.page = page
370
+
371
+ def SetColumns(self, col):
372
+ self.column = col
373
+
374
+ def OutCanvas(self):
375
+ self.AdjustValues()
376
+ self.SetPointAdjust()
377
+
378
+ self.y_start = self.ptop_margin + self.vertical_offset
379
+ self.y_end = self.parent.page_height * self.pheight - self.pbottom_margin + self.vertical_offset
380
+
381
+ self.SetPrintFont(self.label_font)
382
+
383
+ x, y = self.DC.GetTextExtent("W")
384
+ self.label_space = y
385
+
386
+ self.SetPrintFont(self.text_font)
387
+
388
+ x, y = self.DC.GetTextExtent("W")
389
+ self.space = y
390
+
391
+ if self.total_pages is None:
392
+ self.GetTotalPages() # total pages for display/printing
393
+
394
+ self.data_cnt = self.page_index[self.page-1]
395
+
396
+ self.draw = True
397
+ self.PrintHeader()
398
+ self.PrintFooter()
399
+ self.OutPage()
400
+
401
+ def GetTotalPages(self):
402
+ self.data_cnt = 0
403
+ self.draw = False
404
+ self.page_index = [0]
405
+
406
+ cnt = 0
407
+ while 1:
408
+ test = self.OutPage()
409
+ self.page_index.append(self.data_cnt)
410
+ if test == False:
411
+ break
412
+ cnt = cnt + 1
413
+
414
+ self.total_pages = cnt + 1
415
+
416
+ def OutPage(self):
417
+ self.y = self.y_start
418
+ self.end_x = self.column[-1]
419
+
420
+ if self.data_cnt < len(self.data): # if there data for display on the page
421
+ if self.label != []: # check if header defined
422
+ self.PrintLabel()
423
+ else:
424
+ return False
425
+
426
+ for val in self.data:
427
+ try:
428
+ row_val = self.data[self.data_cnt]
429
+ except:
430
+ self.FinishDraw()
431
+ return False
432
+
433
+ max_y = self.PrintRow(row_val, False) # test to see if row will fit in remaining space
434
+ test = max_y + self.space
435
+
436
+ if test > self.y_end:
437
+ break
438
+
439
+ self.ColourRowCells(max_y-self.y+self.space) # colour the row/column
440
+ max_y = self.PrintRow(row_val, True) # row fits - print text
441
+ self.DrawGridLine() # top line of cell
442
+ self.y = max_y + self.space
443
+
444
+ if self.y > self.y_end:
445
+ break
446
+
447
+ self.data_cnt = self.data_cnt + 1
448
+
449
+ self.FinishDraw()
450
+
451
+ if self.data_cnt == len(self.data): # last value in list
452
+ return False
453
+
454
+ return True
455
+
456
+
457
+ def PrintLabel(self):
458
+ self.pt_space_before = self.label_pt_space_before # set the point spacing
459
+ self.pt_space_after = self.label_pt_space_after
460
+
461
+ self.LabelColorRow(self.label_colour)
462
+ self.SetPrintFont(self.label_font)
463
+
464
+ self.col = 0
465
+ max_y = 0
466
+ for vtxt in self.label:
467
+ self.region = self.column[self.col+1] - self.column[self.col]
468
+ self.indent = self.column[self.col]
469
+
470
+ self.align = wx.ALIGN_LEFT
471
+
472
+ max_out = self.OutTextRegion(vtxt, True)
473
+ if max_out > max_y:
474
+ max_y = max_out
475
+ self.col = self.col + 1
476
+
477
+ self.DrawGridLine() # top line of label
478
+ self.y = max_y + self.label_space
479
+
480
+ def PrintHeader(self): # print the header array
481
+ if self.draw == False:
482
+ return
483
+
484
+ for val in self.parent.header:
485
+ self.SetPrintFont(val["Font"])
486
+
487
+ header_indent = val["Indent"] * self.pwidth
488
+ text = val["Text"]
489
+
490
+ htype = val["Type"]
491
+ if htype == "Date":
492
+ addtext = self.GetDate()
493
+ elif htype == "Date & Time":
494
+ addtext = self.GetDateTime()
495
+ else:
496
+ addtext = ""
497
+
498
+ self.OutTextPageWidth(text+addtext, self.pheader_margin, val["Align"], header_indent, True)
499
+
500
+ def PrintFooter(self): # print the header array
501
+ if self.draw == False:
502
+ return
503
+
504
+ footer_pos = self.parent.page_height * self.pheight - self.pfooter_margin + self.vertical_offset
505
+ for val in self.parent.footer:
506
+ self.SetPrintFont(val["Font"])
507
+
508
+ footer_indent = val["Indent"] * self.pwidth
509
+ text = val["Text"]
510
+
511
+ ftype = val["Type"]
512
+ if ftype == "Pageof":
513
+ addtext = "Page " + str(self.page) + " of " + str(self.total_pages)
514
+ elif ftype == "Page":
515
+ addtext = "Page " + str(self.page)
516
+ elif ftype == "Num":
517
+ addtext = str(self.page)
518
+ elif ftype == "Date":
519
+ addtext = self.GetDate()
520
+ elif ftype == "Date & Time":
521
+ addtext = self.GetDateTime()
522
+ else:
523
+ addtext = ""
524
+
525
+ self.OutTextPageWidth(text+addtext, footer_pos, val["Align"], footer_indent, True)
526
+
527
+
528
+ def LabelColorRow(self, colour):
529
+ brush = wx.Brush(colour, wx.BRUSHSTYLE_SOLID)
530
+ self.DC.SetBrush(brush)
531
+ height = self.label_space + self.label_pt_space_before + self.label_pt_space_after
532
+ self.DC.DrawRectangle(int(self.column[0]), int(self.y),
533
+ int(self.end_x-self.column[0]+1), int(height))
534
+
535
+ def ColourRowCells(self, height):
536
+ if self.draw == False:
537
+ return
538
+
539
+ col = 0
540
+ for colour in self.column_bgcolour:
541
+ cellcolour = self.GetCellColour(self.data_cnt, col)
542
+ if cellcolour is not None:
543
+ colour = cellcolour
544
+
545
+ brush = wx.Brush(colour, wx.BRUSHSTYLE_SOLID)
546
+ self.DC.SetBrush(brush)
547
+ self.DC.SetPen(wx.Pen(wx.WHITE, 0))
548
+
549
+ start_x = self.column[col]
550
+ width = self.column[col+1] - start_x + 2
551
+ self.DC.DrawRectangle(int(start_x), int(self.y), int(width), int(height))
552
+ col = col + 1
553
+
554
+ def PrintRow(self, row_val, draw = True, align = wx.ALIGN_LEFT):
555
+ self.SetPrintFont(self.text_font)
556
+
557
+ self.pt_space_before = self.text_pt_space_before # set the point spacing
558
+ self.pt_space_after = self.text_pt_space_after
559
+
560
+ self.col = 0
561
+ max_y = 0
562
+ for vtxt in row_val:
563
+ if not isinstance(vtxt, str):
564
+ vtxt = str(vtxt)
565
+ self.region = self.column[self.col+1] - self.column[self.col]
566
+ self.indent = self.column[self.col]
567
+ self.align = self.column_align[self.col]
568
+
569
+ fcolour = self.column_txtcolour[self.col] # set font colour
570
+ celltext = self.GetCellTextColour(self.data_cnt, self.col)
571
+ if celltext is not None:
572
+ fcolour = celltext # override the column colour
573
+
574
+ self.DC.SetTextForeground(fcolour)
575
+
576
+ max_out = self.OutTextRegion(vtxt, draw)
577
+ if max_out > max_y:
578
+ max_y = max_out
579
+ self.col = self.col + 1
580
+ return max_y
581
+
582
+ def GetCellColour(self, row, col): # check if custom colour defined for the cell background
583
+ try:
584
+ set = self.cell_colour[row]
585
+ except:
586
+ return None
587
+ try:
588
+ colour = set[col]
589
+ return colour
590
+ except:
591
+ return None
592
+
593
+ def GetCellTextColour(self, row, col): # check if custom colour defined for the cell text
594
+ try:
595
+ set = self.cell_text[row]
596
+ except:
597
+ return None
598
+ try:
599
+ colour = set[col]
600
+ return colour
601
+ except:
602
+ return None
603
+
604
+ def FinishDraw(self):
605
+ self.DrawGridLine() # draw last row line
606
+ self.DrawColumns() # draw all vertical lines
607
+
608
+ def DrawGridLine(self):
609
+ if self.draw == True \
610
+ and len(self.column) > 2: #suppress grid lines if only one column
611
+ try:
612
+ size = self.row_line_size[self.data_cnt]
613
+ except:
614
+ size = self.row_def_line_size
615
+
616
+ if size < 1: return
617
+
618
+ try:
619
+ colour = self.row_line_colour[self.data_cnt]
620
+ except:
621
+ colour = self.row_def_line_colour
622
+
623
+ self.DC.SetPen(wx.Pen(colour, size))
624
+
625
+ y_out = self.y
626
+ # y_out = self.y + self.pt_space_before + self.pt_space_after # adjust for extra spacing
627
+ self.DC.DrawLine(int(self.column[0]), int(y_out), int(self.end_x), int(y_out))
628
+
629
+ def DrawColumns(self):
630
+ if self.draw == True \
631
+ and len(self.column) > 2: #suppress grid line if only one column
632
+ col = 0
633
+ for val in self.column:
634
+ try:
635
+ size = self.column_line_size[col]
636
+ except:
637
+ size = self.column_def_line_size
638
+
639
+ if size < 1: continue
640
+
641
+ try:
642
+ colour = self.column_line_colour[col]
643
+ except:
644
+ colour = self.column_def_line_colour
645
+
646
+ indent = val
647
+
648
+ self.DC.SetPen(wx.Pen(colour, size))
649
+ self.DC.DrawLine(int(indent), int(self.y_start), int(indent), int(self.y))
650
+ col = col + 1
651
+
652
+ def DrawText(self):
653
+ self.DoRefresh()
654
+
655
+ def DoDrawing(self, DC):
656
+ size = DC.GetSize()
657
+ self.DC = DC
658
+
659
+ self.DrawText()
660
+
661
+ self.sizew = DC.MaxY()
662
+ self.sizeh = DC.MaxX()
663
+
664
+
665
+ class PrintTable(object):
666
+ def __init__(self, parentFrame=None):
667
+ self.data = []
668
+ self.set_column = []
669
+ self.label = []
670
+ self.header = []
671
+ self.footer = []
672
+
673
+ self.set_column_align = {}
674
+ self.set_column_bgcolour = {}
675
+ self.set_column_txtcolour = {}
676
+ self.set_cell_colour = {}
677
+ self.set_cell_text = {}
678
+ self.column_line_size = {}
679
+ self.column_line_colour = {}
680
+ self.row_line_size = {}
681
+ self.row_line_colour = {}
682
+
683
+ self.parentFrame = parentFrame
684
+ if parentFrame:
685
+ self.SetPreviewSize(parentFrame.GetPosition(), parentFrame.GetSize())
686
+ else:
687
+ self.SetPreviewSize()
688
+
689
+ self.printData = wx.PrintData()
690
+ self.scale = 1.0
691
+
692
+ self.SetParms()
693
+ self.SetColors()
694
+ self.SetFonts()
695
+ self.TextSpacing()
696
+
697
+ self.SetPrinterOffset()
698
+ self.SetHeaderValue()
699
+ self.SetFooterValue()
700
+ self.SetMargins()
701
+ self.SetPortrait()
702
+
703
+ def SetPreviewSize(self, position = wx.Point(0, 0), size="Full"):
704
+ if size == "Full":
705
+ r = wx.GetClientDisplayRect()
706
+ self.preview_frame_size = r.GetSize()
707
+ self.preview_frame_pos = r.GetPosition()
708
+ else:
709
+ self.preview_frame_size = size
710
+ self.preview_frame_pos = position
711
+
712
+ def SetPaperId(self, paper):
713
+ self.printData.SetPaperId(paper)
714
+
715
+ def SetOrientation(self, orient):
716
+ self.printData.SetOrientation(orient)
717
+
718
+ def SetColors(self):
719
+ self.row_def_line_colour = wx.BLACK
720
+ self.row_def_line_size = 1
721
+
722
+ self.column_def_line_colour = wx.BLACK
723
+ self.column_def_line_size = 1
724
+ self.column_colour = wx.WHITE
725
+
726
+ self.label_colour = wx.LIGHT_GREY
727
+
728
+ def SetFonts(self):
729
+ self.label_font = { "Name": self.default_font_name, "Size": 12, "Colour": [0, 0, 0], "Attr": [0, 0, 0] }
730
+ self.text_font = { "Name": self.default_font_name, "Size": 10, "Colour": [0, 0, 0], "Attr": [0, 0, 0] }
731
+
732
+ def TextSpacing(self):
733
+ self.label_pt_adj_before = 0 # point adjustment before and after the label text
734
+ self.label_pt_adj_after = 0
735
+
736
+ self.text_pt_adj_before = 0 # point adjustment before and after the row text
737
+ self.text_pt_adj_after = 0
738
+
739
+ def SetLabelSpacing(self, before, after): # method to set the label space adjustment
740
+ self.label_pt_adj_before = before
741
+ self.label_pt_adj_after = after
742
+
743
+ def SetRowSpacing(self, before, after): # method to set the row space adjustment
744
+ self.text_pt_adj_before = before
745
+ self.text_pt_adj_after = after
746
+
747
+ def SetPrinterOffset(self): # offset to adjust for printer
748
+ self.vertical_offset = -0.1
749
+ self.horizontal_offset = -0.1
750
+
751
+ def SetHeaderValue(self):
752
+ self.header_margin = 0.25
753
+ self.header_font = { "Name": self.default_font_name, "Size": 11, "Colour": [0, 0, 0], "Attr": [0, 0, 0] }
754
+ self.header_align = wx.ALIGN_CENTRE
755
+ self.header_indent = 0
756
+ self.header_type = "Text"
757
+
758
+ def SetFooterValue(self):
759
+ self.footer_margin = 0.7
760
+ self.footer_font = { "Name": self.default_font_name, "Size": 11, "Colour": [0, 0, 0], "Attr": [0, 0, 0] }
761
+ self.footer_align = wx.ALIGN_CENTRE
762
+ self.footer_indent = 0
763
+ self.footer_type = "Pageof"
764
+
765
+ def SetMargins(self):
766
+ self.left_margin = 0.5
767
+ self.right_margin = 0.5 # only used if no column sizes
768
+
769
+ self.top_margin = 0.8
770
+ self.bottom_margin = 1.0
771
+ self.cell_left_margin = 0.1
772
+ self.cell_right_margin = 0.1
773
+
774
+ def SetPortrait(self):
775
+ self.printData.SetPaperId(wx.PAPER_LETTER)
776
+ self.printData.SetOrientation(wx.PORTRAIT)
777
+ self.page_width = 8.5
778
+ self.page_height = 11.0
779
+
780
+ def SetLandscape(self):
781
+ self.printData.SetOrientation(wx.LANDSCAPE)
782
+ self.page_width = 11.0
783
+ self.page_height = 8.5
784
+
785
+ def SetParms(self):
786
+ self.ymax = 1
787
+ self.xmax = 1
788
+ self.page = 1
789
+ self.total_pg = 100
790
+
791
+ self.preview = None
792
+ self.page = 0
793
+
794
+ self.default_font_name = "Arial"
795
+ self.default_font = { "Name": self.default_font_name, "Size": 10, "Colour": [0, 0, 0], "Attr": [0, 0, 0] }
796
+
797
+ def SetColAlignment(self, col, align=wx.ALIGN_LEFT):
798
+ self.set_column_align[col] = align
799
+
800
+ def SetColBackgroundColour(self, col, colour):
801
+ self.set_column_bgcolour[col] = colour
802
+
803
+ def SetColTextColour(self, col, colour):
804
+ self.set_column_txtcolour[col] = colour
805
+
806
+ def SetCellColour(self, row, col, colour): # cell background colour
807
+ try:
808
+ set = self.set_cell_colour[row] # test if row already exists
809
+ try:
810
+ set[col] = colour # test if column already exists
811
+ except:
812
+ set = { col: colour } # create the column value
813
+ except:
814
+ set = { col: colour } # create the column value
815
+
816
+ self.set_cell_colour[row] = set # create dictionary item for colour settings
817
+
818
+ def SetCellText(self, row, col, colour): # font colour for custom cells
819
+ try:
820
+ set = self.set_cell_text[row] # test if row already exists
821
+ try:
822
+ set[col] = colour # test if column already exists
823
+ except:
824
+ set = { col: colour } # create the column value
825
+ except:
826
+ set = { col: colour } # create the column value
827
+
828
+ self.set_cell_text[row] = set # create dictionary item for colour settings
829
+
830
+ def SetColumnLineSize(self, col, size): # column line size
831
+ self.column_line_size[col] = size # create dictionary item for column line settings
832
+
833
+ def SetColumnLineColour(self, col, colour):
834
+ self.column_line_colour[col] = colour
835
+
836
+ def SetRowLineSize(self, row, size):
837
+ self.row_line_size[row] = size
838
+
839
+ def SetRowLineColour(self, row, colour):
840
+ self.row_line_colour[row] = colour
841
+
842
+ def GetColour(self, colour): # returns colours based from wxColour value
843
+ red = colour.Red()
844
+ blue = colour.Blue()
845
+ green = colour.Green()
846
+ return [red, green, blue ]
847
+
848
+ def SetHeader(self, text = "", type = "Text", font=None, align = None, indent = None, colour = None, size = None):
849
+ set = { "Text": text }
850
+
851
+ if font is None:
852
+ set["Font"] = copy.copy(self.default_font)
853
+ else:
854
+ set["Font"] = font
855
+
856
+ if colour is not None:
857
+ setfont = set["Font"]
858
+ setfont["Colour"] = self.GetColour(colour)
859
+
860
+ if size is not None:
861
+ setfont = set["Font"]
862
+ setfont["Size"] = size
863
+
864
+ if align is None:
865
+ set["Align"] = self.header_align
866
+ else:
867
+ set["Align"] = align
868
+
869
+ if indent is None:
870
+ set["Indent"] = self.header_indent
871
+ else:
872
+ set["Indent"] = indent
873
+
874
+ if type is None:
875
+ set["Type"] = self.header_type
876
+ else:
877
+ set["Type"] = type
878
+
879
+ self.header.append(set)
880
+
881
+ def SetFooter(self, text = "", type = None, font=None, align = None, indent = None, colour = None, size = None):
882
+ set = { "Text": text }
883
+
884
+ if font is None:
885
+ set["Font"] = copy.copy(self.default_font)
886
+ else:
887
+ set["Font"] = font
888
+
889
+ if colour is not None:
890
+ setfont = set["Font"]
891
+ setfont["Colour"] = self.GetColour(colour)
892
+
893
+ if size is not None:
894
+ setfont = set["Font"]
895
+ setfont["Size"] = size
896
+
897
+ if align is None:
898
+ set["Align"] = self.footer_align
899
+ else:
900
+ set["Align"] = align
901
+
902
+ if indent is None:
903
+ set["Indent"] = self.footer_indent
904
+ else:
905
+ set["Indent"] = indent
906
+
907
+ if type is None:
908
+ set["Type"] = self.footer_type
909
+ else:
910
+ set["Type"] = type
911
+
912
+ self.footer.append(set)
913
+
914
+ def Preview(self):
915
+ data = wx.PrintDialogData(self.printData)
916
+ printout = SetPrintout(self)
917
+ printout2 = SetPrintout(self)
918
+ self.preview = wx.PrintPreview(printout, printout2, data)
919
+ if not self.preview.IsOk():
920
+ wx.MessageBox("There was a problem printing!", "Printing", wx.OK)
921
+ return
922
+
923
+ self.preview.SetZoom(60) # initial zoom value
924
+ frame = wx.PreviewFrame(self.preview, self.parentFrame, "Print preview")
925
+
926
+ frame.Initialize()
927
+ if self.parentFrame:
928
+ frame.SetPosition(self.preview_frame_pos)
929
+ frame.SetSize(self.preview_frame_size)
930
+ frame.Show(True)
931
+
932
+ def Print(self):
933
+ pdd = wx.PrintDialogData(self.printData)
934
+ printer = wx.Printer(pdd)
935
+ printout = SetPrintout(self)
936
+ if not printer.Print(self.parentFrame, printout):
937
+ if wx.Printer.GetLastError() == wx.PRINTER_ERROR:
938
+ wx.MessageBox("There was a problem printing.\n"
939
+ "Perhaps your current printer is not set correctly?",
940
+ "Printing", wx.OK)
941
+ else:
942
+ self.printData = wx.PrintData( printer.GetPrintDialogData().GetPrintData() )
943
+ printout.Destroy()
944
+
945
+ def DoDrawing(self, DC):
946
+ size = DC.GetSize()
947
+
948
+ table = PrintTableDraw(self, DC, size)
949
+ table.data = self.data
950
+ table.set_column = self.set_column
951
+ table.label = self.label
952
+ table.SetPage(self.page)
953
+
954
+ if self.preview is None:
955
+ table.SetPSize(size[0]/self.page_width, size[1]/self.page_height)
956
+ table.SetPTSize(size[0], size[1])
957
+ table.SetPreview(False)
958
+ else:
959
+ if self.preview == 1:
960
+ table.scale = self.scale
961
+ table.SetPSize(size[0]/self.page_width, size[1]/self.page_height)
962
+ else:
963
+ table.SetPSize(self.pwidth, self.pheight)
964
+
965
+ table.SetPTSize(self.ptwidth, self.ptheight)
966
+ table.SetPreview(self.preview)
967
+
968
+ table.OutCanvas()
969
+ self.page_total = table.total_pages # total display pages
970
+
971
+ self.ymax = DC.MaxY()
972
+ self.xmax = DC.MaxX()
973
+
974
+ self.sizeh = size[0]
975
+ self.sizew = size[1]
976
+
977
+ def GetTotalPages(self):
978
+ self.page_total = 100
979
+ return self.page_total
980
+
981
+ def HasPage(self, page):
982
+ if page <= self.page_total:
983
+ return True
984
+ else:
985
+ return False
986
+
987
+ def SetPage(self, page):
988
+ self.page = page
989
+
990
+ def SetPageSize(self, width, height):
991
+ self.pwidth, self.pheight = width, height
992
+
993
+ def SetTotalSize(self, width, height):
994
+ self.ptwidth, self.ptheight = width, height
995
+
996
+ def SetPreview(self, preview, scale):
997
+ self.preview = preview
998
+ self.scale = scale
999
+
1000
+ def SetTotalSize(self, width, height):
1001
+ self.ptwidth = width
1002
+ self.ptheight = height
1003
+
1004
+ class PrintGrid(object):
1005
+ def __init__(self, parent, grid, format = [], total_col = None, total_row = None):
1006
+ if total_row is None:
1007
+ total_row = grid.GetNumberRows()
1008
+ if total_col is None:
1009
+ total_col = grid.GetNumberCols()
1010
+
1011
+ self.total_row = total_row
1012
+ self.total_col = total_col
1013
+ self.grid = grid
1014
+
1015
+ data = []
1016
+ for row in range(total_row):
1017
+ row_val = []
1018
+ value = grid.GetRowLabelValue(row)
1019
+ row_val.append(value)
1020
+
1021
+ for col in range(total_col):
1022
+ value = grid.GetCellValue(row, col)
1023
+ row_val.append(value)
1024
+ data.append(row_val)
1025
+
1026
+ label = [""]
1027
+ for col in range(total_col):
1028
+ value = grid.GetColLabelValue(col)
1029
+ label.append(value)
1030
+
1031
+ self.table = PrintTable(parent)
1032
+ self.table.cell_left_margin = 0.0
1033
+ self.table.cell_right_margin = 0.0
1034
+
1035
+ self.table.label = label
1036
+ self.table.set_column = format
1037
+ self.table.data = data
1038
+
1039
+ def GetTable(self):
1040
+ return self.table
1041
+
1042
+ def SetAttributes(self):
1043
+ for row in range(self.total_row):
1044
+ for col in range(self.total_col):
1045
+ colour = self.grid.GetCellTextColour(row, col-1)
1046
+ self.table.SetCellText(row, col, colour)
1047
+
1048
+ colour = self.grid.GetCellBackgroundColour(row, col-1)
1049
+ self.table.SetCellColour(row, col, colour)
1050
+
1051
+ def Preview(self):
1052
+ self.table.Preview()
1053
+
1054
+ def Print(self):
1055
+ self.table.Print()
1056
+
1057
+
1058
+ class SetPrintout(wx.Printout):
1059
+ def __init__(self, canvas):
1060
+ wx.Printout.__init__(self)
1061
+ self.canvas = canvas
1062
+ self.end_pg = 1000
1063
+
1064
+ def OnBeginDocument(self, start, end):
1065
+ return super(SetPrintout, self).OnBeginDocument(start, end)
1066
+
1067
+ def OnEndDocument(self):
1068
+ super(SetPrintout, self).OnEndDocument()
1069
+
1070
+ def HasPage(self, page):
1071
+ try:
1072
+ end = self.canvas.HasPage(page)
1073
+ return end
1074
+ except:
1075
+ return True
1076
+
1077
+ def GetPageInfo(self):
1078
+ try:
1079
+ self.end_pg = self.canvas.GetTotalPages()
1080
+ except:
1081
+ pass
1082
+
1083
+ end_pg = self.end_pg
1084
+ str_pg = 1
1085
+ return (str_pg, end_pg, str_pg, end_pg)
1086
+
1087
+ def OnPreparePrinting(self):
1088
+ super(SetPrintout, self).OnPreparePrinting()
1089
+
1090
+ def OnBeginPrinting(self):
1091
+ dc = self.GetDC()
1092
+
1093
+ self.preview = self.IsPreview()
1094
+ if (self.preview):
1095
+ self.pixelsPerInch = self.GetPPIScreen()
1096
+ else:
1097
+ self.pixelsPerInch = self.GetPPIPrinter()
1098
+
1099
+ (w, h) = dc.GetSize()
1100
+ scaleX = float(w) / 1000
1101
+ scaleY = float(h) / 1000
1102
+ self.printUserScale = min(scaleX, scaleY)
1103
+
1104
+ super(SetPrintout, self).OnBeginPrinting()
1105
+
1106
+ def GetSize(self):
1107
+ self.psizew, self.psizeh = self.GetPPIPrinter()
1108
+ return self.psizew, self.psizeh
1109
+
1110
+ def GetTotalSize(self):
1111
+ self.ptsizew, self.ptsizeh = self.GetPageSizePixels()
1112
+ return self.ptsizew, self.ptsizeh
1113
+
1114
+ def OnPrintPage(self, page):
1115
+ dc = self.GetDC()
1116
+ (w, h) = dc.GetSize()
1117
+ scaleX = float(w) / 1000
1118
+ scaleY = float(h) / 1000
1119
+ self.printUserScale = min(scaleX, scaleY)
1120
+ dc.SetUserScale(self.printUserScale, self.printUserScale)
1121
+
1122
+ self.preview = self.IsPreview()
1123
+
1124
+ self.canvas.SetPreview(self.preview, self.printUserScale)
1125
+ self.canvas.SetPage(page)
1126
+
1127
+ self.ptsizew, self.ptsizeh = self.GetPageSizePixels()
1128
+ self.canvas.SetTotalSize(self.ptsizew, self.ptsizeh)
1129
+
1130
+ self.psizew, self.psizeh = self.GetPPIPrinter()
1131
+ self.canvas.SetPageSize(self.psizew, self.psizeh)
1132
+
1133
+ self.canvas.DoDrawing(dc)
1134
+ return True
1135
+
1136
+ if __name__ == '__main__':
1137
+ app = wx.App()
1138
+ frame = wx.Frame(None, -1, "Dummy wx frame for testing printout.py")
1139
+ frame.Show(True)
1140
+ ptbl = PrintTable(frame)
1141
+ ptbl.SetHeader('This is the test HEADER')
1142
+ # a single sequence will print out as a single column with no borders ...
1143
+ ptbl.data = (
1144
+ 'This is the first line of text.',
1145
+ 'This is the second line\nand the third. The fourth will be the number "4.0".',
1146
+ 04.00,
1147
+ 'This is the fifth line, but by design it is too long to fit in the width of a standard'\
1148
+ ' page, so it will be forced to wrap around in order to fit without having '\
1149
+ 'some of its verbose verbage truncated.',
1150
+ 'Here we have the final line.'
1151
+ )
1152
+ #... but, if labels or columns are defined, a single sequence will print out as a single row
1153
+ ##ptbl.label = ('One','Two','Three','Four','5')
1154
+ ptbl.Preview()
1155
+ app.MainLoop()