wxPython-zombie 3.1.5.8__cp313-cp313-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 (1175) hide show
  1. wx/__init__.py +22 -0
  2. wx/__version__.py +9 -0
  3. wx/_adv.cp313-win_amd64.pyd +0 -0
  4. wx/_aui.cp313-win_amd64.pyd +0 -0
  5. wx/_core.cp313-win_amd64.pyd +0 -0
  6. wx/_dataview.cp313-win_amd64.pyd +0 -0
  7. wx/_glcanvas.cp313-win_amd64.pyd +0 -0
  8. wx/_grid.cp313-win_amd64.pyd +0 -0
  9. wx/_html.cp313-win_amd64.pyd +0 -0
  10. wx/_html2.cp313-win_amd64.pyd +0 -0
  11. wx/_media.cp313-win_amd64.pyd +0 -0
  12. wx/_msw.cp313-win_amd64.pyd +0 -0
  13. wx/_propgrid.cp313-win_amd64.pyd +0 -0
  14. wx/_ribbon.cp313-win_amd64.pyd +0 -0
  15. wx/_richtext.cp313-win_amd64.pyd +0 -0
  16. wx/_stc.cp313-win_amd64.pyd +0 -0
  17. wx/_xml.cp313-win_amd64.pyd +0 -0
  18. wx/_xrc.cp313-win_amd64.pyd +0 -0
  19. wx/adv.py +124 -0
  20. wx/adv.pyi +5182 -0
  21. wx/aui.py +77 -0
  22. wx/aui.pyi +3655 -0
  23. wx/core.py +3540 -0
  24. wx/core.pyi +50592 -0
  25. wx/dataview.py +173 -0
  26. wx/dataview.pyi +3491 -0
  27. wx/demo/AUI_DockingWindowMgr.py +1154 -0
  28. wx/demo/AUI_MDI.py +117 -0
  29. wx/demo/AUI_Notebook.py +58 -0
  30. wx/demo/About.py +75 -0
  31. wx/demo/AboutBox.py +75 -0
  32. wx/demo/ActiveXWrapper_Acrobat.py +132 -0
  33. wx/demo/ActiveXWrapper_IE.py +187 -0
  34. wx/demo/ActiveX_FlashWindow.py +107 -0
  35. wx/demo/ActiveX_IEHtmlWindow.py +242 -0
  36. wx/demo/ActiveX_PDFWindow.py +204 -0
  37. wx/demo/ActivityIndicator.py +80 -0
  38. wx/demo/AddPrivateFont.py +116 -0
  39. wx/demo/AdjustChannels.py +178 -0
  40. wx/demo/AlphaDrawing.py +77 -0
  41. wx/demo/AnalogClock.py +144 -0
  42. wx/demo/AnimationCtrl.py +104 -0
  43. wx/demo/ArtProvider.py +893 -0
  44. wx/demo/BannerWindow.py +1 -0
  45. wx/demo/BitmapButton.py +87 -0
  46. wx/demo/BitmapComboBox.py +63 -0
  47. wx/demo/BitmapFromBuffer.py +140 -0
  48. wx/demo/Button.py +77 -0
  49. wx/demo/Cairo.py +197 -0
  50. wx/demo/Cairo_Snippets.py +135 -0
  51. wx/demo/Calendar.py +660 -0
  52. wx/demo/CalendarCtrl.py +122 -0
  53. wx/demo/CheckBox.py +74 -0
  54. wx/demo/CheckListBox.py +79 -0
  55. wx/demo/CheckListCtrl.py +99 -0
  56. wx/demo/Choice.py +55 -0
  57. wx/demo/Choicebook.py +80 -0
  58. wx/demo/CollapsibleHeaderCtrl.py +85 -0
  59. wx/demo/CollapsiblePane.py +126 -0
  60. wx/demo/ColorPanel.py +19 -0
  61. wx/demo/ColourDB.py +203 -0
  62. wx/demo/ColourDialog.py +76 -0
  63. wx/demo/ColourSelect.py +119 -0
  64. wx/demo/ComboBox.py +111 -0
  65. wx/demo/ComboCtrl.py +153 -0
  66. wx/demo/ComboTreeBox.py +71 -0
  67. wx/demo/CommandLinkButton.py +50 -0
  68. wx/demo/ContextHelp.py +112 -0
  69. wx/demo/Cursor.py +336 -0
  70. wx/demo/CustomDragAndDrop.py +353 -0
  71. wx/demo/DVC_CustomRenderer.py +204 -0
  72. wx/demo/DVC_DataViewModel.py +365 -0
  73. wx/demo/DVC_IndexListModel.py +257 -0
  74. wx/demo/DVC_ListCtrl.py +69 -0
  75. wx/demo/DVC_TreeCtrl.py +76 -0
  76. wx/demo/DatePickerCtrl.py +68 -0
  77. wx/demo/DelayedResult.py +239 -0
  78. wx/demo/Dialog.py +169 -0
  79. wx/demo/DialogUnits.py +128 -0
  80. wx/demo/DirDialog.py +58 -0
  81. wx/demo/DragAndDrop.py +265 -0
  82. wx/demo/DragImage.py +316 -0
  83. wx/demo/DragScroller.py +59 -0
  84. wx/demo/DrawXXXList.py +436 -0
  85. wx/demo/DynamicSashWindow.py +177 -0
  86. wx/demo/EditableListBox.py +101 -0
  87. wx/demo/Editor.py +70 -0
  88. wx/demo/EventManager.py +291 -0
  89. wx/demo/ExpandoTextCtrl.py +164 -0
  90. wx/demo/FancyText.py +83 -0
  91. wx/demo/FileBrowseButton.py +100 -0
  92. wx/demo/FileCtrl.py +97 -0
  93. wx/demo/FileDialog.py +144 -0
  94. wx/demo/FileHistory.py +140 -0
  95. wx/demo/FindReplaceDialog.py +123 -0
  96. wx/demo/FloatCanvas.py +1959 -0
  97. wx/demo/FontDialog.py +142 -0
  98. wx/demo/FontEnumerator.py +82 -0
  99. wx/demo/Frame.py +85 -0
  100. wx/demo/GLCanvas.py +371 -0
  101. wx/demo/Gauge.py +66 -0
  102. wx/demo/GenericButtons.py +185 -0
  103. wx/demo/GenericCheckBox.py +65 -0
  104. wx/demo/GenericDirCtrl.py +74 -0
  105. wx/demo/GetMouseState.py +159 -0
  106. wx/demo/GraphicsContext.py +236 -0
  107. wx/demo/GraphicsGradient.py +281 -0
  108. wx/demo/Grid.py +95 -0
  109. wx/demo/GridBagSizer.py +170 -0
  110. wx/demo/GridCustEditor.py +247 -0
  111. wx/demo/GridCustTable.py +170 -0
  112. wx/demo/GridDragAndDrop.py +102 -0
  113. wx/demo/GridDragable.py +206 -0
  114. wx/demo/GridEnterHandler.py +66 -0
  115. wx/demo/GridHugeTable.py +89 -0
  116. wx/demo/GridLabelRenderer.py +114 -0
  117. wx/demo/GridSimple.py +270 -0
  118. wx/demo/GridStdEdRend.py +186 -0
  119. wx/demo/Grid_MegaExample.py +490 -0
  120. wx/demo/HTML2_WebView.py +183 -0
  121. wx/demo/HtmlWindow.py +232 -0
  122. wx/demo/I18N.py +237 -0
  123. wx/demo/Image.py +338 -0
  124. wx/demo/ImageAlpha.py +87 -0
  125. wx/demo/ImageBrowser.py +70 -0
  126. wx/demo/ImageFromStream.py +49 -0
  127. wx/demo/Img2PyArtProvider.py +99 -0
  128. wx/demo/InfoBar.py +127 -0
  129. wx/demo/IntCtrl.py +343 -0
  130. wx/demo/ItemsPicker.py +108 -0
  131. wx/demo/Joystick.py +1083 -0
  132. wx/demo/KeyEvents.py +428 -0
  133. wx/demo/LEDNumberCtrl.py +121 -0
  134. wx/demo/LayoutAnchors.py +258 -0
  135. wx/demo/LayoutConstraints.py +149 -0
  136. wx/demo/Layoutf.py +69 -0
  137. wx/demo/ListBox.py +164 -0
  138. wx/demo/ListCtrl.py +538 -0
  139. wx/demo/ListCtrl_edit.py +155 -0
  140. wx/demo/ListCtrl_virtual.py +145 -0
  141. wx/demo/Listbook.py +104 -0
  142. wx/demo/MDIDemo.py +86 -0
  143. wx/demo/MDISashDemo.py +152 -0
  144. wx/demo/MDIWindows.py +66 -0
  145. wx/demo/Main.py +2768 -0
  146. wx/demo/Mask.py +137 -0
  147. wx/demo/MaskedEditControls.py +648 -0
  148. wx/demo/MaskedNumCtrl.py +359 -0
  149. wx/demo/MediaCtrl.py +190 -0
  150. wx/demo/Menu.py +322 -0
  151. wx/demo/MessageDialog.py +54 -0
  152. wx/demo/MimeTypesManager.py +354 -0
  153. wx/demo/MiniFrame.py +67 -0
  154. wx/demo/MouseGestures.py +198 -0
  155. wx/demo/MultiChoiceDialog.py +59 -0
  156. wx/demo/MultiSash.py +95 -0
  157. wx/demo/MultiSplitterWindow.py +168 -0
  158. wx/demo/MultipleChoiceDialog.py +101 -0
  159. wx/demo/Notebook.py +134 -0
  160. wx/demo/NotificationMessage.py +61 -0
  161. wx/demo/OGL.py +433 -0
  162. wx/demo/Overlay.py +209 -0
  163. wx/demo/OwnerDrawnComboBox.py +152 -0
  164. wx/demo/PDFViewer.py +109 -0
  165. wx/demo/PageSetupDialog.py +70 -0
  166. wx/demo/PenAndBrushStyles.py +208 -0
  167. wx/demo/Pickers.py +120 -0
  168. wx/demo/PlateButton.py +430 -0
  169. wx/demo/PopupControl.py +99 -0
  170. wx/demo/PopupMenu.py +156 -0
  171. wx/demo/PopupWindow.py +227 -0
  172. wx/demo/PrintDialog.py +60 -0
  173. wx/demo/PrintFramework.py +227 -0
  174. wx/demo/Process.py +168 -0
  175. wx/demo/ProgressDialog.py +87 -0
  176. wx/demo/PropertyGrid.py +1045 -0
  177. wx/demo/PropertySheetDialog.py +231 -0
  178. wx/demo/PseudoDC.py +350 -0
  179. wx/demo/PyColourChooser.py +60 -0
  180. wx/demo/PyCrust.py +21 -0
  181. wx/demo/PyPlot.py +83 -0
  182. wx/demo/PyShell.py +22 -0
  183. wx/demo/PythonEvents.py +109 -0
  184. wx/demo/README.txt +7 -0
  185. wx/demo/RadioBox.py +67 -0
  186. wx/demo/RadioButton.py +127 -0
  187. wx/demo/RawBitmapAccess.py +208 -0
  188. wx/demo/RearrangeDialog.py +160 -0
  189. wx/demo/RendererNative.py +170 -0
  190. wx/demo/ResizeWidget.py +76 -0
  191. wx/demo/RichMessageDialog.py +85 -0
  192. wx/demo/RichTextCtrl.py +732 -0
  193. wx/demo/RichToolTip.py +145 -0
  194. wx/demo/SVGImage_Bitmap.py +130 -0
  195. wx/demo/SVGImage_Render.py +138 -0
  196. wx/demo/SashWindow.py +151 -0
  197. wx/demo/ScrolledMessageDialog.py +52 -0
  198. wx/demo/ScrolledPanel.py +124 -0
  199. wx/demo/ScrolledWindow.py +260 -0
  200. wx/demo/SearchCtrl.py +115 -0
  201. wx/demo/ShapedWindow.py +145 -0
  202. wx/demo/Simplebook.py +202 -0
  203. wx/demo/SingleChoiceDialog.py +56 -0
  204. wx/demo/SizedControls.py +433 -0
  205. wx/demo/Sizers.py +609 -0
  206. wx/demo/Slider.py +52 -0
  207. wx/demo/Sound.py +95 -0
  208. wx/demo/SpinButton.py +63 -0
  209. wx/demo/SpinCtrl.py +56 -0
  210. wx/demo/SpinCtrlDouble.py +42 -0
  211. wx/demo/SplitTree.py +146 -0
  212. wx/demo/SplitterWindow.py +62 -0
  213. wx/demo/StandardPaths.py +113 -0
  214. wx/demo/StaticBitmap.py +55 -0
  215. wx/demo/StaticBox.py +62 -0
  216. wx/demo/StaticText.py +69 -0
  217. wx/demo/StatusBar.py +144 -0
  218. wx/demo/StockButtons.py +113 -0
  219. wx/demo/StyledTextCtrl_1.py +303 -0
  220. wx/demo/StyledTextCtrl_2.py +410 -0
  221. wx/demo/SystemSettings.py +333 -0
  222. wx/demo/TablePrint.py +215 -0
  223. wx/demo/TestTable.txt +38 -0
  224. wx/demo/TextCtrl.py +187 -0
  225. wx/demo/TextEntryDialog.py +57 -0
  226. wx/demo/Threads.py +258 -0
  227. wx/demo/Throbber.py +250 -0
  228. wx/demo/Ticker.py +147 -0
  229. wx/demo/TimeCtrl.py +240 -0
  230. wx/demo/TimePickerCtrl.py +60 -0
  231. wx/demo/Timer.py +275 -0
  232. wx/demo/ToggleButton.py +54 -0
  233. wx/demo/ToolBar.py +249 -0
  234. wx/demo/ToolTip.py +71 -0
  235. wx/demo/Toolbook.py +111 -0
  236. wx/demo/TreeCtrl.py +199 -0
  237. wx/demo/TreeListCtrl.py +121 -0
  238. wx/demo/TreeMixin.py +269 -0
  239. wx/demo/Treebook.py +117 -0
  240. wx/demo/UIActionSimulator.py +151 -0
  241. wx/demo/URLDragAndDrop.py +130 -0
  242. wx/demo/Unicode.py +146 -0
  243. wx/demo/VListBox.py +176 -0
  244. wx/demo/Validator.py +237 -0
  245. wx/demo/Wizard.py +248 -0
  246. wx/demo/WrapSizer.py +115 -0
  247. wx/demo/XmlResource.py +80 -0
  248. wx/demo/XmlResourceHandler.py +199 -0
  249. wx/demo/XmlResourceSubclass.py +119 -0
  250. wx/demo/__init__.py +9 -0
  251. wx/demo/agw/AGWInfoBar.py +175 -0
  252. wx/demo/agw/AUI.py +3058 -0
  253. wx/demo/agw/AdvancedSplash.py +59 -0
  254. wx/demo/agw/AquaButton.py +146 -0
  255. wx/demo/agw/BalloonTip.py +378 -0
  256. wx/demo/agw/ButtonPanel.py +890 -0
  257. wx/demo/agw/CubeColourDialog.py +83 -0
  258. wx/demo/agw/CustomTreeCtrl.py +2167 -0
  259. wx/demo/agw/Example1 +67 -0
  260. wx/demo/agw/Example2 +49 -0
  261. wx/demo/agw/FlatMenu.py +876 -0
  262. wx/demo/agw/FlatNotebook.py +994 -0
  263. wx/demo/agw/FloatSpin.py +475 -0
  264. wx/demo/agw/FoldPanelBar.py +953 -0
  265. wx/demo/agw/FourWaySplitter.py +300 -0
  266. wx/demo/agw/GenericMessageDialog.py +207 -0
  267. wx/demo/agw/GradientButton.py +156 -0
  268. wx/demo/agw/HyperLinkCtrl.py +144 -0
  269. wx/demo/agw/HyperTreeList.py +2660 -0
  270. wx/demo/agw/KnobCtrl.py +186 -0
  271. wx/demo/agw/LabelBook.py +567 -0
  272. wx/demo/agw/MacLargeDemo.py +360 -0
  273. wx/demo/agw/MultiDirDialog.py +117 -0
  274. wx/demo/agw/PeakMeter.py +194 -0
  275. wx/demo/agw/PersistentControls.py +589 -0
  276. wx/demo/agw/PieCtrl.py +206 -0
  277. wx/demo/agw/PyBusyInfo.py +64 -0
  278. wx/demo/agw/PyCollapsiblePane.py +308 -0
  279. wx/demo/agw/PyGauge.py +162 -0
  280. wx/demo/agw/PyProgress.py +155 -0
  281. wx/demo/agw/RibbonBar.py +925 -0
  282. wx/demo/agw/RulerCtrl.py +454 -0
  283. wx/demo/agw/ScrolledThumbnail.py +128 -0
  284. wx/demo/agw/ShapedButton.py +603 -0
  285. wx/demo/agw/ShortcutEditor.py +397 -0
  286. wx/demo/agw/SpeedMeter.py +668 -0
  287. wx/demo/agw/SuperToolTip.py +396 -0
  288. wx/demo/agw/ThumbDemoConfig.py +603 -0
  289. wx/demo/agw/ThumbnailCtrl.py +149 -0
  290. wx/demo/agw/ToasterBox.py +410 -0
  291. wx/demo/agw/UltimateListCtrl.py +80 -0
  292. wx/demo/agw/UltimateListIconDemo.py +908 -0
  293. wx/demo/agw/UltimateListListDemo.py +124 -0
  294. wx/demo/agw/UltimateReportDemo.py +1146 -0
  295. wx/demo/agw/UltimateVirtualDemo.py +207 -0
  296. wx/demo/agw/Windows7Explorer_Contents.py +368 -0
  297. wx/demo/agw/XLSGrid.py +238 -0
  298. wx/demo/agw/ZoomBar.py +230 -0
  299. wx/demo/agw/__demo__.py +183 -0
  300. wx/demo/agw/bitmaps/Explorer96.png +0 -0
  301. wx/demo/agw/bitmaps/Explorer96Flip40.png +0 -0
  302. wx/demo/agw/bitmaps/Folder96.png +0 -0
  303. wx/demo/agw/bitmaps/Folder96Flip40.png +0 -0
  304. wx/demo/agw/bitmaps/Monitor96.png +0 -0
  305. wx/demo/agw/bitmaps/Monitor96Flip40.png +0 -0
  306. wx/demo/agw/bitmaps/Music96.png +0 -0
  307. wx/demo/agw/bitmaps/Music96Flip40.png +0 -0
  308. wx/demo/agw/bitmaps/Photo96.png +0 -0
  309. wx/demo/agw/bitmaps/Photo96Flip40.png +0 -0
  310. wx/demo/agw/bitmaps/Search96.png +0 -0
  311. wx/demo/agw/bitmaps/Search96Flip40.png +0 -0
  312. wx/demo/agw/bitmaps/Wizard96.png +0 -0
  313. wx/demo/agw/bitmaps/Wizard96Flip40.png +0 -0
  314. wx/demo/agw/bitmaps/advancedsplash.png +0 -0
  315. wx/demo/agw/bitmaps/aquabutton.png +0 -0
  316. wx/demo/agw/bitmaps/aquachecked.ico +0 -0
  317. wx/demo/agw/bitmaps/aquaflagged.ico +0 -0
  318. wx/demo/agw/bitmaps/aquanotchecked.ico +0 -0
  319. wx/demo/agw/bitmaps/aquanotflagged.ico +0 -0
  320. wx/demo/agw/bitmaps/canada.gif +0 -0
  321. wx/demo/agw/bitmaps/checked.ico +0 -0
  322. wx/demo/agw/bitmaps/columns.png +0 -0
  323. wx/demo/agw/bitmaps/contexthelp-16.png +0 -0
  324. wx/demo/agw/bitmaps/contexthelp.png +0 -0
  325. wx/demo/agw/bitmaps/copy.png +0 -0
  326. wx/demo/agw/bitmaps/cut.png +0 -0
  327. wx/demo/agw/bitmaps/editcopy.png +0 -0
  328. wx/demo/agw/bitmaps/editcut.png +0 -0
  329. wx/demo/agw/bitmaps/editpaste.png +0 -0
  330. wx/demo/agw/bitmaps/empty_icon.png +0 -0
  331. wx/demo/agw/bitmaps/exit-16.png +0 -0
  332. wx/demo/agw/bitmaps/exit.ico +0 -0
  333. wx/demo/agw/bitmaps/ffwd.png +0 -0
  334. wx/demo/agw/bitmaps/ffwddisabled.png +0 -0
  335. wx/demo/agw/bitmaps/field-16.png +0 -0
  336. wx/demo/agw/bitmaps/filenew.png +0 -0
  337. wx/demo/agw/bitmaps/fileopen.png +0 -0
  338. wx/demo/agw/bitmaps/filesave.png +0 -0
  339. wx/demo/agw/bitmaps/flagged.ico +0 -0
  340. wx/demo/agw/bitmaps/folder.png +0 -0
  341. wx/demo/agw/bitmaps/folder_new.png +0 -0
  342. wx/demo/agw/bitmaps/ghost.png +0 -0
  343. wx/demo/agw/bitmaps/gradientbutton.png +0 -0
  344. wx/demo/agw/bitmaps/help-16.png +0 -0
  345. wx/demo/agw/bitmaps/help.ico +0 -0
  346. wx/demo/agw/bitmaps/italy.gif +0 -0
  347. wx/demo/agw/bitmaps/lbadd.png +0 -0
  348. wx/demo/agw/bitmaps/lbcharge.png +0 -0
  349. wx/demo/agw/bitmaps/lbdecrypted.png +0 -0
  350. wx/demo/agw/bitmaps/lbnews.png +0 -0
  351. wx/demo/agw/bitmaps/lbroll.png +0 -0
  352. wx/demo/agw/bitmaps/minus1.ico +0 -0
  353. wx/demo/agw/bitmaps/minus2.ico +0 -0
  354. wx/demo/agw/bitmaps/minus3.ico +0 -0
  355. wx/demo/agw/bitmaps/minus4.ico +0 -0
  356. wx/demo/agw/bitmaps/minus5.ico +0 -0
  357. wx/demo/agw/bitmaps/month-16.png +0 -0
  358. wx/demo/agw/bitmaps/new_file.png +0 -0
  359. wx/demo/agw/bitmaps/new_folder.png +0 -0
  360. wx/demo/agw/bitmaps/notchecked.ico +0 -0
  361. wx/demo/agw/bitmaps/notflagged.ico +0 -0
  362. wx/demo/agw/bitmaps/ok-16.png +0 -0
  363. wx/demo/agw/bitmaps/open_folder.png +0 -0
  364. wx/demo/agw/bitmaps/paste.png +0 -0
  365. wx/demo/agw/bitmaps/pause.png +0 -0
  366. wx/demo/agw/bitmaps/pausedisabled.png +0 -0
  367. wx/demo/agw/bitmaps/play.png +0 -0
  368. wx/demo/agw/bitmaps/playdisabled.png +0 -0
  369. wx/demo/agw/bitmaps/plus1.ico +0 -0
  370. wx/demo/agw/bitmaps/plus2.ico +0 -0
  371. wx/demo/agw/bitmaps/plus3.ico +0 -0
  372. wx/demo/agw/bitmaps/plus4.ico +0 -0
  373. wx/demo/agw/bitmaps/plus5.ico +0 -0
  374. wx/demo/agw/bitmaps/record.png +0 -0
  375. wx/demo/agw/bitmaps/recorddisabled.png +0 -0
  376. wx/demo/agw/bitmaps/recording.gif +0 -0
  377. wx/demo/agw/bitmaps/rewind.png +0 -0
  378. wx/demo/agw/bitmaps/rewinddisabled.png +0 -0
  379. wx/demo/agw/bitmaps/round.png +0 -0
  380. wx/demo/agw/bitmaps/save.png +0 -0
  381. wx/demo/agw/bitmaps/separator.gif +0 -0
  382. wx/demo/agw/bitmaps/separatorflip.png +0 -0
  383. wx/demo/agw/bitmaps/smfuel.ico +0 -0
  384. wx/demo/agw/bitmaps/smpi.ico +0 -0
  385. wx/demo/agw/bitmaps/smtemp.ico +0 -0
  386. wx/demo/agw/bitmaps/stop.png +0 -0
  387. wx/demo/agw/bitmaps/stopdisabled.png +0 -0
  388. wx/demo/agw/bitmaps/sttbutton.png +0 -0
  389. wx/demo/agw/bitmaps/sttfont.png +0 -0
  390. wx/demo/agw/bitmaps/sttheader.png +0 -0
  391. wx/demo/agw/bitmaps/stthelp.png +0 -0
  392. wx/demo/agw/bitmaps/view1.png +0 -0
  393. wx/demo/agw/bitmaps/view2.png +0 -0
  394. wx/demo/agw/bitmaps/view_choose.png +0 -0
  395. wx/demo/agw/bitmaps/view_detailed.png +0 -0
  396. wx/demo/agw/bitmaps/view_icon.png +0 -0
  397. wx/demo/agw/bitmaps/view_multicolumn.png +0 -0
  398. wx/demo/agw/bitmaps/viewmag-16.png +0 -0
  399. wx/demo/agw/bitmaps/viewmag-m-16.png +0 -0
  400. wx/demo/agw/bitmaps/viewmag-p-16.png +0 -0
  401. wx/demo/agw/bitmaps/viewmagfit-16.png +0 -0
  402. wx/demo/agw/data/Example_1.xls +0 -0
  403. wx/demo/agw/images.py +6714 -0
  404. wx/demo/bitmaps/AG00028_.gif +0 -0
  405. wx/demo/bitmaps/AG00039_.gif +0 -0
  406. wx/demo/bitmaps/AG00178_.gif +0 -0
  407. wx/demo/bitmaps/AG00183_.gif +0 -0
  408. wx/demo/bitmaps/AG00185_.gif +0 -0
  409. wx/demo/bitmaps/BD13656_.gif +0 -0
  410. wx/demo/bitmaps/advancedsplash.png +0 -0
  411. wx/demo/bitmaps/aquabutton.png +0 -0
  412. wx/demo/bitmaps/aquachecked.ico +0 -0
  413. wx/demo/bitmaps/aquaflagged.ico +0 -0
  414. wx/demo/bitmaps/aquanotchecked.ico +0 -0
  415. wx/demo/bitmaps/aquanotflagged.ico +0 -0
  416. wx/demo/bitmaps/canada.gif +0 -0
  417. wx/demo/bitmaps/checked.ico +0 -0
  418. wx/demo/bitmaps/columns.png +0 -0
  419. wx/demo/bitmaps/contexthelp-16.png +0 -0
  420. wx/demo/bitmaps/contexthelp.png +0 -0
  421. wx/demo/bitmaps/copy.png +0 -0
  422. wx/demo/bitmaps/cropshot24x20.png +0 -0
  423. wx/demo/bitmaps/cut.png +0 -0
  424. wx/demo/bitmaps/editcopy.png +0 -0
  425. wx/demo/bitmaps/editcut.png +0 -0
  426. wx/demo/bitmaps/editpaste.png +0 -0
  427. wx/demo/bitmaps/exit-16.png +0 -0
  428. wx/demo/bitmaps/exit.ico +0 -0
  429. wx/demo/bitmaps/ffwd.png +0 -0
  430. wx/demo/bitmaps/ffwddisabled.png +0 -0
  431. wx/demo/bitmaps/field-16.png +0 -0
  432. wx/demo/bitmaps/filenew.png +0 -0
  433. wx/demo/bitmaps/fileopen.png +0 -0
  434. wx/demo/bitmaps/filesave.png +0 -0
  435. wx/demo/bitmaps/flagged.ico +0 -0
  436. wx/demo/bitmaps/folder_new.png +0 -0
  437. wx/demo/bitmaps/ghost.png +0 -0
  438. wx/demo/bitmaps/gradientbutton.png +0 -0
  439. wx/demo/bitmaps/help-16.png +0 -0
  440. wx/demo/bitmaps/help.ico +0 -0
  441. wx/demo/bitmaps/honeycomb300.png +0 -0
  442. wx/demo/bitmaps/image.bmp +0 -0
  443. wx/demo/bitmaps/image.gif +0 -0
  444. wx/demo/bitmaps/image.ico +0 -0
  445. wx/demo/bitmaps/image.jpg +0 -0
  446. wx/demo/bitmaps/image.png +0 -0
  447. wx/demo/bitmaps/image.tif +0 -0
  448. wx/demo/bitmaps/italy.gif +0 -0
  449. wx/demo/bitmaps/lbadd.png +0 -0
  450. wx/demo/bitmaps/lbcharge.png +0 -0
  451. wx/demo/bitmaps/lbdecrypted.png +0 -0
  452. wx/demo/bitmaps/lbnews.png +0 -0
  453. wx/demo/bitmaps/lbroll.png +0 -0
  454. wx/demo/bitmaps/minus1.ico +0 -0
  455. wx/demo/bitmaps/minus2.ico +0 -0
  456. wx/demo/bitmaps/minus3.ico +0 -0
  457. wx/demo/bitmaps/minus4.ico +0 -0
  458. wx/demo/bitmaps/minus5.ico +0 -0
  459. wx/demo/bitmaps/month-16.png +0 -0
  460. wx/demo/bitmaps/new_file.png +0 -0
  461. wx/demo/bitmaps/new_folder.png +0 -0
  462. wx/demo/bitmaps/notchecked.ico +0 -0
  463. wx/demo/bitmaps/notflagged.ico +0 -0
  464. wx/demo/bitmaps/ok-16.png +0 -0
  465. wx/demo/bitmaps/open_folder.png +0 -0
  466. wx/demo/bitmaps/paste.png +0 -0
  467. wx/demo/bitmaps/pause.png +0 -0
  468. wx/demo/bitmaps/pausedisabled.png +0 -0
  469. wx/demo/bitmaps/phoenix_title.png +0 -0
  470. wx/demo/bitmaps/phoenix_top.png +0 -0
  471. wx/demo/bitmaps/play.png +0 -0
  472. wx/demo/bitmaps/playdisabled.png +0 -0
  473. wx/demo/bitmaps/plus1.ico +0 -0
  474. wx/demo/bitmaps/plus2.ico +0 -0
  475. wx/demo/bitmaps/plus3.ico +0 -0
  476. wx/demo/bitmaps/plus4.ico +0 -0
  477. wx/demo/bitmaps/plus5.ico +0 -0
  478. wx/demo/bitmaps/record.png +0 -0
  479. wx/demo/bitmaps/recorddisabled.png +0 -0
  480. wx/demo/bitmaps/rewind.png +0 -0
  481. wx/demo/bitmaps/rewinddisabled.png +0 -0
  482. wx/demo/bitmaps/round.png +0 -0
  483. wx/demo/bitmaps/save.png +0 -0
  484. wx/demo/bitmaps/smfuel.ico +0 -0
  485. wx/demo/bitmaps/smpi.ico +0 -0
  486. wx/demo/bitmaps/smtemp.ico +0 -0
  487. wx/demo/bitmaps/snakey_render.png +0 -0
  488. wx/demo/bitmaps/splash.png +0 -0
  489. wx/demo/bitmaps/stop.png +0 -0
  490. wx/demo/bitmaps/stopdisabled.png +0 -0
  491. wx/demo/bitmaps/sttbutton.png +0 -0
  492. wx/demo/bitmaps/sttfont.png +0 -0
  493. wx/demo/bitmaps/sttheader.png +0 -0
  494. wx/demo/bitmaps/stthelp.png +0 -0
  495. wx/demo/bitmaps/toucan.png +0 -0
  496. wx/demo/bitmaps/view1.png +0 -0
  497. wx/demo/bitmaps/view2.png +0 -0
  498. wx/demo/bitmaps/view_choose.png +0 -0
  499. wx/demo/bitmaps/view_detailed.png +0 -0
  500. wx/demo/bitmaps/view_icon.png +0 -0
  501. wx/demo/bitmaps/view_multicolumn.png +0 -0
  502. wx/demo/bitmaps/viewmag-16.png +0 -0
  503. wx/demo/bitmaps/viewmag-m-16.png +0 -0
  504. wx/demo/bitmaps/viewmag-p-16.png +0 -0
  505. wx/demo/bitmaps/viewmagfit-16.png +0 -0
  506. wx/demo/bmp_source/001.png +0 -0
  507. wx/demo/bmp_source/002.png +0 -0
  508. wx/demo/bmp_source/003.png +0 -0
  509. wx/demo/bmp_source/004.png +0 -0
  510. wx/demo/bmp_source/005.png +0 -0
  511. wx/demo/bmp_source/006.png +0 -0
  512. wx/demo/bmp_source/007.png +0 -0
  513. wx/demo/bmp_source/008.png +0 -0
  514. wx/demo/bmp_source/009.png +0 -0
  515. wx/demo/bmp_source/010.png +0 -0
  516. wx/demo/bmp_source/011.png +0 -0
  517. wx/demo/bmp_source/012.png +0 -0
  518. wx/demo/bmp_source/013.png +0 -0
  519. wx/demo/bmp_source/014.png +0 -0
  520. wx/demo/bmp_source/015.png +0 -0
  521. wx/demo/bmp_source/016.png +0 -0
  522. wx/demo/bmp_source/017.png +0 -0
  523. wx/demo/bmp_source/018.png +0 -0
  524. wx/demo/bmp_source/019.png +0 -0
  525. wx/demo/bmp_source/020.png +0 -0
  526. wx/demo/bmp_source/021.png +0 -0
  527. wx/demo/bmp_source/022.png +0 -0
  528. wx/demo/bmp_source/023.png +0 -0
  529. wx/demo/bmp_source/024.png +0 -0
  530. wx/demo/bmp_source/025.png +0 -0
  531. wx/demo/bmp_source/026.png +0 -0
  532. wx/demo/bmp_source/027.png +0 -0
  533. wx/demo/bmp_source/028.png +0 -0
  534. wx/demo/bmp_source/029.png +0 -0
  535. wx/demo/bmp_source/030.png +0 -0
  536. wx/demo/bmp_source/DbDec.bmp +0 -0
  537. wx/demo/bmp_source/DbInc.bmp +0 -0
  538. wx/demo/bmp_source/Dec.bmp +0 -0
  539. wx/demo/bmp_source/FRM_0.png +0 -0
  540. wx/demo/bmp_source/FRM_1.png +0 -0
  541. wx/demo/bmp_source/FRM_2.png +0 -0
  542. wx/demo/bmp_source/FRM_3.png +0 -0
  543. wx/demo/bmp_source/FRM_4.png +0 -0
  544. wx/demo/bmp_source/FRM_5.png +0 -0
  545. wx/demo/bmp_source/FRM_6.png +0 -0
  546. wx/demo/bmp_source/FRM_7.png +0 -0
  547. wx/demo/bmp_source/FRM_8.png +0 -0
  548. wx/demo/bmp_source/GridBG.gif +0 -0
  549. wx/demo/bmp_source/Inc.bmp +0 -0
  550. wx/demo/bmp_source/LB01.png +0 -0
  551. wx/demo/bmp_source/LB02.png +0 -0
  552. wx/demo/bmp_source/LB03.png +0 -0
  553. wx/demo/bmp_source/LB04.png +0 -0
  554. wx/demo/bmp_source/LB05.png +0 -0
  555. wx/demo/bmp_source/LB06.png +0 -0
  556. wx/demo/bmp_source/LB07.png +0 -0
  557. wx/demo/bmp_source/LB08.png +0 -0
  558. wx/demo/bmp_source/LB09.png +0 -0
  559. wx/demo/bmp_source/LB10.png +0 -0
  560. wx/demo/bmp_source/LB11.png +0 -0
  561. wx/demo/bmp_source/LB12.png +0 -0
  562. wx/demo/bmp_source/Pt.bmp +0 -0
  563. wx/demo/bmp_source/Vippi.png +0 -0
  564. wx/demo/bmp_source/backgrnd.png +0 -0
  565. wx/demo/bmp_source/book.png +0 -0
  566. wx/demo/bmp_source/book_blue.png +0 -0
  567. wx/demo/bmp_source/book_green.png +0 -0
  568. wx/demo/bmp_source/book_red.png +0 -0
  569. wx/demo/bmp_source/bp_btn1.png +0 -0
  570. wx/demo/bmp_source/bp_btn2.png +0 -0
  571. wx/demo/bmp_source/bp_btn3.png +0 -0
  572. wx/demo/bmp_source/bp_btn4.png +0 -0
  573. wx/demo/bmp_source/bulb1.bmp +0 -0
  574. wx/demo/bmp_source/bulb2.bmp +0 -0
  575. wx/demo/bmp_source/carrot.png +0 -0
  576. wx/demo/bmp_source/clipboard.png +0 -0
  577. wx/demo/bmp_source/code.png +0 -0
  578. wx/demo/bmp_source/core.png +0 -0
  579. wx/demo/bmp_source/custom.png +0 -0
  580. wx/demo/bmp_source/customcontrol.png +0 -0
  581. wx/demo/bmp_source/deletedocs.png +0 -0
  582. wx/demo/bmp_source/deleteperspective.png +0 -0
  583. wx/demo/bmp_source/demo.png +0 -0
  584. wx/demo/bmp_source/dialog.png +0 -0
  585. wx/demo/bmp_source/exit.png +0 -0
  586. wx/demo/bmp_source/expansion.png +0 -0
  587. wx/demo/bmp_source/find.png +0 -0
  588. wx/demo/bmp_source/findnext.png +0 -0
  589. wx/demo/bmp_source/floatcanvas.png +0 -0
  590. wx/demo/bmp_source/frame.png +0 -0
  591. wx/demo/bmp_source/images.png +0 -0
  592. wx/demo/bmp_source/inspect.png +0 -0
  593. wx/demo/bmp_source/layout.png +0 -0
  594. wx/demo/bmp_source/logo.png +0 -0
  595. wx/demo/bmp_source/miscellaneous.png +0 -0
  596. wx/demo/bmp_source/modifiedexists.png +0 -0
  597. wx/demo/bmp_source/mondrian.ico +0 -0
  598. wx/demo/bmp_source/morecontrols.png +0 -0
  599. wx/demo/bmp_source/moredialog.png +0 -0
  600. wx/demo/bmp_source/noicon.png +0 -0
  601. wx/demo/bmp_source/overview.png +0 -0
  602. wx/demo/bmp_source/pencil.png +0 -0
  603. wx/demo/bmp_source/pointy.png +0 -0
  604. wx/demo/bmp_source/process.png +0 -0
  605. wx/demo/bmp_source/pyshell.png +0 -0
  606. wx/demo/bmp_source/recent.png +0 -0
  607. wx/demo/bmp_source/rest.png +0 -0
  608. wx/demo/bmp_source/robin.jpg +0 -0
  609. wx/demo/bmp_source/rt_alignleft.xpm +24 -0
  610. wx/demo/bmp_source/rt_alignright.xpm +24 -0
  611. wx/demo/bmp_source/rt_bold.xpm +24 -0
  612. wx/demo/bmp_source/rt_centre.xpm +24 -0
  613. wx/demo/bmp_source/rt_colour.xpm +59 -0
  614. wx/demo/bmp_source/rt_copy.xpm +44 -0
  615. wx/demo/bmp_source/rt_cut.xpm +46 -0
  616. wx/demo/bmp_source/rt_font.xpm +25 -0
  617. wx/demo/bmp_source/rt_idea.xpm +47 -0
  618. wx/demo/bmp_source/rt_indentless.xpm +25 -0
  619. wx/demo/bmp_source/rt_indentmore.xpm +25 -0
  620. wx/demo/bmp_source/rt_italic.xpm +25 -0
  621. wx/demo/bmp_source/rt_open.xpm +57 -0
  622. wx/demo/bmp_source/rt_paste.xpm +46 -0
  623. wx/demo/bmp_source/rt_redo.xpm +58 -0
  624. wx/demo/bmp_source/rt_sample.xpm +44 -0
  625. wx/demo/bmp_source/rt_save.xpm +42 -0
  626. wx/demo/bmp_source/rt_smiley.xpm +42 -0
  627. wx/demo/bmp_source/rt_underline.xpm +25 -0
  628. wx/demo/bmp_source/rt_undo.xpm +58 -0
  629. wx/demo/bmp_source/rt_zebra.xpm +409 -0
  630. wx/demo/bmp_source/saveperspective.png +0 -0
  631. wx/demo/bmp_source/sm_down.bmp +0 -0
  632. wx/demo/bmp_source/sm_up.bmp +0 -0
  633. wx/demo/bmp_source/smiles2.bmp +0 -0
  634. wx/demo/bmp_source/test2.bmp +0 -0
  635. wx/demo/bmp_source/testmask.bmp +0 -0
  636. wx/demo/bmp_source/teststar.png +0 -0
  637. wx/demo/bmp_source/thekid.png +0 -0
  638. wx/demo/bmp_source/tog1.bmp +0 -0
  639. wx/demo/bmp_source/tog2.bmp +0 -0
  640. wx/demo/bmp_source/wiztest1.bmp +0 -0
  641. wx/demo/bmp_source/wiztest2.bmp +0 -0
  642. wx/demo/bmp_source/wxpdemo.ico +0 -0
  643. wx/demo/cursors/paperairplane_arrow_blue.cur +0 -0
  644. wx/demo/cursors/paperairplane_arrow_blue_fadeout80.cur +0 -0
  645. wx/demo/cursors/paperairplane_arrow_colorshift.ani +0 -0
  646. wx/demo/cursors/paperairplane_arrow_dark.cur +0 -0
  647. wx/demo/cursors/paperairplane_arrow_grey.cur +0 -0
  648. wx/demo/cursors/paperairplane_arrow_red.cur +0 -0
  649. wx/demo/cursors/paperairplane_arrow_white.cur +0 -0
  650. wx/demo/cursors/paperairplane_arrow_white24.png +0 -0
  651. wx/demo/data/0-tiger.svg +725 -0
  652. wx/demo/data/Asteroid_blaster.swf +0 -0
  653. wx/demo/data/SIL_OPEN_FONT_LICENSE.txt +97 -0
  654. wx/demo/data/SourceCodePro-Regular.ttf +0 -0
  655. wx/demo/data/accessories-calculator.svg +636 -0
  656. wx/demo/data/accessories-text-editor.svg +554 -0
  657. wx/demo/data/anykey.wav +0 -0
  658. wx/demo/data/applications-internet.svg +623 -0
  659. wx/demo/data/desktop-accessibility.svg +245 -0
  660. wx/demo/data/desktop-keyboard-shortcuts.svg +839 -0
  661. wx/demo/data/desktop-locale.svg +878 -0
  662. wx/demo/data/desktop-remote-desktop.svg +1479 -0
  663. wx/demo/data/desktop-theme.svg +882 -0
  664. wx/demo/data/desktop-wallpaper.svg +747 -0
  665. wx/demo/data/echo.py +25 -0
  666. wx/demo/data/imagemap.htm +20 -0
  667. wx/demo/data/imagemap.png +0 -0
  668. wx/demo/data/internet-group-chat.svg +312 -0
  669. wx/demo/data/internet-mail.svg +440 -0
  670. wx/demo/data/locale/af/LC_MESSAGES/wxpydemo.mo +0 -0
  671. wx/demo/data/locale/de/LC_MESSAGES/wxpydemo.mo +0 -0
  672. wx/demo/data/locale/es/LC_MESSAGES/wxpydemo.mo +0 -0
  673. wx/demo/data/locale/fr/LC_MESSAGES/wxpydemo.mo +0 -0
  674. wx/demo/data/locale/it/LC_MESSAGES/wxpydemo.mo +0 -0
  675. wx/demo/data/locale-src/af.po +23 -0
  676. wx/demo/data/locale-src/de.po +23 -0
  677. wx/demo/data/locale-src/es.po +22 -0
  678. wx/demo/data/locale-src/fr.po +22 -0
  679. wx/demo/data/locale-src/install +15 -0
  680. wx/demo/data/locale-src/it.po +23 -0
  681. wx/demo/data/locale-src/wxpydemo.po +21 -0
  682. wx/demo/data/office-calendar.svg +316 -0
  683. wx/demo/data/pic.png +0 -0
  684. wx/demo/data/pic2.bmp +0 -0
  685. wx/demo/data/plan.wav +0 -0
  686. wx/demo/data/proclamation.txt +115 -0
  687. wx/demo/data/resource.wdr +0 -0
  688. wx/demo/data/resource_wdr.xrc +146 -0
  689. wx/demo/data/romedalen.png +0 -0
  690. wx/demo/data/stc.h.html +3544 -0
  691. wx/demo/data/system-session.svg +510 -0
  692. wx/demo/data/system-users.svg +539 -0
  693. wx/demo/data/tables.htm +116 -0
  694. wx/demo/data/test-gradient-pen.svg +14 -0
  695. wx/demo/data/test-opacity.svg +7 -0
  696. wx/demo/data/test.htm +253 -0
  697. wx/demo/data/testmovie.mpg +0 -0
  698. wx/demo/data/testtable.txt +38 -0
  699. wx/demo/data/tips.txt +73 -0
  700. wx/demo/data/utilities-system-monitor.svg +435 -0
  701. wx/demo/data/utilities-terminal.svg +500 -0
  702. wx/demo/data/widgetTest.htm +70 -0
  703. wx/demo/data/world.dat +24055 -0
  704. wx/demo/demo.py +4 -0
  705. wx/demo/demo.pyw +4 -0
  706. wx/demo/demodata.py +310 -0
  707. wx/demo/encode_bitmaps.py +181 -0
  708. wx/demo/images.py +6812 -0
  709. wx/demo/infoframe.py +149 -0
  710. wx/demo/run.py +171 -0
  711. wx/demo/snippets/__init__.py +13 -0
  712. wx/demo/snippets/arc.py +21 -0
  713. wx/demo/snippets/arc_negative.py +21 -0
  714. wx/demo/snippets/clip.py +13 -0
  715. wx/demo/snippets/clip_image.py +13 -0
  716. wx/demo/snippets/curve_rectangle.py +53 -0
  717. wx/demo/snippets/curve_to.py +17 -0
  718. wx/demo/snippets/dash.py +18 -0
  719. wx/demo/snippets/ellipse.py +33 -0
  720. wx/demo/snippets/fill_and_stroke.py +12 -0
  721. wx/demo/snippets/fill_and_stroke2.py +18 -0
  722. wx/demo/snippets/fill_style.py +31 -0
  723. wx/demo/snippets/glyph_path.py +21 -0
  724. wx/demo/snippets/gradient.py +16 -0
  725. wx/demo/snippets/gradient_mask.py +12 -0
  726. wx/demo/snippets/group.py +16 -0
  727. wx/demo/snippets/image.py +14 -0
  728. wx/demo/snippets/imagepattern.py +23 -0
  729. wx/demo/snippets/path.py +7 -0
  730. wx/demo/snippets/set_line_cap.py +19 -0
  731. wx/demo/snippets/set_line_join.py +21 -0
  732. wx/demo/snippets/show_glyphs.py +15 -0
  733. wx/demo/snippets/text.py +22 -0
  734. wx/demo/snippets/text_align_center.py +26 -0
  735. wx/demo/snippets/text_extents.py +27 -0
  736. wx/demo/template.py +36 -0
  737. wx/demo/throbImages.py +1277 -0
  738. wx/demo/version.py +3 -0
  739. wx/demo/widgetTest.py +72 -0
  740. wx/demo/wxpdemo.ico +0 -0
  741. wx/glcanvas.py +10 -0
  742. wx/glcanvas.pyi +458 -0
  743. wx/grid.py +229 -0
  744. wx/grid.pyi +4959 -0
  745. wx/html.py +35 -0
  746. wx/html.pyi +2965 -0
  747. wx/html2.py +40 -0
  748. wx/html2.pyi +772 -0
  749. wx/lib/CDate.py +202 -0
  750. wx/lib/ClickableHtmlWindow.py +57 -0
  751. wx/lib/__init__.py +0 -0
  752. wx/lib/activex.py +178 -0
  753. wx/lib/activexwrapper.py +153 -0
  754. wx/lib/agw/__init__.py +128 -0
  755. wx/lib/agw/advancedsplash.py +564 -0
  756. wx/lib/agw/aquabutton.py +1127 -0
  757. wx/lib/agw/artmanager.py +2110 -0
  758. wx/lib/agw/aui/__init__.py +295 -0
  759. wx/lib/agw/aui/aui_constants.py +2628 -0
  760. wx/lib/agw/aui/aui_switcherdialog.py +1227 -0
  761. wx/lib/agw/aui/aui_utilities.py +672 -0
  762. wx/lib/agw/aui/auibar.py +4031 -0
  763. wx/lib/agw/aui/auibook.py +6289 -0
  764. wx/lib/agw/aui/dockart.py +1198 -0
  765. wx/lib/agw/aui/framemanager.py +10409 -0
  766. wx/lib/agw/aui/tabart.py +2771 -0
  767. wx/lib/agw/aui/tabmdi.py +679 -0
  768. wx/lib/agw/balloontip.py +1158 -0
  769. wx/lib/agw/buttonpanel.py +2823 -0
  770. wx/lib/agw/cubecolourdialog.py +3529 -0
  771. wx/lib/agw/customtreectrl.py +8963 -0
  772. wx/lib/agw/data/ShortcutEditor_1.png +0 -0
  773. wx/lib/agw/data/ShortcutEditor_1_thumb.png +0 -0
  774. wx/lib/agw/data/ShortcutEditor_2.png +0 -0
  775. wx/lib/agw/data/ShortcutEditor_2_thumb.png +0 -0
  776. wx/lib/agw/data/ShortcutEditor_3.png +0 -0
  777. wx/lib/agw/data/ShortcutEditor_3_thumb.png +0 -0
  778. wx/lib/agw/data/ShortcutEditor_4.png +0 -0
  779. wx/lib/agw/data/ShortcutEditor_4_thumb.png +0 -0
  780. wx/lib/agw/data/default_help_text.html +105 -0
  781. wx/lib/agw/flatmenu.py +7333 -0
  782. wx/lib/agw/flatnotebook.py +6672 -0
  783. wx/lib/agw/floatspin.py +1823 -0
  784. wx/lib/agw/fmcustomizedlg.py +540 -0
  785. wx/lib/agw/fmresources.py +407 -0
  786. wx/lib/agw/foldpanelbar.py +2282 -0
  787. wx/lib/agw/fourwaysplitter.py +1130 -0
  788. wx/lib/agw/genericmessagedialog.py +1549 -0
  789. wx/lib/agw/gradientbutton.py +732 -0
  790. wx/lib/agw/hyperlink.py +664 -0
  791. wx/lib/agw/hypertreelist.py +5374 -0
  792. wx/lib/agw/infobar.py +885 -0
  793. wx/lib/agw/knobctrl.py +945 -0
  794. wx/lib/agw/labelbook.py +3029 -0
  795. wx/lib/agw/multidirdialog.py +615 -0
  796. wx/lib/agw/peakmeter.py +1029 -0
  797. wx/lib/agw/persist/__init__.py +188 -0
  798. wx/lib/agw/persist/persist_constants.py +284 -0
  799. wx/lib/agw/persist/persist_handlers.py +2614 -0
  800. wx/lib/agw/persist/persistencemanager.py +864 -0
  801. wx/lib/agw/piectrl.py +1082 -0
  802. wx/lib/agw/pybusyinfo.py +399 -0
  803. wx/lib/agw/pycollapsiblepane.py +940 -0
  804. wx/lib/agw/pygauge.py +570 -0
  805. wx/lib/agw/pyprogress.py +917 -0
  806. wx/lib/agw/ribbon/__init__.py +198 -0
  807. wx/lib/agw/ribbon/art.py +219 -0
  808. wx/lib/agw/ribbon/art_aui.py +1284 -0
  809. wx/lib/agw/ribbon/art_default.py +81 -0
  810. wx/lib/agw/ribbon/art_internal.py +244 -0
  811. wx/lib/agw/ribbon/art_msw.py +2736 -0
  812. wx/lib/agw/ribbon/art_osx.py +52 -0
  813. wx/lib/agw/ribbon/bar.py +1261 -0
  814. wx/lib/agw/ribbon/buttonbar.py +1320 -0
  815. wx/lib/agw/ribbon/control.py +205 -0
  816. wx/lib/agw/ribbon/gallery.py +974 -0
  817. wx/lib/agw/ribbon/page.py +946 -0
  818. wx/lib/agw/ribbon/panel.py +1170 -0
  819. wx/lib/agw/ribbon/toolbar.py +1442 -0
  820. wx/lib/agw/rulerctrl.py +1887 -0
  821. wx/lib/agw/scrolledthumbnail.py +2119 -0
  822. wx/lib/agw/shapedbutton.py +1809 -0
  823. wx/lib/agw/shortcuteditor.py +2634 -0
  824. wx/lib/agw/speedmeter.py +1801 -0
  825. wx/lib/agw/supertooltip.py +1444 -0
  826. wx/lib/agw/thumbnailctrl.py +529 -0
  827. wx/lib/agw/toasterbox.py +1327 -0
  828. wx/lib/agw/ultimatelistctrl.py +13666 -0
  829. wx/lib/agw/xlsgrid.py +2113 -0
  830. wx/lib/agw/zoombar.py +1339 -0
  831. wx/lib/analogclock/__init__.py +140 -0
  832. wx/lib/analogclock/analogclock.py +631 -0
  833. wx/lib/analogclock/helpers.py +991 -0
  834. wx/lib/analogclock/lib_setup/__init__.py +0 -0
  835. wx/lib/analogclock/lib_setup/buttontreectrlpanel.py +297 -0
  836. wx/lib/analogclock/lib_setup/fontselect.py +57 -0
  837. wx/lib/analogclock/setup.py +490 -0
  838. wx/lib/analogclock/styles.py +47 -0
  839. wx/lib/anchors.py +103 -0
  840. wx/lib/art/__init__.py +4 -0
  841. wx/lib/art/flagart.py +1583 -0
  842. wx/lib/art/img2pyartprov.py +56 -0
  843. wx/lib/busy.py +146 -0
  844. wx/lib/buttons.py +1141 -0
  845. wx/lib/calendar.py +1597 -0
  846. wx/lib/checkbox.py +837 -0
  847. wx/lib/colourchooser/__init__.py +38 -0
  848. wx/lib/colourchooser/canvas.py +145 -0
  849. wx/lib/colourchooser/intl.py +24 -0
  850. wx/lib/colourchooser/pycolourbox.py +89 -0
  851. wx/lib/colourchooser/pycolourchooser.py +629 -0
  852. wx/lib/colourchooser/pycolourslider.py +100 -0
  853. wx/lib/colourchooser/pypalette.py +211 -0
  854. wx/lib/colourdb.py +740 -0
  855. wx/lib/colourselect.py +385 -0
  856. wx/lib/colourutils.py +118 -0
  857. wx/lib/combotreebox.py +944 -0
  858. wx/lib/delayedresult.py +420 -0
  859. wx/lib/dialogs.py +510 -0
  860. wx/lib/docview.py +3210 -0
  861. wx/lib/dragscroller.py +79 -0
  862. wx/lib/editor/README.txt +77 -0
  863. wx/lib/editor/__init__.py +24 -0
  864. wx/lib/editor/editor.py +974 -0
  865. wx/lib/editor/images.py +15 -0
  866. wx/lib/editor/selection.py +44 -0
  867. wx/lib/embeddedimage.py +76 -0
  868. wx/lib/eventStack.py +136 -0
  869. wx/lib/eventwatcher.py +440 -0
  870. wx/lib/evtmgr.py +521 -0
  871. wx/lib/expando.py +393 -0
  872. wx/lib/fancytext.py +505 -0
  873. wx/lib/filebrowsebutton.py +459 -0
  874. wx/lib/flashwin.py +262 -0
  875. wx/lib/flashwin_old.py +651 -0
  876. wx/lib/floatcanvas/FCEvents.py +53 -0
  877. wx/lib/floatcanvas/FCObjects.py +2923 -0
  878. wx/lib/floatcanvas/FloatCanvas.py +1027 -0
  879. wx/lib/floatcanvas/GUIMode.py +396 -0
  880. wx/lib/floatcanvas/NavCanvas.py +161 -0
  881. wx/lib/floatcanvas/Resources.py +319 -0
  882. wx/lib/floatcanvas/ScreenShot.py +1788 -0
  883. wx/lib/floatcanvas/Utilities/BBox.py +314 -0
  884. wx/lib/floatcanvas/Utilities/Colors.py +137 -0
  885. wx/lib/floatcanvas/Utilities/GUI.py +91 -0
  886. wx/lib/floatcanvas/Utilities/__init__.py +7 -0
  887. wx/lib/floatcanvas/__init__.py +124 -0
  888. wx/lib/foldmenu.py +89 -0
  889. wx/lib/gestures.py +310 -0
  890. wx/lib/gizmos/__init__.py +18 -0
  891. wx/lib/gizmos/dynamicsash.py +1202 -0
  892. wx/lib/gizmos/ledctrl.py +300 -0
  893. wx/lib/gizmos/treelistctrl.py +87 -0
  894. wx/lib/graphics.py +1939 -0
  895. wx/lib/gridmovers.py +511 -0
  896. wx/lib/iewin.py +249 -0
  897. wx/lib/iewin_old.py +894 -0
  898. wx/lib/imagebrowser.py +856 -0
  899. wx/lib/imageutils.py +163 -0
  900. wx/lib/infoframe.py +490 -0
  901. wx/lib/inspection.py +1255 -0
  902. wx/lib/intctrl.py +1001 -0
  903. wx/lib/itemspicker.py +256 -0
  904. wx/lib/langlistctrl.py +480 -0
  905. wx/lib/layoutf.py +271 -0
  906. wx/lib/masked/__init__.py +27 -0
  907. wx/lib/masked/combobox.py +839 -0
  908. wx/lib/masked/ctrl.py +108 -0
  909. wx/lib/masked/ipaddrctrl.py +242 -0
  910. wx/lib/masked/maskededit.py +7279 -0
  911. wx/lib/masked/numctrl.py +2001 -0
  912. wx/lib/masked/textctrl.py +465 -0
  913. wx/lib/masked/timectrl.py +1466 -0
  914. wx/lib/mixins/__init__.py +17 -0
  915. wx/lib/mixins/grid.py +47 -0
  916. wx/lib/mixins/gridlabelrenderer.py +251 -0
  917. wx/lib/mixins/imagelist.py +77 -0
  918. wx/lib/mixins/inspection.py +184 -0
  919. wx/lib/mixins/listctrl.py +894 -0
  920. wx/lib/mixins/rubberband.py +404 -0
  921. wx/lib/mixins/treemixin.py +678 -0
  922. wx/lib/msgpanel.py +95 -0
  923. wx/lib/multisash.py +747 -0
  924. wx/lib/myole4ax.idl +178 -0
  925. wx/lib/myole4ax.tlb +0 -0
  926. wx/lib/newevent.py +229 -0
  927. wx/lib/nvdlg.py +156 -0
  928. wx/lib/ogl/__init__.py +13 -0
  929. wx/lib/ogl/basic.py +3991 -0
  930. wx/lib/ogl/bmpshape.py +87 -0
  931. wx/lib/ogl/canvas.py +467 -0
  932. wx/lib/ogl/composit.py +1577 -0
  933. wx/lib/ogl/diagram.py +230 -0
  934. wx/lib/ogl/divided.py +483 -0
  935. wx/lib/ogl/drawn.py +900 -0
  936. wx/lib/ogl/lines.py +1811 -0
  937. wx/lib/ogl/oglmisc.py +608 -0
  938. wx/lib/pdfviewer/__init__.py +113 -0
  939. wx/lib/pdfviewer/bitmaps/ArrowLeft.png +0 -0
  940. wx/lib/pdfviewer/bitmaps/ArrowRight.png +0 -0
  941. wx/lib/pdfviewer/bitmaps/DirectionH.png +0 -0
  942. wx/lib/pdfviewer/bitmaps/DirectionV.png +0 -0
  943. wx/lib/pdfviewer/bitmaps/PlayerFirst.png +0 -0
  944. wx/lib/pdfviewer/bitmaps/PlayerLast.png +0 -0
  945. wx/lib/pdfviewer/bitmaps/PlayerNext.png +0 -0
  946. wx/lib/pdfviewer/bitmaps/PlayerPrev.png +0 -0
  947. wx/lib/pdfviewer/bitmaps/Printer.png +0 -0
  948. wx/lib/pdfviewer/bitmaps/ReadMe.txt +28 -0
  949. wx/lib/pdfviewer/bitmaps/Save.png +0 -0
  950. wx/lib/pdfviewer/bitmaps/ZoomIn.png +0 -0
  951. wx/lib/pdfviewer/bitmaps/ZoomOut.png +0 -0
  952. wx/lib/pdfviewer/bitmaps/encode_bitmaps.py +37 -0
  953. wx/lib/pdfviewer/buttonpanel.py +279 -0
  954. wx/lib/pdfviewer/images.py +240 -0
  955. wx/lib/pdfviewer/viewer.py +1077 -0
  956. wx/lib/pdfwin.py +295 -0
  957. wx/lib/pdfwin_old.py +789 -0
  958. wx/lib/platebtn.py +789 -0
  959. wx/lib/plot/CHANGELOG.md +150 -0
  960. wx/lib/plot/README.md +16 -0
  961. wx/lib/plot/__init__.py +46 -0
  962. wx/lib/plot/__main__.py +5 -0
  963. wx/lib/plot/examples/__init__.py +0 -0
  964. wx/lib/plot/examples/demo.py +1009 -0
  965. wx/lib/plot/examples/simple_example.py +54 -0
  966. wx/lib/plot/plotcanvas.py +2981 -0
  967. wx/lib/plot/polyobjects.py +1525 -0
  968. wx/lib/plot/utils.py +327 -0
  969. wx/lib/popupctl.py +250 -0
  970. wx/lib/printout.py +1157 -0
  971. wx/lib/progressindicator.py +151 -0
  972. wx/lib/pubsub/LICENSE_BSD_Simple.txt +23 -0
  973. wx/lib/pubsub/README_WxPython.txt +22 -0
  974. wx/lib/pubsub/RELEASE_NOTES.txt +71 -0
  975. wx/lib/pubsub/__init__.py +25 -0
  976. wx/lib/pubsub/core/__init__.py +92 -0
  977. wx/lib/pubsub/core/arg1/__init__.py +16 -0
  978. wx/lib/pubsub/core/arg1/listenerimpl.py +97 -0
  979. wx/lib/pubsub/core/arg1/publisher.py +40 -0
  980. wx/lib/pubsub/core/arg1/publishermixin.py +34 -0
  981. wx/lib/pubsub/core/arg1/topicargspecimpl.py +66 -0
  982. wx/lib/pubsub/core/arg1/topicmgrimpl.py +19 -0
  983. wx/lib/pubsub/core/callables.py +191 -0
  984. wx/lib/pubsub/core/imp2.py +63 -0
  985. wx/lib/pubsub/core/itopicdefnprovider.py +0 -0
  986. wx/lib/pubsub/core/kwargs/__init__.py +16 -0
  987. wx/lib/pubsub/core/kwargs/datamsg.py +27 -0
  988. wx/lib/pubsub/core/kwargs/listenerimpl.py +93 -0
  989. wx/lib/pubsub/core/kwargs/publisher.py +77 -0
  990. wx/lib/pubsub/core/kwargs/publishermixin.py +65 -0
  991. wx/lib/pubsub/core/kwargs/topicargspecimpl.py +217 -0
  992. wx/lib/pubsub/core/kwargs/topicmgrimpl.py +13 -0
  993. wx/lib/pubsub/core/listener.py +40 -0
  994. wx/lib/pubsub/core/listenerbase.py +185 -0
  995. wx/lib/pubsub/core/notificationmgr.py +185 -0
  996. wx/lib/pubsub/core/publisherbase.py +191 -0
  997. wx/lib/pubsub/core/topicargspec.py +77 -0
  998. wx/lib/pubsub/core/topicdefnprovider.py +632 -0
  999. wx/lib/pubsub/core/topicexc.py +72 -0
  1000. wx/lib/pubsub/core/topicmgr.py +456 -0
  1001. wx/lib/pubsub/core/topicobj.py +472 -0
  1002. wx/lib/pubsub/core/topictreetraverser.py +143 -0
  1003. wx/lib/pubsub/core/topicutils.py +118 -0
  1004. wx/lib/pubsub/core/treeconfig.py +21 -0
  1005. wx/lib/pubsub/core/validatedefnargs.py +29 -0
  1006. wx/lib/pubsub/core/weakmethod.py +102 -0
  1007. wx/lib/pubsub/policies.py +24 -0
  1008. wx/lib/pubsub/pub.py +199 -0
  1009. wx/lib/pubsub/py2and3.py +608 -0
  1010. wx/lib/pubsub/setuparg1.py +47 -0
  1011. wx/lib/pubsub/setupkwargs.py +29 -0
  1012. wx/lib/pubsub/utils/__init__.py +27 -0
  1013. wx/lib/pubsub/utils/exchandling.py +100 -0
  1014. wx/lib/pubsub/utils/misc.py +100 -0
  1015. wx/lib/pubsub/utils/notification.py +331 -0
  1016. wx/lib/pubsub/utils/topictreeprinter.py +195 -0
  1017. wx/lib/pubsub/utils/xmltopicdefnprovider.py +287 -0
  1018. wx/lib/pydocview.py +3300 -0
  1019. wx/lib/rcsizer.py +229 -0
  1020. wx/lib/resizewidget.py +357 -0
  1021. wx/lib/scrolledpanel.py +225 -0
  1022. wx/lib/sheet.py +350 -0
  1023. wx/lib/sized_controls.py +691 -0
  1024. wx/lib/softwareupdate.py +361 -0
  1025. wx/lib/splitter.py +925 -0
  1026. wx/lib/statbmp.py +199 -0
  1027. wx/lib/stattext.py +322 -0
  1028. wx/lib/throbber.py +425 -0
  1029. wx/lib/ticker.py +295 -0
  1030. wx/lib/ticker_xrc.py +48 -0
  1031. wx/lib/utils.py +89 -0
  1032. wx/lib/wordwrap.py +97 -0
  1033. wx/lib/wxcairo/__init__.py +124 -0
  1034. wx/lib/wxcairo/wx_cairocffi.py +200 -0
  1035. wx/lib/wxcairo/wx_pycairo.py +463 -0
  1036. wx/lib/wxpTag.py +274 -0
  1037. wx/locale/af/LC_MESSAGES/wxstd.mo +0 -0
  1038. wx/locale/an/LC_MESSAGES/wxstd.mo +0 -0
  1039. wx/locale/ar/LC_MESSAGES/wxstd.mo +0 -0
  1040. wx/locale/ca/LC_MESSAGES/wxstd.mo +0 -0
  1041. wx/locale/ca@valencia/LC_MESSAGES/wxstd.mo +0 -0
  1042. wx/locale/cs/LC_MESSAGES/wxstd.mo +0 -0
  1043. wx/locale/da/LC_MESSAGES/wxstd.mo +0 -0
  1044. wx/locale/de/LC_MESSAGES/wxstd.mo +0 -0
  1045. wx/locale/el/LC_MESSAGES/wxstd.mo +0 -0
  1046. wx/locale/es/LC_MESSAGES/wxstd.mo +0 -0
  1047. wx/locale/eu/LC_MESSAGES/wxstd.mo +0 -0
  1048. wx/locale/fa_IR/LC_MESSAGES/wxstd.mo +0 -0
  1049. wx/locale/fi/LC_MESSAGES/wxstd.mo +0 -0
  1050. wx/locale/fr/LC_MESSAGES/wxstd.mo +0 -0
  1051. wx/locale/gl_ES/LC_MESSAGES/wxstd.mo +0 -0
  1052. wx/locale/hi/LC_MESSAGES/wxstd.mo +0 -0
  1053. wx/locale/hr/LC_MESSAGES/wxstd.mo +0 -0
  1054. wx/locale/hu/LC_MESSAGES/wxstd.mo +0 -0
  1055. wx/locale/id/LC_MESSAGES/wxstd.mo +0 -0
  1056. wx/locale/it/LC_MESSAGES/wxstd.mo +0 -0
  1057. wx/locale/ja/LC_MESSAGES/wxstd.mo +0 -0
  1058. wx/locale/ka/LC_MESSAGES/wxstd.mo +0 -0
  1059. wx/locale/ko_KR/LC_MESSAGES/wxstd.mo +0 -0
  1060. wx/locale/lt/LC_MESSAGES/wxstd.mo +0 -0
  1061. wx/locale/lv/LC_MESSAGES/wxstd.mo +0 -0
  1062. wx/locale/ms/LC_MESSAGES/wxstd.mo +0 -0
  1063. wx/locale/nb/LC_MESSAGES/wxstd.mo +0 -0
  1064. wx/locale/ne/LC_MESSAGES/wxstd.mo +0 -0
  1065. wx/locale/nl/LC_MESSAGES/wxstd.mo +0 -0
  1066. wx/locale/pl/LC_MESSAGES/wxstd.mo +0 -0
  1067. wx/locale/pt/LC_MESSAGES/wxstd.mo +0 -0
  1068. wx/locale/pt_BR/LC_MESSAGES/wxstd.mo +0 -0
  1069. wx/locale/ro/LC_MESSAGES/wxstd.mo +0 -0
  1070. wx/locale/ru/LC_MESSAGES/wxstd.mo +0 -0
  1071. wx/locale/sk/LC_MESSAGES/wxstd.mo +0 -0
  1072. wx/locale/sl/LC_MESSAGES/wxstd.mo +0 -0
  1073. wx/locale/sq/LC_MESSAGES/wxstd.mo +0 -0
  1074. wx/locale/sv/LC_MESSAGES/wxstd.mo +0 -0
  1075. wx/locale/ta/LC_MESSAGES/wxstd.mo +0 -0
  1076. wx/locale/tr/LC_MESSAGES/wxstd.mo +0 -0
  1077. wx/locale/uk/LC_MESSAGES/wxstd.mo +0 -0
  1078. wx/locale/vi/LC_MESSAGES/wxstd.mo +0 -0
  1079. wx/locale/zh_CN/LC_MESSAGES/wxstd.mo +0 -0
  1080. wx/locale/zh_TW/LC_MESSAGES/wxstd.mo +0 -0
  1081. wx/media.py +27 -0
  1082. wx/media.pyi +223 -0
  1083. wx/msw.py +13 -0
  1084. wx/msw.pyi +65 -0
  1085. wx/propgrid.py +1451 -0
  1086. wx/propgrid.pyi +7914 -0
  1087. wx/py/CHANGES.txt +796 -0
  1088. wx/py/Py.ico +0 -0
  1089. wx/py/PyAlaCarte.py +34 -0
  1090. wx/py/PyAlaMode.py +34 -0
  1091. wx/py/PyAlaModeTest.py +33 -0
  1092. wx/py/PyCrust.ico +0 -0
  1093. wx/py/PyCrust.py +78 -0
  1094. wx/py/PyCrust_16.png +0 -0
  1095. wx/py/PyCrust_32.png +0 -0
  1096. wx/py/PyFilling.py +35 -0
  1097. wx/py/PyShell.py +78 -0
  1098. wx/py/PySlices.ico +0 -0
  1099. wx/py/PySlices.py +98 -0
  1100. wx/py/PySlicesShell.py +94 -0
  1101. wx/py/PySlices_16.png +0 -0
  1102. wx/py/PySlices_32.png +0 -0
  1103. wx/py/PyWrap.py +52 -0
  1104. wx/py/README.txt +77 -0
  1105. wx/py/__init__.py +20 -0
  1106. wx/py/buffer.py +136 -0
  1107. wx/py/crust.py +403 -0
  1108. wx/py/crustslices.py +403 -0
  1109. wx/py/dispatcher.py +259 -0
  1110. wx/py/document.py +37 -0
  1111. wx/py/editor.py +844 -0
  1112. wx/py/editwindow.py +299 -0
  1113. wx/py/filling.py +357 -0
  1114. wx/py/frame.py +978 -0
  1115. wx/py/images.py +212 -0
  1116. wx/py/interpreter.py +170 -0
  1117. wx/py/introspect.py +393 -0
  1118. wx/py/magic.py +98 -0
  1119. wx/py/parse.py +134 -0
  1120. wx/py/path.py +36 -0
  1121. wx/py/pseudo.py +99 -0
  1122. wx/py/shell.py +1588 -0
  1123. wx/py/sliceshell.py +3814 -0
  1124. wx/py/tests/test_interpreter.py +71 -0
  1125. wx/py/tests/test_introspect.py +862 -0
  1126. wx/py/tests/test_pseudo.py +70 -0
  1127. wx/py/tests/test_version.py +36 -0
  1128. wx/py/tests/testall.py +22 -0
  1129. wx/py/version.py +7 -0
  1130. wx/ribbon.py +45 -0
  1131. wx/ribbon.pyi +2494 -0
  1132. wx/richtext.py +142 -0
  1133. wx/richtext.pyi +12113 -0
  1134. wx/siplib.cp313-win_amd64.pyd +0 -0
  1135. wx/stc.py +58 -0
  1136. wx/stc.pyi +8463 -0
  1137. wx/svg/__init__.py +364 -0
  1138. wx/svg/_nanosvg.cp313-win_amd64.pyd +0 -0
  1139. wx/tools/__init__.py +18 -0
  1140. wx/tools/dbg.py +268 -0
  1141. wx/tools/genaxmodule.py +50 -0
  1142. wx/tools/helpviewer.py +92 -0
  1143. wx/tools/img2img.py +85 -0
  1144. wx/tools/img2png.py +54 -0
  1145. wx/tools/img2py.py +309 -0
  1146. wx/tools/img2xpm.py +54 -0
  1147. wx/tools/pywxrc.py +949 -0
  1148. wx/tools/wxget.py +254 -0
  1149. wx/tools/wxget_docs_demo.py +186 -0
  1150. wx/wxbase315u_net_vc140_x64.dll +0 -0
  1151. wx/wxbase315u_vc140_x64.dll +0 -0
  1152. wx/wxbase315u_xml_vc140_x64.dll +0 -0
  1153. wx/wxmsw315u_adv_vc140_x64.dll +0 -0
  1154. wx/wxmsw315u_aui_vc140_x64.dll +0 -0
  1155. wx/wxmsw315u_core_vc140_x64.dll +0 -0
  1156. wx/wxmsw315u_gl_vc140_x64.dll +0 -0
  1157. wx/wxmsw315u_html_vc140_x64.dll +0 -0
  1158. wx/wxmsw315u_media_vc140_x64.dll +0 -0
  1159. wx/wxmsw315u_propgrid_vc140_x64.dll +0 -0
  1160. wx/wxmsw315u_qa_vc140_x64.dll +0 -0
  1161. wx/wxmsw315u_ribbon_vc140_x64.dll +0 -0
  1162. wx/wxmsw315u_richtext_vc140_x64.dll +0 -0
  1163. wx/wxmsw315u_stc_vc140_x64.dll +0 -0
  1164. wx/wxmsw315u_webview_vc140_x64.dll +0 -0
  1165. wx/wxmsw315u_xrc_vc140_x64.dll +0 -0
  1166. wx/xml.py +15 -0
  1167. wx/xml.pyi +575 -0
  1168. wx/xrc.py +65 -0
  1169. wx/xrc.pyi +742 -0
  1170. wxPython_zombie-3.1.5.8.dist-info/LICENSE.txt +950 -0
  1171. wxPython_zombie-3.1.5.8.dist-info/METADATA +107 -0
  1172. wxPython_zombie-3.1.5.8.dist-info/RECORD +1175 -0
  1173. wxPython_zombie-3.1.5.8.dist-info/WHEEL +5 -0
  1174. wxPython_zombie-3.1.5.8.dist-info/entry_points.txt +2 -0
  1175. wxPython_zombie-3.1.5.8.dist-info/top_level.txt +1 -0
