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,1443 @@
1
+ # --------------------------------------------------------------------------------- #
2
+ # SUPERTOOLTIP wxPython IMPLEMENTATION
3
+ #
4
+ # Andrea Gavana, @ 07 October 2008
5
+ # Latest Revision: 04 Feb 2013, 21.00 GMT
6
+ #
7
+ #
8
+ # TODO List
9
+ #
10
+ # 1) Maybe add some more customization like multiline text
11
+ # in the header and footer;
12
+ # 2) Check whether it's possible to use rounded corners and
13
+ # shadows on the Mac
14
+ # 3) Split OnPaint() into smaller pieces to improve readability and
15
+ # ability to redefine behaviour in subclasses
16
+ # 4) Extend text formatting capabilities
17
+ # 5) Make better use of links (right now it's difficult to click them without hiding tooltip)
18
+ #
19
+ # For all kind of problems, requests of enhancements and bug reports, please
20
+ # write to me at:
21
+ #
22
+ # andrea.gavana@gmail.com
23
+ # andrea.gavana@maerskoil.com
24
+ #
25
+ # Or, obviously, to the wxPython mailing list!!!
26
+ #
27
+ # Tags: phoenix-port, documented, unittest, py3-port
28
+ #
29
+ # End Of Comments
30
+ # --------------------------------------------------------------------------------- #
31
+
32
+ """
33
+ :class:`~wx.lib.agw.supertooltip.SuperToolTip` is a class that mimics the behaviour of :class:`TipWindow` and generic tooltip
34
+ windows, although it is a custom-drawn widget.
35
+
36
+
37
+ Description
38
+ ===========
39
+
40
+ :class:`SuperToolTip` is a class that mimics the behaviour of :class:`TipWindow` and generic tooltip
41
+ windows, although it is a custom-drawn widget.
42
+
43
+ This class supports:
44
+
45
+ * Blended triple-gradient for the tooltip background;
46
+ * Header text and header image, with possibility to set the header font independently;
47
+ * Footer text and footer image, with possibility to set the footer font independently;
48
+ * Multiline text message in the tooltip body, plus an optional image as "body image";
49
+ * Bold lines and hyperlink lines in the tooltip body;
50
+ * A wide set of predefined drawing styles for the tooltip background;
51
+ * Drawing of separator lines after the header and/or before the footer;
52
+ * Rounded corners and shadows below the tooltip window (Windows XP only);
53
+ * Fade in/fade out effects (Windows XP only);
54
+ * User-settable delays for the delay after which the tooltip appears and the delay
55
+ after which the tooltip is destroyed.
56
+
57
+ And a lot more. Check the demo for an almost complete review of the functionalities.
58
+
59
+
60
+ Usage
61
+ =====
62
+
63
+ Usage example::
64
+
65
+ import wx
66
+ import wx.lib.agw.supertooltip as STT
67
+
68
+ class MyFrame(wx.Frame):
69
+
70
+ def __init__(self, parent):
71
+
72
+ wx.Frame.__init__(self, parent, -1, "SuperToolTip Demo")
73
+
74
+ panel = wx.Panel(self)
75
+ button = wx.Button(panel, -1, "I am the SuperToolTip target", pos=(100, 50))
76
+
77
+ tip = STT.SuperToolTip("A nice tooltip message")
78
+
79
+ tip.SetHeader("Hello World")
80
+ tip.SetTarget(button)
81
+ tip.SetDrawHeaderLine(True)
82
+
83
+ tip.ApplyStyle("Office 2007 Blue")
84
+
85
+ tip.SetDropShadow(True)
86
+
87
+
88
+ # our normal wxApp-derived class, as usual
89
+
90
+ app = wx.App(0)
91
+
92
+ frame = MyFrame(None)
93
+ app.SetTopWindow(frame)
94
+ frame.Show()
95
+
96
+ app.MainLoop()
97
+
98
+
99
+
100
+ Supported Platforms
101
+ ===================
102
+
103
+ :class:`SuperToolTip` has been tested on the following platforms:
104
+ * Windows (Windows XP).
105
+
106
+
107
+ Window Styles
108
+ =============
109
+
110
+ `No particular window styles are available for this class.`
111
+
112
+
113
+ Events Processing
114
+ =================
115
+
116
+ `No custom events are available for this class.`
117
+
118
+
119
+ License And Version
120
+ ===================
121
+
122
+ :class:`SuperToolTip` is distributed under the wxPython license.
123
+
124
+ Latest Revision: Andrea Gavana @ 04 Feb 2013, 21.00 GMT
125
+
126
+ Version 0.5
127
+
128
+ """
129
+
130
+ # Version Info
131
+ __version__ = "0.5"
132
+
133
+ import wx
134
+ import webbrowser
135
+
136
+ # Let's see if we can add few nice shadows to our tooltips (Windows only)
137
+ _libimported = None
138
+
139
+ if wx.Platform == "__WXMSW__":
140
+ osVersion = wx.GetOsVersion()
141
+ # Shadows behind menus are supported only in XP
142
+ if osVersion[1] > 5 or (osVersion[1] == 5 and osVersion[2] >= 1):
143
+ try:
144
+ # Try Mark Hammond's win32all extensions
145
+ import win32api
146
+ import win32con
147
+ import win32gui
148
+ import winxpgui
149
+ _libimported = "MH"
150
+ except ImportError:
151
+ _libimported = None
152
+ else:
153
+ _libimported = None
154
+
155
+
156
+ # Define a bunch of predefined colour schemes...
157
+
158
+ _colourSchemes = {
159
+ "Beige": (wx.WHITE, wx.Colour(242, 242, 223), wx.Colour(198, 195, 160), wx.BLACK),
160
+ "Blue": (wx.WHITE, wx.Colour(202, 220, 246), wx.Colour(150, 180, 222), wx.BLACK),
161
+ "Blue 2": (wx.WHITE, wx.Colour(228, 236, 248), wx.Colour(198, 214, 235), wx.BLACK),
162
+ "Blue 3": (wx.WHITE, wx.Colour(213, 233, 243), wx.Colour(151, 195, 216), wx.BLACK),
163
+ "Blue 4": (wx.WHITE, wx.Colour(227, 235, 255), wx.Colour(102, 153, 255), wx.BLACK),
164
+ "Blue Glass": (wx.Colour(182, 226, 253), wx.Colour(137, 185, 232), wx.Colour(188, 244, 253), wx.BLACK),
165
+ "Blue Glass 2": (wx.Colour(192, 236, 255), wx.Colour(147, 195, 242), wx.Colour(198, 254, 255), wx.BLACK),
166
+ "Blue Glass 3": (wx.Colour(212, 255, 255), wx.Colour(167, 215, 255), wx.Colour(218, 255, 255), wx.BLACK),
167
+ "Blue Inverted": (wx.Colour(117, 160, 222), wx.Colour(167, 210, 240), wx.Colour(233, 243, 255), wx.BLACK),
168
+ "Blue Shift": (wx.Colour(124, 178, 190), wx.Colour(13, 122, 153), wx.Colour(0, 89, 116), wx.WHITE),
169
+ "CodeProject": (wx.Colour(255, 250, 172), wx.Colour(255, 207, 157), wx.Colour(255, 153, 0), wx.BLACK),
170
+ "Dark Gray": (wx.Colour(195, 195, 195), wx.Colour(168, 168, 168), wx.Colour(134, 134, 134), wx.WHITE),
171
+ "Deep Purple": (wx.Colour(131, 128, 164), wx.Colour(112, 110, 143), wx.Colour(90, 88, 117), wx.WHITE),
172
+ "Electric Blue": (wx.Colour(224, 233, 255), wx.Colour(135, 146, 251), wx.Colour(99, 109, 233), wx.BLACK),
173
+ "Firefox": (wx.Colour(255, 254, 207), wx.Colour(254, 248, 125), wx.Colour(225, 119, 24), wx.BLACK),
174
+ "Gold": (wx.Colour(255, 202, 0), wx.Colour(255, 202, 0), wx.Colour(255, 202, 0), wx.BLACK),
175
+ "Gold Shift": (wx.Colour(178, 170, 107), wx.Colour(202, 180, 32), wx.Colour(162, 139, 1), wx.WHITE),
176
+ "Gray": (wx.WHITE, wx.Colour(228, 228, 228), wx.Colour(194, 194, 194), wx.BLACK),
177
+ "Green": (wx.Colour(234, 241, 223), wx.Colour(211, 224, 180), wx.Colour(182, 200, 150), wx.BLACK),
178
+ "Green Shift": (wx.Colour(129, 184, 129), wx.Colour(13, 185, 15), wx.Colour(1, 125, 1), wx.WHITE),
179
+ "Light Green": (wx.Colour(174, 251, 171), wx.Colour(145, 221, 146), wx.Colour(90, 176, 89), wx.BLACK),
180
+ "NASA Blue": (wx.Colour(0, 91, 134), wx.Colour(0, 100, 150), wx.Colour(0, 105, 160), wx.WHITE),
181
+ "Office 2007 Blue": (wx.WHITE, wx.Colour(242, 246, 251), wx.Colour(202, 218, 239), wx.Colour(76, 76, 76)),
182
+ "Orange Shift": (wx.Colour(179, 120, 80), wx.Colour(183, 92, 19), wx.Colour(157, 73, 1), wx.WHITE),
183
+ "Outlook Green": (wx.Colour(236, 242, 208), wx.Colour(219, 230, 187), wx.Colour(195, 210, 155), wx.BLACK),
184
+ "Pale Green": (wx.Colour(249, 255, 248), wx.Colour(206, 246, 209), wx.Colour(148, 225, 155), wx.BLACK),
185
+ "Pink Blush": (wx.Colour(255, 254, 255), wx.Colour(255, 231, 242), wx.Colour(255, 213, 233), wx.BLACK),
186
+ "Pink Shift": (wx.Colour(202, 135, 188), wx.Colour(186, 8, 158), wx.Colour(146, 2, 116), wx.WHITE),
187
+ "Pretty Pink": (wx.Colour(255, 240, 249), wx.Colour(253, 205, 217), wx.Colour(255, 150, 177), wx.BLACK),
188
+ "Red": (wx.Colour(255, 183, 176), wx.Colour(253, 157, 143), wx.Colour(206, 88, 78), wx.BLACK),
189
+ "Red Shift": (wx.Colour(186, 102, 102), wx.Colour(229, 23, 9), wx.Colour(182, 11, 1), wx.WHITE),
190
+ "Silver": (wx.WHITE, wx.Colour(242, 242, 246), wx.Colour(212, 212, 224), wx.BLACK),
191
+ "Silver 2": (wx.WHITE, wx.Colour(242, 242, 248), wx.Colour(222, 222, 228), wx.BLACK),
192
+ "Silver Glass": (wx.Colour(158, 158, 158), wx.WHITE, wx.Colour(105, 105, 105), wx.BLACK),
193
+ "Silver Inverted": (wx.Colour(161, 160, 186), wx.Colour(199, 201, 213), wx.WHITE, wx.BLACK),
194
+ "Silver Inverted 2": (wx.Colour(181, 180, 206), wx.Colour(219, 221, 233), wx.WHITE, wx.BLACK),
195
+ "Soylent Green": (wx.Colour(134, 211, 131), wx.Colour(105, 181, 106), wx.Colour(50, 136, 49), wx.WHITE),
196
+ "Spring Green": (wx.Colour(154, 231, 151), wx.Colour(125, 201, 126), wx.Colour(70, 156, 69), wx.WHITE),
197
+ "Too Blue": (wx.WHITE, wx.Colour(225, 235, 244), wx.Colour(188, 209, 226), wx.BLACK),
198
+ "Totally Green": (wx.Colour(190, 230, 160), wx.Colour(190, 230, 160), wx.Colour(190, 230, 160), wx.BLACK),
199
+ "XP Blue": (wx.Colour(119, 185, 236), wx.Colour(81, 144, 223), wx.Colour(36, 76, 171), wx.WHITE),
200
+ "Yellow": (wx.Colour(255, 255, 220), wx.Colour(255, 231, 161), wx.Colour(254, 218, 108), wx.BLACK)
201
+ }
202
+
203
+
204
+ def GetStyleKeys():
205
+ """ Returns the predefined styles keywords. """
206
+
207
+ schemes = sorted(_colourSchemes)
208
+ return schemes
209
+
210
+
211
+ def MakeBold(font):
212
+ """
213
+ Makes a font bold. Utility method.
214
+
215
+ :param `font`: the font to be made bold.
216
+ """
217
+
218
+ newFont = wx.Font(font.GetPointSize(), font.GetFamily(), font.GetStyle(),
219
+ wx.FONTWEIGHT_BOLD, font.GetUnderlined(), font.GetFaceName())
220
+
221
+ return newFont
222
+
223
+
224
+ def ExtractLink(line):
225
+ """
226
+ Extract the link from an hyperlink line.
227
+
228
+ :param `line`: the line of text to be processed.
229
+ """
230
+
231
+ line = line[4:]
232
+ indxStart = line.find("{")
233
+ indxEnd = line.find("}")
234
+ hl = line[indxStart+1:indxEnd].strip()
235
+ line = line[0:indxStart].strip()
236
+
237
+ return line, hl
238
+
239
+
240
+ class ToolTipWindowBase(object):
241
+ """ Base class for the different Windows and Mac implementation. """
242
+
243
+ def __init__(self, parent, classParent):
244
+ """
245
+ Default class constructor.
246
+
247
+ :param `parent`: the :class:`SuperToolTip` parent widget;
248
+ :param `classParent`: the :class:`SuperToolTip` class object.
249
+ """
250
+
251
+ self._spacing = 6
252
+ self._wasOnLink = False
253
+ self._hyperlinkRect, self._hyperlinkWeb = [], []
254
+
255
+ self._classParent = classParent
256
+ self._alphaTimer = wx.Timer(self, wx.ID_ANY)
257
+
258
+ # Bind the events
259
+ self.Bind(wx.EVT_PAINT, self.OnPaint)
260
+ self.Bind(wx.EVT_SIZE, self.OnSize)
261
+ self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
262
+ self.Bind(wx.EVT_MOTION, self.OnMouseMotion)
263
+ self.Bind(wx.EVT_TIMER, self.AlphaCycle)
264
+ parent.Bind(wx.EVT_KILL_FOCUS, self.OnDestroy)
265
+ self.Bind(wx.EVT_LEFT_DOWN, self.OnDestroy)
266
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnDestroy)
267
+
268
+
269
+ def OnPaint(self, event):
270
+ """
271
+ Handles the ``wx.EVT_PAINT`` event for :class:`SuperToolTip`.
272
+
273
+ If the `event` parameter is ``None``, calculates best size and returns it.
274
+
275
+ :param `event`: a :class:`PaintEvent` event to be processed or ``None``.
276
+ """
277
+
278
+ maxWidth = 0
279
+ if event is None:
280
+ dc = wx.ClientDC(self)
281
+ else:
282
+ # Go with double buffering...
283
+ dc = wx.BufferedPaintDC(self)
284
+
285
+ frameRect = self.GetClientRect()
286
+ x, y, width, _height = frameRect
287
+ # Store the rects for the hyperlink lines
288
+ self._hyperlinkRect, self._hyperlinkWeb = [], []
289
+ classParent = self._classParent
290
+
291
+ # Retrieve the colours for the blended triple-gradient background
292
+ topColour, middleColour, bottomColour = classParent.GetTopGradientColour(), \
293
+ classParent.GetMiddleGradientColour(), \
294
+ classParent.GetBottomGradientColour()
295
+
296
+ # Get the user options for header, bitmaps etc...
297
+ drawHeader, drawFooter = classParent.GetDrawHeaderLine(), classParent.GetDrawFooterLine()
298
+ topRect = wx.Rect(frameRect.x, frameRect.y, frameRect.width, frameRect.height//2)
299
+ bottomRect = wx.Rect(frameRect.x, frameRect.y+frameRect.height//2, frameRect.width, frameRect.height//2+1)
300
+ # Fill the triple-gradient
301
+ dc.GradientFillLinear(topRect, topColour, middleColour, wx.SOUTH)
302
+ dc.GradientFillLinear(bottomRect, middleColour, bottomColour, wx.SOUTH)
303
+
304
+ header, headerBmp = classParent.GetHeader(), classParent.GetHeaderBitmap()
305
+ headerFont, messageFont, footerFont, hyperlinkFont = classParent.GetHeaderFont(), classParent.GetMessageFont(), \
306
+ classParent.GetFooterFont(), classParent.GetHyperlinkFont()
307
+
308
+ yPos = 0
309
+ bmpXPos = 0
310
+ bmpHeight = textHeight = bmpWidth = 0
311
+
312
+ if headerBmp and headerBmp.IsOk():
313
+ # We got the header bitmap
314
+ bmpHeight, bmpWidth = headerBmp.GetHeight(), headerBmp.GetWidth()
315
+ bmpXPos = self._spacing
316
+
317
+ if header:
318
+ # We got the header text
319
+ dc.SetFont(headerFont)
320
+ textWidth, textHeight = dc.GetTextExtent(header)
321
+ maxWidth = max(bmpWidth+(textWidth+self._spacing*3), maxWidth)
322
+ # Calculate the header height
323
+ height = max(textHeight, bmpHeight)
324
+ normalText = classParent.GetTextColour()
325
+ if header:
326
+ dc.SetTextForeground(normalText)
327
+ dc.DrawText(header, bmpXPos+bmpWidth+self._spacing, (height-textHeight+self._spacing)//2)
328
+ if headerBmp and headerBmp.IsOk():
329
+ dc.DrawBitmap(headerBmp, bmpXPos, (height-bmpHeight+self._spacing)//2, True)
330
+
331
+ if header or (headerBmp and headerBmp.IsOk()):
332
+ yPos += height
333
+ if drawHeader:
334
+ # Draw the separator line after the header
335
+ dc.SetPen(wx.GREY_PEN)
336
+ dc.DrawLine(self._spacing, yPos+self._spacing, width-self._spacing, yPos+self._spacing)
337
+ yPos += self._spacing
338
+
339
+ maxWidth = max(bmpXPos + bmpWidth + self._spacing, maxWidth)
340
+ # Get the big body image (if any)
341
+ embeddedImage = classParent.GetBodyImage()
342
+ bmpWidth = bmpHeight = -1
343
+ if embeddedImage and embeddedImage.IsOk():
344
+ bmpWidth, bmpHeight = embeddedImage.GetWidth(), embeddedImage.GetHeight()
345
+
346
+ # A bunch of calculations to draw the main body message
347
+ messageHeight = 0
348
+ lines = classParent.GetMessage().split("\n")
349
+ yText = yPos
350
+ embImgPos = yPos
351
+ hyperLinkText = wx.BLUE
352
+ messagePos = self._getTextExtent(dc, lines[0] if lines else "")[1] // 2 + self._spacing
353
+ for line in lines:
354
+ # Loop over all the lines in the message
355
+ if line.startswith("<hr>"): # draw a line
356
+ yText += self._spacing * 2
357
+ dc.DrawLine(self._spacing, yText+self._spacing, width-self._spacing, yText+self._spacing)
358
+ else:
359
+ isLink = False
360
+ dc.SetTextForeground(normalText)
361
+ if line.startswith("</b>"): # is a bold line
362
+ line = line[4:]
363
+ font = MakeBold(messageFont)
364
+ dc.SetFont(font)
365
+ elif line.startswith("</l>"): # is a link
366
+ dc.SetFont(hyperlinkFont)
367
+ isLink = True
368
+ line, hl = ExtractLink(line)
369
+ dc.SetTextForeground(hyperLinkText)
370
+ else:
371
+ # Is a normal line
372
+ dc.SetFont(messageFont)
373
+
374
+ textWidth, textHeight = self._getTextExtent(dc, line)
375
+
376
+ messageHeight += textHeight
377
+
378
+ xText = (bmpWidth + 2 * self._spacing) if bmpWidth > 0 else self._spacing
379
+ yText += textHeight//2+self._spacing
380
+ maxWidth = max(xText + textWidth + self._spacing, maxWidth)
381
+ dc.DrawText(line, xText, yText)
382
+ if isLink:
383
+ self._storeHyperLinkInfo(xText, yText, textWidth, textHeight, hl)
384
+
385
+ toAdd = 0
386
+ if bmpHeight > messageHeight:
387
+ yPos += 2*self._spacing + bmpHeight
388
+ toAdd = self._spacing
389
+ else:
390
+ yPos += messageHeight + 2*self._spacing
391
+
392
+ yText = max(messageHeight, bmpHeight+2*self._spacing)
393
+ if embeddedImage and embeddedImage.IsOk():
394
+ # Draw the main body image
395
+ dc.DrawBitmap(embeddedImage, self._spacing, embImgPos + (self._spacing * 2), True)
396
+
397
+ footer, footerBmp = classParent.GetFooter(), classParent.GetFooterBitmap()
398
+ bmpHeight = bmpWidth = textHeight = textWidth = 0
399
+ bmpXPos = 0
400
+
401
+ if footerBmp and footerBmp.IsOk():
402
+ # Got the footer bitmap
403
+ bmpHeight, bmpWidth = footerBmp.GetHeight(), footerBmp.GetWidth()
404
+ bmpXPos = self._spacing
405
+
406
+ if footer:
407
+ # Got the footer text
408
+ dc.SetFont(footerFont)
409
+ textWidth, textHeight = dc.GetTextExtent(footer)
410
+
411
+ if textHeight or bmpHeight:
412
+ if drawFooter:
413
+ # Draw the separator line before the footer
414
+ dc.SetPen(wx.GREY_PEN)
415
+ dc.DrawLine(self._spacing, yPos-self._spacing//2+toAdd,
416
+ width-self._spacing, yPos-self._spacing//2+toAdd)
417
+ # Draw the footer and footer bitmap (if any)
418
+ dc.SetTextForeground(normalText)
419
+ height = max(textHeight, bmpHeight)
420
+ yPos += toAdd
421
+ if footer:
422
+ toAdd = (height - textHeight + self._spacing) // 2
423
+ dc.DrawText(footer, bmpXPos + bmpWidth + self._spacing, yPos + toAdd)
424
+ maxWidth = max(bmpXPos + bmpWidth + (self._spacing*2) + textWidth, maxWidth)
425
+ if footerBmp and footerBmp.IsOk():
426
+ toAdd = (height - bmpHeight + self._spacing) // 2
427
+ dc.DrawBitmap(footerBmp, bmpXPos, int(yPos + toAdd), True)
428
+ maxWidth = max(footerBmp.GetSize().GetWidth() + bmpXPos, maxWidth)
429
+
430
+ maxHeight = yPos + height + toAdd
431
+ if event is None:
432
+ return maxWidth, maxHeight
433
+
434
+
435
+ @staticmethod
436
+ def _getTextExtent(dc, line):
437
+ textWidth, textHeight = dc.GetTextExtent(line)
438
+ if textHeight == 0:
439
+ _, textHeight = dc.GetTextExtent("a")
440
+ return textWidth, textHeight
441
+
442
+ def _storeHyperLinkInfo(self, hTextPos, vTextPos, textWidth, textHeight, linkTarget):
443
+ # Store the hyperlink rectangle and link
444
+ self._hyperlinkRect.append(wx.Rect(hTextPos, vTextPos, textWidth, textHeight))
445
+ self._hyperlinkWeb.append(linkTarget)
446
+
447
+
448
+ def OnEraseBackground(self, event):
449
+ """
450
+ Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`SuperToolTip`.
451
+
452
+ :param `event`: a :class:`EraseEvent` event to be processed.
453
+
454
+ :note: This method is intentionally empty to reduce flicker.
455
+ """
456
+
457
+ # This is intentionally empty to reduce flicker
458
+ pass
459
+
460
+
461
+ def OnSize(self, event):
462
+ """
463
+ Handles the ``wx.EVT_SIZE`` event for :class:`SuperToolTip`.
464
+
465
+ :param `event`: a :class:`wx.SizeEvent` event to be processed.
466
+ """
467
+
468
+ self.Refresh()
469
+ event.Skip()
470
+
471
+
472
+ def OnMouseMotion(self, event):
473
+ """
474
+ Handles the ``wx.EVT_MOTION`` event for :class:`SuperToolTip`.
475
+
476
+ :param `event`: a :class:`MouseEvent` event to be processed.
477
+ """
478
+
479
+ x, y = event.GetPosition()
480
+ for rect in self._hyperlinkRect:
481
+ if rect.Contains((x, y)):
482
+ # We are over one hyperlink...
483
+ self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
484
+ self._wasOnLink = True
485
+ return
486
+
487
+ if self._wasOnLink:
488
+ # Restore the normal cursor
489
+ self._wasOnLink = False
490
+ self.SetCursor(wx.NullCursor)
491
+
492
+
493
+ def OnDestroy(self, event):
494
+ """
495
+ Handles the ``wx.EVT_LEFT_DOWN``, ``wx.EVT_LEFT_DCLICK`` and ``wx.EVT_KILL_FOCUS``
496
+ events for :class:`SuperToolTip`. All these events destroy the :class:`SuperToolTip`,
497
+ unless the user clicked on one hyperlink.
498
+
499
+ :param `event`: a :class:`MouseEvent` or a :class:`FocusEvent` event to be processed.
500
+ """
501
+
502
+ if not isinstance(event, wx.MouseEvent):
503
+ # We haven't clicked a link
504
+ if self: # Check if window still exists, Destroy might have been called manually (more than once)
505
+ self.Destroy()
506
+ return
507
+
508
+ x, y = event.GetPosition()
509
+ for indx, rect in enumerate(self._hyperlinkRect):
510
+ if rect.Contains((x, y)):
511
+ # Run the webbrowser with the clicked link
512
+ webbrowser.open_new_tab(self._hyperlinkWeb[indx])
513
+ return
514
+
515
+ if self._classParent.GetUseFade():
516
+ # Fade out...
517
+ self.StartAlpha(False)
518
+ else:
519
+ self.Destroy()
520
+
521
+
522
+ def StartAlpha(self, isShow):
523
+ """
524
+ Start the timer which set the alpha channel for :class:`SuperToolTip`.
525
+
526
+ :param `isShow`: whether :class:`SuperToolTip` is being shown or deleted.
527
+
528
+ :note: This method is available only on Windows and requires Mark Hammond's
529
+ pywin32 package.
530
+ """
531
+
532
+ if self._alphaTimer.IsRunning():
533
+ return
534
+
535
+ # Calculate starting alpha value and its step
536
+ self.amount = (isShow and [0] or [255])[0]
537
+ self.delta = (isShow and [5] or [-5])[0]
538
+ # Start the timer
539
+ self._alphaTimer.Start(30)
540
+
541
+
542
+ def SetFont(self, font):
543
+ """
544
+ Sets the :class:`SuperToolTip` font globally.
545
+
546
+ :param `font`: the font to set.
547
+ """
548
+
549
+ wx.PopupWindow.SetFont(self, font)
550
+ self._classParent.InitFont()
551
+ self.Invalidate()
552
+
553
+
554
+ def Invalidate(self):
555
+ """ Invalidate :class:`SuperToolTip` size and repaint it. """
556
+
557
+ if not self._classParent.GetMessage():
558
+ # No message yet...
559
+ return
560
+
561
+ self.CalculateBestSize()
562
+ self.Refresh()
563
+
564
+
565
+ def DropShadow(self, drop=True):
566
+ """
567
+ Adds a shadow under the window.
568
+
569
+ :param `drop`: whether to drop a shadow or not.
570
+
571
+ :note: This method is available only on Windows and requires Mark Hammond's
572
+ pywin32 package.
573
+ """
574
+
575
+ if not _libimported:
576
+ # No Mark Hammond's win32all extension
577
+ return
578
+
579
+ if wx.Platform != "__WXMSW__":
580
+ # This works only on Windows XP
581
+ return
582
+
583
+ hwnd = self.GetHandle()
584
+
585
+ # Create a rounded rectangle region
586
+ size = self.GetSize()
587
+ if drop:
588
+ if hasattr(win32gui, "CreateRoundRectRgn"):
589
+ rgn = win32gui.CreateRoundRectRgn(0, 0, size.x, size.y, 9, 9)
590
+ win32gui.SetWindowRgn(hwnd, rgn, True)
591
+
592
+ CS_DROPSHADOW = 0x00020000
593
+ # Load the user32 library
594
+ if not hasattr(self, "_winlib"):
595
+ self._winlib = win32api.LoadLibrary("user32")
596
+
597
+ csstyle = win32api.GetWindowLong(hwnd, win32con.GCL_STYLE)
598
+ if drop:
599
+ if csstyle & CS_DROPSHADOW:
600
+ return
601
+ else:
602
+ csstyle |= CS_DROPSHADOW #Nothing to be done
603
+ else:
604
+ csstyle &= ~CS_DROPSHADOW
605
+
606
+ # Drop the shadow underneath the window
607
+ GCL_STYLE= -26
608
+ cstyle= win32gui.GetClassLong(hwnd, GCL_STYLE)
609
+ if drop:
610
+ if cstyle & CS_DROPSHADOW == 0:
611
+ win32api.SetClassLong(hwnd, GCL_STYLE, cstyle | CS_DROPSHADOW)
612
+ else:
613
+ win32api.SetClassLong(hwnd, GCL_STYLE, cstyle &~ CS_DROPSHADOW)
614
+
615
+
616
+ def AlphaCycle(self, event):
617
+ """
618
+ Handles the ``wx.EVT_TIMER`` event for :class:`SuperToolTip`.
619
+
620
+ :param `event`: a :class:`TimerEvent` event to be processed.
621
+ """
622
+
623
+ # Increase (or decrease) the alpha channel
624
+ self.amount += self.delta
625
+
626
+ if self.amount > 255 or self.amount < 0:
627
+ # We're done, stop the timer
628
+ self._alphaTimer.Stop()
629
+ if self.amount < 0:
630
+ # Destroy the SuperToolTip, we are fading out
631
+ self.Destroy()
632
+ return
633
+
634
+ # Make the SuperToolTip more or less transparent
635
+ self.MakeWindowTransparent(self.amount)
636
+ if not self.IsShown():
637
+ self.Show()
638
+
639
+
640
+ def MakeWindowTransparent(self, amount):
641
+ """
642
+ Makes the :class:`SuperToolTip` window transparent.
643
+
644
+ :param `amount`: the alpha channel value.
645
+
646
+ :note: This method is available only on Windows and requires Mark Hammond's
647
+ pywin32 package.
648
+ """
649
+
650
+ if not _libimported:
651
+ # No way, only Windows XP with Mark Hammond's win32all
652
+ return
653
+
654
+ # this API call is not in all SDKs, only the newer ones, so
655
+ # we will runtime bind this
656
+ if wx.Platform != "__WXMSW__":
657
+ return
658
+
659
+ hwnd = self.GetHandle()
660
+
661
+ if not hasattr(self, "_winlib"):
662
+ self._winlib = win32api.LoadLibrary("user32")
663
+
664
+ pSetLayeredWindowAttributes = win32api.GetProcAddress(self._winlib,
665
+ "SetLayeredWindowAttributes")
666
+
667
+ if pSetLayeredWindowAttributes is None:
668
+ return
669
+
670
+ exstyle = win32api.GetWindowLong(hwnd, win32con.GWL_EXSTYLE)
671
+ if 0 == (exstyle & 0x80000):
672
+ win32api.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, exstyle | 0x80000)
673
+
674
+ winxpgui.SetLayeredWindowAttributes(hwnd, 0, amount, 2)
675
+
676
+
677
+ def CalculateBestSize(self):
678
+ """ Calculates the :class:`SuperToolTip` window best size. """
679
+
680
+ maxWidth, maxHeight = self.OnPaint(None)
681
+ self.SetSize((int(maxWidth), int(maxHeight)))
682
+
683
+
684
+ def CalculateBestPosition(self,widget):
685
+ screen = wx.ClientDisplayRect()[2:]
686
+ left,top = widget.ClientToScreen((0, 0))
687
+ right,bottom = widget.ClientToScreen(widget.GetClientRect()[2:])
688
+ size = self.GetSize()
689
+ if right+size[0]>screen[0]:
690
+ xpos = left-size[0]
691
+ else:
692
+ xpos = right
693
+ if bottom+size[1]>screen[1]:
694
+ ypos = top-size[1]
695
+ else:
696
+ ypos = bottom
697
+ self.SetPosition((xpos,ypos))
698
+
699
+
700
+ # Handle Mac and Windows/GTK differences...
701
+
702
+ if wx.Platform == "__WXMAC__":
703
+
704
+ class ToolTipWindow(wx.Frame, ToolTipWindowBase):
705
+ """ Popup window that works on wxMac. """
706
+
707
+ def __init__(self, parent, classParent):
708
+ """
709
+ Default class constructor.
710
+
711
+ :param `parent`: the :class:`SuperToolTip` parent widget;
712
+ :param `classParent`: the :class:`SuperToolTip` class object.
713
+ """
714
+
715
+ wx.Frame.__init__(self, parent, style=wx.NO_BORDER|wx.FRAME_FLOAT_ON_PARENT|wx.FRAME_NO_TASKBAR|wx.POPUP_WINDOW)
716
+ # Call the base class
717
+ ToolTipWindowBase.__init__(self, parent, classParent)
718
+
719
+ else:
720
+
721
+ class ToolTipWindow(ToolTipWindowBase, wx.PopupWindow):
722
+ """
723
+ A simple :class:`PopupWindow` that holds fancy tooltips.
724
+ Not available on Mac as :class:`PopupWindow` is not implemented there.
725
+ """
726
+
727
+ def __init__(self, parent, classParent):
728
+ """
729
+ Default class constructor.
730
+
731
+ :param `parent`: the :class:`SuperToolTip` parent widget;
732
+ :param `classParent`: the :class:`SuperToolTip` class object.
733
+ """
734
+
735
+ wx.PopupWindow.__init__(self, parent)
736
+ # Call the base class
737
+ ToolTipWindowBase.__init__(self, parent, classParent)
738
+
739
+
740
+ class SuperToolTip(object):
741
+ """
742
+ The main class for :class:`SuperToolTip`, which holds all the methods
743
+ and setters/getters available to the user.
744
+ """
745
+
746
+ def __init__(self, message, bodyImage=wx.NullBitmap, header="", headerBmp=wx.NullBitmap,
747
+ footer="", footerBmp=wx.NullBitmap):
748
+ """
749
+ Default class constructor.
750
+
751
+ :param `message`: the main message in :class:`SuperToolTip` body;
752
+ :param `bodyImage`: the image in the :class:`SuperToolTip` body;
753
+ :param `header`: the header text;
754
+ :param `headerBmp`: the header bitmap;
755
+ :param `footer`: the footer text;
756
+ :param `footerBmp`: the footer bitmap.
757
+ """
758
+
759
+ self._superToolTip = None
760
+
761
+ # Set all the initial options
762
+ self.SetMessage(message)
763
+ self.SetBodyImage(bodyImage)
764
+ self.SetHeader(header)
765
+ self.SetHeaderBitmap(headerBmp)
766
+ self.SetFooter(footer)
767
+ self.SetFooterBitmap(footerBmp)
768
+ self._dropShadow = False
769
+ self._useFade = False
770
+
771
+ self._topLine = False
772
+ self._bottomLine = False
773
+
774
+ self.InitFont()
775
+
776
+ # Get the running applications
777
+ self._runningApp = wx.GetApp()
778
+ self._runningApp.__superToolTip = True
779
+
780
+ # Build a couple of timers...
781
+ self._startTimer = wx.PyTimer(self.OnStartTimer)
782
+ self._endTimer = wx.PyTimer(self.OnEndTimer)
783
+
784
+ self.SetStartDelay()
785
+ self.SetEndDelay()
786
+ self.ApplyStyle("XP Blue")
787
+
788
+
789
+ def SetTarget(self, widget):
790
+ """
791
+ Sets the target window for :class:`SuperToolTip`.
792
+
793
+ :param `widget`: the widget to which :class:`SuperToolTip` is associated.
794
+ """
795
+
796
+ self._widget = widget
797
+
798
+ self._widget.Bind(wx.EVT_ENTER_WINDOW, self.OnWidgetEnter)
799
+ self._widget.Bind(wx.EVT_LEAVE_WINDOW, self.OnWidgetLeave)
800
+
801
+
802
+ def GetTarget(self):
803
+ """ Returns the target window for :class:`SuperToolTip`. """
804
+
805
+ if not hasattr(self, "_widget"):
806
+ raise Exception("\nError: the widget target for L{SuperToolTip} has not been set.")
807
+
808
+ return self._widget
809
+
810
+
811
+ def SetStartDelay(self, delay=1):
812
+ """
813
+ Sets the time delay (in seconds) after which the :class:`SuperToolTip` is created.
814
+
815
+ :param `delay`: the delay in seconds.
816
+ """
817
+
818
+ self._startDelayTime = int(delay)
819
+
820
+
821
+ def GetStartDelay(self):
822
+ """ Returns the tim delay (in seconds) after which the :class:`SuperToolTip` is created."""
823
+
824
+ return self._startDelayTime
825
+
826
+
827
+ def SetEndDelay(self, delay=1e6):
828
+ """
829
+ Sets the delay time (in seconds) after which the :class:`SuperToolTip` is destroyed.
830
+
831
+ :param `delay`: the delay in seconds.
832
+ """
833
+
834
+ self._endDelayTime = int(delay)
835
+
836
+
837
+ def GetEndDelay(self):
838
+ """ Returns the delay time (in seconds) after which the :class:`SuperToolTip` is destroyed."""
839
+
840
+ return self._endDelayTime
841
+
842
+
843
+ def OnWidgetEnter(self, event):
844
+ """
845
+ Starts the :class:`SuperToolTip` timer for creation, handles the ``wx.EVT_ENTER_WINDOW`` event.
846
+
847
+ :param `event`: a :class:`MouseEvent` event to be processed.
848
+ """
849
+
850
+ if self._superToolTip:
851
+ # Not yet created
852
+ return
853
+
854
+ if not self._runningApp.__superToolTip:
855
+ # The running app doesn't want tooltips...
856
+ return
857
+
858
+ if not self._widget.GetTopLevelParent().IsActive():
859
+ self._startTimer.Stop()
860
+ return
861
+
862
+ if self._startTimer.IsRunning():
863
+ # We are already running
864
+ event.Skip()
865
+ return
866
+ self._startTimer.Start(self._startDelayTime*1000)
867
+ event.Skip()
868
+
869
+
870
+ def OnWidgetLeave(self, event):
871
+ """
872
+ Handles the ``wx.EVT_LEAVE_WINDOW`` event for the target widgets.
873
+
874
+ :param `event`: a :class:`MouseEvent` event to be processed.
875
+ """
876
+
877
+ if self._superToolTip:
878
+ if self.GetUseFade():
879
+ # Fade out...
880
+ self._superToolTip.StartAlpha(False)
881
+ else:
882
+ self._superToolTip.Destroy()
883
+
884
+ self._startTimer.Stop()
885
+ self._endTimer.Stop()
886
+
887
+ event.Skip()
888
+
889
+ def GetTipWindow(self):
890
+ """ Return the TipWindow, will return None if not yet created """
891
+
892
+ return self._superToolTip
893
+
894
+
895
+ def OnStartTimer(self):
896
+ """ The creation time has expired, create the :class:`SuperToolTip`. """
897
+
898
+ # target widget might already be destroyed
899
+ if not self._widget:
900
+ self._startTimer.Stop()
901
+ return
902
+
903
+ tip = ToolTipWindow(self._widget, self)
904
+ self._superToolTip = tip
905
+ self._superToolTip.CalculateBestSize()
906
+ self._superToolTip.CalculateBestPosition(self._widget)
907
+ self._superToolTip.DropShadow(self.GetDropShadow())
908
+
909
+ if self.GetUseFade():
910
+ self._superToolTip.StartAlpha(True)
911
+ else:
912
+ self._superToolTip.Show()
913
+
914
+ self._startTimer.Stop()
915
+ self._endTimer.Start(self._endDelayTime*1000)
916
+
917
+
918
+ def OnEndTimer(self):
919
+ """ The show time for :class:`SuperToolTip` has expired, destroy the :class:`SuperToolTip`. """
920
+
921
+ if self._superToolTip:
922
+ if self.GetUseFade():
923
+ self._superToolTip.StartAlpha(False)
924
+ else:
925
+ self._superToolTip.Destroy()
926
+
927
+ self._endTimer.Stop()
928
+
929
+
930
+ def DoShowNow(self):
931
+ """ Create the :class:`SuperToolTip` immediately. """
932
+
933
+ if self._superToolTip:
934
+ # need to destroy it if already exists,
935
+ # otherwise we might end up with many of them
936
+ self._superToolTip.Destroy()
937
+
938
+ tip = ToolTipWindow(self._widget, self)
939
+ self._superToolTip = tip
940
+ self._superToolTip.CalculateBestSize()
941
+ self._superToolTip.CalculateBestPosition(self._widget)
942
+ self._superToolTip.DropShadow(self.GetDropShadow())
943
+
944
+ # need to stop this, otherwise we get into trouble when leaving the window
945
+ self._startTimer.Stop()
946
+
947
+ if self.GetUseFade():
948
+ self._superToolTip.StartAlpha(True)
949
+ else:
950
+ self._superToolTip.Show()
951
+
952
+ self._endTimer.Start(self._endDelayTime*1000)
953
+
954
+
955
+ def DoHideNow(self):
956
+ """
957
+ Dismiss the :class:`SuperToolTip` window immediately.
958
+
959
+ .. versionadded:: 0.9.6
960
+ """
961
+
962
+ if self._superToolTip:
963
+ if self.GetUseFade():
964
+ # Fade out...
965
+ self._superToolTip.StartAlpha(False)
966
+ else:
967
+ self._superToolTip.Destroy()
968
+
969
+ self._startTimer.Stop()
970
+ self._endTimer.Stop()
971
+
972
+
973
+ def Show(self, show=True):
974
+ """
975
+ Shows or hides the window.
976
+
977
+ You may need to call `Raise` for a top level window if you want to bring it to
978
+ top, although this is not needed if :meth:`~SuperToolTip.Show` is called immediately after the frame creation.
979
+
980
+ :param bool `show`: ``True`` to show the :class:`SuperToolTip` window, ``False`` to hide it.
981
+
982
+ :return: ``True`` if the window has been shown or hidden or ``False`` if nothing was done
983
+ because it already was in the requested state.
984
+
985
+ .. note::
986
+
987
+ Notice that the default state of newly created top level windows is hidden (to allow
988
+ you to create their contents without flicker) unlike for all the other, not derived from
989
+ :class:`TopLevelWindow`, windows that are by default created in the shown state.
990
+
991
+
992
+ .. versionadded:: 0.9.5
993
+ """
994
+
995
+ if show and self._superToolTip is None:
996
+ self.DoShowNow()
997
+ return True
998
+ elif not show and self._superToolTip is not None:
999
+ self.DoHideNow()
1000
+ return True
1001
+ return False
1002
+
1003
+
1004
+ def Update(self):
1005
+ """
1006
+ Calling this method immediately repaints the invalidated area of the window and all of its
1007
+ children recursively (this normally only happens when the flow of control returns to the
1008
+ event loop).
1009
+
1010
+ :note: Notice that this function doesn't invalidate any area of the window so nothing happens
1011
+ if nothing has been invalidated (i.e. marked as requiring a redraw). Use `Refresh` first if
1012
+ you want to immediately redraw the window unconditionally.
1013
+
1014
+ .. versionadded:: 0.9.5
1015
+ """
1016
+
1017
+ if self._superToolTip:
1018
+ self._superToolTip.Update()
1019
+
1020
+
1021
+ def OnDestroy(self, event):
1022
+ """ Handles the :class:`SuperToolTip` target destruction. """
1023
+
1024
+ if self._superToolTip:
1025
+ # Unbind the events!
1026
+ self._widget.Unbind(wx.EVT_LEAVE_WINDOW)
1027
+ self._widget.Unbind(wx.EVT_ENTER_WINDOW)
1028
+
1029
+ self._superToolTip.Destroy()
1030
+ del self._superToolTip
1031
+ self._superToolTip = None
1032
+
1033
+
1034
+ def SetHeaderBitmap(self, bmp):
1035
+ """
1036
+ Sets the header bitmap for :class:`SuperToolTip`.
1037
+
1038
+ :param `bmp`: the header bitmap, a valid :class:`wx.Bitmap` object.
1039
+ """
1040
+
1041
+ self._headerBmp = bmp
1042
+ if self._superToolTip:
1043
+ self._superToolTip.Invalidate()
1044
+
1045
+
1046
+ def GetHeaderBitmap(self):
1047
+ """ Returns the header bitmap. """
1048
+
1049
+ return self._headerBmp
1050
+
1051
+
1052
+ def SetHeader(self, header):
1053
+ """
1054
+ Sets the header text.
1055
+
1056
+ :param `header`: the header text to display.
1057
+ """
1058
+
1059
+ self._header = header
1060
+ if self._superToolTip:
1061
+ self._superToolTip.Invalidate()
1062
+
1063
+
1064
+ def GetHeader(self):
1065
+ """ Returns the header text. """
1066
+
1067
+ return self._header
1068
+
1069
+
1070
+ def SetDrawHeaderLine(self, draw):
1071
+ """
1072
+ Sets whether to draw a separator line after the header or not.
1073
+
1074
+ :param `draw`: ``True`` to draw a separator line after the header, ``False``
1075
+ otherwise.
1076
+ """
1077
+
1078
+ self._topLine = draw
1079
+ if self._superToolTip:
1080
+ self._superToolTip.Refresh()
1081
+
1082
+
1083
+ def GetDrawHeaderLine(self):
1084
+ """ Returns whether the separator line after the header is drawn or not. """
1085
+
1086
+ return self._topLine
1087
+
1088
+
1089
+ def SetBodyImage(self, bmp):
1090
+ """
1091
+ Sets the main body bitmap for :class:`SuperToolTip`.
1092
+
1093
+ :param `bmp`: the body bitmap, a valid :class:`wx.Bitmap` object.
1094
+ """
1095
+
1096
+ self._embeddedImage = bmp
1097
+ if self._superToolTip:
1098
+ self._superToolTip.Invalidate()
1099
+
1100
+
1101
+ def GetBodyImage(self):
1102
+ """ Returns the main body bitmap used in :class:`SuperToolTip`. """
1103
+
1104
+ return self._embeddedImage
1105
+
1106
+
1107
+ def SetDrawFooterLine(self, draw):
1108
+ """
1109
+ Sets whether to draw a separator line before the footer or not.
1110
+
1111
+ :param `draw`: ``True`` to draw a separator line before the footer, ``False``
1112
+ otherwise.
1113
+ """
1114
+
1115
+ self._bottomLine = draw
1116
+ if self._superToolTip:
1117
+ self._superToolTip.Refresh()
1118
+
1119
+
1120
+ def GetDrawFooterLine(self):
1121
+ """ Returns whether the separator line before the footer is drawn or not. """
1122
+
1123
+ return self._bottomLine
1124
+
1125
+
1126
+ def SetFooterBitmap(self, bmp):
1127
+ """
1128
+ Sets the footer bitmap for :class:`SuperToolTip`.
1129
+
1130
+ :param `bmp`: the footer bitmap, a valid :class:`wx.Bitmap` object.
1131
+ """
1132
+
1133
+ self._footerBmp = bmp
1134
+ if self._superToolTip:
1135
+ self._superToolTip.Invalidate()
1136
+
1137
+
1138
+ def GetFooterBitmap(self):
1139
+ """ Returns the footer bitmap. """
1140
+
1141
+ return self._footerBmp
1142
+
1143
+
1144
+ def SetFooter(self, footer):
1145
+ """
1146
+ Sets the footer text.
1147
+
1148
+ :param `footer`: the footer text to display.
1149
+ """
1150
+
1151
+ self._footer = footer
1152
+ if self._superToolTip:
1153
+ self._superToolTip.Invalidate()
1154
+
1155
+
1156
+ def GetFooter(self):
1157
+ """ Returns the footer text. """
1158
+
1159
+ return self._footer
1160
+
1161
+
1162
+ def SetMessage(self, message):
1163
+ """
1164
+ Sets the main body message for :class:`SuperToolTip`.
1165
+
1166
+ :param `message`: the message to display in the body.
1167
+ """
1168
+
1169
+ self._message = message
1170
+ if self._superToolTip:
1171
+ self._superToolTip.Invalidate()
1172
+
1173
+
1174
+ def GetMessage(self):
1175
+ """ Returns the main body message in :class:`SuperToolTip`. """
1176
+
1177
+ return self._message
1178
+
1179
+
1180
+ def SetTopGradientColour(self, colour):
1181
+ """
1182
+ Sets the top gradient colour for :class:`SuperToolTip`.
1183
+
1184
+ :param `colour`: the colour to use as top colour, a valid :class:`wx.Colour` object.
1185
+ """
1186
+
1187
+ self._topColour = colour
1188
+ if self._superToolTip:
1189
+ self._superToolTip.Refresh()
1190
+
1191
+
1192
+ def SetMiddleGradientColour(self, colour):
1193
+ """
1194
+ Sets the middle gradient colour for :class:`SuperToolTip`.
1195
+
1196
+ :param `colour`: the colour to use as middle colour, a valid :class:`wx.Colour` object.
1197
+ """
1198
+
1199
+ self._middleColour = colour
1200
+ if self._superToolTip:
1201
+ self._superToolTip.Refresh()
1202
+
1203
+
1204
+ def SetBottomGradientColour(self, colour):
1205
+ """
1206
+ Sets the bottom gradient colour for :class:`SuperToolTip`.
1207
+
1208
+ :param `colour`: the colour to use as bottom colour, a valid :class:`wx.Colour` object.
1209
+ """
1210
+
1211
+ self._bottomColour = colour
1212
+ if self._superToolTip:
1213
+ self._superToolTip.Refresh()
1214
+
1215
+
1216
+ def SetTextColour(self, colour):
1217
+ """
1218
+ Sets the text colour for :class:`SuperToolTip`.
1219
+
1220
+ :param `colour`: the colour to use as text colour, a valid :class:`wx.Colour` object.
1221
+ """
1222
+
1223
+ self._textColour = colour
1224
+ if self._superToolTip:
1225
+ self._superToolTip.Refresh()
1226
+
1227
+
1228
+ def GetTopGradientColour(self):
1229
+ """ Returns the top gradient colour. """
1230
+
1231
+ return self._topColour
1232
+
1233
+
1234
+ def GetMiddleGradientColour(self):
1235
+ """ Returns the middle gradient colour. """
1236
+
1237
+ return self._middleColour
1238
+
1239
+
1240
+ def GetBottomGradientColour(self):
1241
+ """ Returns the bottom gradient colour. """
1242
+
1243
+ return self._bottomColour
1244
+
1245
+
1246
+ def GetTextColour(self):
1247
+ """ Returns the text colour. """
1248
+
1249
+ return self._textColour
1250
+
1251
+
1252
+ SetTopGradientColor = SetTopGradientColour
1253
+ SetMiddleGradientColor = SetMiddleGradientColour
1254
+ SetBottomGradientColor = SetBottomGradientColour
1255
+ GetTopGradientColor = GetTopGradientColour
1256
+ GetMiddleGradientColor = GetMiddleGradientColour
1257
+ GetBottomGradientColor = GetBottomGradientColour
1258
+ SetTextColor = SetTextColour
1259
+ GetTextColor = GetTextColour
1260
+
1261
+
1262
+ def InitFont(self):
1263
+ """ Initializes the fonts for :class:`SuperToolTip`. """
1264
+
1265
+ self._messageFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
1266
+ self._headerFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
1267
+ self._headerFont.SetWeight(wx.FONTWEIGHT_BOLD)
1268
+ self._footerFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
1269
+ self._footerFont.SetWeight(wx.FONTWEIGHT_BOLD)
1270
+ self._hyperlinkFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
1271
+ self._hyperlinkFont.SetWeight(wx.FONTWEIGHT_BOLD)
1272
+ self._hyperlinkFont.SetUnderlined(True)
1273
+
1274
+
1275
+ def SetMessageFont(self, font):
1276
+ """
1277
+ Sets the font for the main body message.
1278
+
1279
+ :param `font`: the font to use for the main body message, a valid :class:`wx.Font`
1280
+ object.
1281
+ """
1282
+
1283
+ self._messageFont = font
1284
+ if self._superToolTip:
1285
+ self._superToolTip.Invalidate()
1286
+
1287
+
1288
+ def SetHeaderFont(self, font):
1289
+ """
1290
+ Sets the font for the header text.
1291
+
1292
+ :param `font`: the font to use for the header text, a valid :class:`wx.Font`
1293
+ object.
1294
+ """
1295
+
1296
+ self._headerFont = font
1297
+ if self._superToolTip:
1298
+ self._superToolTip.Invalidate()
1299
+
1300
+
1301
+ def SetFooterFont(self, font):
1302
+ """
1303
+ Sets the font for the footer text.
1304
+
1305
+ :param `font`: the font to use for the footer text, a valid :class:`wx.Font`
1306
+ object.
1307
+ """
1308
+
1309
+ self._footerFont = font
1310
+ if self._superToolTip:
1311
+ self._superToolTip.Invalidate()
1312
+
1313
+
1314
+ def SetHyperlinkFont(self, font):
1315
+ """
1316
+ Sets the font for the hyperlink text.
1317
+
1318
+ :param `font`: the font to use for the hyperlink text, a valid :class:`wx.Font`
1319
+ object.
1320
+ """
1321
+
1322
+ self._hyperlinkFont = font
1323
+ if self._superToolTip:
1324
+ self._superToolTip.Invalidate()
1325
+
1326
+
1327
+ def GetMessageFont(self):
1328
+ """ Returns the font used in the main body message. """
1329
+
1330
+ return self._messageFont
1331
+
1332
+
1333
+ def GetHeaderFont(self):
1334
+ """ Returns the font used for the header text. """
1335
+
1336
+ return self._headerFont
1337
+
1338
+
1339
+ def GetFooterFont(self):
1340
+ """ Returns the font used for the footer text. """
1341
+
1342
+ return self._footerFont
1343
+
1344
+
1345
+ def GetHyperlinkFont(self):
1346
+ """ Returns the font used for the hyperlink text. """
1347
+
1348
+ return self._hyperlinkFont
1349
+
1350
+
1351
+ def SetDropShadow(self, drop):
1352
+ """
1353
+ Whether to draw a shadow below :class:`SuperToolTip` or not.
1354
+
1355
+ :param `drop`: ``True`` to drop a shadow below the control, ``False`` otherwise.
1356
+
1357
+ :note: This method is available only on Windows and requires Mark Hammond's
1358
+ pywin32 package.
1359
+ """
1360
+
1361
+ self._dropShadow = drop
1362
+ if self._superToolTip:
1363
+ self._superToolTip.Invalidate()
1364
+
1365
+
1366
+ def GetDropShadow(self):
1367
+ """
1368
+ Returns whether a shadow below :class:`SuperToolTip` is drawn or not.
1369
+
1370
+ :note: This method is available only on Windows and requires Mark Hammond's
1371
+ pywin32 package.
1372
+ """
1373
+
1374
+ return self._dropShadow
1375
+
1376
+
1377
+ def SetUseFade(self, fade):
1378
+ """
1379
+ Whether to use a fade in/fade out effect or not.
1380
+
1381
+ :param `fade`: ``True`` to use a fade in/fade out effect, ``False`` otherwise.
1382
+
1383
+ :note: This method is available only on Windows and requires Mark Hammond's
1384
+ pywin32 package.
1385
+ """
1386
+
1387
+ self._useFade = fade
1388
+
1389
+
1390
+ def GetUseFade(self):
1391
+ """
1392
+ Returns whether a fade in/fade out effect is used or not.
1393
+
1394
+ :note: This method is available only on Windows and requires Mark Hammond's
1395
+ pywin32 package.
1396
+ """
1397
+
1398
+ return self._useFade
1399
+
1400
+
1401
+ def ApplyStyle(self, style):
1402
+ """
1403
+ Applies none of the predefined styles.
1404
+
1405
+ :param `style`: one of the predefined styles available at the
1406
+ beginning of the module.
1407
+ """
1408
+
1409
+ if style not in _colourSchemes:
1410
+ raise Exception("Invalid style '%s' selected"%style)
1411
+
1412
+ top, middle, bottom, text = _colourSchemes[style]
1413
+ self._topColour = top
1414
+ self._middleColour = middle
1415
+ self._bottomColour = bottom
1416
+ self._textColour = text
1417
+
1418
+ if self._superToolTip:
1419
+ self._superToolTip.Refresh()
1420
+
1421
+
1422
+ def EnableTip(self, enable=True):
1423
+ """
1424
+ Globally (application-wide) enables/disables :class:`SuperToolTip`.
1425
+
1426
+ :param `enable`: ``True`` to enable :class:`SuperToolTip` globally, ``False`` otherwise.
1427
+ """
1428
+
1429
+ wx.GetApp().__superToolTip = enable
1430
+ if not enable and self._superToolTip:
1431
+ self.DoHideNow()
1432
+ del self._superToolTip
1433
+ self._superToolTip = None
1434
+
1435
+
1436
+ def IsEnabled(self):
1437
+ """
1438
+ Returns ``True`` when :class:`SuperToolTip` is globally enabled, ``False`` otherwise.
1439
+
1440
+ .. versionadded:: 0.9.6
1441
+ """
1442
+
1443
+ return wx.GetApp().__superToolTip