wx/core.py ADDED
@@ -0,0 +1,3540 @@
1
+ # This file is generated by wxPython's SIP generator. Do not edit by hand.
2
+
3
+ """
4
+ The classes in this module are the most commonly used classes for wxPython,
5
+ which is why they have been made visible in the core `wx` namespace.
6
+ Everything you need for building typical GUI applications is here.
7
+ """
8
+
9
+ from ._core import *
10
+
11
+ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12
+ # This code block was included from src/core_ex.py
13
+ import sys as _sys
14
+
15
+ # Load version numbers from __version__ and some other initialization tasks...
16
+ if 'wxEVT_NULL' in dir():
17
+ from wx.__version__ import *
18
+ import wx._core
19
+ __version__ = VERSION_STRING
20
+
21
+ # Add the build type to PlatformInfo
22
+ PlatformInfo = PlatformInfo + ('build-type: ' + BUILD_TYPE, )
23
+
24
+ # Register a function to be called when Python terminates that will clean
25
+ # up and release all system resources that wxWidgets allocated.
26
+ import atexit
27
+ atexit.register(wx._core._wxPyCleanup)
28
+ del atexit
29
+
30
+ else:
31
+ Port = ''
32
+ Platform = ''
33
+ PlatformInfo = []
34
+
35
+ # A little trick to make 'wx' be a reference to this module so wx.Names can
36
+ # be used in the python code here.
37
+ wx = _sys.modules[__name__]
38
+
39
+
40
+ import warnings
41
+ class wxPyDeprecationWarning(DeprecationWarning):
42
+ pass
43
+
44
+ warnings.simplefilter('default', wxPyDeprecationWarning)
45
+ del warnings
46
+
47
+
48
+ def deprecated(item, msg='', useName=False):
49
+ """
50
+ Create a delegating wrapper that raises a deprecation warning. Can be
51
+ used with callable objects (functions, methods, classes) or with
52
+ properties.
53
+ """
54
+ import warnings
55
+
56
+ name = ''
57
+ if useName:
58
+ try:
59
+ name = ' ' + item.__name__
60
+ except AttributeError:
61
+ pass
62
+
63
+ if isinstance(item, type):
64
+ # It is a class. Make a subclass that raises a warning.
65
+ class DeprecatedClassProxy(item):
66
+ def __init__(*args, **kw):
67
+ warnings.warn("Using deprecated class%s. %s" % (name, msg),
68
+ wxPyDeprecationWarning, stacklevel=2)
69
+ item.__init__(*args, **kw)
70
+ DeprecatedClassProxy.__name__ = item.__name__
71
+ return DeprecatedClassProxy
72
+
73
+ elif callable(item):
74
+ # wrap a new function around the callable
75
+ def deprecated_func(*args, **kw):
76
+ warnings.warn("Call to deprecated item%s. %s" % (name, msg),
77
+ wxPyDeprecationWarning, stacklevel=2)
78
+ if not kw:
79
+ return item(*args)
80
+ return item(*args, **kw)
81
+ deprecated_func.__name__ = item.__name__
82
+ deprecated_func.__doc__ = item.__doc__
83
+ if hasattr(item, '__dict__'):
84
+ deprecated_func.__dict__.update(item.__dict__)
85
+ return deprecated_func
86
+
87
+ elif hasattr(item, '__get__'):
88
+ # it should be a property if there is a getter
89
+ class DepGetProp(object):
90
+ def __init__(self, item, msg):
91
+ self.item = item
92
+ self.msg = msg
93
+ def __get__(self, inst, klass):
94
+ warnings.warn("Accessing deprecated property. %s" % msg,
95
+ wxPyDeprecationWarning, stacklevel=2)
96
+ return self.item.__get__(inst, klass)
97
+ class DepGetSetProp(DepGetProp):
98
+ def __set__(self, inst, val):
99
+ warnings.warn("Accessing deprecated property. %s" % msg,
100
+ wxPyDeprecationWarning, stacklevel=2)
101
+ return self.item.__set__(inst, val)
102
+ class DepGetSetDelProp(DepGetSetProp):
103
+ def __delete__(self, inst):
104
+ warnings.warn("Accessing deprecated property. %s" % msg,
105
+ wxPyDeprecationWarning, stacklevel=2)
106
+ return self.item.__delete__(inst)
107
+
108
+ if hasattr(item, '__set__') and hasattr(item, '__delete__'):
109
+ return DepGetSetDelProp(item, msg)
110
+ elif hasattr(item, '__set__'):
111
+ return DepGetSetProp(item, msg)
112
+ else:
113
+ return DepGetProp(item, msg)
114
+ else:
115
+ raise TypeError("unsupported type %s" % type(item))
116
+
117
+
118
+ def deprecatedMsg(msg):
119
+ """
120
+ A wrapper for the deprecated decorator that makes it easier to attach a
121
+ custom message to the warning that is raised if the item is used. This
122
+ can also be used in the @decorator role since it returns the real
123
+ decorator when called.
124
+ """
125
+ import functools
126
+ return functools.partial(deprecated, msg=msg, useName=True)
127
+
128
+ #----------------------------------------------------------------------------
129
+
130
+ EmptyString = ""
131
+
132
+ #----------------------------------------------------------------------------
133
+
134
+ # End of included code block
135
+ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
136
+
137
+ BG_STYLE_CUSTOM = BG_STYLE_PAINT
138
+
139
+ ADJUST_MINSIZE = 0
140
+
141
+ WS_EX_VALIDATE_RECURSIVELY = 0
142
+
143
+ def _ClientDataContainer_GetClientObject(self):
144
+ """
145
+ Alias for :meth:`GetClientData`
146
+ """
147
+ return self.GetClientData()
148
+ ClientDataContainer.GetClientObject = _ClientDataContainer_GetClientObject
149
+ del _ClientDataContainer_GetClientObject
150
+ def _ClientDataContainer_SetClientObject(self, data):
151
+ """
152
+ Alias for :meth:`SetClientData`
153
+ """
154
+ self.SetClientData(data)
155
+ ClientDataContainer.SetClientObject = _ClientDataContainer_SetClientObject
156
+ del _ClientDataContainer_SetClientObject
157
+ ClientDataContainer.ClientData = property(ClientDataContainer.GetClientData, ClientDataContainer.SetClientData)
158
+ def _initStockObjects():
159
+ import wx
160
+ wx.NORMAL_FONT._copyFrom( StockGDI.instance().GetFont(StockGDI.FONT_NORMAL))
161
+ wx.SMALL_FONT._copyFrom( StockGDI.instance().GetFont(StockGDI.FONT_SMALL))
162
+ wx.SWISS_FONT._copyFrom( StockGDI.instance().GetFont(StockGDI.FONT_SWISS))
163
+ wx.ITALIC_FONT._copyFrom( StockGDI.instance().GetFont(StockGDI.FONT_ITALIC))
164
+
165
+ wx.BLACK_DASHED_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_BLACKDASHED))
166
+ wx.BLACK_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_BLACK))
167
+ wx.BLUE_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_BLUE))
168
+ wx.CYAN_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_CYAN))
169
+ wx.GREEN_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_GREEN))
170
+ wx.YELLOW_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_YELLOW))
171
+ wx.GREY_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_GREY))
172
+ wx.LIGHT_GREY_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_LIGHTGREY))
173
+ wx.MEDIUM_GREY_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_MEDIUMGREY))
174
+ wx.RED_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_RED))
175
+ wx.TRANSPARENT_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_TRANSPARENT))
176
+ wx.WHITE_PEN._copyFrom( StockGDI.GetPen(StockGDI.PEN_WHITE))
177
+
178
+ wx.BLACK_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_BLACK))
179
+ wx.BLUE_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_BLUE))
180
+ wx.CYAN_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_CYAN))
181
+ wx.GREEN_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_GREEN))
182
+ wx.YELLOW_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_YELLOW))
183
+ wx.GREY_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_GREY))
184
+ wx.LIGHT_GREY_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_LIGHTGREY))
185
+ wx.MEDIUM_GREY_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_MEDIUMGREY))
186
+ wx.RED_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_RED))
187
+ wx.TRANSPARENT_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_TRANSPARENT))
188
+ wx.WHITE_BRUSH._copyFrom( StockGDI.GetBrush(StockGDI.BRUSH_WHITE))
189
+
190
+ wx.BLACK._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_BLACK))
191
+ wx.BLUE._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_BLUE))
192
+ wx.CYAN._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_CYAN))
193
+ wx.GREEN._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_GREEN))
194
+ wx.YELLOW._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_YELLOW))
195
+ wx.LIGHT_GREY._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_LIGHTGREY))
196
+ wx.RED._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_RED))
197
+ wx.WHITE._copyFrom( StockGDI.GetColour(StockGDI.COLOUR_WHITE))
198
+
199
+ wx.CROSS_CURSOR._copyFrom( StockGDI.GetCursor(StockGDI.CURSOR_CROSS))
200
+ wx.HOURGLASS_CURSOR._copyFrom( StockGDI.GetCursor(StockGDI.CURSOR_HOURGLASS))
201
+ wx.STANDARD_CURSOR._copyFrom( StockGDI.GetCursor(StockGDI.CURSOR_STANDARD))
202
+
203
+ wx.TheFontList = StockGDI._getTheFontList()
204
+ wx.ThePenList = StockGDI._getThePenList()
205
+ wx.TheBrushList = StockGDI._getTheBrushList()
206
+ wx.TheColourDatabase = StockGDI._getTheColourDatabase()
207
+
208
+
209
+ StockGDI._initStockObjects = staticmethod(_initStockObjects)
210
+ def _DateTime___repr__(self):
211
+ from six import PY2
212
+ if self.IsValid():
213
+ f = self.Format()
214
+ if PY2: f = f.encode('utf-8')
215
+ return '<wx.DateTime: "%s">' % f
216
+ else:
217
+ return '<wx.DateTime: "INVALID">'
218
+ DateTime.__repr__ = _DateTime___repr__
219
+ del _DateTime___repr__
220
+ def _DateTime___str__(self):
221
+ from six import PY2
222
+ if self.IsValid():
223
+ f = self.Format()
224
+ if PY2: f = f.encode('utf-8')
225
+ return f
226
+ else:
227
+ return "INVALID DateTime"
228
+ DateTime.__str__ = _DateTime___str__
229
+ del _DateTime___str__
230
+ InvalidDateTime = DefaultDateTime
231
+
232
+ @wx.deprecatedMsg("Use :meth:`DateTime.FromTimeT` instead.")
233
+ def DateTimeFromTimeT(timet):
234
+ """
235
+ Compatibility wrapper for :meth:`DateTime.FromTimeT`
236
+ """
237
+ return DateTime.FromTimeT(timet)
238
+
239
+ @wx.deprecatedMsg("Use :meth:`DateTime.FromJDN` instead.")
240
+ def DateTimeFromJDN(jdn):
241
+ """
242
+ Compatibility wrapper for :meth:`DateTime.FromJDN`
243
+ """
244
+ return DateTime.FromJDN(jdn)
245
+
246
+ @wx.deprecatedMsg("Use :meth:`DateTime.FromHMS` instead.")
247
+ def DateTimeFromHMS(hour, minute=0, second=0, millisecond=0):
248
+ """
249
+ Compatibility wrapper for :meth:`DateTime.FromHMS`
250
+ """
251
+ return DateTime.FromHMS(hour, minute, second, millisecond)
252
+
253
+ @wx.deprecatedMsg("Use :meth:`DateTime.FromDMY` instead.")
254
+ def DateTimeFromDMY(day, month, year=DateTime.Inv_Year, hour=0, minute=0, second=0, millisecond=0):
255
+ """
256
+ Compatibility wrapper for :meth:`DateTime.FromDMY`
257
+ """
258
+ return DateTime.FromDMY(day, month, year, hour, minute, second, millisecond)
259
+
260
+ def pydate2wxdate(date):
261
+ """
262
+ Convert a Python date or datetime to a :class:`DateTime` object
263
+ """
264
+ import datetime
265
+ assert isinstance(date, (datetime.datetime, datetime.date))
266
+ return DateTime(date) # the built-in typemap will convert it for us
267
+
268
+ def wxdate2pydate(date):
269
+ """
270
+ Convert a :class:`DateTime` object to a Python datetime.
271
+ """
272
+ import datetime
273
+ assert isinstance(date, DateTime)
274
+ if date.IsValid():
275
+ return datetime.datetime(date.year, date.month+1, date.day,
276
+ date.hour, date.minute, date.second, date.millisecond*1000)
277
+ else:
278
+ return None
279
+
280
+ def _WindowIDRef___repr__(self):
281
+ return "WindowIDRef: {}".format(self.GetId())
282
+ WindowIDRef.__repr__ = _WindowIDRef___repr__
283
+ del _WindowIDRef___repr__
284
+ def _WindowIDRef___hash__(self):
285
+ return hash(self.GetValue())
286
+ WindowIDRef.__hash__ = _WindowIDRef___hash__
287
+ del _WindowIDRef___hash__
288
+ def NewIdRef(count=1):
289
+ """
290
+ Reserves a new Window ID (or range of WindowIDs) and returns a
291
+ :class:`wx.WindowIDRef` object (or list of them) that will help
292
+ manage the reservation of that ID.
293
+
294
+ This function is intended to be a drop-in replacement of the old
295
+ and deprecated :func:`wx.NewId` function, with the added benefit
296
+ that the ID should never conflict with an in-use ID or other IDs
297
+ generated by this function.
298
+ """
299
+ if count == 1:
300
+ return WindowIDRef(IdManager.ReserveId())
301
+ else:
302
+ start = IdManager.ReserveId(count)
303
+ IDRefs = []
304
+ for id in range(start, start+count):
305
+ IDRefs.append(WindowIDRef(id))
306
+ return IDRefs
307
+
308
+ def _ArrayVideoModes___repr__(self):
309
+ return "ArrayVideoModes: " + repr(list(self))
310
+ ArrayVideoModes.__repr__ = _ArrayVideoModes___repr__
311
+ del _ArrayVideoModes___repr__
312
+ #----------------------------------------------------------------------------
313
+ # Add the directory where the wxWidgets catalogs were installed
314
+ # to the default catalog path, if they were put in the package dir.
315
+ import os
316
+ _localedir = os.path.join(os.path.dirname(__file__), "locale")
317
+ if os.path.exists(_localedir):
318
+ if isinstance(_localedir, (bytes, bytearray)):
319
+ _localedir = _localedir.decode(_sys.getfilesystemencoding())
320
+ Locale.AddCatalogLookupPathPrefix(_localedir)
321
+ del os
322
+ #----------------------------------------------------------------------------
323
+
324
+ def _Point_GetIM(self):
325
+ """
326
+ Returns an immutable representation of the ``wx.Point`` object, based on ``namedtuple``.
327
+
328
+ This new object is hashable and can be used as a dictionary key,
329
+ be added to sets, etc. It can be converted back into a real ``wx.Point``
330
+ with a simple statement like this: ``obj = wx.Point(imObj)``.
331
+ """
332
+ return _im_Point(*self.Get())
333
+ Point.GetIM = _Point_GetIM
334
+ del _Point_GetIM
335
+ def _Point___str__(self):
336
+ return str(self.Get())
337
+ Point.__str__ = _Point___str__
338
+ del _Point___str__
339
+ def _Point___repr__(self):
340
+ return "wx.Point"+str(self.Get())
341
+ Point.__repr__ = _Point___repr__
342
+ del _Point___repr__
343
+ def _Point___len__(self):
344
+ return len(self.Get())
345
+ Point.__len__ = _Point___len__
346
+ del _Point___len__
347
+ def _Point___reduce__(self):
348
+ return (Point, self.Get())
349
+ Point.__reduce__ = _Point___reduce__
350
+ del _Point___reduce__
351
+ def _Point___getitem__(self, idx):
352
+ return self.Get()[idx]
353
+ Point.__getitem__ = _Point___getitem__
354
+ del _Point___getitem__
355
+ def _Point___setitem__(self, idx, val):
356
+ if idx == 0: self.x = val
357
+ elif idx == 1: self.y = val
358
+ else: raise IndexError
359
+ Point.__setitem__ = _Point___setitem__
360
+ del _Point___setitem__
361
+ Point.__safe_for_unpickling__ = True
362
+
363
+ Point.IM = property(Point.GetIM)
364
+ def _Size_GetIM(self):
365
+ """
366
+ Returns an immutable representation of the ``wx.Size`` object, based on ``namedtuple``.
367
+
368
+ This new object is hashable and can be used as a dictionary key,
369
+ be added to sets, etc. It can be converted back into a real ``wx.Size``
370
+ with a simple statement like this: ``obj = wx.Size(imObj)``.
371
+ """
372
+ return _im_Size(*self.Get())
373
+ Size.GetIM = _Size_GetIM
374
+ del _Size_GetIM
375
+ def _Size___str__(self):
376
+ return str(self.Get())
377
+ Size.__str__ = _Size___str__
378
+ del _Size___str__
379
+ def _Size___repr__(self):
380
+ return "wx.Size"+str(self.Get())
381
+ Size.__repr__ = _Size___repr__
382
+ del _Size___repr__
383
+ def _Size___len__(self):
384
+ return len(self.Get())
385
+ Size.__len__ = _Size___len__
386
+ del _Size___len__
387
+ def _Size___nonzero__(self):
388
+ return self.Get() != (0,0)
389
+ Size.__nonzero__ = _Size___nonzero__
390
+ del _Size___nonzero__
391
+ def _Size___bool__(self):
392
+ return self.Get() != (0,0)
393
+ Size.__bool__ = _Size___bool__
394
+ del _Size___bool__
395
+ def _Size___reduce__(self):
396
+ return (Size, self.Get())
397
+ Size.__reduce__ = _Size___reduce__
398
+ del _Size___reduce__
399
+ def _Size___getitem__(self, idx):
400
+ return self.Get()[idx]
401
+ Size.__getitem__ = _Size___getitem__
402
+ del _Size___getitem__
403
+ def _Size___setitem__(self, idx, val):
404
+ if idx == 0: self.width = val
405
+ elif idx == 1: self.height = val
406
+ else: raise IndexError
407
+ Size.__setitem__ = _Size___setitem__
408
+ del _Size___setitem__
409
+ Size.__safe_for_unpickling__ = True
410
+
411
+ def _Rect_GetIM(self):
412
+ """
413
+ Returns an immutable representation of the ``wx.Rect`` object, based on ``namedtuple``.
414
+
415
+ This new object is hashable and can be used as a dictionary key,
416
+ be added to sets, etc. It can be converted back into a real ``wx.Rect``
417
+ with a simple statement like this: ``obj = wx.Rect(imObj)``.
418
+ """
419
+ return _im_Rect(*self.Get())
420
+ Rect.GetIM = _Rect_GetIM
421
+ del _Rect_GetIM
422
+ def _Rect___str__(self):
423
+ return str(self.Get())
424
+ Rect.__str__ = _Rect___str__
425
+ del _Rect___str__
426
+ def _Rect___repr__(self):
427
+ return "wx.Rect"+str(self.Get())
428
+ Rect.__repr__ = _Rect___repr__
429
+ del _Rect___repr__
430
+ def _Rect___len__(self):
431
+ return len(self.Get())
432
+ Rect.__len__ = _Rect___len__
433
+ del _Rect___len__
434
+ def _Rect___nonzero__(self):
435
+ return self.Get() != (0,0,0,0)
436
+ Rect.__nonzero__ = _Rect___nonzero__
437
+ del _Rect___nonzero__
438
+ def _Rect___bool__(self):
439
+ return self.Get() != (0,0,0,0)
440
+ Rect.__bool__ = _Rect___bool__
441
+ del _Rect___bool__
442
+ def _Rect___reduce__(self):
443
+ return (Rect, self.Get())
444
+ Rect.__reduce__ = _Rect___reduce__
445
+ del _Rect___reduce__
446
+ def _Rect___getitem__(self, idx):
447
+ return self.Get()[idx]
448
+ Rect.__getitem__ = _Rect___getitem__
449
+ del _Rect___getitem__
450
+ def _Rect___setitem__(self, idx, val):
451
+ if idx == 0: self.x = val
452
+ elif idx == 1: self.y = val
453
+ elif idx == 2: self.width = val
454
+ elif idx == 3: self.height = val
455
+ else: raise IndexError
456
+ Rect.__setitem__ = _Rect___setitem__
457
+ del _Rect___setitem__
458
+ Rect.__safe_for_unpickling__ = True
459
+
460
+ def _RealPoint_GetIM(self):
461
+ """
462
+ Returns an immutable representation of the ``wx.RealPoint`` object, based on ``namedtuple``.
463
+
464
+ This new object is hashable and can be used as a dictionary key,
465
+ be added to sets, etc. It can be converted back into a real ``wx.RealPoint``
466
+ with a simple statement like this: ``obj = wx.RealPoint(imObj)``.
467
+ """
468
+ return _im_RealPoint(*self.Get())
469
+ RealPoint.GetIM = _RealPoint_GetIM
470
+ del _RealPoint_GetIM
471
+ def _RealPoint___str__(self):
472
+ return str(self.Get())
473
+ RealPoint.__str__ = _RealPoint___str__
474
+ del _RealPoint___str__
475
+ def _RealPoint___repr__(self):
476
+ return "wx.RealPoint"+str(self.Get())
477
+ RealPoint.__repr__ = _RealPoint___repr__
478
+ del _RealPoint___repr__
479
+ def _RealPoint___len__(self):
480
+ return len(self.Get())
481
+ RealPoint.__len__ = _RealPoint___len__
482
+ del _RealPoint___len__
483
+ def _RealPoint___nonzero__(self):
484
+ return self.Get() != (0,0)
485
+ RealPoint.__nonzero__ = _RealPoint___nonzero__
486
+ del _RealPoint___nonzero__
487
+ def _RealPoint___bool__(self):
488
+ return self.Get() != (0,0)
489
+ RealPoint.__bool__ = _RealPoint___bool__
490
+ del _RealPoint___bool__
491
+ def _RealPoint___reduce__(self):
492
+ return (Rect, self.Get())
493
+ RealPoint.__reduce__ = _RealPoint___reduce__
494
+ del _RealPoint___reduce__
495
+ def _RealPoint___getitem__(self, idx):
496
+ return self.Get()[idx]
497
+ RealPoint.__getitem__ = _RealPoint___getitem__
498
+ del _RealPoint___getitem__
499
+ def _RealPoint___setitem__(self, idx, val):
500
+ if idx == 0: self.x = val
501
+ elif idx == 1: self.y = val
502
+ else: raise IndexError
503
+ RealPoint.__setitem__ = _RealPoint___setitem__
504
+ del _RealPoint___setitem__
505
+ RealPoint.__safe_for_unpickling__ = True
506
+
507
+ RealPoint.IM = property(RealPoint.GetIM)
508
+ def _ColourDatabase_FindColour(self, colour):
509
+ return self.Find(colour)
510
+ ColourDatabase.FindColour = _ColourDatabase_FindColour
511
+ del _ColourDatabase_FindColour
512
+ from collections import namedtuple
513
+ _im_Point = namedtuple('_im_Point', ['x', 'y'])
514
+ del namedtuple
515
+
516
+ def _PointList___repr__(self):
517
+ return "PointList: " + repr(list(self))
518
+ PointList.__repr__ = _PointList___repr__
519
+ del _PointList___repr__
520
+ from collections import namedtuple
521
+ _im_Size = namedtuple('_im_Size', ['width', 'height'])
522
+ del namedtuple
523
+
524
+ from collections import namedtuple
525
+ _im_Rect = namedtuple('_im_Rect', ['x', 'y', 'width', 'height'])
526
+ del namedtuple
527
+
528
+ from collections import namedtuple
529
+ _im_RealPoint = namedtuple('_im_RealPoint', ['x', 'y'])
530
+ del namedtuple
531
+
532
+ def _Point2D_GetIM(self):
533
+ """
534
+ Returns an immutable representation of the ``wx.Point2D`` object, based on ``namedtuple``.
535
+
536
+ This new object is hashable and can be used as a dictionary key,
537
+ be added to sets, etc. It can be converted back into a real ``wx.Point2D``
538
+ with a simple statement like this: ``obj = wx.Point2D(imObj)``.
539
+ """
540
+ return _im_Point2D(*self.Get())
541
+ Point2D.GetIM = _Point2D_GetIM
542
+ del _Point2D_GetIM
543
+ def _Point2D___str__(self):
544
+ return str(self.Get())
545
+ Point2D.__str__ = _Point2D___str__
546
+ del _Point2D___str__
547
+ def _Point2D___repr__(self):
548
+ return "wx.Point2D"+str(self.Get())
549
+ Point2D.__repr__ = _Point2D___repr__
550
+ del _Point2D___repr__
551
+ def _Point2D___len__(self):
552
+ return len(self.Get())
553
+ Point2D.__len__ = _Point2D___len__
554
+ del _Point2D___len__
555
+ def _Point2D___nonzero__(self):
556
+ return self.Get() != (0,0)
557
+ Point2D.__nonzero__ = _Point2D___nonzero__
558
+ del _Point2D___nonzero__
559
+ def _Point2D___bool__(self):
560
+ return self.Get() != (0,0)
561
+ Point2D.__bool__ = _Point2D___bool__
562
+ del _Point2D___bool__
563
+ def _Point2D___reduce__(self):
564
+ return (Point2D, self.Get())
565
+ Point2D.__reduce__ = _Point2D___reduce__
566
+ del _Point2D___reduce__
567
+ def _Point2D___getitem__(self, idx):
568
+ return self.Get()[idx]
569
+ Point2D.__getitem__ = _Point2D___getitem__
570
+ del _Point2D___getitem__
571
+ def _Point2D___setitem__(self, idx, val):
572
+ if idx == 0: self.x = val
573
+ elif idx == 1: self.y = val
574
+ else: raise IndexError
575
+ Point2D.__setitem__ = _Point2D___setitem__
576
+ del _Point2D___setitem__
577
+ Point2D.__safe_for_unpickling__ = True
578
+
579
+ Point2D.IM = property(Point2D.GetIM)
580
+ def _Rect2D_GetIM(self):
581
+ """
582
+ Returns an immutable representation of the ``wx.Rect2D`` object, based on ``namedtuple``.
583
+
584
+ This new object is hashable and can be used as a dictionary key,
585
+ be added to sets, etc. It can be converted back into a real ``wx.Rect2D``
586
+ with a simple statement like this: ``obj = wx.Rect2D(imObj)``.
587
+ """
588
+ return _im_Rect2D(*self.Get())
589
+ Rect2D.GetIM = _Rect2D_GetIM
590
+ del _Rect2D_GetIM
591
+ def _Rect2D___str__(self):
592
+ return str(self.Get())
593
+ Rect2D.__str__ = _Rect2D___str__
594
+ del _Rect2D___str__
595
+ def _Rect2D___repr__(self):
596
+ return "wx.Rect2D"+str(self.Get())
597
+ Rect2D.__repr__ = _Rect2D___repr__
598
+ del _Rect2D___repr__
599
+ def _Rect2D___len__(self):
600
+ return len(self.Get())
601
+ Rect2D.__len__ = _Rect2D___len__
602
+ del _Rect2D___len__
603
+ def _Rect2D___nonzero__(self):
604
+ return self.Get() != (0,0,0,0)
605
+ Rect2D.__nonzero__ = _Rect2D___nonzero__
606
+ del _Rect2D___nonzero__
607
+ def _Rect2D___bool__(self):
608
+ return self.Get() != (0,0,0,0)
609
+ Rect2D.__bool__ = _Rect2D___bool__
610
+ del _Rect2D___bool__
611
+ def _Rect2D___reduce__(self):
612
+ return (Rect2D, self.Get())
613
+ Rect2D.__reduce__ = _Rect2D___reduce__
614
+ del _Rect2D___reduce__
615
+ def _Rect2D___getitem__(self, idx):
616
+ return self.Get()[idx]
617
+ Rect2D.__getitem__ = _Rect2D___getitem__
618
+ del _Rect2D___getitem__
619
+ def _Rect2D___setitem__(self, idx, val):
620
+ if idx == 0: self.x = val
621
+ elif idx == 1: self.y = val
622
+ elif idx == 2: self.width = val
623
+ elif idx == 3: self.height = val
624
+ else: raise IndexError
625
+ Rect2D.__setitem__ = _Rect2D___setitem__
626
+ del _Rect2D___setitem__
627
+ Rect2D.__safe_for_unpickling__ = True
628
+
629
+ Rect2D.IM = property(Rect2D.GetIM)
630
+ from collections import namedtuple
631
+ _im_Point2D = namedtuple('_im_Point2D', ['x', 'y'])
632
+ del namedtuple
633
+
634
+ from collections import namedtuple
635
+ _im_Rect2D = namedtuple('_im_Rect2D', ['x', 'y', 'width', 'height'])
636
+ del namedtuple
637
+
638
+ def _Position_GetIM(self):
639
+ """
640
+ Returns an immutable representation of the ``wx.Position`` object, based on ``namedtuple``.
641
+
642
+ This new object is hashable and can be used as a dictionary key,
643
+ be added to sets, etc. It can be converted back into a real ``wx.Position``
644
+ with a simple statement like this: ``obj = wx.Position(imObj)``.
645
+ """
646
+ return _im_Position(*self.Get())
647
+ Position.GetIM = _Position_GetIM
648
+ del _Position_GetIM
649
+ def _Position___str__(self):
650
+ return str(self.Get())
651
+ Position.__str__ = _Position___str__
652
+ del _Position___str__
653
+ def _Position___repr__(self):
654
+ return "wx.Position"+str(self.Get())
655
+ Position.__repr__ = _Position___repr__
656
+ del _Position___repr__
657
+ def _Position___len__(self):
658
+ return len(self.Get())
659
+ Position.__len__ = _Position___len__
660
+ del _Position___len__
661
+ def _Position___nonzero__(self):
662
+ return self.Get() != (0,0)
663
+ Position.__nonzero__ = _Position___nonzero__
664
+ del _Position___nonzero__
665
+ def _Position___bool__(self):
666
+ return self.Get() != (0,0)
667
+ Position.__bool__ = _Position___bool__
668
+ del _Position___bool__
669
+ def _Position___reduce__(self):
670
+ return (Position, self.Get())
671
+ Position.__reduce__ = _Position___reduce__
672
+ del _Position___reduce__
673
+ def _Position___getitem__(self, idx):
674
+ return self.Get()[idx]
675
+ Position.__getitem__ = _Position___getitem__
676
+ del _Position___getitem__
677
+ def _Position___setitem__(self, idx, val):
678
+ if idx == 0: self.Row = val
679
+ elif idx == 1: self.Col = val
680
+ else: raise IndexError
681
+ Position.__setitem__ = _Position___setitem__
682
+ del _Position___setitem__
683
+ Position.__safe_for_unpickling__ = True
684
+
685
+ Position.IM = property(Position.GetIM)
686
+ from collections import namedtuple
687
+ _im_Position = namedtuple('_im_Position', ['Row', 'Col'])
688
+ del namedtuple
689
+
690
+ def _Colour_GetIM(self):
691
+ """
692
+ Returns an immutable representation of the ``wx.Colour`` object, based on ``namedtuple``.
693
+
694
+ This new object is hashable and can be used as a dictionary key,
695
+ be added to sets, etc. It can be converted back into a real ``wx.Colour``
696
+ with a simple statement like this: ``obj = wx.Colour(imObj)``.
697
+ """
698
+ return _im_Colour(*self.Get())
699
+ Colour.GetIM = _Colour_GetIM
700
+ del _Colour_GetIM
701
+ def _Colour___str__(self):
702
+ return str(self.Get())
703
+ Colour.__str__ = _Colour___str__
704
+ del _Colour___str__
705
+ def _Colour___repr__(self):
706
+ return "wx.Colour"+str(self.Get())
707
+ Colour.__repr__ = _Colour___repr__
708
+ del _Colour___repr__
709
+ def _Colour___len__(self):
710
+ return len(self.Get())
711
+ Colour.__len__ = _Colour___len__
712
+ del _Colour___len__
713
+ def _Colour___reduce__(self):
714
+ return (Colour, self.Get())
715
+ Colour.__reduce__ = _Colour___reduce__
716
+ del _Colour___reduce__
717
+ def _Colour___getitem__(self, idx):
718
+ return self.Get()[idx]
719
+ Colour.__getitem__ = _Colour___getitem__
720
+ del _Colour___getitem__
721
+ def _Colour___setitem__(self, idx, val):
722
+ if idx == 0: self.red = val
723
+ elif idx == 1: self.green = val
724
+ elif idx == 2: self.blue = val
725
+ elif idx == 3: self.alpha = val
726
+ else: raise IndexError
727
+ Colour.__setitem__ = _Colour___setitem__
728
+ del _Colour___setitem__
729
+ Colour.__safe_for_unpickling__ = True
730
+
731
+ # These stock colours will be initialized when the wx.App object is created.
732
+ BLACK = Colour()
733
+ BLUE = Colour()
734
+ CYAN = Colour()
735
+ GREEN = Colour()
736
+ YELLOW = Colour()
737
+ LIGHT_GREY = Colour()
738
+ RED = Colour()
739
+ WHITE = Colour()
740
+
741
+ from collections import namedtuple
742
+ _im_Colour = namedtuple('_im_Colour', ['red', 'green', 'blue', 'alpha'])
743
+ del namedtuple
744
+
745
+ NamedColour = wx.deprecated(Colour, "Use Colour instead.")
746
+
747
+ ZipFSHandler = wx.deprecated(ArchiveFSHandler, "Use ArchiveFSHandler instead.")
748
+
749
+ def _Image_ConvertToBitmap(self, depth=-1):
750
+ """
751
+ ConvertToBitmap(depth=-1) -> Bitmap
752
+
753
+ Convert the image to a :class:`wx.Bitmap`.
754
+ """
755
+ bmp = wx.Bitmap(self, depth)
756
+ return bmp
757
+ Image.ConvertToBitmap = _Image_ConvertToBitmap
758
+ del _Image_ConvertToBitmap
759
+ def _Image_ConvertToMonoBitmap(self, red, green, blue):
760
+ """
761
+ ConvertToMonoBitmap(red, green, blue) -> Bitmap
762
+
763
+ Creates a monochrome version of the image and returns it as a :class:`wx.Bitmap`.
764
+ """
765
+ mono = self.ConvertToMono( red, green, blue )
766
+ bmp = wx.Bitmap( mono, 1 )
767
+ return bmp
768
+ Image.ConvertToMonoBitmap = _Image_ConvertToMonoBitmap
769
+ del _Image_ConvertToMonoBitmap
770
+ @wx.deprecatedMsg("Use :class:`Image` instead.")
771
+ def EmptyImage(width=0, height=0, clear=True):
772
+ """
773
+ A compatibility wrapper for the wx.Image(width, height) constructor
774
+ """
775
+ return Image(width, height, clear)
776
+
777
+ @wx.deprecatedMsg("Use bitmap.ConvertToImage instead.")
778
+ def ImageFromBitmap(bitmap):
779
+ """
780
+ Create a :class:`Image` from a :class:`wx.Bitmap`
781
+ """
782
+ return bitmap.ConvertToImage()
783
+
784
+ @wx.deprecatedMsg("Use :class:`Image` instead.")
785
+ def ImageFromStream(stream, type=BITMAP_TYPE_ANY, index=-1):
786
+ """
787
+ Load an image from a stream (file-like object)
788
+ """
789
+ return wx.Image(stream, type, index)
790
+
791
+ @wx.deprecatedMsg("Use :class:`Image` instead.")
792
+ def ImageFromData(width, height, data):
793
+ """
794
+ Compatibility wrapper for creating an image from RGB data
795
+ """
796
+ return Image(width, height, data)
797
+
798
+ @wx.deprecatedMsg("Use :class:`Image` instead.")
799
+ def ImageFromDataWithAlpha(width, height, data, alpha):
800
+ """
801
+ Compatibility wrapper for creating an image from RGB and Alpha data
802
+ """
803
+ return Image(width, height, data, alpha)
804
+
805
+ def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
806
+ """
807
+ Creates a :class:`Image` from the data in `dataBuffer`. The `dataBuffer`
808
+ parameter must be a Python object that implements the buffer interface,
809
+ such as a string, array, etc. The `dataBuffer` object is expected to
810
+ contain a series of RGB bytes and be width*height*3 bytes long. A buffer
811
+ object can optionally be supplied for the image's alpha channel data, and
812
+ it is expected to be width*height bytes long.
813
+
814
+ The :class:`Image` will be created with its data and alpha pointers initialized
815
+ to the memory address pointed to by the buffer objects, thus saving the
816
+ time needed to copy the image data from the buffer object to the :class:`Image`.
817
+ While this has advantages, it also has the shoot-yourself-in-the-foot
818
+ risks associated with sharing a C pointer between two objects.
819
+
820
+ To help alleviate the risk a reference to the data and alpha buffer
821
+ objects are kept with the :class:`Image`, so that they won't get deleted until
822
+ after the wx.Image is deleted. However please be aware that it is not
823
+ guaranteed that an object won't move its memory buffer to a new location
824
+ when it needs to resize its contents. If that happens then the :class:`Image`
825
+ will end up referring to an invalid memory location and could cause the
826
+ application to crash. Therefore care should be taken to not manipulate
827
+ the objects used for the data and alpha buffers in a way that would cause
828
+ them to change size.
829
+ """
830
+ img = Image(width, height)
831
+ img.SetDataBuffer(dataBuffer)
832
+ if alphaBuffer:
833
+ img.SetAlphaBuffer(alphaBuffer)
834
+ img._buffer = dataBuffer
835
+ img._alpha = alphaBuffer
836
+ return img
837
+
838
+ def _ImageArray___repr__(self):
839
+ return "ImageArray: " + repr(list(self))
840
+ ImageArray.__repr__ = _ImageArray___repr__
841
+ del _ImageArray___repr__
842
+ IMAGE_OPTION_QUALITY = "quality"
843
+ IMAGE_OPTION_FILENAME = "FileName"
844
+ IMAGE_OPTION_RESOLUTION = "Resolution"
845
+ IMAGE_OPTION_RESOLUTIONX = "ResolutionX"
846
+ IMAGE_OPTION_RESOLUTIONY = "ResolutionY"
847
+ IMAGE_OPTION_RESOLUTIONUNIT = "ResolutionUnit"
848
+ IMAGE_OPTION_MAX_WIDTH = "MaxWidth"
849
+ IMAGE_OPTION_MAX_HEIGHT = "MaxHeight"
850
+ IMAGE_OPTION_ORIGINAL_WIDTH = "OriginalWidth"
851
+ IMAGE_OPTION_ORIGINAL_HEIGHT = "OriginalHeight"
852
+ IMAGE_OPTION_BMP_FORMAT = "wxBMP_FORMAT"
853
+ IMAGE_OPTION_CUR_HOTSPOT_X = "HotSpotX"
854
+ IMAGE_OPTION_CUR_HOTSPOT_Y = "HotSpotY"
855
+ IMAGE_OPTION_GIF_COMMENT = "GifComment"
856
+ IMAGE_OPTION_GIF_TRANSPARENCY = "Transparency"
857
+ IMAGE_OPTION_GIF_TRANSPARENCY_HIGHLIGHT = "Highlight"
858
+ IMAGE_OPTION_GIF_TRANSPARENCY_UNCHANGED = "Unchanged"
859
+ IMAGE_OPTION_PNG_FORMAT = "PngFormat"
860
+ IMAGE_OPTION_PNG_BITDEPTH = "PngBitDepth"
861
+ IMAGE_OPTION_PNG_FILTER = "PngF"
862
+ IMAGE_OPTION_PNG_COMPRESSION_LEVEL = "PngZL"
863
+ IMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL = "PngZM"
864
+ IMAGE_OPTION_PNG_COMPRESSION_STRATEGY = "PngZS"
865
+ IMAGE_OPTION_PNG_COMPRESSION_BUFFER_SIZE = "PngZB"
866
+ IMAGE_OPTION_TIFF_BITSPERSAMPLE = "BitsPerSample"
867
+ IMAGE_OPTION_TIFF_SAMPLESPERPIXEL = "SamplesPerPixel"
868
+ IMAGE_OPTION_TIFF_COMPRESSION = "Compression"
869
+ IMAGE_OPTION_TIFF_PHOTOMETRIC = "Photometric"
870
+ IMAGE_OPTION_TIFF_IMAGEDESCRIPTOR = "ImageDescriptor"
871
+ IMAGE_OPTION_TIFF_BITSPERSAMPLE = "BitsPerSample"
872
+ IMAGE_OPTION_TIFF_SAMPLESPERPIXEL = "SamplesPerPixel"
873
+ IMAGE_OPTION_TIFF_COMPRESSION = "Compression"
874
+ IMAGE_OPTION_TIFF_PHOTOMETRIC = "Photometric"
875
+ IMAGE_OPTION_TIFF_IMAGEDESCRIPTOR = "ImageDescriptor"
876
+ IMAGE_OPTION_GIF_COMMENT = "GifComment"
877
+ IMAGE_OPTION_PNG_FORMAT = "PngFormat"
878
+ IMAGE_OPTION_PNG_BITDEPTH = "PngBitDepth"
879
+ IMAGE_OPTION_PNG_FILTER = "PngF"
880
+ IMAGE_OPTION_PNG_COMPRESSION_LEVEL = "PngZL"
881
+ IMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL = "PngZM"
882
+ IMAGE_OPTION_PNG_COMPRESSION_STRATEGY = "PngZS"
883
+ IMAGE_OPTION_PNG_COMPRESSION_BUFFER_SIZE = "PngZB"
884
+
885
+ @wx.deprecatedMsg("Use :meth:`wx.Bitmap.FromBuffer` or :meth:`wx.Bitmap.FromBufferAndAlpha` instead.")
886
+ def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
887
+ """
888
+ A compatibility wrapper for :meth:`wx.Bitmap.FromBuffer` and :meth:`wx.Bitmap.FromBufferAndAlpha`
889
+ """
890
+ if alphaBuffer is not None:
891
+ return Bitmap.FromBufferAndAlpha(width, height, dataBuffer, alphaBuffer)
892
+ else:
893
+ return Bitmap.FromBuffer(width, height, dataBuffer)
894
+
895
+ @wx.deprecatedMsg("Use :meth:`wx.Bitmap.FromBufferRGBA` instead.")
896
+ def BitmapFromBufferRGBA(width, height, dataBuffer):
897
+ """
898
+ A compatibility wrapper for :meth:`wx.Bitmap.FromBufferRGBA`
899
+ """
900
+ return Bitmap.FromBufferRGBA(width, height, dataBuffer)
901
+
902
+ @wx.deprecatedMsg("Use :meth:`wx.Bitmap.FromRGBA` instead.")
903
+ def EmptyBitmapRGBA(width, height, red=0, green=0, blue=0, alpha=0):
904
+ """
905
+ A compatibility wrapper for :meth:`wx.Bitmap.FromRGBA`
906
+ """
907
+ return Bitmap.FromRGBA(width, height, red, green, blue, alpha)
908
+
909
+ @wx.deprecatedMsg("Use :class:`wx.Bitmap` instead")
910
+ def EmptyBitmap(width, height, depth=BITMAP_SCREEN_DEPTH):
911
+ """
912
+ A compatibility wrapper for the wx.Bitmap(width, height, depth) constructor
913
+ """
914
+ return Bitmap(width, height, depth)
915
+
916
+ @wx.deprecatedMsg("Use :class:`wx.Bitmap` instead")
917
+ def BitmapFromImage(image):
918
+ """
919
+ A compatibility wrapper for the wx.Bitmap(wx.Image) constructor
920
+ """
921
+ return Bitmap(image)
922
+
923
+ @wx.deprecatedMsg("Use :class:`Icon` instead")
924
+ def EmptyIcon():
925
+ """
926
+ A compatibility wrapper for the :class:`Icon` constructor
927
+ """
928
+ return Icon()
929
+
930
+ def _Font_SetNoAntiAliasing(self, no=True):
931
+ pass
932
+ Font.SetNoAntiAliasing = wx.deprecated(_Font_SetNoAntiAliasing)
933
+ del _Font_SetNoAntiAliasing
934
+ def _Font_GetNoAntiAliasing(self):
935
+ pass
936
+ Font.GetNoAntiAliasing = wx.deprecated(_Font_GetNoAntiAliasing)
937
+ del _Font_GetNoAntiAliasing
938
+ # These stock fonts will be initialized when the wx.App object is created.
939
+ NORMAL_FONT = Font()
940
+ SMALL_FONT = Font()
941
+ ITALIC_FONT = Font()
942
+ SWISS_FONT = Font()
943
+
944
+ wx.DEFAULT = int(wx.FONTFAMILY_DEFAULT)
945
+ wx.DECORATIVE = int(wx.FONTFAMILY_DECORATIVE)
946
+ wx.ROMAN = int(wx.FONTFAMILY_ROMAN)
947
+ wx.SCRIPT = int(wx.FONTFAMILY_SCRIPT)
948
+ wx.SWISS = int(wx.FONTFAMILY_SWISS)
949
+ wx.MODERN = int(wx.FONTFAMILY_MODERN)
950
+ wx.TELETYPE = int(wx.FONTFAMILY_TELETYPE)
951
+
952
+ wx.NORMAL = int(wx.FONTWEIGHT_NORMAL)
953
+ wx.LIGHT = int(wx.FONTWEIGHT_LIGHT)
954
+ wx.BOLD = int(wx.FONTWEIGHT_BOLD)
955
+
956
+ wx.NORMAL = int(wx.FONTSTYLE_NORMAL)
957
+ wx.ITALIC = int(wx.FONTSTYLE_ITALIC)
958
+ wx.SLANT = int(wx.FONTSTYLE_SLANT)
959
+
960
+ # These stock pens will be initialized when the wx.App object is created.
961
+ RED_PEN = Pen()
962
+ BLUE_PEN = Pen()
963
+ CYAN_PEN = Pen()
964
+ GREEN_PEN = Pen()
965
+ YELLOW_PEN = Pen()
966
+ BLACK_PEN = Pen()
967
+ WHITE_PEN = Pen()
968
+ TRANSPARENT_PEN = Pen()
969
+ BLACK_DASHED_PEN = Pen()
970
+ GREY_PEN = Pen()
971
+ MEDIUM_GREY_PEN = Pen()
972
+ LIGHT_GREY_PEN = Pen()
973
+
974
+ wx.SOLID = int(wx.PENSTYLE_SOLID)
975
+ wx.DOT = int(wx.PENSTYLE_DOT)
976
+ wx.LONG_DASH = int(wx.PENSTYLE_LONG_DASH)
977
+ wx.SHORT_DASH = int(wx.PENSTYLE_SHORT_DASH)
978
+ wx.DOT_DASH = int(wx.PENSTYLE_DOT_DASH)
979
+ wx.USER_DASH = int(wx.PENSTYLE_USER_DASH)
980
+ wx.TRANSPARENT = int(wx.PENSTYLE_TRANSPARENT)
981
+
982
+ # These stock brushes will be initialized when the wx.App object is created.
983
+ BLUE_BRUSH = Brush()
984
+ GREEN_BRUSH = Brush()
985
+ YELLOW_BRUSH = Brush()
986
+ WHITE_BRUSH = Brush()
987
+ BLACK_BRUSH = Brush()
988
+ GREY_BRUSH = Brush()
989
+ MEDIUM_GREY_BRUSH = Brush()
990
+ LIGHT_GREY_BRUSH = Brush()
991
+ TRANSPARENT_BRUSH = Brush()
992
+ CYAN_BRUSH = Brush()
993
+ RED_BRUSH = Brush()
994
+
995
+ wx.STIPPLE_MASK_OPAQUE = int(wx.BRUSHSTYLE_STIPPLE_MASK_OPAQUE)
996
+ wx.STIPPLE_MASK = int(wx.BRUSHSTYLE_STIPPLE_MASK)
997
+ wx.STIPPLE = int(wx.BRUSHSTYLE_STIPPLE)
998
+ wx.BDIAGONAL_HATCH = int(wx.BRUSHSTYLE_BDIAGONAL_HATCH)
999
+ wx.CROSSDIAG_HATCH = int(wx.BRUSHSTYLE_CROSSDIAG_HATCH)
1000
+ wx.FDIAGONAL_HATCH = int(wx.BRUSHSTYLE_FDIAGONAL_HATCH)
1001
+ wx.CROSS_HATCH = int(wx.BRUSHSTYLE_CROSS_HATCH)
1002
+ wx.HORIZONTAL_HATCH = int(wx.BRUSHSTYLE_HORIZONTAL_HATCH)
1003
+ wx.VERTICAL_HATCH = int(wx.BRUSHSTYLE_VERTICAL_HATCH)
1004
+
1005
+ # These stock cursors will be initialized when the wx.App object is created.
1006
+ STANDARD_CURSOR = Cursor()
1007
+ HOURGLASS_CURSOR = Cursor()
1008
+ CROSS_CURSOR = Cursor()
1009
+
1010
+ StockCursor = wx.deprecated(Cursor, "Use Cursor instead.")
1011
+
1012
+ CursorFromImage = wx.deprecated(Cursor, "Use Cursor instead.")
1013
+
1014
+ def _Region___iter__(self):
1015
+ """
1016
+ Returns a rectangle iterator conforming to the Python iterator
1017
+ protocol.
1018
+ """
1019
+ return PyRegionIterator(self)
1020
+ Region.__iter__ = _Region___iter__
1021
+ del _Region___iter__
1022
+ class PyRegionIterator(object):
1023
+ "A Python iterator for wx.Region objects"
1024
+ def __init__(self, region):
1025
+ self._region = region
1026
+ self._iterator = wx.RegionIterator(region)
1027
+ def next(self):
1028
+ if not self._iterator:
1029
+ raise StopIteration
1030
+ rect = self._iterator.GetRect()
1031
+ if self._iterator.HaveRects():
1032
+ self._iterator.Next()
1033
+ return rect
1034
+ __next__ = next # for Python 3
1035
+
1036
+ def _DC_GetClippingRect(self):
1037
+ """
1038
+ Returns the rectangle surrounding the current clipping region as a wx.Rect.
1039
+ """
1040
+ rv, x, y, w, h = self.GetClippingBox()
1041
+ return wx.Rect(x,y,w,h)
1042
+ DC.GetClippingRect = _DC_GetClippingRect
1043
+ del _DC_GetClippingRect
1044
+ DC.DrawImageLabel = wx.deprecated(DC.DrawLabel, "Use DrawLabel instead.")
1045
+
1046
+ def _DC_GetBoundingBox(self):
1047
+ """
1048
+ GetBoundingBox() -> (x1,y1, x2,y2)
1049
+
1050
+ Returns the min and max points used in drawing commands so far.
1051
+ """
1052
+ return (self.MinX(), self.MinY(), self.MaxX(), self.MaxY())
1053
+ DC.GetBoundingBox = _DC_GetBoundingBox
1054
+ del _DC_GetBoundingBox
1055
+ DC.GetHDC = wx.deprecated(DC.GetHDC, "Use GetHandle instead.")
1056
+
1057
+ DC.GetCGContext = wx.deprecated(DC.GetCGContext, "Use GetHandle instead.")
1058
+
1059
+ DC.GetGdkDrawable = wx.deprecated(DC.GetGdkDrawable, "Use GetHandle instead.")
1060
+
1061
+ def _DC___enter__(self):
1062
+ return self
1063
+ DC.__enter__ = _DC___enter__
1064
+ del _DC___enter__
1065
+ def _DC___exit__(self, exc_type, exc_val, exc_tb):
1066
+ self.Destroy()
1067
+ DC.__exit__ = _DC___exit__
1068
+ del _DC___exit__
1069
+ def _DC_DrawPointList(self, points, pens=None):
1070
+ """
1071
+ Draw a list of points as quickly as possible.
1072
+
1073
+ :param points: A sequence of 2-element sequences representing
1074
+ each point to draw, (x,y).
1075
+ :param pens: If None, then the current pen is used. If a single
1076
+ pen then it will be used for all points. If a list of
1077
+ pens then there should be one for each point in points.
1078
+ """
1079
+ if pens is None:
1080
+ pens = []
1081
+ elif isinstance(pens, wx.Pen):
1082
+ pens = [pens]
1083
+ elif len(pens) != len(points):
1084
+ raise ValueError('points and pens must have same length')
1085
+ return self._DrawPointList(points, pens, [])
1086
+ DC.DrawPointList = _DC_DrawPointList
1087
+ del _DC_DrawPointList
1088
+ def _DC_DrawLineList(self, lines, pens=None):
1089
+ """
1090
+ Draw a list of lines as quickly as possible.
1091
+
1092
+ :param lines: A sequence of 4-element sequences representing
1093
+ each line to draw, (x1,y1, x2,y2).
1094
+ :param pens: If None, then the current pen is used. If a
1095
+ single pen then it will be used for all lines. If
1096
+ a list of pens then there should be one for each line
1097
+ in lines.
1098
+ """
1099
+ if pens is None:
1100
+ pens = []
1101
+ elif isinstance(pens, wx.Pen):
1102
+ pens = [pens]
1103
+ elif len(pens) != len(lines):
1104
+ raise ValueError('lines and pens must have same length')
1105
+ return self._DrawLineList(lines, pens, [])
1106
+ DC.DrawLineList = _DC_DrawLineList
1107
+ del _DC_DrawLineList
1108
+ def _DC_DrawRectangleList(self, rectangles, pens=None, brushes=None):
1109
+ """
1110
+ Draw a list of rectangles as quickly as possible.
1111
+
1112
+ :param rectangles: A sequence of 4-element sequences representing
1113
+ each rectangle to draw, (x,y, w,h).
1114
+ :param pens: If None, then the current pen is used. If a
1115
+ single pen then it will be used for all rectangles.
1116
+ If a list of pens then there should be one for each
1117
+ rectangle in rectangles.
1118
+ :param brushes: A brush or brushes to be used to fill the rectagles,
1119
+ with similar semantics as the pens parameter.
1120
+ """
1121
+ if pens is None:
1122
+ pens = []
1123
+ elif isinstance(pens, wx.Pen):
1124
+ pens = [pens]
1125
+ elif len(pens) != len(rectangles):
1126
+ raise ValueError('rectangles and pens must have same length')
1127
+ if brushes is None:
1128
+ brushes = []
1129
+ elif isinstance(brushes, wx.Brush):
1130
+ brushes = [brushes]
1131
+ elif len(brushes) != len(rectangles):
1132
+ raise ValueError('rectangles and brushes must have same length')
1133
+ return self._DrawRectangleList(rectangles, pens, brushes)
1134
+ DC.DrawRectangleList = _DC_DrawRectangleList
1135
+ del _DC_DrawRectangleList
1136
+ def _DC_DrawEllipseList(self, ellipses, pens=None, brushes=None):
1137
+ """
1138
+ Draw a list of ellipses as quickly as possible.
1139
+
1140
+ :param ellipses: A sequence of 4-element sequences representing
1141
+ each ellipse to draw, (x,y, w,h).
1142
+ :param pens: If None, then the current pen is used. If a
1143
+ single pen then it will be used for all ellipses.
1144
+ If a list of pens then there should be one for each
1145
+ ellipse in ellipses.
1146
+ :param brushes: A brush or brushes to be used to fill the ellipses,
1147
+ with similar semantics as the pens parameter.
1148
+ """
1149
+ if pens is None:
1150
+ pens = []
1151
+ elif isinstance(pens, wx.Pen):
1152
+ pens = [pens]
1153
+ elif len(pens) != len(ellipses):
1154
+ raise ValueError('ellipses and pens must have same length')
1155
+ if brushes is None:
1156
+ brushes = []
1157
+ elif isinstance(brushes, wx.Brush):
1158
+ brushes = [brushes]
1159
+ elif len(brushes) != len(ellipses):
1160
+ raise ValueError('ellipses and brushes must have same length')
1161
+ return self._DrawEllipseList(ellipses, pens, brushes)
1162
+ DC.DrawEllipseList = _DC_DrawEllipseList
1163
+ del _DC_DrawEllipseList
1164
+ def _DC_DrawPolygonList(self, polygons, pens=None, brushes=None):
1165
+ """
1166
+ Draw a list of polygons, each of which is a list of points.
1167
+
1168
+ :param polygons: A sequence of sequences of sequences.
1169
+ [[(x1,y1),(x2,y2),(x3,y3)...], [(x1,y1),(x2,y2),(x3,y3)...]]
1170
+
1171
+ :param pens: If None, then the current pen is used. If a
1172
+ single pen then it will be used for all polygons.
1173
+ If a list of pens then there should be one for each
1174
+ polygon.
1175
+ :param brushes: A brush or brushes to be used to fill the polygons,
1176
+ with similar semantics as the pens parameter.
1177
+ """
1178
+ if pens is None:
1179
+ pens = []
1180
+ elif isinstance(pens, wx.Pen):
1181
+ pens = [pens]
1182
+ elif len(pens) != len(polygons):
1183
+ raise ValueError('polygons and pens must have same length')
1184
+ if brushes is None:
1185
+ brushes = []
1186
+ elif isinstance(brushes, wx.Brush):
1187
+ brushes = [brushes]
1188
+ elif len(brushes) != len(polygons):
1189
+ raise ValueError('polygons and brushes must have same length')
1190
+ return self._DrawPolygonList(polygons, pens, brushes)
1191
+ DC.DrawPolygonList = _DC_DrawPolygonList
1192
+ del _DC_DrawPolygonList
1193
+ def _DC_DrawTextList(self, textList, coords, foregrounds=None, backgrounds=None):
1194
+ """
1195
+ Draw a list of strings using a list of coordinants for positioning each string.
1196
+
1197
+ :param textList: A list of strings
1198
+ :param coords: A list of (x,y) positions
1199
+ :param foregrounds: A list of `wx.Colour` objects to use for the
1200
+ foregrounds of the strings.
1201
+ :param backgrounds: A list of `wx.Colour` objects to use for the
1202
+ backgrounds of the strings.
1203
+
1204
+ NOTE: Make sure you set background mode to wx.Solid (DC.SetBackgroundMode)
1205
+ If you want backgrounds to do anything.
1206
+ """
1207
+ if type(textList) == type(''):
1208
+ textList = [textList]
1209
+ elif len(textList) != len(coords):
1210
+ raise ValueError('textlist and coords must have same length')
1211
+ if foregrounds is None:
1212
+ foregrounds = []
1213
+ elif isinstance(foregrounds, wx.Colour):
1214
+ foregrounds = [foregrounds]
1215
+ elif len(foregrounds) != len(coords):
1216
+ raise ValueError('foregrounds and coords must have same length')
1217
+ if backgrounds is None:
1218
+ backgrounds = []
1219
+ elif isinstance(backgrounds, wx.Colour):
1220
+ backgrounds = [backgrounds]
1221
+ elif len(backgrounds) != len(coords):
1222
+ raise ValueError('backgrounds and coords must have same length')
1223
+ return self._DrawTextList(textList, coords, foregrounds, backgrounds)
1224
+ DC.DrawTextList = _DC_DrawTextList
1225
+ del _DC_DrawTextList
1226
+ DC.BoundingBox = property(DC.GetBoundingBox)
1227
+ DC.ClippingRect = property(DC.GetClippingRect)
1228
+ def _DCClipper___enter__(self):
1229
+ return self
1230
+ DCClipper.__enter__ = _DCClipper___enter__
1231
+ del _DCClipper___enter__
1232
+ def _DCClipper___exit__(self, exc_type, exc_val, exc_tb):
1233
+ return False
1234
+ DCClipper.__exit__ = _DCClipper___exit__
1235
+ del _DCClipper___exit__
1236
+ def _DCBrushChanger___enter__(self):
1237
+ return self
1238
+ DCBrushChanger.__enter__ = _DCBrushChanger___enter__
1239
+ del _DCBrushChanger___enter__
1240
+ def _DCBrushChanger___exit__(self, exc_type, exc_val, exc_tb):
1241
+ return False
1242
+ DCBrushChanger.__exit__ = _DCBrushChanger___exit__
1243
+ del _DCBrushChanger___exit__
1244
+ def _DCPenChanger___enter__(self):
1245
+ return self
1246
+ DCPenChanger.__enter__ = _DCPenChanger___enter__
1247
+ del _DCPenChanger___enter__
1248
+ def _DCPenChanger___exit__(self, exc_type, exc_val, exc_tb):
1249
+ return False
1250
+ DCPenChanger.__exit__ = _DCPenChanger___exit__
1251
+ del _DCPenChanger___exit__
1252
+ def _DCTextColourChanger___enter__(self):
1253
+ return self
1254
+ DCTextColourChanger.__enter__ = _DCTextColourChanger___enter__
1255
+ del _DCTextColourChanger___enter__
1256
+ def _DCTextColourChanger___exit__(self, exc_type, exc_val, exc_tb):
1257
+ return False
1258
+ DCTextColourChanger.__exit__ = _DCTextColourChanger___exit__
1259
+ del _DCTextColourChanger___exit__
1260
+ def _DCFontChanger___enter__(self):
1261
+ return self
1262
+ DCFontChanger.__enter__ = _DCFontChanger___enter__
1263
+ del _DCFontChanger___enter__
1264
+ def _DCFontChanger___exit__(self, exc_type, exc_val, exc_tb):
1265
+ return False
1266
+ DCFontChanger.__exit__ = _DCFontChanger___exit__
1267
+ del _DCFontChanger___exit__
1268
+ def _DCTextBgColourChanger___enter__(self):
1269
+ return self
1270
+ DCTextBgColourChanger.__enter__ = _DCTextBgColourChanger___enter__
1271
+ del _DCTextBgColourChanger___enter__
1272
+ def _DCTextBgColourChanger___exit__(self, exc_type, exc_val, exc_tb):
1273
+ return False
1274
+ DCTextBgColourChanger.__exit__ = _DCTextBgColourChanger___exit__
1275
+ del _DCTextBgColourChanger___exit__
1276
+ def _DCTextBgModeChanger___enter__(self):
1277
+ return self
1278
+ DCTextBgModeChanger.__enter__ = _DCTextBgModeChanger___enter__
1279
+ del _DCTextBgModeChanger___enter__
1280
+ def _DCTextBgModeChanger___exit__(self, exc_type, exc_val, exc_tb):
1281
+ return False
1282
+ DCTextBgModeChanger.__exit__ = _DCTextBgModeChanger___exit__
1283
+ del _DCTextBgModeChanger___exit__
1284
+ GraphicsContext.DrawRotatedText = wx.deprecated(GraphicsContext.DrawText, 'Use DrawText instead.')
1285
+
1286
+ def _ctx_hold_ref(f):
1287
+ from functools import wraps
1288
+ @wraps(f)
1289
+ def wrapper(self, obj):
1290
+ ctx = f(self, obj)
1291
+ if ctx is not None:
1292
+ ctx._obj = obj
1293
+ return ctx
1294
+ return wrapper
1295
+ GraphicsRenderer.CreateContext = _ctx_hold_ref(GraphicsRenderer.CreateContext)
1296
+ GraphicsRenderer.CreateContextFromImage = _ctx_hold_ref(GraphicsRenderer.CreateContextFromImage)
1297
+ GraphicsRenderer.CreateContextFromUnknownDC = _ctx_hold_ref(GraphicsRenderer.CreateContextFromUnknownDC)
1298
+
1299
+ def _GraphicsRenderer_GetType(self):
1300
+ """
1301
+ Returns the name of the GraphicsRenderer class.
1302
+ """
1303
+ return self.GetClassInfo().GetClassName()
1304
+ GraphicsRenderer.GetType = _GraphicsRenderer_GetType
1305
+ del _GraphicsRenderer_GetType
1306
+ GraphicsRenderer.Type = property(GraphicsRenderer.GetType)
1307
+ def _PixelDataBase___iter__(self):
1308
+ """
1309
+ Create and return an iterator/generator object for traversing
1310
+ this pixel data object.
1311
+ """
1312
+ width = self.GetWidth()
1313
+ height = self.GetHeight()
1314
+ pixels = self.GetPixels() # this is the C++ iterator
1315
+
1316
+ # This class is a facade over the pixels object (using the one
1317
+ # in the enclosing scope) that only allows Get() and Set() to
1318
+ # be called.
1319
+ class PixelFacade(object):
1320
+ def Get(self):
1321
+ return pixels.Get()
1322
+ def Set(self, *args, **kw):
1323
+ return pixels.Set(*args, **kw)
1324
+ def __str__(self):
1325
+ return str(self.Get())
1326
+ def __repr__(self):
1327
+ return 'pixel(%d,%d): %s' % (x,y,self.Get())
1328
+ X = property(lambda self: x)
1329
+ Y = property(lambda self: y)
1330
+
1331
+ import sys
1332
+ rangeFunc = range if sys.version_info >= (3,) else xrange
1333
+
1334
+ pf = PixelFacade()
1335
+ for y in rangeFunc(height):
1336
+ pixels.MoveTo(self, 0, y)
1337
+ for x in rangeFunc(width):
1338
+ # We always generate the same pf instance, but it
1339
+ # accesses the pixels object which we use to iterate
1340
+ # over the pixel buffer.
1341
+ yield pf
1342
+ pixels.nextPixel()
1343
+ PixelDataBase.__iter__ = _PixelDataBase___iter__
1344
+ del _PixelDataBase___iter__
1345
+ @wx.deprecated
1346
+ def GetAccelFromString(label):
1347
+ accel = wx.AcceleratorEntry()
1348
+ accel.FromString(label)
1349
+ return accel
1350
+
1351
+ def _LogNull___enter__(self):
1352
+ return self
1353
+ LogNull.__enter__ = _LogNull___enter__
1354
+ del _LogNull___enter__
1355
+ def _LogNull___exit__(self, exc_type, exc_val, exc_tb):
1356
+ return False
1357
+ LogNull.__exit__ = _LogNull___exit__
1358
+ del _LogNull___exit__
1359
+ def CustomDataFormat(format):
1360
+ return wx.DataFormat(format)
1361
+ CustomDataFormat = wx.deprecated(CustomDataFormat, "Use wx.DataFormat instead.")
1362
+
1363
+ PyDataObjectSimple = wx.deprecated(DataObjectSimple), 'Use DataObjectSimple instead.'
1364
+
1365
+ PyTextDataObject = wx.deprecated(TextDataObject, 'Use TextDataObject instead.')
1366
+
1367
+ PyBitmapDataObject = wx.deprecated(BitmapDataObject, 'Use TextDataObject instead.')
1368
+
1369
+ PyDropTarget = wx.deprecated(DropTarget, 'Use DropTarget instead.')
1370
+
1371
+ # Since wxTheClipboard is not really a global variable (it is a macro
1372
+ # that calls the Get static method) we can't declare it as a global
1373
+ # variable for the wrapper generator, otherwise it will try to run the
1374
+ # function at module import and the wxApp object won't exist yet. So
1375
+ # we'll use a class that will allow us to delay calling the Get until
1376
+ # wx.TheClipboard is actually being used for the first time.
1377
+ class _wxPyDelayedInitWrapper(object):
1378
+ def __init__(self, initfunc, *args, **kwargs):
1379
+ self._initfunc = initfunc
1380
+ self._args = args
1381
+ self._kwargs = kwargs
1382
+ self._instance = None
1383
+ def _checkInstance(self):
1384
+ if self._instance is None:
1385
+ if wx.GetApp():
1386
+ self._instance = self._initfunc(*self._args, **self._kwargs)
1387
+ def __getattr__(self, name):
1388
+ self._checkInstance()
1389
+ return getattr(self._instance, name)
1390
+ def __repr__(self):
1391
+ self._checkInstance()
1392
+ return repr(self._instance)
1393
+
1394
+ # context manager methods
1395
+ def __enter__(self):
1396
+ self._checkInstance()
1397
+ if not self.Open():
1398
+ raise RuntimeError('Unable to open clipboard.')
1399
+ return self
1400
+ def __exit__(self, exc_type, exc_val, exc_tb):
1401
+ self.Close()
1402
+
1403
+ TheClipboard = _wxPyDelayedInitWrapper(Clipboard.Get)
1404
+
1405
+ def _ConfigBase_ReadInt(self, key, defaultVal=0):
1406
+ import six
1407
+ rv = self._cpp_ReadInt(key, defaultVal)
1408
+ if six.PY2:
1409
+ rv = int(rv)
1410
+ return rv
1411
+ ConfigBase.ReadInt = _ConfigBase_ReadInt
1412
+ del _ConfigBase_ReadInt
1413
+ def _ConfigPathChanger___enter__(self):
1414
+ return self
1415
+ ConfigPathChanger.__enter__ = _ConfigPathChanger___enter__
1416
+ del _ConfigPathChanger___enter__
1417
+ def _ConfigPathChanger___exit__(self, exc_type, exc_val, exc_tb):
1418
+ return False
1419
+ ConfigPathChanger.__exit__ = _ConfigPathChanger___exit__
1420
+ del _ConfigPathChanger___exit__
1421
+ # For 2.8 compatibility
1422
+ KeyboardState.m_controlDown = wx.deprecated(KeyboardState.controlDown, "Use controlDown instead.")
1423
+ KeyboardState.m_shiftDown = wx.deprecated(KeyboardState.shiftDown, "Use shiftDown instead.")
1424
+ KeyboardState.m_altDown = wx.deprecated(KeyboardState.altDown, "Use altDown instead.")
1425
+ KeyboardState.m_metaDown = wx.deprecated(KeyboardState.metaDown, "Use metaDown instead.")
1426
+
1427
+ def _EvtHandler_Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
1428
+ """
1429
+ Bind an event to an event handler.
1430
+
1431
+ :param event: One of the ``EVT_*`` event binder objects that
1432
+ specifies the type of event to bind.
1433
+
1434
+ :param handler: A callable object to be invoked when the
1435
+ event is delivered to self. Pass ``None`` to
1436
+ disconnect an event handler.
1437
+
1438
+ :param source: Sometimes the event originates from a
1439
+ different window than self, but you still
1440
+ want to catch it in self. (For example, a
1441
+ button event delivered to a frame.) By
1442
+ passing the source of the event, the event
1443
+ handling system is able to differentiate
1444
+ between the same event type from different
1445
+ controls.
1446
+
1447
+ :param id: Used to spcify the event source by ID instead
1448
+ of instance.
1449
+
1450
+ :param id2: Used when it is desirable to bind a handler
1451
+ to a range of IDs, such as with EVT_MENU_RANGE.
1452
+ """
1453
+ assert isinstance(event, wx.PyEventBinder)
1454
+ assert callable(handler) or handler is None
1455
+ assert source is None or hasattr(source, 'GetId')
1456
+ if source is not None:
1457
+ id = source.GetId()
1458
+ event.Bind(self, id, id2, handler)
1459
+ EvtHandler.Bind = _EvtHandler_Bind
1460
+ del _EvtHandler_Bind
1461
+ def _EvtHandler_Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY, handler=None):
1462
+ """
1463
+ Disconnects the event handler binding for event from `self`.
1464
+ Returns ``True`` if successful.
1465
+ """
1466
+ if source is not None:
1467
+ id = source.GetId()
1468
+ return event.Unbind(self, id, id2, handler)
1469
+ EvtHandler.Unbind = _EvtHandler_Unbind
1470
+ del _EvtHandler_Unbind
1471
+ def _EventBlocker___enter__(self):
1472
+ return self
1473
+ EventBlocker.__enter__ = _EventBlocker___enter__
1474
+ del _EventBlocker___enter__
1475
+ def _EventBlocker___exit__(self, exc_type, exc_val, exc_tb):
1476
+ return False
1477
+ EventBlocker.__exit__ = _EventBlocker___exit__
1478
+ del _EventBlocker___exit__
1479
+ def _PropagationDisabler___enter__(self):
1480
+ return self
1481
+ PropagationDisabler.__enter__ = _PropagationDisabler___enter__
1482
+ del _PropagationDisabler___enter__
1483
+ def _PropagationDisabler___exit__(self, exc_type, exc_val, exc_tb):
1484
+ return False
1485
+ PropagationDisabler.__exit__ = _PropagationDisabler___exit__
1486
+ del _PropagationDisabler___exit__
1487
+ def _PropagateOnce___enter__(self):
1488
+ return self
1489
+ PropagateOnce.__enter__ = _PropagateOnce___enter__
1490
+ del _PropagateOnce___enter__
1491
+ def _PropagateOnce___exit__(self, exc_type, exc_val, exc_tb):
1492
+ return False
1493
+ PropagateOnce.__exit__ = _PropagateOnce___exit__
1494
+ del _PropagateOnce___exit__
1495
+ def _CommandEvent_GetClientObject(self):
1496
+ """
1497
+ Alias for :meth:`GetClientData`
1498
+ """
1499
+ return self.GetClientData()
1500
+ CommandEvent.GetClientObject = _CommandEvent_GetClientObject
1501
+ del _CommandEvent_GetClientObject
1502
+ def _CommandEvent_SetClientObject(self, data):
1503
+ """
1504
+ Alias for :meth:`SetClientData`
1505
+ """
1506
+ self.SetClientData(data)
1507
+ CommandEvent.SetClientObject = _CommandEvent_SetClientObject
1508
+ del _CommandEvent_SetClientObject
1509
+ CommandEvent.ClientData = property(CommandEvent.GetClientData, CommandEvent.SetClientData)
1510
+ class PyEventBinder(object):
1511
+ """
1512
+ Instances of this class are used to bind specific events to event handlers.
1513
+ """
1514
+ def __init__(self, evtType, expectedIDs=0):
1515
+ if expectedIDs not in [0, 1, 2]:
1516
+ raise ValueError("Invalid number of expectedIDs")
1517
+ self.expectedIDs = expectedIDs
1518
+
1519
+ if isinstance(evtType, (list, tuple)):
1520
+ self.evtType = list(evtType)
1521
+ else:
1522
+ self.evtType = [evtType]
1523
+
1524
+ def Bind(self, target, id1, id2, function):
1525
+ """
1526
+ Bind this set of event types to target using its Connect() method.
1527
+ """
1528
+ for et in self.evtType:
1529
+ target.Connect(id1, id2, et, function)
1530
+
1531
+ def Unbind(self, target, id1, id2, handler=None):
1532
+ """
1533
+ Remove an event binding.
1534
+ """
1535
+ success = 0
1536
+ for et in self.evtType:
1537
+ success += int(target.Disconnect(id1, id2, et, handler))
1538
+ return success != 0
1539
+
1540
+ def _getEvtType(self):
1541
+ """
1542
+ Make it easy to get to the default wxEventType typeID for this
1543
+ event binder.
1544
+ """
1545
+ return self.evtType[0]
1546
+
1547
+ typeId = property(_getEvtType)
1548
+ @wx.deprecatedMsg("Use :meth:`EvtHandler.Bind` instead.")
1549
+ def __call__(self, *args):
1550
+ """
1551
+ For backwards compatibility with the old ``EVT_*`` functions.
1552
+ Should be called with either (window, func), (window, ID,
1553
+ func) or (window, ID1, ID2, func) parameters depending on the
1554
+ type of the event.
1555
+ """
1556
+ assert len(args) == 2 + self.expectedIDs
1557
+ id1 = ID_ANY
1558
+ id2 = ID_ANY
1559
+ target = args[0]
1560
+ if self.expectedIDs == 0:
1561
+ func = args[1]
1562
+ elif self.expectedIDs == 1:
1563
+ id1 = args[1]
1564
+ func = args[2]
1565
+ elif self.expectedIDs == 2:
1566
+ id1 = args[1]
1567
+ id2 = args[2]
1568
+ func = args[3]
1569
+ else:
1570
+ raise ValueError("Unexpected number of IDs")
1571
+
1572
+ self.Bind(target, id1, id2, func)
1573
+
1574
+
1575
+ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1576
+ # This code block was included from src/event_ex.py
1577
+ # Create some event binders
1578
+ EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
1579
+ EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
1580
+ EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
1581
+ EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
1582
+ EVT_MOVE_START = wx.PyEventBinder( wxEVT_MOVE_START )
1583
+ EVT_MOVE_END = wx.PyEventBinder( wxEVT_MOVE_END )
1584
+ EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
1585
+ EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
1586
+ EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
1587
+ EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
1588
+ EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
1589
+ EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
1590
+ EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
1591
+ EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
1592
+ EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
1593
+ EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
1594
+ EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
1595
+ EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
1596
+ EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
1597
+ EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
1598
+ EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
1599
+ EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
1600
+ EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
1601
+ EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
1602
+ EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
1603
+ EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
1604
+ EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
1605
+ EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
1606
+ EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
1607
+ EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
1608
+ EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
1609
+ EVT_DPI_CHANGED = wx.PyEventBinder( wxEVT_DPI_CHANGED )
1610
+ EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
1611
+ EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
1612
+ EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
1613
+ EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
1614
+ EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
1615
+ EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
1616
+ EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
1617
+ EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
1618
+ EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
1619
+ EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
1620
+ EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
1621
+
1622
+ EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
1623
+ EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
1624
+ EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
1625
+ EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
1626
+ EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
1627
+ EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
1628
+ EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
1629
+ EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
1630
+ EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
1631
+ EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
1632
+ EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
1633
+ EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
1634
+ EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
1635
+ EVT_MOUSE_AUX1_DOWN = wx.PyEventBinder( wxEVT_AUX1_DOWN )
1636
+ EVT_MOUSE_AUX1_UP = wx.PyEventBinder( wxEVT_AUX1_UP )
1637
+ EVT_MOUSE_AUX1_DCLICK = wx.PyEventBinder( wxEVT_AUX1_DCLICK )
1638
+ EVT_MOUSE_AUX2_DOWN = wx.PyEventBinder( wxEVT_AUX2_DOWN )
1639
+ EVT_MOUSE_AUX2_UP = wx.PyEventBinder( wxEVT_AUX2_UP )
1640
+ EVT_MOUSE_AUX2_DCLICK = wx.PyEventBinder( wxEVT_AUX2_DCLICK )
1641
+
1642
+ EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
1643
+ wxEVT_LEFT_UP,
1644
+ wxEVT_MIDDLE_DOWN,
1645
+ wxEVT_MIDDLE_UP,
1646
+ wxEVT_RIGHT_DOWN,
1647
+ wxEVT_RIGHT_UP,
1648
+ wxEVT_MOTION,
1649
+ wxEVT_LEFT_DCLICK,
1650
+ wxEVT_MIDDLE_DCLICK,
1651
+ wxEVT_RIGHT_DCLICK,
1652
+ wxEVT_ENTER_WINDOW,
1653
+ wxEVT_LEAVE_WINDOW,
1654
+ wxEVT_MOUSEWHEEL,
1655
+ wxEVT_AUX1_DOWN,
1656
+ wxEVT_AUX1_UP,
1657
+ wxEVT_AUX1_DCLICK,
1658
+ wxEVT_AUX2_DOWN,
1659
+ wxEVT_AUX2_UP,
1660
+ wxEVT_AUX2_DCLICK,
1661
+ ])
1662
+ EVT_MAGNIFY = wx.PyEventBinder( wxEVT_MAGNIFY )
1663
+
1664
+
1665
+ # Scrolling from wxWindow (sent to wxScrolledWindow)
1666
+ EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
1667
+ wxEVT_SCROLLWIN_BOTTOM,
1668
+ wxEVT_SCROLLWIN_LINEUP,
1669
+ wxEVT_SCROLLWIN_LINEDOWN,
1670
+ wxEVT_SCROLLWIN_PAGEUP,
1671
+ wxEVT_SCROLLWIN_PAGEDOWN,
1672
+ wxEVT_SCROLLWIN_THUMBTRACK,
1673
+ wxEVT_SCROLLWIN_THUMBRELEASE,
1674
+ ])
1675
+
1676
+ EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
1677
+ EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
1678
+ EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
1679
+ EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
1680
+ EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
1681
+ EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
1682
+ EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
1683
+ EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
1684
+
1685
+ # Scrolling from wx.Slider and wx.ScrollBar
1686
+ EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
1687
+ wxEVT_SCROLL_BOTTOM,
1688
+ wxEVT_SCROLL_LINEUP,
1689
+ wxEVT_SCROLL_LINEDOWN,
1690
+ wxEVT_SCROLL_PAGEUP,
1691
+ wxEVT_SCROLL_PAGEDOWN,
1692
+ wxEVT_SCROLL_THUMBTRACK,
1693
+ wxEVT_SCROLL_THUMBRELEASE,
1694
+ wxEVT_SCROLL_CHANGED,
1695
+ ])
1696
+
1697
+ EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
1698
+ EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
1699
+ EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
1700
+ EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
1701
+ EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
1702
+ EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
1703
+ EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
1704
+ EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
1705
+ EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
1706
+ EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
1707
+
1708
+ # Scrolling from wx.Slider and wx.ScrollBar, with an id
1709
+ EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
1710
+ wxEVT_SCROLL_BOTTOM,
1711
+ wxEVT_SCROLL_LINEUP,
1712
+ wxEVT_SCROLL_LINEDOWN,
1713
+ wxEVT_SCROLL_PAGEUP,
1714
+ wxEVT_SCROLL_PAGEDOWN,
1715
+ wxEVT_SCROLL_THUMBTRACK,
1716
+ wxEVT_SCROLL_THUMBRELEASE,
1717
+ wxEVT_SCROLL_CHANGED,
1718
+ ], 1)
1719
+
1720
+ EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
1721
+ EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
1722
+ EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
1723
+ EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
1724
+ EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
1725
+ EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
1726
+ EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
1727
+ EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
1728
+ EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
1729
+ EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
1730
+
1731
+ EVT_BUTTON = wx.PyEventBinder( wxEVT_BUTTON, 1)
1732
+ EVT_CHECKBOX = wx.PyEventBinder( wxEVT_CHECKBOX, 1)
1733
+ EVT_CHOICE = wx.PyEventBinder( wxEVT_CHOICE, 1)
1734
+ EVT_LISTBOX = wx.PyEventBinder( wxEVT_LISTBOX, 1)
1735
+ EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_LISTBOX_DCLICK, 1)
1736
+ EVT_MENU = wx.PyEventBinder( wxEVT_MENU, 1)
1737
+ EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_MENU, 2)
1738
+ EVT_SLIDER = wx.PyEventBinder( wxEVT_SLIDER, 1)
1739
+ EVT_RADIOBOX = wx.PyEventBinder( wxEVT_RADIOBOX, 1)
1740
+ EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_RADIOBUTTON, 1)
1741
+
1742
+ EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_SCROLLBAR, 1)
1743
+ EVT_VLBOX = wx.PyEventBinder( wxEVT_VLBOX, 1)
1744
+ EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMBOBOX, 1)
1745
+ EVT_TOOL = wx.PyEventBinder( wxEVT_TOOL, 1)
1746
+ EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_TOOL, 2)
1747
+ EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_TOOL_RCLICKED, 1)
1748
+ EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_TOOL_RCLICKED, 2)
1749
+ EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_TOOL_ENTER, 1)
1750
+ EVT_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_TOOL_DROPDOWN, 1)
1751
+ EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_CHECKLISTBOX, 1)
1752
+ EVT_COMBOBOX_DROPDOWN = wx.PyEventBinder( wxEVT_COMBOBOX_DROPDOWN , 1)
1753
+ EVT_COMBOBOX_CLOSEUP = wx.PyEventBinder( wxEVT_COMBOBOX_CLOSEUP , 1)
1754
+
1755
+ EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
1756
+ EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
1757
+ EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
1758
+ EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
1759
+ EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
1760
+ EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
1761
+ EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
1762
+
1763
+ EVT_HELP = wx.PyEventBinder( wxEVT_HELP, 1)
1764
+ EVT_HELP_RANGE = wx.PyEventBinder( wxEVT_HELP, 2)
1765
+ EVT_DETAILED_HELP = wx.PyEventBinder( wxEVT_DETAILED_HELP, 1)
1766
+ EVT_DETAILED_HELP_RANGE = wx.PyEventBinder( wxEVT_DETAILED_HELP, 2)
1767
+
1768
+ EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
1769
+
1770
+ EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
1771
+ EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
1772
+
1773
+ EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
1774
+
1775
+ EVT_THREAD = wx.PyEventBinder( wxEVT_THREAD )
1776
+
1777
+ EVT_WINDOW_MODAL_DIALOG_CLOSED = wx.PyEventBinder( wxEVT_WINDOW_MODAL_DIALOG_CLOSED )
1778
+
1779
+ EVT_JOY_BUTTON_DOWN = wx.PyEventBinder( wxEVT_JOY_BUTTON_DOWN )
1780
+ EVT_JOY_BUTTON_UP = wx.PyEventBinder( wxEVT_JOY_BUTTON_UP )
1781
+ EVT_JOY_MOVE = wx.PyEventBinder( wxEVT_JOY_MOVE )
1782
+ EVT_JOY_ZMOVE = wx.PyEventBinder( wxEVT_JOY_ZMOVE )
1783
+ EVT_JOYSTICK_EVENTS = wx.PyEventBinder([ wxEVT_JOY_BUTTON_DOWN,
1784
+ wxEVT_JOY_BUTTON_UP,
1785
+ wxEVT_JOY_MOVE,
1786
+ wxEVT_JOY_ZMOVE,
1787
+ ])
1788
+
1789
+ EVT_GESTURE_PAN = wx.PyEventBinder( wxEVT_GESTURE_PAN )
1790
+ EVT_GESTURE_ZOOM = wx.PyEventBinder( wxEVT_GESTURE_ZOOM )
1791
+ EVT_GESTURE_ROTATE = wx.PyEventBinder( wxEVT_GESTURE_ROTATE )
1792
+ EVT_TWO_FINGER_TAP = wx.PyEventBinder( wxEVT_TWO_FINGER_TAP )
1793
+ EVT_LONG_PRESS = wx.PyEventBinder( wxEVT_LONG_PRESS )
1794
+ EVT_PRESS_AND_TAP = wx.PyEventBinder( wxEVT_PRESS_AND_TAP )
1795
+
1796
+ EVT_CLIPBOARD_CHANGED = PyEventBinder(wxEVT_CLIPBOARD_CHANGED, 1)
1797
+
1798
+
1799
+ # deprecated wxEVT aliases
1800
+ wxEVT_COMMAND_BUTTON_CLICKED = wxEVT_BUTTON
1801
+ wxEVT_COMMAND_CHECKBOX_CLICKED = wxEVT_CHECKBOX
1802
+ wxEVT_COMMAND_CHOICE_SELECTED = wxEVT_CHOICE
1803
+ wxEVT_COMMAND_LISTBOX_SELECTED = wxEVT_LISTBOX
1804
+ wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = wxEVT_LISTBOX_DCLICK
1805
+ wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxEVT_CHECKLISTBOX
1806
+ wxEVT_COMMAND_MENU_SELECTED = wxEVT_MENU
1807
+ wxEVT_COMMAND_TOOL_CLICKED = wxEVT_TOOL
1808
+ wxEVT_COMMAND_SLIDER_UPDATED = wxEVT_SLIDER
1809
+ wxEVT_COMMAND_RADIOBOX_SELECTED = wxEVT_RADIOBOX
1810
+ wxEVT_COMMAND_RADIOBUTTON_SELECTED = wxEVT_RADIOBUTTON
1811
+ wxEVT_COMMAND_SCROLLBAR_UPDATED = wxEVT_SCROLLBAR
1812
+ wxEVT_COMMAND_VLBOX_SELECTED = wxEVT_VLBOX
1813
+ wxEVT_COMMAND_COMBOBOX_SELECTED = wxEVT_COMBOBOX
1814
+ wxEVT_COMMAND_TOOL_RCLICKED = wxEVT_TOOL_RCLICKED
1815
+ wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED = wxEVT_TOOL_DROPDOWN
1816
+ wxEVT_COMMAND_TOOL_ENTER = wxEVT_TOOL_ENTER
1817
+ wxEVT_COMMAND_COMBOBOX_DROPDOWN = wxEVT_COMBOBOX_DROPDOWN
1818
+ wxEVT_COMMAND_COMBOBOX_CLOSEUP = wxEVT_COMBOBOX_CLOSEUP
1819
+
1820
+ # End of included code block
1821
+ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1822
+
1823
+ PyEvtHandler = wx.deprecated(EvtHandler, "Use :class:`EvtHandler` instead.")
1824
+
1825
+ def _PyEvent_Clone(self):
1826
+ """
1827
+ Make a new instance of the event that is a copy of self.
1828
+
1829
+ Through the magic of Python this implementation should work for
1830
+ this and all derived classes.
1831
+ """
1832
+ # Create a new instance of the same type as this instance and
1833
+ # then invoke the C++ copy constructor to copy the C++ parts and
1834
+ # any custom attributes.
1835
+ clone = wx.PyEvent.__new__(self.__class__)
1836
+ wx.PyEvent.__init__(clone, self)
1837
+ return clone
1838
+ PyEvent.Clone = _PyEvent_Clone
1839
+ del _PyEvent_Clone
1840
+ def _PyCommandEvent_Clone(self):
1841
+ """
1842
+ Make a new instance of the event that is a copy of self.
1843
+
1844
+ Through the magic of Python this implementation should work for
1845
+ this and all derived classes.
1846
+ """
1847
+ # Create a new instance of the same type as this instance and
1848
+ # then invoke the C++ copy constructor to copy the C++ parts and
1849
+ # any custom attributes.
1850
+ clone = wx.PyCommandEvent.__new__(self.__class__)
1851
+ wx.PyCommandEvent.__init__(clone, self)
1852
+ return clone
1853
+ PyCommandEvent.Clone = _PyCommandEvent_Clone
1854
+ del _PyCommandEvent_Clone
1855
+ def _Sizer_AddMany(self, items):
1856
+ """
1857
+ :meth:`AddMany` is a convenience method for adding several items to a sizer
1858
+ at one time. Simply pass it a list of tuples, where each tuple
1859
+ consists of the parameters that you would normally pass to the :meth:`Add`
1860
+ method.
1861
+ """
1862
+ for item in items:
1863
+ if not isinstance(item, (tuple, list)):
1864
+ item = (item, )
1865
+ self.Add(*item)
1866
+ Sizer.AddMany = _Sizer_AddMany
1867
+ del _Sizer_AddMany
1868
+ def _Sizer___nonzero__(self):
1869
+ """
1870
+ Can be used to test if the C++ part of the sizer still exists, with
1871
+ code like this::
1872
+
1873
+ if theSizer:
1874
+ doSomething()
1875
+ """
1876
+ import wx.siplib
1877
+ return not wx.siplib.isdeleted(self)
1878
+ Sizer.__nonzero__ = _Sizer___nonzero__
1879
+ del _Sizer___nonzero__
1880
+ def _Sizer___iter__(self):
1881
+ """
1882
+ A Python convenience method that allows Sizers to act as iterables that will yield their wx.SizerItems.
1883
+ """
1884
+ for item in self.GetChildren(): yield item
1885
+ Sizer.__iter__ = _Sizer___iter__
1886
+ del _Sizer___iter__
1887
+ Sizer.__bool__ = Sizer.__nonzero__
1888
+
1889
+ def _GridSizer_CalcRowsCols(self):
1890
+ """
1891
+ CalcRowsCols() -> (rows, cols)
1892
+
1893
+ Calculates how many rows and columns will be in the sizer based
1894
+ on the current number of items and also the rows, cols specified
1895
+ in the constructor.
1896
+ """
1897
+ nitems = len(self.GetChildren())
1898
+ rows = self.GetRows()
1899
+ cols = self.GetCols()
1900
+ assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
1901
+ if cols != 0:
1902
+ rows = (nitems + cols - 1) / cols
1903
+ elif rows != 0:
1904
+ cols = (nitems + rows - 1) / rows
1905
+ return (rows, cols)
1906
+ GridSizer.CalcRowsCols = _GridSizer_CalcRowsCols
1907
+ del _GridSizer_CalcRowsCols
1908
+ PySizer = wx.deprecated(Sizer, 'Use Sizer instead.')
1909
+
1910
+ def _SizerItemList___repr__(self):
1911
+ return "SizerItemList: " + repr(list(self))
1912
+ SizerItemList.__repr__ = _SizerItemList___repr__
1913
+ del _SizerItemList___repr__
1914
+ def _GBPosition_GetIM(self):
1915
+ """
1916
+ Returns an immutable representation of the ``wx.GBPosition`` object, based on ``namedtuple``.
1917
+
1918
+ This new object is hashable and can be used as a dictionary key,
1919
+ be added to sets, etc. It can be converted back into a real ``wx.GBPosition``
1920
+ with a simple statement like this: ``obj = wx.GBPosition(imObj)``.
1921
+ """
1922
+ return _im_GBPosition(*self.Get())
1923
+ GBPosition.GetIM = _GBPosition_GetIM
1924
+ del _GBPosition_GetIM
1925
+ def _GBPosition___str__(self):
1926
+ return str(self.Get())
1927
+ GBPosition.__str__ = _GBPosition___str__
1928
+ del _GBPosition___str__
1929
+ def _GBPosition___repr__(self):
1930
+ return "wx.GBPosition"+str(self.Get())
1931
+ GBPosition.__repr__ = _GBPosition___repr__
1932
+ del _GBPosition___repr__
1933
+ def _GBPosition___len__(self):
1934
+ return len(self.Get())
1935
+ GBPosition.__len__ = _GBPosition___len__
1936
+ del _GBPosition___len__
1937
+ def _GBPosition___nonzero__(self):
1938
+ return self.Get() != (0,0)
1939
+ GBPosition.__nonzero__ = _GBPosition___nonzero__
1940
+ del _GBPosition___nonzero__
1941
+ def _GBPosition___bool__(self):
1942
+ return self.Get() != (0,0)
1943
+ GBPosition.__bool__ = _GBPosition___bool__
1944
+ del _GBPosition___bool__
1945
+ def _GBPosition___reduce__(self):
1946
+ return (GBPosition, self.Get())
1947
+ GBPosition.__reduce__ = _GBPosition___reduce__
1948
+ del _GBPosition___reduce__
1949
+ def _GBPosition___getitem__(self, idx):
1950
+ return self.Get()[idx]
1951
+ GBPosition.__getitem__ = _GBPosition___getitem__
1952
+ del _GBPosition___getitem__
1953
+ def _GBPosition___setitem__(self, idx, val):
1954
+ if idx == 0: self.Row = val
1955
+ elif idx == 1: self.Col = val
1956
+ else: raise IndexError
1957
+ GBPosition.__setitem__ = _GBPosition___setitem__
1958
+ del _GBPosition___setitem__
1959
+ GBPosition.__safe_for_unpickling__ = True
1960
+
1961
+ def _GBSpan_GetIM(self):
1962
+ """
1963
+ Returns an immutable representation of the ``wx.GBSpan`` object, based on ``namedtuple``.
1964
+
1965
+ This new object is hashable and can be used as a dictionary key,
1966
+ be added to sets, etc. It can be converted back into a real ``wx.GBSpan``
1967
+ with a simple statement like this: ``obj = wx.GBSpan(imObj)``.
1968
+ """
1969
+ return _im_GBSpan(*self.Get())
1970
+ GBSpan.GetIM = _GBSpan_GetIM
1971
+ del _GBSpan_GetIM
1972
+ def _GBSpan___str__(self):
1973
+ return str(self.Get())
1974
+ GBSpan.__str__ = _GBSpan___str__
1975
+ del _GBSpan___str__
1976
+ def _GBSpan___repr__(self):
1977
+ return "wx.GBSpan"+str(self.Get())
1978
+ GBSpan.__repr__ = _GBSpan___repr__
1979
+ del _GBSpan___repr__
1980
+ def _GBSpan___len__(self):
1981
+ return len(self.Get())
1982
+ GBSpan.__len__ = _GBSpan___len__
1983
+ del _GBSpan___len__
1984
+ def _GBSpan___nonzero__(self):
1985
+ return self.Get() != (0,0)
1986
+ GBSpan.__nonzero__ = _GBSpan___nonzero__
1987
+ del _GBSpan___nonzero__
1988
+ def _GBSpan___bool__(self):
1989
+ return self.Get() != (0,0)
1990
+ GBSpan.__bool__ = _GBSpan___bool__
1991
+ del _GBSpan___bool__
1992
+ def _GBSpan___reduce__(self):
1993
+ return (GBSpan, self.Get())
1994
+ GBSpan.__reduce__ = _GBSpan___reduce__
1995
+ del _GBSpan___reduce__
1996
+ def _GBSpan___getitem__(self, idx):
1997
+ return self.Get()[idx]
1998
+ GBSpan.__getitem__ = _GBSpan___getitem__
1999
+ del _GBSpan___getitem__
2000
+ def _GBSpan___setitem__(self, idx, val):
2001
+ if idx == 0: self.Rowspan = val
2002
+ elif idx == 1: self.Colspan = val
2003
+ else: raise IndexError
2004
+ GBSpan.__setitem__ = _GBSpan___setitem__
2005
+ del _GBSpan___setitem__
2006
+ GBSpan.__safe_for_unpickling__ = True
2007
+
2008
+ GridBagSizer.CheckForIntersectionPos = wx.deprecated(GridBagSizer.CheckForIntersection, 'Use CheckForIntersection instead.')
2009
+
2010
+ from collections import namedtuple
2011
+ _im_GBPosition = namedtuple('_im_GBPosition', ['row', 'col'])
2012
+ del namedtuple
2013
+
2014
+ from collections import namedtuple
2015
+ _im_GBSpan = namedtuple('_im_GBSpan', ['rowspan', 'colspan'])
2016
+ del namedtuple
2017
+
2018
+ def _EventLoopActivator___enter__(self):
2019
+ return self
2020
+ EventLoopActivator.__enter__ = _EventLoopActivator___enter__
2021
+ del _EventLoopActivator___enter__
2022
+ def _EventLoopActivator___exit__(self, exc_type, exc_val, exc_tb):
2023
+ return False
2024
+ EventLoopActivator.__exit__ = _EventLoopActivator___exit__
2025
+ del _EventLoopActivator___exit__
2026
+ @wx.deprecatedMsg('Use GUIEventLoop instead.')
2027
+ class EventLoop(GUIEventLoop):
2028
+ '''A class using the old name for compatibility.'''
2029
+ def __init__(self):
2030
+ GUIEventLoop.__init__(self)
2031
+
2032
+ def YieldIfNeeded():
2033
+ """
2034
+ Convenience function for wx.GetApp().Yield(True)
2035
+ """
2036
+ return wx.GetApp().Yield(True)
2037
+
2038
+ class PyOnDemandOutputWindow(object):
2039
+ """
2040
+ A class that can be used for redirecting Python's stdout and
2041
+ stderr streams. It will do nothing until something is wrriten to
2042
+ the stream at which point it will create a Frame with a text area
2043
+ and write the text there.
2044
+ """
2045
+ def __init__(self, title="wxPython: stdout/stderr"):
2046
+ self.frame = None
2047
+ self.title = title
2048
+ self.pos = wx.DefaultPosition
2049
+ self.size = (450, 300)
2050
+ self.parent = None
2051
+
2052
+ def SetParent(self, parent):
2053
+ """
2054
+ Set the window to be used as the popup Frame's parent.
2055
+ """
2056
+ self.parent = parent
2057
+
2058
+ def CreateOutputWindow(self, txt):
2059
+ self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
2060
+ style=wx.DEFAULT_FRAME_STYLE)
2061
+ self.text = wx.TextCtrl(self.frame, -1, "",
2062
+ style=wx.TE_MULTILINE|wx.TE_READONLY)
2063
+ self.text.AppendText(txt)
2064
+ self.frame.Show(True)
2065
+ self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
2066
+
2067
+ def OnCloseWindow(self, event):
2068
+ if self.frame is not None:
2069
+ self.frame.Destroy()
2070
+ self.frame = None
2071
+ self.text = None
2072
+ self.parent = None
2073
+
2074
+ def write(self, text):
2075
+ """
2076
+ Create the output window if needed and write the string to it.
2077
+ If not called in the context of the gui thread then CallAfter is
2078
+ used to do the work there.
2079
+ """
2080
+ if self.frame is None:
2081
+ if not wx.IsMainThread():
2082
+ wx.CallAfter(self.CreateOutputWindow, text)
2083
+ else:
2084
+ self.CreateOutputWindow(text)
2085
+ else:
2086
+ if not wx.IsMainThread():
2087
+ wx.CallAfter(self.text.AppendText, text)
2088
+ else:
2089
+ self.text.AppendText(text)
2090
+
2091
+ def close(self):
2092
+ if self.frame is not None:
2093
+ wx.CallAfter(self.frame.Close)
2094
+
2095
+ def flush(self):
2096
+ pass
2097
+
2098
+
2099
+ class App(PyApp):
2100
+ """
2101
+ The ``wx.App`` class represents the application and is used to:
2102
+
2103
+ * bootstrap the wxPython system and initialize the underlying
2104
+ gui toolkit
2105
+ * set and get application-wide properties
2106
+ * implement the native windowing system main message or event loop,
2107
+ and to dispatch events to window instances
2108
+ * etc.
2109
+
2110
+ Every wx application must have a single ``wx.App`` instance, and all
2111
+ creation of UI objects should be delayed until after the ``wx.App`` object
2112
+ has been created in order to ensure that the gui platform and wxWidgets
2113
+ have been fully initialized.
2114
+
2115
+ Normally you would derive from this class and implement an ``OnInit``
2116
+ method that creates a frame and then calls ``self.SetTopWindow(frame)``,
2117
+ however ``wx.App`` is also usable on its own without derivation.
2118
+
2119
+ :note: In Python the wrapper for the C++ class ``wxApp`` has been renamed tp
2120
+ :class:`wx.PyApp`. This ``wx.App`` class derives from ``wx.PyApp``, and is
2121
+ responsible for handling the Python-specific needs for bootstrapping the
2122
+ wxWidgets library and other Python integration related requirements.
2123
+ """
2124
+ outputWindowClass = PyOnDemandOutputWindow
2125
+ def __init__(self, redirect=False, filename=None, useBestVisual=False, clearSigInt=True):
2126
+ """
2127
+ Construct a ``wx.App`` object.
2128
+
2129
+ :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
2130
+ redirected? Defaults to False. If ``filename`` is None
2131
+ then output will be redirected to a window that pops up
2132
+ as needed. (You can control what kind of window is created
2133
+ for the output by resetting the class variable
2134
+ ``outputWindowClass`` to a class of your choosing.)
2135
+
2136
+ :param filename: The name of a file to redirect output to, if
2137
+ redirect is True.
2138
+
2139
+ :param useBestVisual: Should the app try to use the best
2140
+ available visual provided by the system (only relevant on
2141
+ systems that have more than one visual.) This parameter
2142
+ must be used instead of calling `SetUseBestVisual` later
2143
+ on because it must be set before the underlying GUI
2144
+ toolkit is initialized.
2145
+
2146
+ :param clearSigInt: Should SIGINT be cleared? This allows the
2147
+ app to terminate upon a Ctrl-C in the console like other
2148
+ GUI apps will.
2149
+
2150
+ :note: You should override OnInit to do application
2151
+ initialization to ensure that the system, toolkit and
2152
+ wxWidgets are fully initialized.
2153
+ """
2154
+ PyApp.__init__(self)
2155
+
2156
+ # make sure we can create a GUI
2157
+ if not self.IsDisplayAvailable():
2158
+
2159
+ if wx.Port == "__WXMAC__":
2160
+ msg = "This program needs access to the screen. Please run with a\n" \
2161
+ "Framework build of python, and only when you are logged in\n" \
2162
+ "on the main display of your Mac."
2163
+
2164
+ elif wx.Port == "__WXGTK__":
2165
+ msg ="Unable to access the X Display, is $DISPLAY set properly?"
2166
+
2167
+ else:
2168
+ msg = "Unable to create GUI"
2169
+ # TODO: more description is needed for wxMSW...
2170
+
2171
+ raise SystemExit(msg)
2172
+
2173
+ # This has to be done before OnInit
2174
+ self.SetUseBestVisual(useBestVisual)
2175
+
2176
+ # Set the default handler for SIGINT. This fixes a problem
2177
+ # where if Ctrl-C is pressed in the console that started this
2178
+ # app then it will not appear to do anything, (not even send
2179
+ # KeyboardInterrupt???) but will later segfault on exit. By
2180
+ # setting the default handler then the app will exit, as
2181
+ # expected (depending on platform.)
2182
+ if clearSigInt:
2183
+ try:
2184
+ import signal
2185
+ signal.signal(signal.SIGINT, signal.SIG_DFL)
2186
+ except:
2187
+ pass
2188
+
2189
+ # Save and redirect the stdio to a window?
2190
+ self.stdioWin = None
2191
+ self.saveStdio = (_sys.stdout, _sys.stderr)
2192
+ if redirect:
2193
+ self.RedirectStdio(filename)
2194
+
2195
+ # Use Python's install prefix as the default
2196
+ prefix = _sys.prefix
2197
+ if isinstance(prefix, (bytes, bytearray)):
2198
+ prefix = prefix.decode(_sys.getfilesystemencoding())
2199
+ wx.StandardPaths.Get().SetInstallPrefix(prefix)
2200
+
2201
+ # Until the new native control for wxMac is up to par, still use the generic one.
2202
+ wx.SystemOptions.SetOption("mac.listctrl.always_use_generic", 1)
2203
+
2204
+ # This finishes the initialization of wxWindows and then calls
2205
+ # the OnInit that should be present in the derived class
2206
+ self._BootstrapApp()
2207
+
2208
+ def OnPreInit(self):
2209
+ """
2210
+ Things that must be done after _BootstrapApp has done its thing, but
2211
+ would be nice if they were already done by the time that OnInit is
2212
+ called. This can be overridden in derived classes, but be sure to call
2213
+ this method from there.
2214
+ """
2215
+ wx.StockGDI._initStockObjects()
2216
+ self.InitLocale()
2217
+
2218
+ def __del__(self):
2219
+ # Just in case the MainLoop was overridden without calling RestoreStio
2220
+ self.RestoreStdio()
2221
+
2222
+ def SetTopWindow(self, frame):
2223
+ """
2224
+ Set the "main" top level window, which will be used for the parent of
2225
+ the on-demand output window as well as for dialogs that do not have
2226
+ an explicit parent set.
2227
+ """
2228
+ if self.stdioWin:
2229
+ self.stdioWin.SetParent(frame)
2230
+ wx.PyApp.SetTopWindow(self, frame)
2231
+
2232
+ def MainLoop(self):
2233
+ """
2234
+ Execute the main GUI event loop
2235
+ """
2236
+ rv = wx.PyApp.MainLoop(self)
2237
+ self.RestoreStdio()
2238
+ return rv
2239
+
2240
+ def RedirectStdio(self, filename=None):
2241
+ """
2242
+ Redirect sys.stdout and sys.stderr to a file or a popup window.
2243
+ """
2244
+ if filename:
2245
+ _sys.stdout = _sys.stderr = open(filename, 'a')
2246
+ else:
2247
+ self.stdioWin = self.outputWindowClass()
2248
+ _sys.stdout = _sys.stderr = self.stdioWin
2249
+
2250
+ def RestoreStdio(self):
2251
+ try:
2252
+ _sys.stdout, _sys.stderr = self.saveStdio
2253
+ except:
2254
+ pass
2255
+
2256
+ def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
2257
+ """
2258
+ Set the title, position and/or size of the output window if the stdio
2259
+ has been redirected. This should be called before any output would
2260
+ cause the output window to be created.
2261
+ """
2262
+ if self.stdioWin:
2263
+ if title is not None:
2264
+ self.stdioWin.title = title
2265
+ if pos is not None:
2266
+ self.stdioWin.pos = pos
2267
+ if size is not None:
2268
+ self.stdioWin.size = size
2269
+
2270
+ def InitLocale(self):
2271
+ """
2272
+ Starting with version 3.8 on Windows, Python is now setting the locale
2273
+ to what is defined by the system as the default locale. This causes
2274
+ problems with wxWidgets which expects to be able to manage the locale
2275
+ via the wx.Locale class, so the locale will be reset here to be the
2276
+ default "C" locale settings.
2277
+
2278
+ If you have troubles from the default behavior of this method you can
2279
+ override it in a derived class to behave differently. Please report
2280
+ the problem you encountered.
2281
+ """
2282
+ if _sys.platform.startswith('win') and _sys.version_info > (3,8):
2283
+ import locale
2284
+ locale.setlocale(locale.LC_ALL, "C")
2285
+
2286
+ def ResetLocale(self):
2287
+ """
2288
+ This method is now a NOP and will be deprecated.
2289
+ """
2290
+ pass
2291
+
2292
+ @staticmethod
2293
+ def Get():
2294
+ """
2295
+ A staticmethod returning the currently active application object.
2296
+ Essentially just a more pythonic version of :meth:`GetApp`.
2297
+ """
2298
+ return GetApp()
2299
+
2300
+
2301
+ @wx.deprecatedMsg("Use :class:`App` instead.")
2302
+ class PySimpleApp(App):
2303
+ """
2304
+ This class is deprecated. Please use :class:`App` instead.
2305
+ """
2306
+ def __init__(self, *args, **kw):
2307
+ App.__init__(self, *args, **kw)
2308
+
2309
+
2310
+ EVT_TIMER = wx.PyEventBinder( wxEVT_TIMER )
2311
+
2312
+ class PyTimer(Timer):
2313
+ '''This timer class is passed the callable object to be called when the timer expires.'''
2314
+ def __init__(self, notify):
2315
+ Timer.__init__(self)
2316
+ self.notify = notify
2317
+
2318
+ def Notify(self):
2319
+ if self.notify:
2320
+ self.notify()
2321
+
2322
+ def _Window_SetRect(self, rect):
2323
+ return self.SetSize(rect)
2324
+ Window.SetRect = _Window_SetRect
2325
+ del _Window_SetRect
2326
+ Window.Rect = property(Window.GetRect, Window.SetRect)
2327
+ def _Window_SetClientRect(self, rect):
2328
+ return self.SetClientSize(rect)
2329
+ Window.SetClientRect = _Window_SetClientRect
2330
+ del _Window_SetClientRect
2331
+ Window.ClientRect = property(Window.GetClientRect, Window.SetClientRect)
2332
+ Window.SetDimensions = wx.deprecated(Window.SetDimensions, 'Use SetSize instead.')
2333
+
2334
+ def _Window___nonzero__(self):
2335
+ """
2336
+ Can be used to test if the C++ part of the window still exists, with
2337
+ code like this::
2338
+
2339
+ if theWindow:
2340
+ doSomething()
2341
+ """
2342
+ import wx.siplib
2343
+ return not wx.siplib.isdeleted(self)
2344
+ Window.__nonzero__ = _Window___nonzero__
2345
+ del _Window___nonzero__
2346
+ Window.__bool__ = Window.__nonzero__
2347
+
2348
+ def _Window_DestroyLater(self):
2349
+ """
2350
+ Schedules the window to be destroyed in the near future.
2351
+
2352
+ This should be used whenever Destroy could happen too soon, such
2353
+ as when there may still be events for this window or its children
2354
+ waiting in the event queue.
2355
+ """
2356
+ self.Hide()
2357
+ wx.GetApp().ScheduleForDestruction(self)
2358
+ Window.DestroyLater = _Window_DestroyLater
2359
+ del _Window_DestroyLater
2360
+ def _Window_DLG_UNIT(self, dlg_unit):
2361
+ """
2362
+ A convenience wrapper for :meth:`ConvertDialogToPixels`.
2363
+ """
2364
+ is_wxType = isinstance(dlg_unit, (wx.Size, wx.Point))
2365
+ pix = self.ConvertDialogToPixels(dlg_unit)
2366
+ if not is_wxType:
2367
+ pix = tuple(pix)
2368
+ return pix
2369
+ Window.DLG_UNIT = _Window_DLG_UNIT
2370
+ del _Window_DLG_UNIT
2371
+ def _Window_PostCreate(self, pre):
2372
+ pass
2373
+ Window.PostCreate = wx.deprecated(_Window_PostCreate, "PostCreate is no longer necessary.")
2374
+ del _Window_PostCreate
2375
+ def _Window_GetPositionTuple(self):
2376
+ return self.GetPosition()
2377
+ Window.GetPositionTuple = wx.deprecated(_Window_GetPositionTuple, "Use GetPosition instead")
2378
+ del _Window_GetPositionTuple
2379
+ def _Window_GetSizeTuple(self):
2380
+ return self.GetSize()
2381
+ Window.GetSizeTuple = wx.deprecated(_Window_GetSizeTuple, "Use GetSize instead")
2382
+ del _Window_GetSizeTuple
2383
+ def _Window_MoveXY(self, x, y):
2384
+ return self.Move(x, y)
2385
+ Window.MoveXY = wx.deprecated(_Window_MoveXY, "Use Move instead.")
2386
+ del _Window_MoveXY
2387
+ def _Window_SetSizeWH(self, w, h):
2388
+ return self.SetSize(w,h)
2389
+ Window.SetSizeWH = wx.deprecated(_Window_SetSizeWH, "Use SetSize instead.")
2390
+ del _Window_SetSizeWH
2391
+ def _Window_SetVirtualSizeWH(self, w, h):
2392
+ return self.SetVirtualSize(w,h)
2393
+ Window.SetVirtualSizeWH = wx.deprecated(_Window_SetVirtualSizeWH, "Use SetVirtualSize instead.")
2394
+ del _Window_SetVirtualSizeWH
2395
+ def _Window_GetVirtualSizeTuple(self):
2396
+ return self.GetVirtualSize()
2397
+ Window.GetVirtualSizeTuple = wx.deprecated(_Window_GetVirtualSizeTuple, "Use GetVirtualSize instead.")
2398
+ del _Window_GetVirtualSizeTuple
2399
+ def _Window_SetToolTipString(self, string):
2400
+ return self.SetToolTip(string)
2401
+ Window.SetToolTipString = wx.deprecated(_Window_SetToolTipString, "Use SetToolTip instead.")
2402
+ del _Window_SetToolTipString
2403
+ def _Window_ConvertDialogPointToPixels(self, point):
2404
+ return self.ConvertDialogToPixels(point)
2405
+ Window.ConvertDialogPointToPixels = wx.deprecated(_Window_ConvertDialogPointToPixels, "Use ConvertDialogToPixels instead.")
2406
+ del _Window_ConvertDialogPointToPixels
2407
+ def _Window_ConvertDialogSizeToPixels(self, size):
2408
+ return self.ConvertDialogToPixels(point)
2409
+ Window.ConvertDialogSizeToPixels = wx.deprecated(_Window_ConvertDialogSizeToPixels, "Use ConvertDialogToPixels instead.")
2410
+ del _Window_ConvertDialogSizeToPixels
2411
+ def _Window_SetSizeHintsSz(self, minSize, maxSize=wx.DefaultSize, incSize=wx.DefaultSize):
2412
+ return self.SetSizeHints(minSize, maxSize, incSize)
2413
+ Window.SetSizeHintsSz = wx.deprecated(_Window_SetSizeHintsSz, "Use SetSizeHints instead.")
2414
+ del _Window_SetSizeHintsSz
2415
+ class FrozenWindow(object):
2416
+ """
2417
+ A context manager to be used with Python 'with' statements
2418
+ that will freeze the given window for the duration of the
2419
+ with block.
2420
+ """
2421
+ def __init__(self, window):
2422
+ self._win = window
2423
+ def __enter__(self):
2424
+ self._win.Freeze()
2425
+ return self
2426
+ def __exit__(self, exc_type, exc_val, exc_tb):
2427
+ self._win.Thaw()
2428
+
2429
+ def DLG_UNIT(win, dlg_unit, val2=None):
2430
+ """
2431
+ Convenience function for converting a wx.Point, wx.Size or
2432
+ (x,y) in dialog units to pixels, using the given window as a
2433
+ reference.
2434
+ """
2435
+ if val2 is not None:
2436
+ dlg_unit = (dlg_unit, val2)
2437
+ is_wxType = isinstance(dlg_unit, (wx.Size, wx.Point))
2438
+ pix = win.ConvertDialogToPixels(dlg_unit)
2439
+ if not is_wxType:
2440
+ pix = tuple(pix)
2441
+ return pix
2442
+
2443
+ DLG_PNT = wx.deprecated(DLG_UNIT, "Use DLG_UNIT instead.")
2444
+ DLG_SZE = wx.deprecated(DLG_UNIT, "Use DLG_UNIT instead.")
2445
+
2446
+ def _WindowList___repr__(self):
2447
+ return "WindowList: " + repr(list(self))
2448
+ WindowList.__repr__ = _WindowList___repr__
2449
+ del _WindowList___repr__
2450
+ PyWindow = wx.deprecated(Window, 'Use Window instead.')
2451
+
2452
+ PyValidator = wx.deprecated(Validator, 'Use Validator instead.')
2453
+
2454
+ PyPanel = wx.deprecated(Panel, 'Use Panel instead.')
2455
+
2456
+ def _MenuItemList___repr__(self):
2457
+ return "MenuItemList: " + repr(list(self))
2458
+ MenuItemList.__repr__ = _MenuItemList___repr__
2459
+ del _MenuItemList___repr__
2460
+ def _Menu_AppendMenu(self, id, item, subMenu, help=""):
2461
+ return self.Append(id, item, subMenu, help)
2462
+ Menu.AppendMenu = wx.deprecated(_Menu_AppendMenu, "Use Append instead.")
2463
+ del _Menu_AppendMenu
2464
+ def _Menu_AppendItem(self, menuItem):
2465
+ return self.Append(menuItem)
2466
+ Menu.AppendItem = wx.deprecated(_Menu_AppendItem, "Use Append instead.")
2467
+ del _Menu_AppendItem
2468
+ def _Menu_InsertMenu(self, pos, id, item, subMenu, help=""):
2469
+ return self.Insert(pos, id, item, subMenu, help)
2470
+ Menu.InsertMenu = wx.deprecated(_Menu_InsertMenu, "Use Insert instead.")
2471
+ del _Menu_InsertMenu
2472
+ def _Menu_InsertItem(self, pos, menuItem):
2473
+ return self.Insert(pos, menuItem)
2474
+ Menu.InsertItem = wx.deprecated(_Menu_InsertItem, "Use Insert instead.")
2475
+ del _Menu_InsertItem
2476
+ def _Menu_PrependMenu(self, id, item, subMenu, help=""):
2477
+ return self.Prepend(id, item, subMenu, help)
2478
+ Menu.PrependMenu = wx.deprecated(_Menu_PrependMenu, "Use Prepend instead.")
2479
+ del _Menu_PrependMenu
2480
+ def _Menu_PrependItem(self, menuItem):
2481
+ return self.Prepend(menuItem)
2482
+ Menu.PrependItem = wx.deprecated(_Menu_PrependItem, "Use Prepend instead.")
2483
+ del _Menu_PrependItem
2484
+ def _Menu_RemoveMenu(self, id, item, subMenu, help=""):
2485
+ return self.Remove(id, item, subMenu, help)
2486
+ Menu.RemoveMenu = wx.deprecated(_Menu_RemoveMenu, "Use Remove instead.")
2487
+ del _Menu_RemoveMenu
2488
+ def _Menu_RemoveItem(self, menuItem):
2489
+ return self.Remove(menuItem)
2490
+ Menu.RemoveItem = wx.deprecated(_Menu_RemoveItem, "Use Remove instead.")
2491
+ del _Menu_RemoveItem
2492
+ def _MenuBar_GetMenus(self):
2493
+ """
2494
+ GetMenus() -> (menu, label)
2495
+
2496
+ Return a list of (menu, label) items for the menus in the :class:`MenuBar`.
2497
+ """
2498
+ return [(self.GetMenu(i), self.GetMenuLabel(i)) for i in range(self.GetMenuCount())]
2499
+ MenuBar.GetMenus = _MenuBar_GetMenus
2500
+ del _MenuBar_GetMenus
2501
+ def _MenuBar_SetMenus(self, items):
2502
+ """
2503
+ SetMenus()
2504
+
2505
+ Clear and add new menus to the :class:`MenuBar` from a list of (menu, label) items.
2506
+ """
2507
+ for i in range(self.GetMenuCount()-1, -1, -1):
2508
+ self.Remove(i)
2509
+ for m, l in items:
2510
+ self.Append(m, l)
2511
+ MenuBar.SetMenus = _MenuBar_SetMenus
2512
+ del _MenuBar_SetMenus
2513
+ MenuBar.Menus = property(MenuBar.GetMenus, MenuBar.SetMenus)
2514
+ def _MenuList___repr__(self):
2515
+ return "MenuList: " + repr(list(self))
2516
+ MenuList.__repr__ = _MenuList___repr__
2517
+ del _MenuList___repr__
2518
+ PyScrolledWindow = wx.deprecated(ScrolledWindow, 'Use ScrolledWindow instead.')
2519
+
2520
+ def _VScrolledWindow_HitTest(self, *args):
2521
+ """
2522
+ Deprecated compatibility helper.
2523
+ """
2524
+ if len(args) == 2:
2525
+ x, y = args
2526
+ return self.VirtualHitTest(y)
2527
+ else:
2528
+ pt = args[0]
2529
+ return self.VirtualHitTest(pt[1])
2530
+ VScrolledWindow.HitTest = wx.deprecated(_VScrolledWindow_HitTest, "Use VirtualHitTest instead.")
2531
+ del _VScrolledWindow_HitTest
2532
+ PyControl = wx.deprecated(Control, 'Use Control instead.')
2533
+
2534
+ def _ItemContainer_GetClientObject(self, n):
2535
+ """
2536
+ Alias for :meth:`GetClientData`
2537
+ """
2538
+ return self.GetClientData(n)
2539
+ ItemContainer.GetClientObject = _ItemContainer_GetClientObject
2540
+ del _ItemContainer_GetClientObject
2541
+ def _ItemContainer_SetClientObject(self, n, data):
2542
+ """
2543
+ Alias for :meth:`SetClientData`
2544
+ """
2545
+ self.SetClientData(n, data)
2546
+ ItemContainer.SetClientObject = _ItemContainer_SetClientObject
2547
+ del _ItemContainer_SetClientObject
2548
+ def _ItemContainer_AppendItems(self, items):
2549
+ """
2550
+ Alias for :meth:`Append`
2551
+ """
2552
+ self.Append(items)
2553
+ ItemContainer.AppendItems = _ItemContainer_AppendItems
2554
+ del _ItemContainer_AppendItems
2555
+ def _ItemContainer_GetItems(self):
2556
+ """
2557
+ Alias for :meth:`GetStrings`
2558
+ """
2559
+ return self.GetStrings()
2560
+ ItemContainer.GetItems = _ItemContainer_GetItems
2561
+ del _ItemContainer_GetItems
2562
+ def _ItemContainer_SetItems(self, items):
2563
+ """
2564
+ Alias for :meth:`Set`
2565
+ """
2566
+ self.Set(items)
2567
+ ItemContainer.SetItems = _ItemContainer_SetItems
2568
+ del _ItemContainer_SetItems
2569
+ ItemContainer.Items = property(ItemContainer.GetItems, ItemContainer.SetItems)
2570
+ EVT_NOTEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_NOTEBOOK_PAGE_CHANGED, 1 )
2571
+ EVT_NOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_NOTEBOOK_PAGE_CHANGING, 1 )
2572
+
2573
+ # Aliases for the "best book" control as described in the overview
2574
+ BookCtrl = Notebook
2575
+ wxEVT_BOOKCTRL_PAGE_CHANGED = wxEVT_NOTEBOOK_PAGE_CHANGED
2576
+ wxEVT_BOOKCTRL_PAGE_CHANGING = wxEVT_NOTEBOOK_PAGE_CHANGING
2577
+ EVT_BOOKCTRL_PAGE_CHANGED = EVT_NOTEBOOK_PAGE_CHANGED
2578
+ EVT_BOOKCTRL_PAGE_CHANGING = EVT_NOTEBOOK_PAGE_CHANGING
2579
+
2580
+ # deprecated wxEVT aliases
2581
+ wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED = wxEVT_BOOKCTRL_PAGE_CHANGED
2582
+ wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING = wxEVT_BOOKCTRL_PAGE_CHANGING
2583
+ wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_NOTEBOOK_PAGE_CHANGED
2584
+ wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_NOTEBOOK_PAGE_CHANGING
2585
+
2586
+ # Add wx.NotebookPage alias, as seen in the documentation
2587
+ NotebookPage = Window
2588
+
2589
+ EVT_SPLITTER_SASH_POS_CHANGED = wx.PyEventBinder( wxEVT_SPLITTER_SASH_POS_CHANGED, 1 )
2590
+ EVT_SPLITTER_SASH_POS_CHANGING = wx.PyEventBinder( wxEVT_SPLITTER_SASH_POS_CHANGING, 1 )
2591
+ EVT_SPLITTER_DOUBLECLICKED = wx.PyEventBinder( wxEVT_SPLITTER_DOUBLECLICKED, 1 )
2592
+ EVT_SPLITTER_UNSPLIT = wx.PyEventBinder( wxEVT_SPLITTER_UNSPLIT, 1 )
2593
+ EVT_SPLITTER_DCLICK = EVT_SPLITTER_DOUBLECLICKED
2594
+
2595
+ # deprecated wxEVT aliases
2596
+ wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxEVT_SPLITTER_SASH_POS_CHANGED
2597
+ wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxEVT_SPLITTER_SASH_POS_CHANGING
2598
+ wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxEVT_SPLITTER_DOUBLECLICKED
2599
+ wxEVT_COMMAND_SPLITTER_UNSPLIT = wxEVT_SPLITTER_UNSPLIT
2600
+
2601
+ EVT_COLLAPSIBLEPANE_CHANGED = wx.PyEventBinder( wxEVT_COLLAPSIBLEPANE_CHANGED )
2602
+
2603
+ # deprecated wxEVT alias
2604
+ wxEVT_COMMAND_COLLPANE_CHANGED = wxEVT_COLLAPSIBLEPANE_CHANGED
2605
+
2606
+ EVT_TEXT = wx.PyEventBinder( wxEVT_TEXT, 1)
2607
+ EVT_TEXT_ENTER = wx.PyEventBinder( wxEVT_TEXT_ENTER, 1)
2608
+ EVT_TEXT_URL = wx.PyEventBinder( wxEVT_TEXT_URL, 1)
2609
+ EVT_TEXT_MAXLEN = wx.PyEventBinder( wxEVT_TEXT_MAXLEN, 1)
2610
+ EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_TEXT_CUT )
2611
+ EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_TEXT_COPY )
2612
+ EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_TEXT_PASTE )
2613
+
2614
+ # deprecated wxEVT aliases
2615
+ wxEVT_COMMAND_TEXT_UPDATED = wxEVT_TEXT
2616
+ wxEVT_COMMAND_TEXT_ENTER = wxEVT_TEXT_ENTER
2617
+ wxEVT_COMMAND_TEXT_URL = wxEVT_TEXT_URL
2618
+ wxEVT_COMMAND_TEXT_MAXLEN = wxEVT_TEXT_MAXLEN
2619
+ wxEVT_COMMAND_TEXT_CUT = wxEVT_TEXT_CUT
2620
+ wxEVT_COMMAND_TEXT_COPY = wxEVT_TEXT_COPY
2621
+ wxEVT_COMMAND_TEXT_PASTE = wxEVT_TEXT_PASTE
2622
+
2623
+ ComboBox.SetMark = wx.deprecated(ComboBox.SetTextSelection, 'Use SetTextSelection instead.')
2624
+
2625
+ ComboBox.GetMark = wx.deprecated(ComboBox.GetTextSelection, 'Use GetTextSelection instead.')
2626
+
2627
+ def _CheckListBox_GetCheckedItems(self):
2628
+ """
2629
+ GetCheckedItems()
2630
+
2631
+ Return a sequence of integers corresponding to the checked items in
2632
+ the control, based on :meth:`IsChecked`.
2633
+ """
2634
+ return tuple([i for i in range(self.Count) if self.IsChecked(i)])
2635
+ CheckListBox.GetCheckedItems = _CheckListBox_GetCheckedItems
2636
+ del _CheckListBox_GetCheckedItems
2637
+ def _CheckListBox_GetCheckedStrings(self):
2638
+ """
2639
+ GetCheckedStrings()
2640
+
2641
+ Return a tuple of strings corresponding to the checked
2642
+ items of the control, based on :meth:`GetChecked`.
2643
+ """
2644
+ return tuple([self.GetString(i) for i in self.GetCheckedItems()])
2645
+ CheckListBox.GetCheckedStrings = _CheckListBox_GetCheckedStrings
2646
+ del _CheckListBox_GetCheckedStrings
2647
+ def _CheckListBox_SetCheckedItems(self, indexes):
2648
+ """
2649
+ SetCheckedItems(indexes)
2650
+
2651
+ Sets the checked state of items if the index of the item is
2652
+ found in the indexes sequence.
2653
+ """
2654
+ for i in indexes:
2655
+ assert 0 <= i < self.Count, "Index (%s) out of range" % i
2656
+ for i in range(self.Count):
2657
+ self.Check(i, i in indexes)
2658
+ CheckListBox.SetCheckedItems = _CheckListBox_SetCheckedItems
2659
+ del _CheckListBox_SetCheckedItems
2660
+ def _CheckListBox_SetCheckedStrings(self, strings):
2661
+ """
2662
+ SetCheckedStrings(strings)
2663
+
2664
+ Sets the checked state of items if the item's string is found
2665
+ in the strings sequence.
2666
+ """
2667
+ for s in strings:
2668
+ assert s in self.GetStrings(), "String ('%s') not found" % s
2669
+ for i in range(self.Count):
2670
+ self.Check(i, self.GetString(i) in strings)
2671
+ CheckListBox.SetCheckedStrings = _CheckListBox_SetCheckedStrings
2672
+ del _CheckListBox_SetCheckedStrings
2673
+ def _CheckListBox_GetChecked(self):
2674
+ return self.GetCheckedItems()
2675
+ CheckListBox.GetChecked = wx.deprecated(_CheckListBox_GetChecked, "Use GetCheckedItems instead.")
2676
+ del _CheckListBox_GetChecked
2677
+ def _CheckListBox_SetChecked(self, indexes):
2678
+ return self.SetCheckedItems(indexes)
2679
+ CheckListBox.SetChecked = wx.deprecated(_CheckListBox_SetChecked, "Use SetCheckedItems instead.")
2680
+ del _CheckListBox_SetChecked
2681
+ CheckListBox.Checked = property(CheckListBox.GetChecked, CheckListBox.SetChecked)
2682
+ CheckListBox.CheckedItems = property(CheckListBox.GetCheckedItems, CheckListBox.SetCheckedItems)
2683
+ CheckListBox.CheckedStrings = property(CheckListBox.GetCheckedStrings, CheckListBox.SetCheckedStrings)
2684
+ SettableHeaderColumn.Title = property(HeaderColumn.GetTitle, SettableHeaderColumn.SetTitle)
2685
+ SettableHeaderColumn.Bitmap = property(HeaderColumn.GetBitmap, SettableHeaderColumn.SetBitmap)
2686
+ SettableHeaderColumn.Width = property(HeaderColumn.GetWidth, SettableHeaderColumn.SetWidth)
2687
+ SettableHeaderColumn.MinWidth = property(HeaderColumn.GetMinWidth, SettableHeaderColumn.SetMinWidth)
2688
+ SettableHeaderColumn.Alignment = property(HeaderColumn.GetAlignment, SettableHeaderColumn.SetAlignment)
2689
+ SettableHeaderColumn.Flags = property(HeaderColumn.GetFlags, SettableHeaderColumn.SetFlags)
2690
+ SettableHeaderColumn.Resizeable = property(HeaderColumn.IsResizeable, SettableHeaderColumn.SetResizeable)
2691
+ SettableHeaderColumn.Sortable = property(HeaderColumn.IsSortable, SettableHeaderColumn.SetSortable)
2692
+ SettableHeaderColumn.Reorderable = property(HeaderColumn.IsReorderable, SettableHeaderColumn.SetReorderable)
2693
+ SettableHeaderColumn.Hidden = property(HeaderColumn.IsHidden, SettableHeaderColumn.SetHidden)
2694
+ EVT_HEADER_CLICK = wx.PyEventBinder( wxEVT_HEADER_CLICK )
2695
+ EVT_HEADER_RIGHT_CLICK = wx.PyEventBinder( wxEVT_HEADER_RIGHT_CLICK )
2696
+ EVT_HEADER_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_HEADER_MIDDLE_CLICK )
2697
+ EVT_HEADER_DCLICK = wx.PyEventBinder( wxEVT_HEADER_DCLICK )
2698
+ EVT_HEADER_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_HEADER_RIGHT_DCLICK )
2699
+ EVT_HEADER_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_HEADER_MIDDLE_DCLICK )
2700
+ EVT_HEADER_SEPARATOR_DCLICK = wx.PyEventBinder( wxEVT_HEADER_SEPARATOR_DCLICK )
2701
+ EVT_HEADER_BEGIN_RESIZE = wx.PyEventBinder( wxEVT_HEADER_BEGIN_RESIZE )
2702
+ EVT_HEADER_RESIZING = wx.PyEventBinder( wxEVT_HEADER_RESIZING )
2703
+ EVT_HEADER_END_RESIZE = wx.PyEventBinder( wxEVT_HEADER_END_RESIZE )
2704
+ EVT_HEADER_BEGIN_REORDER = wx.PyEventBinder( wxEVT_HEADER_BEGIN_REORDER )
2705
+ EVT_HEADER_END_REORDER = wx.PyEventBinder( wxEVT_HEADER_END_REORDER )
2706
+ EVT_HEADER_DRAGGING_CANCELLED = wx.PyEventBinder( wxEVT_HEADER_DRAGGING_CANCELLED )
2707
+
2708
+ # deprecated wxEVT aliases
2709
+ wxEVT_COMMAND_HEADER_CLICK = wxEVT_HEADER_CLICK
2710
+ wxEVT_COMMAND_HEADER_RIGHT_CLICK = wxEVT_HEADER_RIGHT_CLICK
2711
+ wxEVT_COMMAND_HEADER_MIDDLE_CLICK = wxEVT_HEADER_MIDDLE_CLICK
2712
+ wxEVT_COMMAND_HEADER_DCLICK = wxEVT_HEADER_DCLICK
2713
+ wxEVT_COMMAND_HEADER_RIGHT_DCLICK = wxEVT_HEADER_RIGHT_DCLICK
2714
+ wxEVT_COMMAND_HEADER_MIDDLE_DCLICK = wxEVT_HEADER_MIDDLE_DCLICK
2715
+ wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK = wxEVT_HEADER_SEPARATOR_DCLICK
2716
+ wxEVT_COMMAND_HEADER_BEGIN_RESIZE = wxEVT_HEADER_BEGIN_RESIZE
2717
+ wxEVT_COMMAND_HEADER_RESIZING = wxEVT_HEADER_RESIZING
2718
+ wxEVT_COMMAND_HEADER_END_RESIZE = wxEVT_HEADER_END_RESIZE
2719
+ wxEVT_COMMAND_HEADER_BEGIN_REORDER = wxEVT_HEADER_BEGIN_REORDER
2720
+ wxEVT_COMMAND_HEADER_END_REORDER = wxEVT_HEADER_END_REORDER
2721
+ wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED = wxEVT_HEADER_DRAGGING_CANCELLED
2722
+
2723
+ EVT_SEARCH_CANCEL = wx.PyEventBinder( wxEVT_SEARCH_CANCEL, 1)
2724
+ EVT_SEARCH = wx.PyEventBinder( wxEVT_SEARCH, 1)
2725
+
2726
+ # deprecated wxEVT aliases
2727
+ wxEVT_SEARCHCTRL_CANCEL_BTN = wxEVT_SEARCH_CANCEL
2728
+ wxEVT_SEARCHCTRL_SEARCH_BTN = wxEVT_SEARCH
2729
+ wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN = wxEVT_SEARCHCTRL_CANCEL_BTN
2730
+ wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN = wxEVT_SEARCHCTRL_SEARCH_BTN
2731
+ EVT_SEARCHCTRL_CANCEL_BTN = wx.PyEventBinder( wxEVT_SEARCHCTRL_CANCEL_BTN, 1)
2732
+ EVT_SEARCHCTRL_SEARCH_BTN = wx.PyEventBinder( wxEVT_SEARCHCTRL_SEARCH_BTN, 1)
2733
+
2734
+ def _RadioBox_GetItemLabel(self, n):
2735
+ """
2736
+ GetItemLabel(self, n) -> string
2737
+
2738
+ Return the text of the n'th item in the radio box.
2739
+ """
2740
+ return self.GetString(n)
2741
+ RadioBox.GetItemLabel = _RadioBox_GetItemLabel
2742
+ del _RadioBox_GetItemLabel
2743
+ def _RadioBox_SetItemLabel(self, n, text):
2744
+ """
2745
+ SetItemLabel(self, n, text)
2746
+
2747
+ Set the text of the n'th item in the radio box.
2748
+ """
2749
+ self.SetString(n, text)
2750
+ RadioBox.SetItemLabel = _RadioBox_SetItemLabel
2751
+ del _RadioBox_SetItemLabel
2752
+ def _Slider_GetRange(self):
2753
+ return (self.GetMin(), self.GetMax())
2754
+ Slider.GetRange = _Slider_GetRange
2755
+ del _Slider_GetRange
2756
+ Slider.Range = property(Slider.GetRange)
2757
+ def _SpinButton_GetRange(self):
2758
+ return (self.GetMin(), self.GetMax())
2759
+ SpinButton.GetRange = _SpinButton_GetRange
2760
+ del _SpinButton_GetRange
2761
+ def _SpinButton_SetMin(self, minVal):
2762
+ self.SetRange(minVal, self.GetMax())
2763
+ SpinButton.SetMin = _SpinButton_SetMin
2764
+ del _SpinButton_SetMin
2765
+ def _SpinButton_SetMax(self, maxVal):
2766
+ self.SetRange(self.GetMin(), maxVal)
2767
+ SpinButton.SetMax = _SpinButton_SetMax
2768
+ del _SpinButton_SetMax
2769
+ SpinButton.Max = property(SpinButton.GetMax, SpinButton.SetMax)
2770
+ SpinButton.Min = property(SpinButton.GetMin, SpinButton.SetMin)
2771
+ SpinButton.Range = property(SpinButton.GetRange)
2772
+ EVT_SPIN_UP = wx.PyEventBinder( wxEVT_SPIN_UP, 1)
2773
+ EVT_SPIN_DOWN = wx.PyEventBinder( wxEVT_SPIN_DOWN, 1)
2774
+ EVT_SPIN = wx.PyEventBinder( wxEVT_SPIN, 1)
2775
+
2776
+ def _SpinCtrl_GetRange(self):
2777
+ return (self.GetMin(), self.GetMax())
2778
+ SpinCtrl.GetRange = _SpinCtrl_GetRange
2779
+ del _SpinCtrl_GetRange
2780
+ def _SpinCtrl_SetMin(self, minVal):
2781
+ self.SetRange(minVal, self.GetMax())
2782
+ SpinCtrl.SetMin = _SpinCtrl_SetMin
2783
+ del _SpinCtrl_SetMin
2784
+ def _SpinCtrl_SetMax(self, maxVal):
2785
+ self.SetRange(self.GetMin(), maxVal)
2786
+ SpinCtrl.SetMax = _SpinCtrl_SetMax
2787
+ del _SpinCtrl_SetMax
2788
+ SpinCtrl.Max = property(SpinCtrl.GetMax, SpinCtrl.SetMax)
2789
+ SpinCtrl.Min = property(SpinCtrl.GetMin, SpinCtrl.SetMin)
2790
+ SpinCtrl.Range = property(SpinCtrl.GetRange)
2791
+ def _SpinCtrlDouble_GetRange(self):
2792
+ return (self.GetMin(), self.GetMax())
2793
+ SpinCtrlDouble.GetRange = _SpinCtrlDouble_GetRange
2794
+ del _SpinCtrlDouble_GetRange
2795
+ def _SpinCtrlDouble_SetMin(self, minVal):
2796
+ self.SetRange(minVal, self.GetMax())
2797
+ SpinCtrlDouble.SetMin = _SpinCtrlDouble_SetMin
2798
+ del _SpinCtrlDouble_SetMin
2799
+ def _SpinCtrlDouble_SetMax(self, maxVal):
2800
+ self.SetRange(self.GetMin(), maxVal)
2801
+ SpinCtrlDouble.SetMax = _SpinCtrlDouble_SetMax
2802
+ del _SpinCtrlDouble_SetMax
2803
+ SpinCtrlDouble.Max = property(SpinCtrlDouble.GetMax, SpinCtrlDouble.SetMax)
2804
+ SpinCtrlDouble.Min = property(SpinCtrlDouble.GetMin, SpinCtrlDouble.SetMin)
2805
+ SpinCtrlDouble.Range = property(SpinCtrlDouble.GetRange)
2806
+ EVT_SPINCTRL = wx.PyEventBinder( wxEVT_SPINCTRL, 1)
2807
+ EVT_SPINCTRLDOUBLE = wx.PyEventBinder( wxEVT_SPINCTRLDOUBLE, 1)
2808
+
2809
+ # deprecated wxEVT aliases
2810
+ wxEVT_COMMAND_SPINCTRL_UPDATED = wxEVT_SPINCTRL
2811
+ wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED = wxEVT_SPINCTRLDOUBLE
2812
+
2813
+ EVT_TOGGLEBUTTON = PyEventBinder(wxEVT_TOGGLEBUTTON, 1)
2814
+
2815
+ # deprecated wxEVT alias
2816
+ wxEVT_COMMAND_TOGGLEBUTTON_CLICKED = wxEVT_TOGGLEBUTTON
2817
+
2818
+ def _ToolBar_AddSimpleTool(self, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0):
2819
+ """
2820
+ Old style method to add a tool to the toolbar.
2821
+ """
2822
+ kind = wx.ITEM_NORMAL
2823
+ if isToggle: kind = wx.ITEM_CHECK
2824
+ return self.AddTool(toolId, '', bitmap, wx.NullBitmap, kind,
2825
+ shortHelpString, longHelpString)
2826
+ ToolBar.AddSimpleTool = wx.deprecated(_ToolBar_AddSimpleTool, "Use :meth:`AddTool` instead.")
2827
+ del _ToolBar_AddSimpleTool
2828
+ def _ToolBar_AddLabelTool(self, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="", clientData=None):
2829
+ """
2830
+ Old style method to add a tool in the toolbar.
2831
+ """
2832
+ return self.AddTool(id, label, bitmap, bmpDisabled, kind,
2833
+ shortHelp, longHelp, clientData)
2834
+ ToolBar.AddLabelTool = wx.deprecated(_ToolBar_AddLabelTool, "Use :meth:`AddTool` instead.")
2835
+ del _ToolBar_AddLabelTool
2836
+ def _ToolBar_InsertSimpleTool(self, pos, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0):
2837
+ """
2838
+ Old style method to insert a tool in the toolbar.
2839
+ """
2840
+ kind = wx.ITEM_NORMAL
2841
+ if isToggle: kind = wx.ITEM_CHECK
2842
+ return self.InsertTool(pos, toolId, '', bitmap, wx.NullBitmap, kind,
2843
+ shortHelpString, longHelpString)
2844
+ ToolBar.InsertSimpleTool = wx.deprecated(_ToolBar_InsertSimpleTool, "Use :meth:`InsertTool` instead.")
2845
+ del _ToolBar_InsertSimpleTool
2846
+ def _ToolBar_InsertLabelTool(self, pos, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="", clientData=None):
2847
+ """
2848
+ Old style method to insert a tool in the toolbar.
2849
+ """
2850
+ return self.InsertTool(pos, id, label, bitmap, bmpDisabled, kind,
2851
+ shortHelp, longHelp, clientData)
2852
+ ToolBar.InsertLabelTool = wx.deprecated(_ToolBar_InsertLabelTool, "Use :meth:`InsertTool` instead.")
2853
+ del _ToolBar_InsertLabelTool
2854
+ ListCtrl.FindItemData = wx.deprecated(ListCtrl.FindItem, "Use FindItem instead.")
2855
+
2856
+ ListCtrl.FindItemAtPos = wx.deprecated(ListCtrl.FindItem, "Use FindItem instead.")
2857
+
2858
+ ListCtrl.InsertStringItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem instead.")
2859
+
2860
+ ListCtrl.InsertImageItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem instead.")
2861
+
2862
+ ListCtrl.InsertImageStringItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem instead.")
2863
+
2864
+ ListCtrl.SetStringItem = wx.deprecated(ListCtrl.SetItem, "Use SetItem instead.")
2865
+
2866
+ def _ListCtrl_Select(self, idx, on=1):
2867
+ """
2868
+ Selects/deselects an item.
2869
+ """
2870
+ if on: state = wx.LIST_STATE_SELECTED
2871
+ else: state = 0
2872
+ self.SetItemState(idx, state, wx.LIST_STATE_SELECTED)
2873
+ ListCtrl.Select = _ListCtrl_Select
2874
+ del _ListCtrl_Select
2875
+ def _ListCtrl_Focus(self, idx):
2876
+ """
2877
+ Focus and show the given item.
2878
+ """
2879
+ self.SetItemState(idx, wx.LIST_STATE_FOCUSED, wx.LIST_STATE_FOCUSED)
2880
+ self.EnsureVisible(idx)
2881
+ ListCtrl.Focus = _ListCtrl_Focus
2882
+ del _ListCtrl_Focus
2883
+ def _ListCtrl_GetFocusedItem(self):
2884
+ """
2885
+ Gets the currently focused item or -1 if none is focused.
2886
+ """
2887
+ return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_FOCUSED)
2888
+ ListCtrl.GetFocusedItem = _ListCtrl_GetFocusedItem
2889
+ del _ListCtrl_GetFocusedItem
2890
+ def _ListCtrl_GetFirstSelected(self, *args):
2891
+ """
2892
+ Returns the first selected item, or -1 when none is selected.
2893
+ """
2894
+ return self.GetNextSelected(-1)
2895
+ ListCtrl.GetFirstSelected = _ListCtrl_GetFirstSelected
2896
+ del _ListCtrl_GetFirstSelected
2897
+ def _ListCtrl_GetNextSelected(self, item):
2898
+ """
2899
+ Returns subsequent selected items, or -1 when no more are selected.
2900
+ """
2901
+ return self.GetNextItem(item, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
2902
+ ListCtrl.GetNextSelected = _ListCtrl_GetNextSelected
2903
+ del _ListCtrl_GetNextSelected
2904
+ def _ListCtrl_IsSelected(self, idx):
2905
+ """
2906
+ Returns ``True`` if the item is selected.
2907
+ """
2908
+ return (self.GetItemState(idx, wx.LIST_STATE_SELECTED) & wx.LIST_STATE_SELECTED) != 0
2909
+ ListCtrl.IsSelected = _ListCtrl_IsSelected
2910
+ del _ListCtrl_IsSelected
2911
+ def _ListCtrl_SetColumnImage(self, col, image):
2912
+ item = self.GetColumn(col)
2913
+ # preserve all other attributes too
2914
+ item.SetMask( wx.LIST_MASK_STATE |
2915
+ wx.LIST_MASK_TEXT |
2916
+ wx.LIST_MASK_IMAGE |
2917
+ wx.LIST_MASK_DATA |
2918
+ wx.LIST_SET_ITEM |
2919
+ wx.LIST_MASK_WIDTH |
2920
+ wx.LIST_MASK_FORMAT )
2921
+ item.SetImage(image)
2922
+ self.SetColumn(col, item)
2923
+ ListCtrl.SetColumnImage = _ListCtrl_SetColumnImage
2924
+ del _ListCtrl_SetColumnImage
2925
+ def _ListCtrl_ClearColumnImage(self, col):
2926
+ self.SetColumnImage(col, -1)
2927
+ ListCtrl.ClearColumnImage = _ListCtrl_ClearColumnImage
2928
+ del _ListCtrl_ClearColumnImage
2929
+ def _ListCtrl_Append(self, entry):
2930
+ """
2931
+ Append an item to the list control. The `entry` parameter should be a
2932
+ sequence with an item for each column
2933
+ """
2934
+ if len(entry):
2935
+ from six import text_type
2936
+ pos = self.InsertItem(self.GetItemCount(), text_type(entry[0]))
2937
+ for i in range(1, len(entry)):
2938
+ self.SetItem(pos, i, text_type(entry[i]))
2939
+ return pos
2940
+ ListCtrl.Append = _ListCtrl_Append
2941
+ del _ListCtrl_Append
2942
+ ListCtrl.FocusedItem = property(ListCtrl.GetFocusedItem)
2943
+ ListItemAttr = wx.deprecated(ItemAttr, 'Use ItemAttr instead')
2944
+
2945
+ EVT_LIST_BEGIN_DRAG = PyEventBinder(wxEVT_LIST_BEGIN_DRAG , 1)
2946
+ EVT_LIST_BEGIN_RDRAG = PyEventBinder(wxEVT_LIST_BEGIN_RDRAG , 1)
2947
+ EVT_LIST_BEGIN_LABEL_EDIT = PyEventBinder(wxEVT_LIST_BEGIN_LABEL_EDIT , 1)
2948
+ EVT_LIST_END_LABEL_EDIT = PyEventBinder(wxEVT_LIST_END_LABEL_EDIT , 1)
2949
+ EVT_LIST_DELETE_ITEM = PyEventBinder(wxEVT_LIST_DELETE_ITEM , 1)
2950
+ EVT_LIST_DELETE_ALL_ITEMS = PyEventBinder(wxEVT_LIST_DELETE_ALL_ITEMS , 1)
2951
+ EVT_LIST_ITEM_SELECTED = PyEventBinder(wxEVT_LIST_ITEM_SELECTED , 1)
2952
+ EVT_LIST_ITEM_DESELECTED = PyEventBinder(wxEVT_LIST_ITEM_DESELECTED , 1)
2953
+ EVT_LIST_KEY_DOWN = PyEventBinder(wxEVT_LIST_KEY_DOWN , 1)
2954
+ EVT_LIST_INSERT_ITEM = PyEventBinder(wxEVT_LIST_INSERT_ITEM , 1)
2955
+ EVT_LIST_COL_CLICK = PyEventBinder(wxEVT_LIST_COL_CLICK , 1)
2956
+ EVT_LIST_ITEM_RIGHT_CLICK = PyEventBinder(wxEVT_LIST_ITEM_RIGHT_CLICK , 1)
2957
+ EVT_LIST_ITEM_MIDDLE_CLICK = PyEventBinder(wxEVT_LIST_ITEM_MIDDLE_CLICK, 1)
2958
+ EVT_LIST_ITEM_ACTIVATED = PyEventBinder(wxEVT_LIST_ITEM_ACTIVATED , 1)
2959
+ EVT_LIST_CACHE_HINT = PyEventBinder(wxEVT_LIST_CACHE_HINT , 1)
2960
+ EVT_LIST_COL_RIGHT_CLICK = PyEventBinder(wxEVT_LIST_COL_RIGHT_CLICK , 1)
2961
+ EVT_LIST_COL_BEGIN_DRAG = PyEventBinder(wxEVT_LIST_COL_BEGIN_DRAG , 1)
2962
+ EVT_LIST_COL_DRAGGING = PyEventBinder(wxEVT_LIST_COL_DRAGGING , 1)
2963
+ EVT_LIST_COL_END_DRAG = PyEventBinder(wxEVT_LIST_COL_END_DRAG , 1)
2964
+ EVT_LIST_ITEM_FOCUSED = PyEventBinder(wxEVT_LIST_ITEM_FOCUSED , 1)
2965
+ EVT_LIST_ITEM_CHECKED = PyEventBinder(wxEVT_LIST_ITEM_CHECKED , 1)
2966
+ EVT_LIST_ITEM_UNCHECKED = PyEventBinder(wxEVT_LIST_ITEM_UNCHECKED , 1)
2967
+
2968
+ # deprecated wxEVT aliases
2969
+ wxEVT_COMMAND_LIST_BEGIN_DRAG = wxEVT_LIST_BEGIN_DRAG
2970
+ wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxEVT_LIST_BEGIN_RDRAG
2971
+ wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxEVT_LIST_BEGIN_LABEL_EDIT
2972
+ wxEVT_COMMAND_LIST_END_LABEL_EDIT = wxEVT_LIST_END_LABEL_EDIT
2973
+ wxEVT_COMMAND_LIST_DELETE_ITEM = wxEVT_LIST_DELETE_ITEM
2974
+ wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = wxEVT_LIST_DELETE_ALL_ITEMS
2975
+ wxEVT_COMMAND_LIST_ITEM_SELECTED = wxEVT_LIST_ITEM_SELECTED
2976
+ wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxEVT_LIST_ITEM_DESELECTED
2977
+ wxEVT_COMMAND_LIST_KEY_DOWN = wxEVT_LIST_KEY_DOWN
2978
+ wxEVT_COMMAND_LIST_INSERT_ITEM = wxEVT_LIST_INSERT_ITEM
2979
+ wxEVT_COMMAND_LIST_COL_CLICK = wxEVT_LIST_COL_CLICK
2980
+ wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = wxEVT_LIST_ITEM_RIGHT_CLICK
2981
+ wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = wxEVT_LIST_ITEM_MIDDLE_CLICK
2982
+ wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxEVT_LIST_ITEM_ACTIVATED
2983
+ wxEVT_COMMAND_LIST_CACHE_HINT = wxEVT_LIST_CACHE_HINT
2984
+ wxEVT_COMMAND_LIST_COL_RIGHT_CLICK = wxEVT_LIST_COL_RIGHT_CLICK
2985
+ wxEVT_COMMAND_LIST_COL_BEGIN_DRAG = wxEVT_LIST_COL_BEGIN_DRAG
2986
+ wxEVT_COMMAND_LIST_COL_DRAGGING = wxEVT_LIST_COL_DRAGGING
2987
+ wxEVT_COMMAND_LIST_COL_END_DRAG = wxEVT_LIST_COL_END_DRAG
2988
+ wxEVT_COMMAND_LIST_ITEM_FOCUSED = wxEVT_LIST_ITEM_FOCUSED
2989
+
2990
+ def _TreeItemId___hash__(self):
2991
+ return hash(int(self.GetID()))
2992
+ TreeItemId.__hash__ = _TreeItemId___hash__
2993
+ del _TreeItemId___hash__
2994
+ TreeCtrl.GetItemPyData = wx.deprecated(TreeCtrl.GetItemData, 'Use GetItemData instead.')
2995
+ TreeCtrl.SetItemPyData = wx.deprecated(TreeCtrl.SetItemData, 'Use SetItemData instead.')
2996
+ TreeCtrl.GetPyData = wx.deprecated(TreeCtrl.GetItemData, 'Use GetItemData instead.')
2997
+ TreeCtrl.SetPyData = wx.deprecated(TreeCtrl.SetItemData, 'Use SetItemData instead.')
2998
+
2999
+ def TreeItemData(data):
3000
+ return data
3001
+ TreeItemData = deprecated(TreeItemData, "The TreeItemData class no longer exists, just pass your object directly to the tree instead.")
3002
+
3003
+ EVT_TREE_BEGIN_DRAG = PyEventBinder(wxEVT_TREE_BEGIN_DRAG , 1)
3004
+ EVT_TREE_BEGIN_RDRAG = PyEventBinder(wxEVT_TREE_BEGIN_RDRAG , 1)
3005
+ EVT_TREE_BEGIN_LABEL_EDIT = PyEventBinder(wxEVT_TREE_BEGIN_LABEL_EDIT , 1)
3006
+ EVT_TREE_END_LABEL_EDIT = PyEventBinder(wxEVT_TREE_END_LABEL_EDIT , 1)
3007
+ EVT_TREE_DELETE_ITEM = PyEventBinder(wxEVT_TREE_DELETE_ITEM , 1)
3008
+ EVT_TREE_GET_INFO = PyEventBinder(wxEVT_TREE_GET_INFO , 1)
3009
+ EVT_TREE_SET_INFO = PyEventBinder(wxEVT_TREE_SET_INFO , 1)
3010
+ EVT_TREE_ITEM_EXPANDED = PyEventBinder(wxEVT_TREE_ITEM_EXPANDED , 1)
3011
+ EVT_TREE_ITEM_EXPANDING = PyEventBinder(wxEVT_TREE_ITEM_EXPANDING , 1)
3012
+ EVT_TREE_ITEM_COLLAPSED = PyEventBinder(wxEVT_TREE_ITEM_COLLAPSED , 1)
3013
+ EVT_TREE_ITEM_COLLAPSING = PyEventBinder(wxEVT_TREE_ITEM_COLLAPSING , 1)
3014
+ EVT_TREE_SEL_CHANGED = PyEventBinder(wxEVT_TREE_SEL_CHANGED , 1)
3015
+ EVT_TREE_SEL_CHANGING = PyEventBinder(wxEVT_TREE_SEL_CHANGING , 1)
3016
+ EVT_TREE_KEY_DOWN = PyEventBinder(wxEVT_TREE_KEY_DOWN , 1)
3017
+ EVT_TREE_ITEM_ACTIVATED = PyEventBinder(wxEVT_TREE_ITEM_ACTIVATED , 1)
3018
+ EVT_TREE_ITEM_RIGHT_CLICK = PyEventBinder(wxEVT_TREE_ITEM_RIGHT_CLICK , 1)
3019
+ EVT_TREE_ITEM_MIDDLE_CLICK = PyEventBinder(wxEVT_TREE_ITEM_MIDDLE_CLICK, 1)
3020
+ EVT_TREE_END_DRAG = PyEventBinder(wxEVT_TREE_END_DRAG , 1)
3021
+ EVT_TREE_STATE_IMAGE_CLICK = PyEventBinder(wxEVT_TREE_STATE_IMAGE_CLICK, 1)
3022
+ EVT_TREE_ITEM_GETTOOLTIP = PyEventBinder(wxEVT_TREE_ITEM_GETTOOLTIP, 1)
3023
+ EVT_TREE_ITEM_MENU = PyEventBinder(wxEVT_TREE_ITEM_MENU, 1)
3024
+
3025
+ # deprecated wxEVT aliases
3026
+ wxEVT_COMMAND_TREE_BEGIN_DRAG = wxEVT_TREE_BEGIN_DRAG
3027
+ wxEVT_COMMAND_TREE_BEGIN_RDRAG = wxEVT_TREE_BEGIN_RDRAG
3028
+ wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = wxEVT_TREE_BEGIN_LABEL_EDIT
3029
+ wxEVT_COMMAND_TREE_END_LABEL_EDIT = wxEVT_TREE_END_LABEL_EDIT
3030
+ wxEVT_COMMAND_TREE_DELETE_ITEM = wxEVT_TREE_DELETE_ITEM
3031
+ wxEVT_COMMAND_TREE_GET_INFO = wxEVT_TREE_GET_INFO
3032
+ wxEVT_COMMAND_TREE_SET_INFO = wxEVT_TREE_SET_INFO
3033
+ wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxEVT_TREE_ITEM_EXPANDED
3034
+ wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxEVT_TREE_ITEM_EXPANDING
3035
+ wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxEVT_TREE_ITEM_COLLAPSED
3036
+ wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxEVT_TREE_ITEM_COLLAPSING
3037
+ wxEVT_COMMAND_TREE_SEL_CHANGED = wxEVT_TREE_SEL_CHANGED
3038
+ wxEVT_COMMAND_TREE_SEL_CHANGING = wxEVT_TREE_SEL_CHANGING
3039
+ wxEVT_COMMAND_TREE_KEY_DOWN = wxEVT_TREE_KEY_DOWN
3040
+ wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxEVT_TREE_ITEM_ACTIVATED
3041
+ wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxEVT_TREE_ITEM_RIGHT_CLICK
3042
+ wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxEVT_TREE_ITEM_MIDDLE_CLICK
3043
+ wxEVT_COMMAND_TREE_END_DRAG = wxEVT_TREE_END_DRAG
3044
+ wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK = wxEVT_TREE_STATE_IMAGE_CLICK
3045
+ wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP = wxEVT_TREE_ITEM_GETTOOLTIP
3046
+ wxEVT_COMMAND_TREE_ITEM_MENU = wxEVT_TREE_ITEM_MENU
3047
+
3048
+ EVT_COLOURPICKER_CHANGED = wx.PyEventBinder( wxEVT_COLOURPICKER_CHANGED, 1 )
3049
+ EVT_COLOURPICKER_CURRENT_CHANGED = wx.PyEventBinder( wxEVT_COLOURPICKER_CURRENT_CHANGED, 1 )
3050
+ EVT_COLOURPICKER_DIALOG_CANCELLED = wx.PyEventBinder( wxEVT_COLOURPICKER_DIALOG_CANCELLED, 1 )
3051
+
3052
+ # deprecated wxEVT alias
3053
+ wxEVT_COMMAND_COLOURPICKER_CHANGED = wxEVT_COLOURPICKER_CHANGED
3054
+
3055
+ EVT_FILEPICKER_CHANGED = wx.PyEventBinder( wxEVT_FILEPICKER_CHANGED, 1 )
3056
+ EVT_DIRPICKER_CHANGED = wx.PyEventBinder( wxEVT_DIRPICKER_CHANGED, 1 )
3057
+
3058
+ # deprecated wxEVT aliases
3059
+ wxEVT_COMMAND_FILEPICKER_CHANGED = wxEVT_FILEPICKER_CHANGED
3060
+ wxEVT_COMMAND_DIRPICKER_CHANGED = wxEVT_DIRPICKER_CHANGED
3061
+
3062
+ EVT_FONTPICKER_CHANGED = wx.PyEventBinder( wxEVT_FONTPICKER_CHANGED, 1 )
3063
+
3064
+ # deprecated wxEVT alias
3065
+ wxEVT_COMMAND_FONTPICKER_CHANGED = wxEVT_FONTPICKER_CHANGED
3066
+
3067
+ if 'wxMac' in wx.PlatformInfo:
3068
+ class ColourPickerCtrl(PickerBase):
3069
+ '''
3070
+ This control allows the user to select a colour. The
3071
+ implementation varies by platform but is usually a button which
3072
+ brings up a `wx.ColourDialog` when clicked.
3073
+
3074
+
3075
+ Window Styles
3076
+ -------------
3077
+
3078
+ ====================== ============================================
3079
+ wx.CLRP_DEFAULT Default style.
3080
+ wx.CLRP_USE_TEXTCTRL Creates a text control to the left of the
3081
+ picker button which is completely managed
3082
+ by the `wx.ColourPickerCtrl` and which can
3083
+ be used by the user to specify a colour.
3084
+ The text control is automatically synchronized
3085
+ with the button's value. Use functions defined in
3086
+ `wx.PickerBase` to modify the text control.
3087
+ wx.CLRP_SHOW_LABEL Shows the colour in HTML form (AABBCC) as the
3088
+ colour button label (instead of no label at all).
3089
+ ====================== ============================================
3090
+
3091
+ Events
3092
+ ------
3093
+
3094
+ ======================== ==========================================
3095
+ EVT_COLOURPICKER_CHANGED The user changed the colour selected in the
3096
+ control either using the button or using the
3097
+ text control (see wx.CLRP_USE_TEXTCTRL; note
3098
+ that in this case the event is fired only if
3099
+ the user's input is valid, i.e. recognizable).
3100
+ ======================== ==========================================
3101
+ '''
3102
+
3103
+ # ColourData object to be shared by all colour pickers, so they can
3104
+ # share the custom colours
3105
+ _colourData = None
3106
+
3107
+ #--------------------------------------------------
3108
+ class ColourPickerButton(BitmapButton):
3109
+ def __init__(self, parent, id=-1, colour=wx.BLACK,
3110
+ pos=wx.DefaultPosition, size=wx.DefaultSize,
3111
+ style = CLRP_DEFAULT_STYLE,
3112
+ validator = wx.DefaultValidator,
3113
+ name = "colourpickerwidget"):
3114
+
3115
+ wx.BitmapButton.__init__(self, parent, id, wx.Bitmap(1,1),
3116
+ pos, size, style, validator, name)
3117
+ self.SetColour(colour)
3118
+ self.InvalidateBestSize()
3119
+ self.SetInitialSize(size)
3120
+ self.Bind(wx.EVT_BUTTON, self.OnButtonClick)
3121
+
3122
+ if ColourPickerCtrl._colourData is None:
3123
+ ColourPickerCtrl._colourData = wx.ColourData()
3124
+ ColourPickerCtrl._colourData.SetChooseFull(True)
3125
+ grey = 0
3126
+ for i in range(16):
3127
+ c = wx.Colour(grey, grey, grey)
3128
+ ColourPickerCtrl._colourData.SetCustomColour(i, c)
3129
+ grey += 16
3130
+
3131
+ def SetColour(self, colour):
3132
+ # force a copy, in case the _colorData is shared
3133
+ self.colour = wx.Colour(colour)
3134
+ bmp = self._makeBitmap()
3135
+ self.SetBitmapLabel(bmp)
3136
+
3137
+ def GetColour(self):
3138
+ return self.colour
3139
+
3140
+ def OnButtonClick(self, evt):
3141
+ ColourPickerCtrl._colourData.SetColour(self.colour)
3142
+ dlg = wx.ColourDialog(self, ColourPickerCtrl._colourData)
3143
+ if dlg.ShowModal() == wx.ID_OK:
3144
+ ColourPickerCtrl._colourData = dlg.GetColourData()
3145
+ self.SetColour(ColourPickerCtrl._colourData.GetColour())
3146
+ evt = wx.ColourPickerEvent(self, self.GetId(), self.GetColour())
3147
+ self.GetEventHandler().ProcessEvent(evt)
3148
+
3149
+ def _makeBitmap(self):
3150
+ width = height = 24
3151
+ bg = self.GetColour()
3152
+ if self.HasFlag(CLRP_SHOW_LABEL):
3153
+ w, h = self.GetTextExtent(bg.GetAsString(wx.C2S_HTML_SYNTAX))
3154
+ width += w
3155
+ bmp = wx.Bitmap(width, height)
3156
+ dc = wx.MemoryDC(bmp)
3157
+ dc.SetBackground(wx.Brush(self.colour))
3158
+ dc.Clear()
3159
+ if self.HasFlag(CLRP_SHOW_LABEL):
3160
+ from wx.lib.colourutils import BestLabelColour
3161
+ fg = BestLabelColour(bg)
3162
+ dc.SetTextForeground(fg)
3163
+ dc.DrawText(bg.GetAsString(wx.C2S_HTML_SYNTAX),
3164
+ (width - w)/2, (height - h)/2)
3165
+ return bmp
3166
+
3167
+ #--------------------------------------------------
3168
+
3169
+ def __init__(self, parent, id=-1, colour=wx.BLACK,
3170
+ pos=wx.DefaultPosition, size=wx.DefaultSize,
3171
+ style = CLRP_DEFAULT_STYLE,
3172
+ validator = wx.DefaultValidator,
3173
+ name = "colourpicker"):
3174
+ if type(colour) != wx.Colour:
3175
+ colour = wx.Colour(colour)
3176
+ wx.PickerBase.__init__(self)
3177
+ self.CreateBase(parent, id, colour.GetAsString(),
3178
+ pos, size, style, validator, name)
3179
+ widget = ColourPickerCtrl.ColourPickerButton(
3180
+ self, -1, colour, style=self.GetPickerStyle(style))
3181
+ self.SetPickerCtrl(widget)
3182
+ widget.Bind(wx.EVT_COLOURPICKER_CHANGED, self.OnColourChange)
3183
+ self.PostCreation()
3184
+
3185
+
3186
+ def GetColour(self):
3187
+ '''Set the displayed colour.'''
3188
+ return self.GetPickerCtrl().GetColour()
3189
+
3190
+ def SetColour(self, colour):
3191
+ '''Returns the currently selected colour.'''
3192
+ self.GetPickerCtrl().SetColour(colour)
3193
+ self.UpdateTextCtrlFromPicker()
3194
+ Colour = property(GetColour, SetColour)
3195
+
3196
+
3197
+ def UpdatePickerFromTextCtrl(self):
3198
+ col = wx.Colour(self.GetTextCtrl().GetValue())
3199
+ if not col.IsOk():
3200
+ return
3201
+ if self.GetColour() != col:
3202
+ self.GetPickerCtrl().SetColour(col)
3203
+ evt = wx.ColourPickerEvent(self, self.GetId(), self.GetColour())
3204
+ self.GetEventHandler().ProcessEvent(evt)
3205
+
3206
+ def UpdateTextCtrlFromPicker(self):
3207
+ if not self.GetTextCtrl():
3208
+ return
3209
+ self.GetTextCtrl().SetValue(self.GetColour().GetAsString())
3210
+
3211
+ def GetPickerStyle(self, style):
3212
+ return style & CLRP_SHOW_LABEL
3213
+
3214
+ def OnColourChange(self, evt):
3215
+ self.UpdateTextCtrlFromPicker()
3216
+ evt = wx.ColourPickerEvent(self, self.GetId(), self.GetColour())
3217
+ self.GetEventHandler().ProcessEvent(evt)
3218
+
3219
+ EVT_FILECTRL_SELECTIONCHANGED = wx.PyEventBinder( wxEVT_FILECTRL_SELECTIONCHANGED, 1)
3220
+ EVT_FILECTRL_FILEACTIVATED = wx.PyEventBinder( wxEVT_FILECTRL_FILEACTIVATED, 1)
3221
+ EVT_FILECTRL_FOLDERCHANGED = wx.PyEventBinder( wxEVT_FILECTRL_FOLDERCHANGED, 1)
3222
+ EVT_FILECTRL_FILTERCHANGED = wx.PyEventBinder( wxEVT_FILECTRL_FILTERCHANGED, 1)
3223
+
3224
+ EVT_CHOICEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_CHOICEBOOK_PAGE_CHANGED, 1 )
3225
+ EVT_CHOICEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_CHOICEBOOK_PAGE_CHANGING, 1 )
3226
+
3227
+ # deprecated wxEVT aliases
3228
+ wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxEVT_CHOICEBOOK_PAGE_CHANGED
3229
+ wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxEVT_CHOICEBOOK_PAGE_CHANGING
3230
+
3231
+ EVT_LISTBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_LISTBOOK_PAGE_CHANGED, 1 )
3232
+ EVT_LISTBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_LISTBOOK_PAGE_CHANGING, 1 )
3233
+
3234
+ # deprecated wxEVT aliases
3235
+ wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxEVT_LISTBOOK_PAGE_CHANGED
3236
+ wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxEVT_LISTBOOK_PAGE_CHANGING
3237
+
3238
+ EVT_TOOLBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_TOOLBOOK_PAGE_CHANGED, 1 )
3239
+ EVT_TOOLBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_TOOLBOOK_PAGE_CHANGING, 1 )
3240
+
3241
+ # deprecated wxEVT aliases
3242
+ wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED = wxEVT_TOOLBOOK_PAGE_CHANGED
3243
+ wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING = wxEVT_TOOLBOOK_PAGE_CHANGING
3244
+
3245
+ EVT_TREEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGED, 1 )
3246
+ EVT_TREEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGING, 1)
3247
+ EVT_TREEBOOK_NODE_COLLAPSED = wx.PyEventBinder( wxEVT_TREEBOOK_NODE_COLLAPSED, 1 )
3248
+ EVT_TREEBOOK_NODE_EXPANDED = wx.PyEventBinder( wxEVT_TREEBOOK_NODE_EXPANDED, 1 )
3249
+
3250
+ # deprecated wxEVT aliases
3251
+ wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED = wxEVT_TREEBOOK_PAGE_CHANGED
3252
+ wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wxEVT_TREEBOOK_PAGE_CHANGING
3253
+ wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED = wxEVT_TREEBOOK_NODE_COLLAPSED
3254
+ wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED = wxEVT_TREEBOOK_NODE_EXPANDED
3255
+
3256
+ EVT_COLLAPSIBLEHEADER_CHANGED = PyEventBinder(wxEVT_COLLAPSIBLEHEADER_CHANGED, 1)
3257
+
3258
+ def _Dialog___enter__(self):
3259
+ return self
3260
+ Dialog.__enter__ = _Dialog___enter__
3261
+ del _Dialog___enter__
3262
+ def _Dialog___exit__(self, exc_type, exc_val, exc_tb):
3263
+ self.Destroy()
3264
+ Dialog.__exit__ = _Dialog___exit__
3265
+ del _Dialog___exit__
3266
+ EVT_DIRCTRL_SELECTIONCHANGED = wx.PyEventBinder( wxEVT_DIRCTRL_SELECTIONCHANGED, 1 )
3267
+ EVT_DIRCTRL_FILEACTIVATED = wx.PyEventBinder( wxEVT_DIRCTRL_FILEACTIVATED, 1 )
3268
+
3269
+ EVT_COLOUR_CHANGED = PyEventBinder(wxEVT_COLOUR_CHANGED, 1)
3270
+
3271
+ EVT_FIND = wx.PyEventBinder( wxEVT_FIND, 1 )
3272
+ EVT_FIND_NEXT = wx.PyEventBinder( wxEVT_FIND_NEXT, 1 )
3273
+ EVT_FIND_REPLACE = wx.PyEventBinder( wxEVT_FIND_REPLACE, 1 )
3274
+ EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_FIND_REPLACE_ALL, 1 )
3275
+ EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_FIND_CLOSE, 1 )
3276
+
3277
+ # deprecated wxEVT aliases
3278
+ wxEVT_COMMAND_FIND = wxEVT_FIND
3279
+ wxEVT_COMMAND_FIND_NEXT = wxEVT_FIND_NEXT
3280
+ wxEVT_COMMAND_FIND_REPLACE = wxEVT_FIND_REPLACE
3281
+ wxEVT_COMMAND_FIND_REPLACE_ALL = wxEVT_FIND_REPLACE_ALL
3282
+ wxEVT_COMMAND_FIND_CLOSE = wxEVT_FIND_CLOSE
3283
+
3284
+ def _PowerResourceBlocker___enter__(self):
3285
+ return self
3286
+ PowerResourceBlocker.__enter__ = _PowerResourceBlocker___enter__
3287
+ del _PowerResourceBlocker___enter__
3288
+ def _PowerResourceBlocker___exit__(self, exc_type, exc_val, exc_tb):
3289
+ pass
3290
+ PowerResourceBlocker.__exit__ = _PowerResourceBlocker___exit__
3291
+ del _PowerResourceBlocker___exit__
3292
+ EVT_POWER_SUSPENDING = wx.PyEventBinder( wxEVT_POWER_SUSPENDING , 1 )
3293
+ EVT_POWER_SUSPENDED = wx.PyEventBinder( wxEVT_POWER_SUSPENDED , 1 )
3294
+ EVT_POWER_SUSPEND_CANCEL = wx.PyEventBinder( wxEVT_POWER_SUSPEND_CANCEL , 1 )
3295
+ EVT_POWER_RESUME = wx.PyEventBinder( wxEVT_POWER_RESUME , 1 )
3296
+
3297
+ def _WindowDisabler___enter__(self):
3298
+ return self
3299
+ WindowDisabler.__enter__ = _WindowDisabler___enter__
3300
+ del _WindowDisabler___enter__
3301
+ def _WindowDisabler___exit__(self, exc_type, exc_val, exc_tb):
3302
+ pass
3303
+ WindowDisabler.__exit__ = _WindowDisabler___exit__
3304
+ del _WindowDisabler___exit__
3305
+ def _BusyCursor___enter__(self):
3306
+ return self
3307
+ BusyCursor.__enter__ = _BusyCursor___enter__
3308
+ del _BusyCursor___enter__
3309
+ def _BusyCursor___exit__(self, exc_type, exc_val, exc_tb):
3310
+ pass
3311
+ BusyCursor.__exit__ = _BusyCursor___exit__
3312
+ del _BusyCursor___exit__
3313
+ EVT_END_PROCESS = wx.PyEventBinder( wxEVT_END_PROCESS )
3314
+
3315
+ def HelpController(parentWindow=None):
3316
+ """
3317
+ Rather than being an alias for some class, the Python version of
3318
+ ``HelpController`` is a factory function that creates and returns an
3319
+ instance of the best Help Controller for the platform.
3320
+ """
3321
+ try:
3322
+ if 'wxMSW' in wx.PlatformInfo:
3323
+ from .msw import CHMHelpController as ControllerClass
3324
+ else:
3325
+ from .html import HtmlHelpController as ControllerClass
3326
+ except ImportError:
3327
+ from .adv import ExtHelpController as ControllerClass
3328
+
3329
+ return ControllerClass(parentWindow)
3330
+
3331
+ PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk instead.')
3332
+
3333
+ PyPrintPreview = wx.deprecated(PrintPreview, 'Use PrintPreview instead.')
3334
+
3335
+ PyPreviewFrame = wx.deprecated(PreviewFrame, 'Use PreviewFrame instead.')
3336
+
3337
+ PyPreviewControlBar = wx.deprecated(PreviewControlBar, 'Use PreviewControlBar instead.')
3338
+
3339
+ PyPrintout = wx.deprecated(Printout, 'Use Printout instead.')
3340
+
3341
+ def _BusyInfo___enter__(self):
3342
+ return self
3343
+ BusyInfo.__enter__ = _BusyInfo___enter__
3344
+ del _BusyInfo___enter__
3345
+ def _BusyInfo___exit__(self, exc_type, exc_val, exc_tb):
3346
+ return False
3347
+ BusyInfo.__exit__ = _BusyInfo___exit__
3348
+ del _BusyInfo___exit__
3349
+ def _FileHistoryMenuList___repr__(self):
3350
+ return "FileHistoryMenuList: " + repr(list(self))
3351
+ FileHistoryMenuList.__repr__ = _FileHistoryMenuList___repr__
3352
+ del _FileHistoryMenuList___repr__
3353
+ def _CommandList___repr__(self):
3354
+ return "CommandList: " + repr(list(self))
3355
+ CommandList.__repr__ = _CommandList___repr__
3356
+ del _CommandList___repr__
3357
+ EVT_FSWATCHER = wx.PyEventBinder(wxEVT_FSWATCHER)
3358
+
3359
+ def version():
3360
+ """
3361
+ Returns a string containing version and port info
3362
+ """
3363
+ if wx.Port == '__WXMSW__':
3364
+ port = 'msw'
3365
+ elif wx.Port == '__WXMAC__':
3366
+ if 'wxOSX-carbon' in wx.PlatformInfo:
3367
+ port = 'osx-carbon'
3368
+ else:
3369
+ port = 'osx-cocoa'
3370
+ elif wx.Port == '__WXGTK__':
3371
+ port = 'gtk'
3372
+ if 'gtk2' in wx.PlatformInfo:
3373
+ port = 'gtk2'
3374
+ elif 'gtk3' in wx.PlatformInfo:
3375
+ port = 'gtk3'
3376
+ else:
3377
+ port = '???'
3378
+ return "%s %s (zombie) %s" % (wx.VERSION_STRING, port, wx.wxWidgets_version)
3379
+
3380
+ def CallAfter(callableObj, *args, **kw):
3381
+ """
3382
+ Call the specified function after the current and pending event
3383
+ handlers have been completed. This is also good for making GUI
3384
+ method calls from non-GUI threads. Any extra positional or
3385
+ keyword args are passed on to the callable when it is called.
3386
+
3387
+ :param PyObject callableObj: the callable object
3388
+ :param args: arguments to be passed to the callable object
3389
+ :param kw: keywords to be passed to the callable object
3390
+
3391
+ .. seealso::
3392
+ :ref:`wx.CallLater`
3393
+ """
3394
+ assert callable(callableObj), "callableObj is not callable"
3395
+ app = wx.GetApp()
3396
+ assert app is not None, 'No wx.App created yet'
3397
+
3398
+ if not hasattr(app, "_CallAfterId"):
3399
+ app._CallAfterId = wx.NewEventType()
3400
+ app.Connect(-1, -1, app._CallAfterId,
3401
+ lambda event: event.callable(*event.args, **event.kw) )
3402
+ evt = wx.PyEvent()
3403
+ evt.SetEventType(app._CallAfterId)
3404
+ evt.callable = callableObj
3405
+ evt.args = args
3406
+ evt.kw = kw
3407
+ wx.PostEvent(app, evt)
3408
+
3409
+ class CallLater(object):
3410
+ """
3411
+ A convenience class for :class:`wx.Timer`, that calls the given callable
3412
+ object once after the given amount of milliseconds, passing any
3413
+ positional or keyword args. The return value of the callable is
3414
+ available after it has been run with the :meth:`~wx.CallLater.GetResult`
3415
+ method.
3416
+
3417
+ If you don't need to get the return value or restart the timer
3418
+ then there is no need to hold a reference to this object. CallLater
3419
+ maintains references to its instances while they are running. When they
3420
+ finish, the internal reference is deleted and the GC is free to collect
3421
+ naturally.
3422
+
3423
+ .. seealso::
3424
+ :func:`wx.CallAfter`
3425
+ """
3426
+ __instances = {}
3427
+ def __init__(self, millis, callableObj, *args, **kwargs):
3428
+ """
3429
+ Constructs a new :class:`wx.CallLater` object.
3430
+
3431
+ :param int millis: number of milliseconds to delay until calling the callable object
3432
+ :param PyObject callableObj: the callable object
3433
+ :param args: arguments to be passed to the callable object
3434
+ :param kw: keywords to be passed to the callable object
3435
+ """
3436
+ assert callable(callableObj), "callableObj is not callable"
3437
+ self.millis = millis
3438
+ self.callable = callableObj
3439
+ self.SetArgs(*args, **kwargs)
3440
+ self.runCount = 0
3441
+ self.running = False
3442
+ self.hasRun = False
3443
+ self.result = None
3444
+ self.timer = None
3445
+ self.Start()
3446
+
3447
+ def __del__(self):
3448
+ self.Stop()
3449
+
3450
+ def Start(self, millis=None, *args, **kwargs):
3451
+ """
3452
+ (Re)start the timer
3453
+
3454
+ :param int millis: number of milli seconds
3455
+ :param args: arguments to be passed to the callable object
3456
+ :param kw: keywords to be passed to the callable object
3457
+ """
3458
+ self.hasRun = False
3459
+ if millis is not None:
3460
+ self.millis = millis
3461
+ if args or kwargs:
3462
+ self.SetArgs(*args, **kwargs)
3463
+ self.Stop()
3464
+ CallLater.__instances[self] = "value irrelevant" # Maintain a reference to avoid GC
3465
+ self.timer = wx.PyTimer(self.Notify)
3466
+ self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
3467
+ self.running = True
3468
+
3469
+ Restart = Start
3470
+ def Stop(self):
3471
+ """
3472
+ Stop and destroy the timer.
3473
+ """
3474
+ if self in CallLater.__instances:
3475
+ del CallLater.__instances[self]
3476
+ if self.timer is not None:
3477
+ self.timer.Stop()
3478
+ self.timer = None
3479
+
3480
+ def GetInterval(self):
3481
+ if self.timer is not None:
3482
+ return self.timer.GetInterval()
3483
+ else:
3484
+ return 0
3485
+
3486
+ def IsRunning(self):
3487
+ return self.timer is not None and self.timer.IsRunning()
3488
+
3489
+ def SetArgs(self, *args, **kwargs):
3490
+ """
3491
+ (Re)set the args passed to the callable object. This is
3492
+ useful in conjunction with :meth:`Start` if
3493
+ you want to schedule a new call to the same callable
3494
+ object but with different parameters.
3495
+
3496
+ :param args: arguments to be passed to the callable object
3497
+ :param kw: keywords to be passed to the callable object
3498
+ """
3499
+ self.args = args
3500
+ self.kwargs = kwargs
3501
+
3502
+ def HasRun(self):
3503
+ """
3504
+ Returns whether or not the callable has run.
3505
+
3506
+ :rtype: bool
3507
+ """
3508
+ return self.hasRun
3509
+
3510
+ def GetResult(self):
3511
+ """
3512
+ Returns the value of the callable.
3513
+
3514
+ :rtype: a Python object
3515
+ :return: result from callable
3516
+ """
3517
+ return self.result
3518
+
3519
+ def Notify(self):
3520
+ """
3521
+ The timer has expired so call the callable.
3522
+ """
3523
+ if self.callable and getattr(self.callable, 'im_self', True):
3524
+ self.runCount += 1
3525
+ self.running = False
3526
+ self.result = self.callable(*self.args, **self.kwargs)
3527
+ self.hasRun = True
3528
+ if not self.running:
3529
+ # if it wasn't restarted, then cleanup
3530
+ wx.CallAfter(self.Stop)
3531
+
3532
+ Interval = property(GetInterval)
3533
+ Result = property(GetResult)
3534
+
3535
+ FutureCall = deprecated(CallLater, 'Use CallLater instead.')
3536
+
3537
+ def GetDefaultPyEncoding():
3538
+ return "utf-8"
3539
+ GetDefaultPyEncoding = deprecated(GetDefaultPyEncoding, msg="wxPython now always uses utf-8")
3540
+