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/demo/Main.py ADDED
@@ -0,0 +1,2768 @@
1
+ #!/bin/env python
2
+ #----------------------------------------------------------------------------
3
+ # Name: Main.py
4
+ # Purpose: Testing lots of stuff, controls, window types, etc.
5
+ #
6
+ # Author: Robin Dunn
7
+ #
8
+ # Created: A long time ago, in a galaxy far, far away...
9
+ # Copyright: (c) 1999-2020 by Total Control Software
10
+ # Licence: wxWindows license
11
+ # Tags: phoenix-port, py3-port
12
+ #----------------------------------------------------------------------------
13
+ # (c) 2022 Zombie
14
+ #----------------------------------------------------------------------------
15
+
16
+ # FIXME List:
17
+ # * Problems with flickering related to ERASE_BACKGROUND
18
+ # and the splitters. Might be a problem with this 2.5 beta...?
19
+ # UPDATE: can't see on 2.5.2 GTK - maybe just a faster machine :)
20
+ # * Demo Code menu?
21
+ # * Annoying switching between tabs and resulting flicker
22
+ # how to replace a page in the notebook without deleting/adding?
23
+ # Where is SetPage!? tried freeze...tried reparent of dummy panel....
24
+ # AG: It looks like this issue is fixed by Freeze()ing and Thaw()ing the
25
+ # main frame and not the notebook
26
+
27
+ # TODO List:
28
+ # * UI design more professional (is the new version more professional?)
29
+ # * save file positions (new field in demoModules) (@ LoadDemoSource)
30
+ # * Update main overview
31
+
32
+ # * Why don't we move _treeList into a separate module
33
+
34
+ # =====================
35
+ # = EXTERNAL Packages =
36
+ # =====================
37
+ # In order to let a package (like AGW) be included in the wxPython demo,
38
+ # the package owner should create a sub-directory of the wxPython demo folder
39
+ # in which all the package's demos should live. In addition, the sub-folder
40
+ # should contain a Python file called __demo__.py which, when imported, should
41
+ # contain the following methods:
42
+ #
43
+ # * GetDemoBitmap: returns the bitmap to be used in the wxPython demo tree control
44
+ # in a PyEmbeddedImage format;
45
+ # * GetRecentAdditions: returns a list of demos which will be displayed under the
46
+ # "Recent Additions/Updates" tree item. This list should be a subset (or the full
47
+ # set) of the package's demos;
48
+ # * GetDemos: returns a tuple. The first item of the tuple is the package's name
49
+ # as will be displayed in the wxPython demo tree, right after the "Custom Controls"
50
+ # item. The second element of the tuple is the list of demos for the external package.
51
+ # * GetOverview: returns a wx.html-ready representation of the package's documentation.
52
+ #
53
+ # Please see the __demo__.py file in the demo/agw/ folder for an example.
54
+ # Last updated: Andrea Gavana, 20 Oct 2008, 18.00 GMT
55
+
56
+ import sys, os, time, traceback
57
+ import re
58
+ import shutil
59
+ from threading import Thread
60
+
61
+ import wx
62
+ import wx.adv
63
+ import wx.lib.agw.aui as aui
64
+ import wx.html
65
+ from wx.lib.msgpanel import MessagePanel
66
+ from wx.adv import TaskBarIcon as TaskBarIcon
67
+ from wx.adv import SplashScreen as SplashScreen
68
+ import wx.lib.mixins.inspection
69
+
70
+ import six
71
+ from six import exec_, BytesIO
72
+ from six.moves import cPickle
73
+ from six.moves import urllib
74
+
75
+ import version
76
+
77
+ # We won't import the images module yet, but we'll assign it to this
78
+ # global when we do.
79
+ images = None
80
+
81
+ # For debugging
82
+ ##wx.Trap();
83
+ ##print("wx.VERSION_STRING = %s (%s)" % (wx.VERSION_STRING, wx.USE_UNICODE and 'unicode' or 'ansi'))
84
+ ##print("pid:", os.getpid())
85
+ ##raw_input("Press Enter...")
86
+
87
+ #---------------------------------------------------------------------------
88
+
89
+ USE_CUSTOMTREECTRL = False
90
+ DEFAULT_PERSPECTIVE = "Default Perspective"
91
+
92
+ #---------------------------------------------------------------------------
93
+
94
+ # get images and demo list
95
+ from demodata import _demoPngs, _treeList
96
+
97
+ #---------------------------------------------------------------------------
98
+
99
+ _styleTable = '<h3>Window %s</h3>\n' \
100
+ '<p>This class supports the following window %s:\n' \
101
+ '<p><table bgcolor=\"#ffffff\" border cols=1>'
102
+
103
+ _eventTable = '<h3>Events</h3>\n' \
104
+ '<p>Events emitted by this class:\n' \
105
+ '<p><table bgcolor=\"#ffffff\" border cols=1>'
106
+
107
+ _appearanceTable = '<h3>Appearance</h3>\n' \
108
+ '<p>Control appearance on various platform:\n' \
109
+ '<p><table bgcolor=\"#ffffff\" cellspacing=20>'
110
+
111
+ _styleHeaders = ["Style Name", "Description"]
112
+ _eventHeaders = ["Event Name", "Description"]
113
+ _headerTable = '<td><b>%s</b></td>'
114
+ _styleTag = '<td><tt>%s</tt></td>'
115
+ _eventTag = '<td><i>%s</i></td>'
116
+ _hexValues = '<td><font color="%s"> %s </font></td>'
117
+ _description = '<td>%s</td>'
118
+ _imageTag = '<td align=center valign=middle><a href="%s"><img src="%s" alt="%s"></a></td>'
119
+ _platformTag = '<td align=center><b>%s</b></td>'
120
+
121
+ _trunkURL = "http://docs.wxwidgets.org/trunk/"
122
+ _docsURL = _trunkURL + "classwx%s.html"
123
+ _platformNames = ["wxMSW", "wxGTK", "wxMac"]
124
+
125
+
126
+ _importList = ["wx.aui", "wx.calendar", "wx.html", "wx.media", "wx.wizard",
127
+ "wx.combo", "wx.animate", "wx.gizmos", "wx.glcanvas", "wx.grid",
128
+ "wx.richtext", "wx.stc"]
129
+
130
+ _dirWX = dir(wx)
131
+ for mod in _importList:
132
+ try:
133
+ module = __import__(mod)
134
+ except ImportError:
135
+ continue
136
+
137
+ #---------------------------------------------------------------------------
138
+
139
+ def ReplaceCapitals(string):
140
+ """
141
+ Replaces the capital letter in a string with an underscore plus the
142
+ corresponding lowercase character.
143
+
144
+ **Parameters:**
145
+
146
+ * `string`: the string to be analyzed.
147
+ """
148
+
149
+ newString = ""
150
+ for char in string:
151
+ if char.isupper():
152
+ newString += "_%s"%char.lower()
153
+ else:
154
+ newString += char
155
+
156
+ return newString
157
+
158
+
159
+ def RemoveHTMLTags(data):
160
+ """
161
+ Removes all the HTML tags from a string.
162
+
163
+ **Parameters:**
164
+
165
+ * `data`: the string to be analyzed.
166
+ """
167
+
168
+ p = re.compile(r'<[^<]*?>')
169
+ return p.sub('', data)
170
+
171
+
172
+ def FormatDocs(keyword, values, num):
173
+
174
+ names = sorted(values)
175
+
176
+ headers = (num == 2 and [_eventHeaders] or [_styleHeaders])[0]
177
+ table = (num == 2 and [_eventTable] or [_styleTable])[0]
178
+ if num == 3:
179
+ text = "<br>" + table%(keyword.lower(), keyword.lower()) + "\n<tr>\n"
180
+ else:
181
+ text = "<br>" + table
182
+
183
+ for indx in range(2):
184
+ text += _headerTable%headers[indx]
185
+
186
+ text += "\n</tr>\n"
187
+
188
+ for name in names:
189
+
190
+ text += "<tr>\n"
191
+
192
+ description = values[name].strip()
193
+ pythonValue = name.replace("wx", "wx.")
194
+
195
+ if num == 3:
196
+
197
+ colour = "#ff0000"
198
+ value = "Unavailable"
199
+ cutValue = pythonValue[3:]
200
+
201
+ if cutValue in _dirWX:
202
+ try:
203
+ val = eval(pythonValue)
204
+ value = "%s"%hex(val)
205
+ colour = "#0000ff"
206
+ except AttributeError:
207
+ value = "Unavailable"
208
+ else:
209
+ for packages in _importList:
210
+ if cutValue in dir(eval(packages)):
211
+ val = eval("%s.%s"%(packages, cutValue))
212
+ value = "%s"%hex(val)
213
+ colour = "#0000ff"
214
+ pythonValue = "%s.%s"%(packages, cutValue)
215
+ break
216
+
217
+ text += _styleTag%pythonValue + "\n"
218
+
219
+ else:
220
+
221
+ text += _eventTag%pythonValue + "\n"
222
+
223
+ text += _description%FormatDescription(description) + "\n"
224
+ text += "</tr>\n"
225
+
226
+ text += "\n</table>\n\n<p>"
227
+ return text
228
+
229
+
230
+ def FormatDescription(description):
231
+ """
232
+ Formats a wxWidgets C++ description in a more wxPython-based way.
233
+
234
+ **Parameters:**
235
+
236
+ * `description`: the string description to be formatted.
237
+ """
238
+
239
+ description = description.replace("wx", "wx.")
240
+ description = description.replace("EVT_COMMAND", "wxEVT_COMMAND")
241
+ description = description.replace("wx.Widgets", "wxWidgets")
242
+
243
+ return description
244
+
245
+
246
+ def FormatImages(appearance):
247
+
248
+ text = "<p><br>" + _appearanceTable
249
+
250
+ for indx in range(2):
251
+ text += "\n<tr>\n"
252
+ for key in _platformNames:
253
+ if indx == 0:
254
+ src = appearance[key]
255
+ alt = key + "Appearance"
256
+ text += _imageTag%(src, src, alt)
257
+ else:
258
+ text += _platformTag%key
259
+
260
+ text += "</tr>\n"
261
+
262
+ text += "\n</table>\n\n<p>"
263
+ return text
264
+
265
+
266
+ def FindWindowStyles(text, originalText, widgetName):
267
+ """
268
+ Finds the windows styles and events in the input text.
269
+
270
+ **Parameters:**
271
+
272
+ * `text`: the wxWidgets C++ docs for a particular widget/event, stripped
273
+ of all HTML tags;
274
+ * `originalText`: the wxWidgets C++ docs for a particular widget/event, with
275
+ all HTML tags.
276
+ """
277
+
278
+ winStyles, winEvents, winExtra, winAppearance = {}, {}, {}, {}
279
+ inStyle = inExtra = inEvent = False
280
+
281
+ for line in text:
282
+ if "following styles:" in line:
283
+ inStyle = True
284
+ continue
285
+
286
+ elif "Event macros" in line:
287
+ inEvent = True
288
+ continue
289
+
290
+ if "following extra styles:" in line:
291
+ inExtra = True
292
+ continue
293
+
294
+ if "Appearance:" in line:
295
+ winAppearance = FindImages(originalText, widgetName)
296
+ continue
297
+
298
+ elif not line.strip():
299
+ inStyle = inEvent = inExtra = False
300
+ continue
301
+
302
+ if inStyle:
303
+ start = line.index(':')
304
+ windowStyle = line[0:start]
305
+ styleDescription = line[start+1:]
306
+ winStyles[windowStyle] = styleDescription
307
+ elif inEvent:
308
+ start = line.index(':')
309
+ eventName = line[0:start]
310
+ eventDescription = line[start+1:]
311
+ winEvents[eventName] = eventDescription
312
+ elif inExtra:
313
+ start = line.index(':')
314
+ styleName = line[0:start]
315
+ styleDescription = line[start+1:]
316
+ winExtra[styleName] = styleDescription
317
+
318
+ return winStyles, winEvents, winExtra, winAppearance
319
+
320
+
321
+ def FindImages(text, widgetName):
322
+ """
323
+ When the wxWidgets docs contain athe control appearance (a screenshot of the
324
+ control), this method will try and download the images.
325
+
326
+ **Parameters:**
327
+
328
+ * `text`: the wxWidgets C++ docs for a particular widget/event, with
329
+ all HTML tags.
330
+ """
331
+
332
+ winAppearance = {}
333
+ start = text.find("class='appearance'")
334
+
335
+ if start < 0:
336
+ return winAppearance
337
+
338
+ imagesDir = GetDocImagesDir()
339
+
340
+ end = start + text.find("</table>")
341
+ text = text[start:end]
342
+ split = text.split()
343
+
344
+ for indx, items in enumerate(split):
345
+
346
+ if "src=" in items:
347
+ possibleImage = items.replace("src=", "").strip()
348
+ possibleImage = possibleImage.replace('"', "")
349
+ with urllib.request.urlopen(_trunkURL + possibleImage) as f:
350
+ stream = f.read()
351
+ elif "alt=" in items:
352
+ plat = items.replace("alt=", "").replace("'", "").strip()
353
+ path = os.path.join(imagesDir, plat, widgetName + ".png")
354
+ if not os.path.isfile(path):
355
+ image = wx.ImageFromStream(BytesIO(stream))
356
+ image.SaveFile(path, wx.BITMAP_TYPE_PNG)
357
+
358
+ winAppearance[plat] = path
359
+
360
+ return winAppearance
361
+
362
+
363
+ def GetCaretPeriod(win = None):
364
+ """
365
+ Attempts to identify the correct caret blinkrate to use in the Demo Code panel.
366
+
367
+ :pram wx.Window win: a window to pass to wx.SystemSettings.GetMetric.
368
+
369
+ :return: a value in milliseconds that indicates the proper period.
370
+ :rtype: int
371
+
372
+ :raises: ValueError if unable to resolve a proper caret blink rate.
373
+ """
374
+ if '--no-caret-blink' in sys.argv:
375
+ return 0
376
+
377
+ try:
378
+ onmsec = wx.SystemSettings.GetMetric(wx.SYS_CARET_ON_MSEC, win)
379
+ offmsec = wx.SystemSettings.GetMetric(wx.SYS_CARET_OFF_MSEC, win)
380
+
381
+ # check values aren't -1
382
+ if -1 in (onmsec, offmsec):
383
+ raise ValueError("Unable to determine caret blink rate.")
384
+
385
+ # attempt to average.
386
+ # (wx systemsettings allows on and off time, but scintilla just takes a single period.)
387
+ return int((onmsec + offmsec) / 2.0)
388
+
389
+ except AttributeError:
390
+ # Issue where wx.SYS_CARET_ON/OFF_MSEC is unavailable.
391
+ raise ValueError("Unable to determine caret blink rate.")
392
+
393
+ #---------------------------------------------------------------------------
394
+ # Set up a thread that will scan the wxWidgets docs for window styles,
395
+ # events and widgets screenshots
396
+
397
+ class InternetThread(Thread):
398
+ """ Worker thread class to attempt connection to the internet. """
399
+
400
+ def __init__(self, notifyWindow, selectedClass):
401
+
402
+ Thread.__init__(self)
403
+
404
+ self.notifyWindow = notifyWindow
405
+ self.selectedClass = selectedClass
406
+ self.keepRunning = True
407
+ self.setDaemon(True)
408
+
409
+ self.start()
410
+
411
+
412
+ def run(self):
413
+ """ Run the worker thread. """
414
+
415
+ # This is the code executing in the new thread. Simulation of
416
+ # a long process as a simple urllib call
417
+
418
+ try:
419
+ url = _docsURL % ReplaceCapitals(self.selectedClass)
420
+ with urllib.request.urlopen(url) as fid:
421
+ if six.PY2:
422
+ originalText = fid.read()
423
+ else:
424
+ originalText = fid.read().decode("utf-8")
425
+
426
+ text = RemoveHTMLTags(originalText).split("\n")
427
+ data = FindWindowStyles(text, originalText, self.selectedClass)
428
+
429
+ if not self.keepRunning:
430
+ return
431
+
432
+ wx.CallAfter(self.notifyWindow.LoadDocumentation, data)
433
+ except (IOError, urllib.error.HTTPError):
434
+ # Unable to get to the internet
435
+ t, v = sys.exc_info()[:2]
436
+ message = traceback.format_exception_only(t, v)
437
+ wx.CallAfter(self.notifyWindow.StopDownload, message)
438
+ except:
439
+ # Some other strange error...
440
+ t, v = sys.exc_info()[:2]
441
+ message = traceback.format_exception_only(t, v)
442
+ wx.CallAfter(self.notifyWindow.StopDownload, message)
443
+
444
+
445
+ #---------------------------------------------------------------------------
446
+ # Show how to derive a custom wxLog class
447
+
448
+ class MyLog(wx.Log):
449
+ def __init__(self, textCtrl, logTime=0):
450
+ wx.Log.__init__(self)
451
+ self.tc = textCtrl
452
+ self.logTime = logTime
453
+
454
+ def DoLogText(self, message):
455
+ if self.tc:
456
+ self.tc.AppendText(message + '\n')
457
+
458
+
459
+
460
+ #---------------------------------------------------------------------------
461
+ # A class to be used to display source code in the demo. Try using the
462
+ # wxSTC in the StyledTextCtrl_2 sample first, fall back to wxTextCtrl
463
+ # if there is an error, such as the stc module not being present.
464
+ #
465
+
466
+ try:
467
+ ##raise ImportError # for testing the alternate implementation
468
+ from wx import stc
469
+ from StyledTextCtrl_2 import PythonSTC
470
+
471
+ class DemoCodeEditor(PythonSTC):
472
+ def __init__(self, parent, style=wx.BORDER_NONE):
473
+ PythonSTC.__init__(self, parent, -1, style=style)
474
+ self.SetUpEditor()
475
+
476
+ # Some methods to make it compatible with how the wxTextCtrl is used
477
+ def SetValue(self, value):
478
+ # if wx.USE_UNICODE:
479
+ # value = value.decode('iso8859_1')
480
+ val = self.GetReadOnly()
481
+ self.SetReadOnly(False)
482
+ self.SetText(value)
483
+ self.EmptyUndoBuffer()
484
+ self.SetSavePoint()
485
+ self.SetReadOnly(val)
486
+
487
+ def SetEditable(self, val):
488
+ self.SetReadOnly(not val)
489
+
490
+ def IsModified(self):
491
+ return self.GetModify()
492
+
493
+ def Clear(self):
494
+ self.ClearAll()
495
+
496
+ def SetInsertionPoint(self, pos):
497
+ self.SetCurrentPos(pos)
498
+ self.SetAnchor(pos)
499
+
500
+ def ShowPosition(self, pos):
501
+ line = self.LineFromPosition(pos)
502
+ #self.EnsureVisible(line)
503
+ self.GotoLine(line)
504
+
505
+ def GetLastPosition(self):
506
+ return self.GetLength()
507
+
508
+ def GetPositionFromLine(self, line):
509
+ return self.PositionFromLine(line)
510
+
511
+ def GetRange(self, start, end):
512
+ return self.GetTextRange(start, end)
513
+
514
+ def GetSelection(self):
515
+ return self.GetAnchor(), self.GetCurrentPos()
516
+
517
+ def SetSelection(self, start, end):
518
+ self.SetSelectionStart(start)
519
+ self.SetSelectionEnd(end)
520
+
521
+ def SelectLine(self, line):
522
+ start = self.PositionFromLine(line)
523
+ end = self.GetLineEndPosition(line)
524
+ self.SetSelection(start, end)
525
+
526
+ def SetUpEditor(self):
527
+ """
528
+ This method carries out the work of setting up the demo editor.
529
+ It's separate so as not to clutter up the init code.
530
+ """
531
+ import keyword
532
+
533
+ self.SetLexer(stc.STC_LEX_PYTHON)
534
+ self.SetKeyWords(0, " ".join(keyword.kwlist))
535
+
536
+ # Enable folding
537
+ self.SetProperty("fold", "1" )
538
+
539
+ # Highlight tab/space mixing (shouldn't be any)
540
+ self.SetProperty("tab.timmy.whinge.level", "1")
541
+
542
+ # Set left and right margins
543
+ self.SetMargins(2,2)
544
+
545
+ # Set up the numbers in the margin for margin #1
546
+ self.SetMarginType(1, wx.stc.STC_MARGIN_NUMBER)
547
+ # Reasonable value for, say, 4-5 digits using a mono font (40 pix)
548
+ self.SetMarginWidth(1, 40)
549
+
550
+ # Indentation and tab stuff
551
+ self.SetIndent(4) # Proscribed indent size for wx
552
+ self.SetIndentationGuides(True) # Show indent guides
553
+ self.SetBackSpaceUnIndents(True)# Backspace unindents rather than delete 1 space
554
+ self.SetTabIndents(True) # Tab key indents
555
+ self.SetTabWidth(4) # Proscribed tab size for wx
556
+ self.SetUseTabs(False) # Use spaces rather than tabs, or
557
+ # TabTimmy will complain!
558
+ # White space
559
+ self.SetViewWhiteSpace(False) # Don't view white space
560
+
561
+ # EOL: Since we are loading/saving ourselves, and the
562
+ # strings will always have \n's in them, set the STC to
563
+ # edit them that way.
564
+ self.SetEOLMode(wx.stc.STC_EOL_LF)
565
+ self.SetViewEOL(False)
566
+
567
+ # No right-edge mode indicator
568
+ self.SetEdgeMode(stc.STC_EDGE_NONE)
569
+
570
+ # Setup a margin to hold fold markers
571
+ self.SetMarginType(2, stc.STC_MARGIN_SYMBOL)
572
+ self.SetMarginMask(2, stc.STC_MASK_FOLDERS)
573
+ self.SetMarginSensitive(2, True)
574
+ self.SetMarginWidth(2, 12)
575
+
576
+ # and now set up the fold markers
577
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_BOXPLUSCONNECTED, "white", "black")
578
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_BOXMINUSCONNECTED, "white", "black")
579
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNER, "white", "black")
580
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNER, "white", "black")
581
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "black")
582
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_BOXPLUS, "white", "black")
583
+ self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_BOXMINUS, "white", "black")
584
+
585
+ # Global default style
586
+ if wx.Platform == '__WXMSW__':
587
+ self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
588
+ 'fore:#000000,back:#FFFFFF,face:Courier New')
589
+ elif wx.Platform == '__WXMAC__':
590
+ # TODO: if this looks fine on Linux too, remove the Mac-specific case
591
+ # and use this whenever OS != MSW.
592
+ self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
593
+ 'fore:#000000,back:#FFFFFF,face:Monaco')
594
+ else:
595
+ defsize = wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT).GetPointSize()
596
+ self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
597
+ 'fore:#000000,back:#FFFFFF,face:Courier,size:%d'%defsize)
598
+
599
+ # Clear styles and revert to default.
600
+ self.StyleClearAll()
601
+
602
+ # Following style specs only indicate differences from default.
603
+ # The rest remains unchanged.
604
+
605
+ # Line numbers in margin
606
+ self.StyleSetSpec(wx.stc.STC_STYLE_LINENUMBER,'fore:#000000,back:#99A9C2')
607
+ # Highlighted brace
608
+ self.StyleSetSpec(wx.stc.STC_STYLE_BRACELIGHT,'fore:#00009D,back:#FFFF00')
609
+ # Unmatched brace
610
+ self.StyleSetSpec(wx.stc.STC_STYLE_BRACEBAD,'fore:#00009D,back:#FF0000')
611
+ # Indentation guide
612
+ self.StyleSetSpec(wx.stc.STC_STYLE_INDENTGUIDE, "fore:#CDCDCD")
613
+
614
+ # Python styles
615
+ self.StyleSetSpec(wx.stc.STC_P_DEFAULT, 'fore:#000000')
616
+ # Comments
617
+ self.StyleSetSpec(wx.stc.STC_P_COMMENTLINE, 'fore:#008000,back:#F0FFF0')
618
+ self.StyleSetSpec(wx.stc.STC_P_COMMENTBLOCK, 'fore:#008000,back:#F0FFF0')
619
+ # Numbers
620
+ self.StyleSetSpec(wx.stc.STC_P_NUMBER, 'fore:#008080')
621
+ # Strings and characters
622
+ self.StyleSetSpec(wx.stc.STC_P_STRING, 'fore:#800080')
623
+ self.StyleSetSpec(wx.stc.STC_P_CHARACTER, 'fore:#800080')
624
+ # Keywords
625
+ self.StyleSetSpec(wx.stc.STC_P_WORD, 'fore:#000080,bold')
626
+ # Triple quotes
627
+ self.StyleSetSpec(wx.stc.STC_P_TRIPLE, 'fore:#800080,back:#FFFFEA')
628
+ self.StyleSetSpec(wx.stc.STC_P_TRIPLEDOUBLE, 'fore:#800080,back:#FFFFEA')
629
+ # Class names
630
+ self.StyleSetSpec(wx.stc.STC_P_CLASSNAME, 'fore:#0000FF,bold')
631
+ # Function names
632
+ self.StyleSetSpec(wx.stc.STC_P_DEFNAME, 'fore:#008080,bold')
633
+ # Operators
634
+ self.StyleSetSpec(wx.stc.STC_P_OPERATOR, 'fore:#800000,bold')
635
+ # Identifiers. I leave this as not bold because everything seems
636
+ # to be an identifier if it doesn't match the above criterae
637
+ self.StyleSetSpec(wx.stc.STC_P_IDENTIFIER, 'fore:#000000')
638
+
639
+ # Caret color
640
+ self.SetCaretForeground("BLUE")
641
+ # Selection background
642
+ self.SetSelBackground(1, '#66CCFF')
643
+
644
+ # Attempt to set caret blink rate.
645
+ try:
646
+ self.SetCaretPeriod(GetCaretPeriod(self))
647
+ except ValueError:
648
+ pass
649
+
650
+ self.SetSelBackground(True, wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT))
651
+ self.SetSelForeground(True, wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))
652
+
653
+ def RegisterModifiedEvent(self, eventHandler):
654
+ self.Bind(wx.stc.EVT_STC_CHANGE, eventHandler)
655
+
656
+
657
+ except ImportError:
658
+ class DemoCodeEditor(wx.TextCtrl):
659
+ def __init__(self, parent):
660
+ wx.TextCtrl.__init__(self, parent, -1, style =
661
+ wx.TE_MULTILINE | wx.HSCROLL | wx.TE_RICH2 | wx.TE_NOHIDESEL)
662
+
663
+ def RegisterModifiedEvent(self, eventHandler):
664
+ self.Bind(wx.EVT_TEXT, eventHandler)
665
+
666
+ def SetReadOnly(self, flag):
667
+ self.SetEditable(not flag)
668
+ # NOTE: STC already has this method
669
+
670
+ def GetText(self):
671
+ return self.GetValue()
672
+
673
+ def GetPositionFromLine(self, line):
674
+ return self.XYToPosition(0,line)
675
+
676
+ def GotoLine(self, line):
677
+ pos = self.GetPositionFromLine(line)
678
+ self.SetInsertionPoint(pos)
679
+ self.ShowPosition(pos)
680
+
681
+ def SelectLine(self, line):
682
+ start = self.GetPositionFromLine(line)
683
+ end = start + self.GetLineLength(line)
684
+ self.SetSelection(start, end)
685
+
686
+
687
+ #---------------------------------------------------------------------------
688
+ # Constants for module versions
689
+
690
+ modOriginal = 0
691
+ modModified = 1
692
+ modDefault = modOriginal
693
+
694
+ #---------------------------------------------------------------------------
695
+
696
+ class DemoCodePanel(wx.Panel):
697
+ """Panel for the 'Demo Code' tab"""
698
+ def __init__(self, parent, mainFrame):
699
+ wx.Panel.__init__(self, parent, size=(1,1))
700
+ if 'wxMSW' in wx.PlatformInfo:
701
+ self.Hide()
702
+ self.mainFrame = mainFrame
703
+ self.editor = DemoCodeEditor(self)
704
+ self.editor.RegisterModifiedEvent(self.OnCodeModified)
705
+
706
+ self.btnSave = wx.Button(self, -1, "Save Changes")
707
+ self.btnRestore = wx.Button(self, -1, "Delete Modified")
708
+ self.btnSave.Enable(False)
709
+ self.btnSave.Bind(wx.EVT_BUTTON, self.OnSave)
710
+ self.btnRestore.Bind(wx.EVT_BUTTON, self.OnRestore)
711
+
712
+ self.radioButtons = { modOriginal: wx.RadioButton(self, -1, "Original", style = wx.RB_GROUP),
713
+ modModified: wx.RadioButton(self, -1, "Modified") }
714
+
715
+ self.controlBox = wx.BoxSizer(wx.HORIZONTAL)
716
+ self.controlBox.Add(wx.StaticText(self, -1, "Active Version:"), 0,
717
+ wx.RIGHT | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
718
+ for modID, radioButton in self.radioButtons.items():
719
+ self.controlBox.Add(radioButton, 0, wx.EXPAND | wx.RIGHT, 5)
720
+ radioButton.modID = modID # makes it easier for the event handler
721
+ radioButton.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton)
722
+
723
+ self.controlBox.Add(self.btnSave, 0, wx.RIGHT, 5)
724
+ self.controlBox.Add(self.btnRestore, 0)
725
+
726
+ self.box = wx.BoxSizer(wx.VERTICAL)
727
+ self.box.Add(self.controlBox, 0, wx.EXPAND)
728
+ self.box.Add(wx.StaticLine(self), 0, wx.EXPAND)
729
+ self.box.Add(self.editor, 1, wx.EXPAND)
730
+
731
+ self.box.Fit(self)
732
+ self.SetSizer(self.box)
733
+
734
+
735
+ # Loads a demo from a DemoModules object
736
+ def LoadDemo(self, demoModules):
737
+ self.demoModules = demoModules
738
+ if (modDefault == modModified) and demoModules.Exists(modModified):
739
+ demoModules.SetActive(modModified)
740
+ else:
741
+ demoModules.SetActive(modOriginal)
742
+ self.radioButtons[demoModules.GetActiveID()].Enable(True)
743
+ self.ActiveModuleChanged()
744
+
745
+
746
+ def ActiveModuleChanged(self):
747
+ self.LoadDemoSource(self.demoModules.GetSource())
748
+ self.UpdateControlState()
749
+ self.mainFrame.pnl.Freeze()
750
+ self.ReloadDemo()
751
+ self.mainFrame.pnl.Thaw()
752
+
753
+
754
+ def LoadDemoSource(self, source):
755
+ self.editor.Clear()
756
+ self.editor.SetValue(source)
757
+ self.JumpToLine(0)
758
+ self.btnSave.Enable(False)
759
+
760
+
761
+ def JumpToLine(self, line, highlight=False):
762
+ self.editor.GotoLine(line)
763
+ self.editor.SetFocus()
764
+ if highlight:
765
+ self.editor.SelectLine(line)
766
+
767
+
768
+ def UpdateControlState(self):
769
+ active = self.demoModules.GetActiveID()
770
+ # Update the radio/restore buttons
771
+ for moduleID in self.radioButtons:
772
+ btn = self.radioButtons[moduleID]
773
+ if moduleID == active:
774
+ btn.SetValue(True)
775
+ else:
776
+ btn.SetValue(False)
777
+
778
+ if self.demoModules.Exists(moduleID):
779
+ btn.Enable(True)
780
+ if moduleID == modModified:
781
+ self.btnRestore.Enable(True)
782
+ else:
783
+ btn.Enable(False)
784
+ if moduleID == modModified:
785
+ self.btnRestore.Enable(False)
786
+
787
+
788
+ def OnRadioButton(self, event):
789
+ radioSelected = event.GetEventObject()
790
+ modSelected = radioSelected.modID
791
+ if modSelected != self.demoModules.GetActiveID():
792
+ busy = wx.BusyInfo("Reloading demo module...")
793
+ self.demoModules.SetActive(modSelected)
794
+ self.ActiveModuleChanged()
795
+
796
+
797
+ def ReloadDemo(self):
798
+ if self.demoModules.name != __name__:
799
+ self.mainFrame.RunModule()
800
+
801
+
802
+ def OnCodeModified(self, event):
803
+ self.btnSave.Enable(self.editor.IsModified())
804
+
805
+
806
+ def OnSave(self, event):
807
+ if self.demoModules.Exists(modModified):
808
+ if self.demoModules.GetActiveID() == modOriginal:
809
+ overwriteMsg = "You are about to overwrite an already existing modified copy\n" + \
810
+ "Do you want to continue?"
811
+ dlg = wx.MessageDialog(self, overwriteMsg, "wxPython Demo",
812
+ wx.YES_NO | wx.NO_DEFAULT| wx.ICON_EXCLAMATION)
813
+ result = dlg.ShowModal()
814
+ if result == wx.ID_NO:
815
+ return
816
+ dlg.Destroy()
817
+
818
+ self.demoModules.SetActive(modModified)
819
+ modifiedFilename = GetModifiedFilename(self.demoModules.name)
820
+
821
+ # Create the demo directory if one doesn't already exist
822
+ if not os.path.exists(GetModifiedDirectory()):
823
+ try:
824
+ os.makedirs(GetModifiedDirectory())
825
+ if not os.path.exists(GetModifiedDirectory()):
826
+ wx.LogMessage("BUG: Created demo directory but it still doesn't exist")
827
+ raise AssertionError
828
+ except:
829
+ wx.LogMessage("Error creating demo directory: %s" % GetModifiedDirectory())
830
+ return
831
+ else:
832
+ wx.LogMessage("Created directory for modified demos: %s" % GetModifiedDirectory())
833
+
834
+ # Save
835
+ source = self.editor.GetText()
836
+ with open(modifiedFilename, "wt") as f:
837
+ f.write(source)
838
+
839
+ busy = wx.BusyInfo("Reloading demo module...")
840
+ self.demoModules.LoadFromFile(modModified, modifiedFilename)
841
+ self.ActiveModuleChanged()
842
+
843
+ self.mainFrame.SetTreeModified(True)
844
+
845
+
846
+ def OnRestore(self, event): # Handles the "Delete Modified" button
847
+ modifiedFilename = GetModifiedFilename(self.demoModules.name)
848
+ self.demoModules.Delete(modModified)
849
+ os.unlink(modifiedFilename) # Delete the modified copy
850
+ busy = wx.BusyInfo("Reloading demo module...")
851
+
852
+ self.ActiveModuleChanged()
853
+
854
+ self.mainFrame.SetTreeModified(False)
855
+
856
+
857
+ #---------------------------------------------------------------------------
858
+
859
+ def opj(path):
860
+ """Convert paths to the platform-specific separator"""
861
+ st = os.path.join(*tuple(path.split('/')))
862
+ # HACK: on Linux, a leading / gets lost...
863
+ if path.startswith('/'):
864
+ st = '/' + st
865
+ return st
866
+
867
+
868
+ def GetDataDir():
869
+ """
870
+ Return the standard location on this platform for application data
871
+ """
872
+ sp = wx.StandardPaths.Get()
873
+ return sp.GetUserDataDir()
874
+
875
+
876
+ def GetModifiedDirectory():
877
+ """
878
+ Returns the directory where modified versions of the demo files
879
+ are stored
880
+ """
881
+ return os.path.join(GetDataDir(), "modified")
882
+
883
+
884
+ def GetModifiedFilename(name):
885
+ """
886
+ Returns the filename of the modified version of the specified demo
887
+ """
888
+ if not name.endswith(".py"):
889
+ name = name + ".py"
890
+ return os.path.join(GetModifiedDirectory(), name)
891
+
892
+
893
+ def GetOriginalFilename(name):
894
+ """
895
+ Returns the filename of the original version of the specified demo
896
+ """
897
+ if not name.endswith(".py"):
898
+ name = name + ".py"
899
+
900
+ if os.path.isfile(name):
901
+ return name
902
+
903
+ originalDir = os.getcwd()
904
+ listDir = os.listdir(originalDir)
905
+ # Loop over the content of the demo directory
906
+ for item in listDir:
907
+ if not os.path.isdir(item):
908
+ # Not a directory, continue
909
+ continue
910
+ dirFile = os.listdir(item)
911
+ # See if a file called "name" is there
912
+ if name in dirFile:
913
+ return os.path.join(item, name)
914
+
915
+ # We must return a string...
916
+ return ""
917
+
918
+
919
+ def DoesModifiedExist(name):
920
+ """Returns whether the specified demo has a modified copy"""
921
+ if os.path.exists(GetModifiedFilename(name)):
922
+ return True
923
+ else:
924
+ return False
925
+
926
+
927
+ def GetConfig():
928
+ if not os.path.exists(GetDataDir()):
929
+ os.makedirs(GetDataDir())
930
+
931
+ config = wx.FileConfig(
932
+ localFilename=os.path.join(GetDataDir(), "options"))
933
+ return config
934
+
935
+
936
+ def MakeDocDirs():
937
+
938
+ docDir = os.path.join(GetDataDir(), "docs")
939
+ if not os.path.exists(docDir):
940
+ os.makedirs(docDir)
941
+
942
+ for plat in _platformNames:
943
+ imageDir = os.path.join(docDir, "images", plat)
944
+ if not os.path.exists(imageDir):
945
+ os.makedirs(imageDir)
946
+
947
+
948
+ def GetDocFile():
949
+
950
+ docFile = os.path.join(GetDataDir(), "docs", "TrunkDocs.pkl")
951
+
952
+ return docFile
953
+
954
+
955
+ def GetDocImagesDir():
956
+
957
+ MakeDocDirs()
958
+ return os.path.join(GetDataDir(), "docs", "images")
959
+
960
+
961
+ def SearchDemo(name, keyword):
962
+ """ Returns whether a demo contains the search keyword or not. """
963
+ with open(GetOriginalFilename(name), "rt") as fid:
964
+ fullText = fid.read()
965
+
966
+ if six.PY2:
967
+ fullText = fullText.decode("iso-8859-1")
968
+
969
+ if fullText.find(keyword) >= 0:
970
+ return True
971
+
972
+ return False
973
+
974
+
975
+ def HuntExternalDemos():
976
+ """
977
+ Searches for external demos (i.e. packages like AGW) in the wxPython
978
+ demo sub-directories. In order to be found, these external packages
979
+ must have a __demo__.py file in their directory.
980
+ """
981
+
982
+ externalDemos = {}
983
+ originalDir = os.getcwd()
984
+ listDir = os.listdir(originalDir)
985
+ # Loop over the content of the demo directory
986
+ for item in listDir:
987
+ if not os.path.isdir(item):
988
+ # Not a directory, continue
989
+ continue
990
+ dirFile = os.listdir(item)
991
+ # See if a __demo__.py file is there
992
+ if "__demo__.py" in dirFile:
993
+ # Extend sys.path and import the external demos
994
+ sys.path.append(item)
995
+ externalDemos[item] = __import__("__demo__")
996
+
997
+ if not externalDemos:
998
+ # Nothing to import...
999
+ return {}
1000
+
1001
+ # Modify the tree items and icons
1002
+ index = 0
1003
+ for category, demos in _treeList:
1004
+ # We put the external packages right before the
1005
+ # More Windows/Controls item
1006
+ if category == "More Windows/Controls":
1007
+ break
1008
+ index += 1
1009
+
1010
+ # Sort and reverse the external demos keys so that they
1011
+ # come back in alphabetical order
1012
+ keys = sorted(externalDemos, reverse=True)
1013
+ # Loop over all external packages
1014
+ for extern in keys:
1015
+ package = externalDemos[extern]
1016
+ # Insert a new package in the _treeList of demos
1017
+ _treeList.insert(index, package.GetDemos())
1018
+ # Get the recent additions for this package
1019
+ _treeList[0][1].extend(package.GetRecentAdditions())
1020
+ # Extend the demo bitmaps and the catalog
1021
+ _demoPngs.insert(index+1, extern)
1022
+ images.catalog[extern] = package.GetDemoBitmap()
1023
+
1024
+ # That's all folks...
1025
+ return externalDemos
1026
+
1027
+
1028
+ def LookForExternals(externalDemos, demoName):
1029
+ """
1030
+ Checks if a demo name is in any of the external packages (like AGW) or
1031
+ if the user clicked on one of the external packages parent items in the
1032
+ tree, in which case it returns the html overview for the package.
1033
+ """
1034
+
1035
+ pkg = overview = None
1036
+ # Loop over all the external demos
1037
+ for key, package in externalDemos.items():
1038
+ # Get the tree item name for the package and its demos
1039
+ treeName, treeDemos = package.GetDemos()
1040
+ # Get the overview for the package
1041
+ treeOverview = package.GetOverview()
1042
+ if treeName == demoName:
1043
+ # The user clicked on the parent tree item, return the overview
1044
+ return pkg, treeOverview
1045
+ elif demoName in treeDemos:
1046
+ # The user clicked on a real demo, return the package
1047
+ return key, overview
1048
+
1049
+ # No match found, return None for both
1050
+ return pkg, overview
1051
+
1052
+ #---------------------------------------------------------------------------
1053
+
1054
+ class ModuleDictWrapper(object):
1055
+ """Emulates a module with a dynamically compiled __dict__"""
1056
+ def __init__(self, dict):
1057
+ self.dict = dict
1058
+
1059
+ def __getattr__(self, name):
1060
+ if name in self.dict:
1061
+ return self.dict[name]
1062
+ else:
1063
+ raise AttributeError
1064
+
1065
+ class DemoModules(object):
1066
+ """
1067
+ Dynamically manages the original/modified versions of a demo
1068
+ module
1069
+ """
1070
+ def __init__(self, name):
1071
+ self.modActive = -1
1072
+ self.name = name
1073
+
1074
+ # (dict , source , filename , description , error information )
1075
+ # ( 0 , 1 , 2 , 3 , 4 )
1076
+ self.modules = [[dict(), "" , "" , "<original>" , None],
1077
+ [dict(), "" , "" , "<modified>" , None]]
1078
+
1079
+ getcwd = os.getcwd if six.PY3 else os.getcwdu
1080
+ for i in [modOriginal, modModified]:
1081
+ self.modules[i][0]['__file__'] = \
1082
+ os.path.join(getcwd(), GetOriginalFilename(name))
1083
+
1084
+ # load original module
1085
+ self.LoadFromFile(modOriginal, GetOriginalFilename(name))
1086
+ self.SetActive(modOriginal)
1087
+
1088
+ # load modified module (if one exists)
1089
+ if DoesModifiedExist(name):
1090
+ self.LoadFromFile(modModified, GetModifiedFilename(name))
1091
+
1092
+
1093
+ def LoadFromFile(self, modID, filename):
1094
+ self.modules[modID][2] = filename
1095
+ with open(filename, "rt") as file_:
1096
+ self.LoadFromSource(modID, file_.read())
1097
+
1098
+ def LoadFromSource(self, modID, source):
1099
+ self.modules[modID][1] = source
1100
+ self.LoadDict(modID)
1101
+
1102
+ def LoadDict(self, modID):
1103
+ if self.name != __name__:
1104
+ source = self.modules[modID][1]
1105
+ description = self.modules[modID][2]
1106
+ if six.PY2:
1107
+ description = description.encode(sys.getfilesystemencoding())
1108
+
1109
+ try:
1110
+ code = compile(source, description, "exec")
1111
+ exec_(code, self.modules[modID][0])
1112
+ except:
1113
+ self.modules[modID][4] = DemoError(sys.exc_info())
1114
+ self.modules[modID][0] = None
1115
+ else:
1116
+ self.modules[modID][4] = None
1117
+
1118
+
1119
+ def SetActive(self, modID):
1120
+ if modID != modOriginal and modID != modModified:
1121
+ raise LookupError
1122
+ else:
1123
+ self.modActive = modID
1124
+
1125
+
1126
+ def GetActive(self):
1127
+ dict = self.modules[self.modActive][0]
1128
+ if dict is None:
1129
+ return None
1130
+ else:
1131
+ return ModuleDictWrapper(dict)
1132
+
1133
+
1134
+ def GetActiveID(self):
1135
+ return self.modActive
1136
+
1137
+
1138
+ def GetSource(self, modID = None):
1139
+ if modID is None:
1140
+ modID = self.modActive
1141
+ return self.modules[modID][1]
1142
+
1143
+
1144
+ def GetFilename(self, modID = None):
1145
+ if modID is None:
1146
+ modID = self.modActive
1147
+ return self.modules[self.modActive][2]
1148
+
1149
+
1150
+ def GetErrorInfo(self, modID = None):
1151
+ if modID is None:
1152
+ modID = self.modActive
1153
+ return self.modules[self.modActive][4]
1154
+
1155
+
1156
+ def Exists(self, modID):
1157
+ return self.modules[modID][1] != ""
1158
+
1159
+
1160
+ def UpdateFile(self, modID = None):
1161
+ """Updates the file from which a module was loaded
1162
+ with (possibly updated) source"""
1163
+ if modID is None:
1164
+ modID = self.modActive
1165
+
1166
+ source = self.modules[modID][1]
1167
+ filename = self.modules[modID][2]
1168
+ with open(filename, "wt") as file_:
1169
+ file_.write(source)
1170
+
1171
+ def Delete(self, modID):
1172
+ if self.modActive == modID:
1173
+ self.SetActive(0)
1174
+
1175
+ self.modules[modID][0] = None
1176
+ self.modules[modID][1] = ""
1177
+ self.modules[modID][2] = ""
1178
+
1179
+
1180
+ #---------------------------------------------------------------------------
1181
+
1182
+ class DemoError(object):
1183
+ """Wraps and stores information about the current exception"""
1184
+ def __init__(self, exc_info):
1185
+ import copy
1186
+
1187
+ excType, excValue = exc_info[:2]
1188
+ # traceback list entries: (filename, line number, function name, text)
1189
+ self.traceback = traceback.extract_tb(exc_info[2])
1190
+
1191
+ # --Based on traceback.py::format_exception_only()--
1192
+ if isinstance(excType, type):
1193
+ self.exception_type = excType.__name__
1194
+ else:
1195
+ self.exception_type = excType
1196
+
1197
+ # If it's a syntax error, extra information needs
1198
+ # to be added to the traceback
1199
+ if excType is SyntaxError:
1200
+ try:
1201
+ msg, (filename, lineno, self.offset, line) = excValue
1202
+ except:
1203
+ pass
1204
+ else:
1205
+ if not filename:
1206
+ filename = "<string>"
1207
+ line = line.strip()
1208
+ self.traceback.append( (filename, lineno, "", line) )
1209
+ excValue = msg
1210
+ try:
1211
+ self.exception_details = str(excValue)
1212
+ except:
1213
+ self.exception_details = "<unprintable %s object>" & type(excValue).__name__
1214
+
1215
+ del exc_info
1216
+
1217
+ def __str__(self):
1218
+ ret = "Type %s \n \
1219
+ Traceback: %s \n \
1220
+ Details : %s" % ( str(self.exception_type), str(self.traceback), self.exception_details )
1221
+ return ret
1222
+
1223
+ #---------------------------------------------------------------------------
1224
+
1225
+ class DemoErrorPanel(wx.Panel):
1226
+ """Panel put into the demo tab when the demo fails to run due to errors"""
1227
+
1228
+ def __init__(self, parent, codePanel, demoError, log):
1229
+ wx.Panel.__init__(self, parent, -1)#, style=wx.NO_FULL_REPAINT_ON_RESIZE)
1230
+ self.codePanel = codePanel
1231
+ self.nb = parent
1232
+ self.log = log
1233
+
1234
+ self.box = wx.BoxSizer(wx.VERTICAL)
1235
+
1236
+ # Main Label
1237
+ self.box.Add(wx.StaticText(self, -1, "An error has occurred while trying to run the demo")
1238
+ , 0, wx.ALIGN_CENTER | wx.TOP, 10)
1239
+
1240
+ # Exception Information
1241
+ boxInfo = wx.StaticBox(self, -1, "Exception Info" )
1242
+ boxInfoSizer = wx.StaticBoxSizer(boxInfo, wx.VERTICAL ) # Used to center the grid within the box
1243
+ boxInfoGrid = wx.FlexGridSizer( cols=2 )
1244
+ textFlags = wx.ALIGN_RIGHT | wx.LEFT | wx.RIGHT | wx.TOP
1245
+ boxInfoGrid.Add(wx.StaticText(self, -1, "Type: "), 0, textFlags, 5 )
1246
+ boxInfoGrid.Add(wx.StaticText(self, -1, str(demoError.exception_type)) , 0, textFlags, 5 )
1247
+ boxInfoGrid.Add(wx.StaticText(self, -1, "Details: ") , 0, textFlags, 5 )
1248
+ boxInfoGrid.Add(wx.StaticText(self, -1, demoError.exception_details) , 0, textFlags, 5 )
1249
+ boxInfoSizer.Add(boxInfoGrid, 0, wx.ALIGN_CENTRE | wx.ALL, 5 )
1250
+ self.box.Add(boxInfoSizer, 0, wx.ALIGN_CENTER | wx.ALL, 5)
1251
+
1252
+ # Set up the traceback list
1253
+ # This one automatically resizes last column to take up remaining space
1254
+ from ListCtrl import TestListCtrl
1255
+ self.list = TestListCtrl(self, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
1256
+ self.list.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
1257
+ self.list.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
1258
+ self.list.InsertColumn(0, "Filename")
1259
+ self.list.InsertColumn(1, "Line", wx.LIST_FORMAT_RIGHT)
1260
+ self.list.InsertColumn(2, "Function")
1261
+ self.list.InsertColumn(3, "Code")
1262
+ self.InsertTraceback(self.list, demoError.traceback)
1263
+ self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE)
1264
+ self.list.SetColumnWidth(2, wx.LIST_AUTOSIZE)
1265
+ self.box.Add(wx.StaticText(self, -1, "Traceback:")
1266
+ , 0, wx.ALIGN_CENTER | wx.TOP, 5)
1267
+ self.box.Add(self.list, 1, wx.EXPAND | wx.ALL, 5)
1268
+ self.box.Add(wx.StaticText(self, -1, "Entries from the demo module are shown in blue\n"
1269
+ + "Double-click on them to go to the offending line")
1270
+ , 0, wx.ALIGN_CENTER | wx.BOTTOM, 5)
1271
+
1272
+ self.box.Fit(self)
1273
+ self.SetSizer(self.box)
1274
+
1275
+
1276
+ def InsertTraceback(self, list, traceback):
1277
+ #Add the traceback data
1278
+ for x in range(len(traceback)):
1279
+ data = traceback[x]
1280
+ list.InsertItem(x, os.path.basename(data[0])) # Filename
1281
+ list.SetItem(x, 1, str(data[1])) # Line
1282
+ list.SetItem(x, 2, str(data[2])) # Function
1283
+ list.SetItem(x, 3, str(data[3])) # Code
1284
+
1285
+ # Check whether this entry is from the demo module
1286
+ if data[0] == "<original>" or data[0] == "<modified>": # FIXME: make more generalised
1287
+ self.list.SetItemData(x, int(data[1])) # Store line number for easy access
1288
+ # Give it a blue colour
1289
+ item = self.list.GetItem(x)
1290
+ item.SetTextColour(wx.BLUE)
1291
+ self.list.SetItem(item)
1292
+ else:
1293
+ self.list.SetItemData(x, -1) # Editor can't jump into this one's code
1294
+
1295
+
1296
+ def OnItemSelected(self, event):
1297
+ # This occurs before OnDoubleClick and can be used to set the
1298
+ # currentItem. OnDoubleClick doesn't get a wxListEvent....
1299
+ self.currentItem = event.Index
1300
+ event.Skip()
1301
+
1302
+
1303
+ def OnDoubleClick(self, event):
1304
+ # If double-clicking on a demo's entry, jump to the line number
1305
+ line = self.list.GetItemData(self.currentItem)
1306
+ if line != -1:
1307
+ self.nb.SetSelection(1) # Switch to the code viewer tab
1308
+ wx.CallAfter(self.codePanel.JumpToLine, line-1, True)
1309
+ event.Skip()
1310
+
1311
+
1312
+ #---------------------------------------------------------------------------
1313
+
1314
+ class MainPanel(wx.Panel):
1315
+ """
1316
+ Just a simple derived panel where we override Freeze and Thaw to work
1317
+ around an issue on wxGTK.
1318
+ """
1319
+ def Freeze(self):
1320
+ if 'wxMSW' in wx.PlatformInfo:
1321
+ return super(MainPanel, self).Freeze()
1322
+
1323
+ def Thaw(self):
1324
+ if 'wxMSW' in wx.PlatformInfo:
1325
+ return super(MainPanel, self).Thaw()
1326
+
1327
+ #---------------------------------------------------------------------------
1328
+
1329
+ class DemoTaskBarIcon(TaskBarIcon):
1330
+ TBMENU_RESTORE = wx.NewIdRef()
1331
+ TBMENU_CLOSE = wx.NewIdRef()
1332
+ TBMENU_CHANGE = wx.NewIdRef()
1333
+ TBMENU_REMOVE = wx.NewIdRef()
1334
+
1335
+ def __init__(self, frame):
1336
+ TaskBarIcon.__init__(self, wx.adv.TBI_DOCK) # wx.adv.TBI_CUSTOM_STATUSITEM
1337
+ self.frame = frame
1338
+
1339
+ # Set the image
1340
+ icon = self.MakeIcon(images.WXPdemo.GetImage())
1341
+ self.SetIcon(icon, "wxPython Demo")
1342
+ self.imgidx = 1
1343
+
1344
+ # bind some events
1345
+ self.Bind(wx.adv.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate)
1346
+ self.Bind(wx.EVT_MENU, self.OnTaskBarActivate, id=self.TBMENU_RESTORE)
1347
+ self.Bind(wx.EVT_MENU, self.OnTaskBarClose, id=self.TBMENU_CLOSE)
1348
+ self.Bind(wx.EVT_MENU, self.OnTaskBarChange, id=self.TBMENU_CHANGE)
1349
+ self.Bind(wx.EVT_MENU, self.OnTaskBarRemove, id=self.TBMENU_REMOVE)
1350
+
1351
+
1352
+ def CreatePopupMenu(self):
1353
+ """
1354
+ This method is called by the base class when it needs to popup
1355
+ the menu for the default EVT_RIGHT_DOWN event. Just create
1356
+ the menu how you want it and return it from this function,
1357
+ the base class takes care of the rest.
1358
+ """
1359
+ menu = wx.Menu()
1360
+ menu.Append(self.TBMENU_RESTORE, "Restore wxPython Demo")
1361
+ menu.Append(self.TBMENU_CLOSE, "Close wxPython Demo")
1362
+ menu.AppendSeparator()
1363
+ menu.Append(self.TBMENU_CHANGE, "Change the TB Icon")
1364
+ menu.Append(self.TBMENU_REMOVE, "Remove the TB Icon")
1365
+ return menu
1366
+
1367
+
1368
+ def MakeIcon(self, img):
1369
+ """
1370
+ The various platforms have different requirements for the
1371
+ icon size...
1372
+ """
1373
+ if "wxMSW" in wx.PlatformInfo:
1374
+ img = img.Scale(16, 16)
1375
+ elif "wxGTK" in wx.PlatformInfo:
1376
+ img = img.Scale(22, 22)
1377
+ # wxMac can be any size up to 128x128, so leave the source img alone....
1378
+ icon = wx.Icon(img.ConvertToBitmap())
1379
+ return icon
1380
+
1381
+
1382
+ def OnTaskBarActivate(self, evt):
1383
+ if self.frame.IsIconized():
1384
+ self.frame.Iconize(False)
1385
+ if not self.frame.IsShown():
1386
+ self.frame.Show(True)
1387
+ self.frame.Raise()
1388
+
1389
+
1390
+ def OnTaskBarClose(self, evt):
1391
+ wx.CallAfter(self.frame.Close)
1392
+
1393
+
1394
+ def OnTaskBarChange(self, evt):
1395
+ names = [ "WXPdemo", "Mondrian", "Pencil", "Carrot" ]
1396
+ name = names[self.imgidx]
1397
+
1398
+ eImg = getattr(images, name)
1399
+ self.imgidx += 1
1400
+ if self.imgidx >= len(names):
1401
+ self.imgidx = 0
1402
+
1403
+ icon = self.MakeIcon(eImg.Image)
1404
+ self.SetIcon(icon, "This is a new icon: " + name)
1405
+
1406
+
1407
+ def OnTaskBarRemove(self, evt):
1408
+ self.RemoveIcon()
1409
+
1410
+
1411
+ #---------------------------------------------------------------------------
1412
+ class wxPythonDemo(wx.Frame):
1413
+
1414
+ overviewText = "wxPython Overview"
1415
+
1416
+ def __init__(self, parent, title):
1417
+ wx.Frame.__init__(self, parent, -1, title, size = (970, 720),
1418
+ style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
1419
+
1420
+ self.SetMinSize((640,480))
1421
+
1422
+ self.pnl = pnl = MainPanel(self)
1423
+
1424
+ self.mgr = aui.AuiManager()
1425
+ self.mgr.SetManagedWindow(pnl)
1426
+
1427
+ self.loaded = False
1428
+ self.cwd = os.getcwd()
1429
+ self.curOverview = ""
1430
+ self.demoPage = None
1431
+ self.codePage = None
1432
+ self.shell = None
1433
+ self.firstTime = True
1434
+ self.finddlg = None
1435
+
1436
+ icon = images.WXPdemo.GetIcon()
1437
+ self.SetIcon(icon)
1438
+
1439
+ try:
1440
+ self.tbicon = DemoTaskBarIcon(self)
1441
+ except:
1442
+ self.tbicon = None
1443
+
1444
+ self.otherWin = None
1445
+
1446
+ self.allowDocs = False
1447
+ self.downloading = False
1448
+ self.internetThread = None
1449
+ self.downloadImage = 2
1450
+ self.sendDownloadError = True
1451
+ self.downloadTimer = wx.Timer(self, wx.ID_ANY)
1452
+
1453
+ self.Bind(wx.EVT_IDLE, self.OnIdle)
1454
+ self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
1455
+ self.Bind(wx.EVT_ICONIZE, self.OnIconfiy)
1456
+ self.Bind(wx.EVT_MAXIMIZE, self.OnMaximize)
1457
+ self.Bind(wx.EVT_TIMER, self.OnDownloadTimer, self.downloadTimer)
1458
+
1459
+ self.Centre(wx.BOTH)
1460
+
1461
+ self.statusBar = self.CreateStatusBar(2)#, wx.ST_SIZEGRIP
1462
+ self.statusBar.SetStatusWidths([-2, -1])
1463
+
1464
+ statusText = "Welcome to wxPython %s" % wx.VERSION_STRING
1465
+ self.statusBar.SetStatusText(statusText, 0)
1466
+
1467
+ self.downloadGauge = wx.Gauge(self.statusBar, wx.ID_ANY, 50)
1468
+ self.downloadGauge.SetToolTip("Downloading Docs...")
1469
+ self.downloadGauge.Hide()
1470
+
1471
+ self.sizeChanged = False
1472
+ self.Reposition()
1473
+
1474
+ self.statusBar.Bind(wx.EVT_SIZE, self.OnStatusBarSize)
1475
+ self.statusBar.Bind(wx.EVT_IDLE, self.OnStatusBarIdle)
1476
+
1477
+ self.dying = False
1478
+ self.skipLoad = False
1479
+ self.allowAuiFloating = False
1480
+
1481
+ def EmptyHandler(evt): pass
1482
+
1483
+ self.ReadConfigurationFile()
1484
+ self.externalDemos = HuntExternalDemos()
1485
+
1486
+ # Create a Notebook
1487
+ self.nb = wx.Notebook(pnl, -1, style=wx.CLIP_CHILDREN)
1488
+ if 'wxMac' not in wx.PlatformInfo:
1489
+ imgList = wx.ImageList(16, 16)
1490
+ for png in ["overview", "code", "demo"]:
1491
+ bmp = images.catalog[png].GetBitmap()
1492
+ imgList.Add(bmp)
1493
+ for indx in range(9):
1494
+ bmp = images.catalog["spinning_nb%d"%indx].GetBitmap()
1495
+ imgList.Add(bmp)
1496
+ self.nb.AssignImageList(imgList)
1497
+
1498
+ self.BuildMenuBar()
1499
+
1500
+ self.finddata = wx.FindReplaceData()
1501
+ self.finddata.SetFlags(wx.FR_DOWN)
1502
+
1503
+ # Create a TreeCtrl
1504
+ leftPanel = wx.Panel(pnl, style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN)
1505
+ self.treeMap = {}
1506
+ self.searchItems = {}
1507
+
1508
+ self.tree = wxPythonDemoTree(leftPanel)
1509
+
1510
+ self.filter = wx.SearchCtrl(leftPanel, style=wx.TE_PROCESS_ENTER)
1511
+ self.filter.ShowCancelButton(True)
1512
+ self.filter.Bind(wx.EVT_TEXT, self.RecreateTree)
1513
+ self.filter.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN,
1514
+ lambda e: self.filter.SetValue(''))
1515
+ self.filter.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
1516
+
1517
+ if 'gtk3' in wx.PlatformInfo:
1518
+ # Something is wrong with the bestsize of the SearchCtrl, so for now
1519
+ # let's set it based on the size of a TextCtrl.
1520
+ txt = wx.TextCtrl(leftPanel)
1521
+ bs = txt.GetBestSize()
1522
+ txt.DestroyLater()
1523
+ self.filter.SetMinSize((-1, bs.height+4))
1524
+
1525
+ searchMenu = wx.Menu()
1526
+ item = searchMenu.AppendRadioItem(-1, "Sample Name")
1527
+ self.Bind(wx.EVT_MENU, self.OnSearchMenu, item)
1528
+ item = searchMenu.AppendRadioItem(-1, "Sample Content")
1529
+ self.Bind(wx.EVT_MENU, self.OnSearchMenu, item)
1530
+ self.filter.SetMenu(searchMenu)
1531
+
1532
+ self.RecreateTree()
1533
+ self.tree.SetExpansionState(self.expansionState)
1534
+ self.tree.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded)
1535
+ self.tree.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnItemCollapsed)
1536
+ self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged)
1537
+ self.tree.Bind(wx.EVT_LEFT_DOWN, self.OnTreeLeftDown)
1538
+
1539
+ # Set up a wx.html.HtmlWindow on the Overview Notebook page
1540
+ # we put it in a panel first because there seems to be a
1541
+ # refresh bug of some sort (wxGTK) when it is directly in
1542
+ # the notebook...
1543
+
1544
+ if 0: # the old way
1545
+ self.ovr = wx.html.HtmlWindow(self.nb, -1, size=(400, 400))
1546
+ self.nb.AddPage(self.ovr, self.overviewText, imageId=0)
1547
+
1548
+ else: # hopefully I can remove this hacky code soon, see SF bug #216861
1549
+ panel = wx.Panel(self.nb, -1, style=wx.CLIP_CHILDREN)
1550
+ self.ovr = wx.html.HtmlWindow(panel, -1, size=(400, 400))
1551
+ self.nb.AddPage(panel, self.overviewText, imageId=0)
1552
+
1553
+ def OnOvrSize(evt, ovr=self.ovr):
1554
+ ovr.SetSize(evt.GetSize())
1555
+ panel.Bind(wx.EVT_SIZE, OnOvrSize)
1556
+ panel.Bind(wx.EVT_ERASE_BACKGROUND, EmptyHandler)
1557
+
1558
+ if "gtk2" in wx.PlatformInfo or "gtk3" in wx.PlatformInfo:
1559
+ self.ovr.SetStandardFonts()
1560
+ self.SetOverview(self.overviewText, mainOverview)
1561
+
1562
+
1563
+ # Set up a log window
1564
+ self.log = wx.TextCtrl(pnl, -1,
1565
+ style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)
1566
+ if wx.Platform == "__WXMAC__":
1567
+ self.log.MacCheckSpelling(False)
1568
+
1569
+ # Set the wxWindows log target to be this textctrl
1570
+ #wx.Log.SetActiveTarget(wx.LogTextCtrl(self.log))
1571
+
1572
+ # But instead of the above we want to show how to use our own wx.Log class
1573
+ wx.Log.SetActiveTarget(MyLog(self.log))
1574
+
1575
+ # for serious debugging
1576
+ #wx.Log.SetActiveTarget(wx.LogStderr())
1577
+ #wx.Log.SetTraceMask(wx.TraceMessages)
1578
+
1579
+ self.Bind(wx.EVT_ACTIVATE, self.OnActivate)
1580
+ wx.GetApp().Bind(wx.EVT_ACTIVATE_APP, self.OnAppActivate)
1581
+
1582
+ # add the windows to the splitter and split it.
1583
+ leftBox = wx.BoxSizer(wx.VERTICAL)
1584
+ leftBox.Add(self.tree, 1, wx.EXPAND)
1585
+ leftBox.Add(wx.StaticText(leftPanel, label = "Filter Demos:"), 0, wx.TOP|wx.LEFT, 5)
1586
+ leftBox.Add(self.filter, 0, wx.EXPAND|wx.ALL, 5)
1587
+ if 'wxMac' in wx.PlatformInfo:
1588
+ leftBox.Add((5,5)) # Make sure there is room for the focus ring
1589
+ leftPanel.SetSizer(leftBox)
1590
+
1591
+ # select initial items
1592
+ self.nb.SetSelection(0)
1593
+ self.tree.SelectItem(self.root)
1594
+
1595
+ # Load 'Main' module
1596
+ self.LoadDemo(self.overviewText)
1597
+ self.loaded = True
1598
+
1599
+ # select some other initial module?
1600
+ if len(sys.argv) > 1:
1601
+ arg = sys.argv[1]
1602
+ if arg.endswith('.py'):
1603
+ arg = arg[:-3]
1604
+ selectedDemo = self.treeMap.get(arg, None)
1605
+ if selectedDemo:
1606
+ self.tree.SelectItem(selectedDemo)
1607
+ self.tree.EnsureVisible(selectedDemo)
1608
+
1609
+ # Use the aui manager to set up everything
1610
+ self.mgr.AddPane(self.nb, aui.AuiPaneInfo().CenterPane().Name("Notebook"))
1611
+ self.mgr.AddPane(leftPanel,
1612
+ aui.AuiPaneInfo().
1613
+ Left().Layer(2).BestSize((240, -1)).
1614
+ MinSize((240, -1)).
1615
+ Floatable(self.allowAuiFloating).FloatingSize((240, 700)).
1616
+ Caption("wxPython Demos").
1617
+ CloseButton(False).
1618
+ Name("DemoTree"))
1619
+ self.mgr.AddPane(self.log,
1620
+ aui.AuiPaneInfo().
1621
+ Bottom().BestSize((-1, 150)).
1622
+ MinSize((-1, 140)).
1623
+ Floatable(self.allowAuiFloating).FloatingSize((500, 160)).
1624
+ Caption("Demo Log Messages").
1625
+ CloseButton(False).
1626
+ Name("LogWindow"))
1627
+
1628
+ self.auiConfigurations[DEFAULT_PERSPECTIVE] = self.mgr.SavePerspective()
1629
+ self.mgr.Update()
1630
+
1631
+ self.mgr.SetAGWFlags(self.mgr.GetAGWFlags() ^ aui.AUI_MGR_TRANSPARENT_DRAG)
1632
+
1633
+
1634
+ def ReadConfigurationFile(self):
1635
+
1636
+ self.auiConfigurations = {}
1637
+ self.expansionState = [0, 1]
1638
+
1639
+ config = GetConfig()
1640
+ val = config.Read('ExpansionState')
1641
+ if val:
1642
+ self.expansionState = eval(val)
1643
+
1644
+ val = config.Read('AUIPerspectives')
1645
+ if val:
1646
+ self.auiConfigurations = eval(val)
1647
+
1648
+ val = config.Read('AllowDownloads')
1649
+ if val:
1650
+ self.allowDocs = eval(val)
1651
+
1652
+ val = config.Read('AllowAUIFloating')
1653
+ if val:
1654
+ self.allowAuiFloating = eval(val)
1655
+
1656
+ MakeDocDirs()
1657
+ pickledFile = GetDocFile()
1658
+
1659
+ if not os.path.isfile(pickledFile):
1660
+ self.pickledData = {}
1661
+ return
1662
+
1663
+ with open(pickledFile, "rb") as fid:
1664
+ try:
1665
+ self.pickledData = cPickle.load(fid)
1666
+ except:
1667
+ self.pickledData = {}
1668
+
1669
+ def BuildMenuBar(self):
1670
+
1671
+ # Make a File menu
1672
+ self.mainmenu = wx.MenuBar()
1673
+ menu = wx.Menu()
1674
+ item = menu.Append(-1, '&Redirect Output',
1675
+ 'Redirect print statements to a window',
1676
+ wx.ITEM_CHECK)
1677
+ self.Bind(wx.EVT_MENU, self.OnToggleRedirect, item)
1678
+
1679
+ exitItem = wx.MenuItem(menu, wx.ID_EXIT, 'E&xit\tCtrl-Q', 'Get the heck outta here!')
1680
+ exitItem.SetBitmap(images.catalog['exit'].GetBitmap())
1681
+ menu.Append(exitItem)
1682
+ self.Bind(wx.EVT_MENU, self.OnFileExit, exitItem)
1683
+ self.mainmenu.Append(menu, '&File')
1684
+
1685
+ # Make a Demo menu
1686
+ menu = wx.Menu()
1687
+ for indx, item in enumerate(_treeList[:-1]):
1688
+ menuItem = wx.MenuItem(menu, -1, item[0])
1689
+ submenu = wx.Menu()
1690
+ for childItem in item[1]:
1691
+ mi = submenu.Append(-1, childItem)
1692
+ self.Bind(wx.EVT_MENU, self.OnDemoMenu, mi)
1693
+ menuItem.SetBitmap(images.catalog[_demoPngs[indx+1]].GetBitmap())
1694
+ menuItem.SetSubMenu(submenu)
1695
+ menu.Append(menuItem)
1696
+ self.mainmenu.Append(menu, '&Demo')
1697
+
1698
+ # Make an Option menu
1699
+
1700
+ menu = wx.Menu()
1701
+ item = wx.MenuItem(menu, -1, 'Allow download of docs', 'Docs for window styles and events from the web', wx.ITEM_CHECK)
1702
+ menu.Append(item)
1703
+ item.Check(self.allowDocs)
1704
+ self.Bind(wx.EVT_MENU, self.OnAllowDownload, item)
1705
+
1706
+ item = wx.MenuItem(menu, -1, 'Delete saved docs', 'Deletes the cPickle file where docs are stored')
1707
+ item.SetBitmap(images.catalog['deletedocs'].GetBitmap())
1708
+ menu.Append(item)
1709
+ self.Bind(wx.EVT_MENU, self.OnDeleteDocs, item)
1710
+
1711
+ menu.AppendSeparator()
1712
+ item = wx.MenuItem(menu, -1, 'Allow floating panes', 'Allows the demo panes to be floated using wxAUI', wx.ITEM_CHECK)
1713
+ menu.Append(item)
1714
+ item.Check(self.allowAuiFloating)
1715
+ self.Bind(wx.EVT_MENU, self.OnAllowAuiFloating, item)
1716
+
1717
+ auiPerspectives = sorted(self.auiConfigurations)
1718
+ perspectivesMenu = wx.Menu()
1719
+ item = wx.MenuItem(perspectivesMenu, -1, DEFAULT_PERSPECTIVE, "Load startup default perspective", wx.ITEM_RADIO)
1720
+ self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item)
1721
+ perspectivesMenu.Append(item)
1722
+ for indx, key in enumerate(auiPerspectives):
1723
+ if key == DEFAULT_PERSPECTIVE:
1724
+ continue
1725
+ item = wx.MenuItem(perspectivesMenu, -1, key, "Load user perspective %d"%indx, wx.ITEM_RADIO)
1726
+ perspectivesMenu.Append(item)
1727
+ self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item)
1728
+
1729
+ menu.AppendSubMenu(perspectivesMenu, "&AUI Perspectives")
1730
+ self.perspectives_menu = perspectivesMenu
1731
+
1732
+ item = wx.MenuItem(menu, -1, 'Save Perspective', 'Save AUI perspective')
1733
+ item.SetBitmap(images.catalog['saveperspective'].GetBitmap())
1734
+ menu.Append(item)
1735
+ self.Bind(wx.EVT_MENU, self.OnSavePerspective, item)
1736
+
1737
+ item = wx.MenuItem(menu, -1, 'Delete Perspective', 'Delete AUI perspective')
1738
+ item.SetBitmap(images.catalog['deleteperspective'].GetBitmap())
1739
+ menu.Append(item)
1740
+ self.Bind(wx.EVT_MENU, self.OnDeletePerspective, item)
1741
+
1742
+ menu.AppendSeparator()
1743
+
1744
+ item = wx.MenuItem(menu, -1, 'Restore Tree Expansion', 'Restore the initial tree expansion state')
1745
+ item.SetBitmap(images.catalog['expansion'].GetBitmap())
1746
+ menu.Append(item)
1747
+ self.Bind(wx.EVT_MENU, self.OnTreeExpansion, item)
1748
+
1749
+ self.mainmenu.Append(menu, '&Options')
1750
+ self.options_menu = menu
1751
+
1752
+ # Make a Help menu
1753
+ menu = wx.Menu()
1754
+ findItem = wx.MenuItem(menu, -1, '&Find\tCtrl-F', 'Find in the Demo Code')
1755
+ findItem.SetBitmap(images.catalog['find'].GetBitmap())
1756
+ if 'wxMac' not in wx.PlatformInfo:
1757
+ findNextItem = wx.MenuItem(menu, -1, 'Find &Next\tF3', 'Find Next')
1758
+ else:
1759
+ findNextItem = wx.MenuItem(menu, -1, 'Find &Next\tCtrl-G', 'Find Next')
1760
+ findNextItem.SetBitmap(images.catalog['findnext'].GetBitmap())
1761
+ menu.Append(findItem)
1762
+ menu.Append(findNextItem)
1763
+ menu.AppendSeparator()
1764
+
1765
+ shellItem = wx.MenuItem(menu, -1, 'Open Py&Shell Window\tF5',
1766
+ 'An interactive interpreter window with the demo app and frame objects in the namesapce')
1767
+ shellItem.SetBitmap(images.catalog['pyshell'].GetBitmap())
1768
+ menu.Append(shellItem)
1769
+ inspToolItem = wx.MenuItem(menu, -1, 'Open &Widget Inspector\tF6',
1770
+ 'A tool that lets you browse the live widgets and sizers in an application')
1771
+ inspToolItem.SetBitmap(images.catalog['inspect'].GetBitmap())
1772
+ menu.Append(inspToolItem)
1773
+ if 'wxMac' not in wx.PlatformInfo:
1774
+ menu.AppendSeparator()
1775
+ helpItem = menu.Append(wx.ID_ABOUT, '&About wxPython Demo', 'wxPython RULES!!!')
1776
+
1777
+ self.Bind(wx.EVT_MENU, self.OnOpenShellWindow, shellItem)
1778
+ self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, inspToolItem)
1779
+ self.Bind(wx.EVT_MENU, self.OnHelpAbout, helpItem)
1780
+ self.Bind(wx.EVT_MENU, self.OnHelpFind, findItem)
1781
+ self.Bind(wx.EVT_MENU, self.OnFindNext, findNextItem)
1782
+ self.Bind(wx.EVT_FIND, self.OnFind)
1783
+ self.Bind(wx.EVT_FIND_NEXT, self.OnFind)
1784
+ self.Bind(wx.EVT_FIND_CLOSE, self.OnFindClose)
1785
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findItem)
1786
+ self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findNextItem)
1787
+ self.mainmenu.Append(menu, '&Help')
1788
+ self.SetMenuBar(self.mainmenu)
1789
+
1790
+ self.EnableAUIMenu()
1791
+
1792
+ if False:
1793
+ # This is another way to set Accelerators, in addition to
1794
+ # using the '\t<key>' syntax in the menu items.
1795
+ aTable = wx.AcceleratorTable([(wx.ACCEL_ALT, ord('X'), exitItem.GetId()),
1796
+ (wx.ACCEL_CTRL, ord('H'), helpItem.GetId()),
1797
+ (wx.ACCEL_CTRL, ord('F'), findItem.GetId()),
1798
+ (wx.ACCEL_NORMAL, wx.WXK_F3, findNextItem.GetId()),
1799
+ (wx.ACCEL_NORMAL, wx.WXK_F9, shellItem.GetId()),
1800
+ ])
1801
+ self.SetAcceleratorTable(aTable)
1802
+
1803
+
1804
+ #---------------------------------------------
1805
+ def RecreateTree(self, evt=None):
1806
+ # Catch the search type (name or content)
1807
+ searchMenu = self.filter.GetMenu().GetMenuItems()
1808
+ fullSearch = searchMenu[1].IsChecked()
1809
+
1810
+ if evt:
1811
+ if fullSearch:
1812
+ # Do not`scan all the demo files for every char
1813
+ # the user input, use wx.EVT_TEXT_ENTER instead
1814
+ return
1815
+
1816
+ expansionState = self.tree.GetExpansionState()
1817
+
1818
+ current = None
1819
+ item = self.tree.GetSelection()
1820
+ if item:
1821
+ prnt = self.tree.GetItemParent(item)
1822
+ if prnt:
1823
+ current = (self.tree.GetItemText(item),
1824
+ self.tree.GetItemText(prnt))
1825
+
1826
+ self.tree.Freeze()
1827
+ self.tree.DeleteAllItems()
1828
+ self.root = self.tree.AddRoot("wxPython Overview")
1829
+ self.tree.SetItemImage(self.root, 0)
1830
+ self.tree.SetItemData(self.root, 0)
1831
+
1832
+ treeFont = self.tree.GetFont()
1833
+ catFont = self.tree.GetFont()
1834
+
1835
+ # The native treectrl on MSW has a bug where it doesn't draw
1836
+ # all of the text for an item if the font is larger than the
1837
+ # default. It seems to be clipping the item's label as if it
1838
+ # was the size of the same label in the default font.
1839
+ if USE_CUSTOMTREECTRL or 'wxMSW' not in wx.PlatformInfo:
1840
+ treeFont.SetPointSize(treeFont.GetPointSize()+2)
1841
+
1842
+ treeFont.SetWeight(wx.FONTWEIGHT_BOLD)
1843
+ catFont.SetWeight(wx.FONTWEIGHT_BOLD)
1844
+ self.tree.SetItemFont(self.root, treeFont)
1845
+
1846
+ firstChild = None
1847
+ selectItem = None
1848
+ filter = self.filter.GetValue()
1849
+ count = 0
1850
+
1851
+ for category, items in _treeList:
1852
+ count += 1
1853
+ if filter:
1854
+ if fullSearch:
1855
+ items = self.searchItems[category]
1856
+ else:
1857
+ items = [item for item in items if filter.lower() in item.lower()]
1858
+ if items:
1859
+ child = self.tree.AppendItem(self.root, category, image=count)
1860
+ self.tree.SetItemFont(child, catFont)
1861
+ self.tree.SetItemData(child, count)
1862
+ if not firstChild: firstChild = child
1863
+ for childItem in items:
1864
+ image = count
1865
+ if DoesModifiedExist(childItem):
1866
+ image = len(_demoPngs)
1867
+ theDemo = self.tree.AppendItem(child, childItem, image=image)
1868
+ self.tree.SetItemData(theDemo, count)
1869
+ self.treeMap[childItem] = theDemo
1870
+ if current and (childItem, category) == current:
1871
+ selectItem = theDemo
1872
+
1873
+
1874
+ self.tree.Expand(self.root)
1875
+ if firstChild:
1876
+ self.tree.Expand(firstChild)
1877
+ if filter:
1878
+ self.tree.ExpandAll()
1879
+ elif expansionState:
1880
+ self.tree.SetExpansionState(expansionState)
1881
+ if selectItem:
1882
+ self.skipLoad = True
1883
+ self.tree.SelectItem(selectItem)
1884
+ self.skipLoad = False
1885
+
1886
+ self.tree.Thaw()
1887
+ self.searchItems = {}
1888
+
1889
+
1890
+ def OnStatusBarSize(self, evt):
1891
+ self.Reposition() # for normal size events
1892
+
1893
+ # Set a flag so the idle time handler will also do the repositioning.
1894
+ # It is done this way to get around a buglet where GetFieldRect is not
1895
+ # accurate during the EVT_SIZE resulting from a frame maximize.
1896
+ self.sizeChanged = True
1897
+
1898
+
1899
+ def OnStatusBarIdle(self, evt):
1900
+ if self.sizeChanged:
1901
+ self.Reposition()
1902
+
1903
+
1904
+ # reposition the download gauge
1905
+ def Reposition(self):
1906
+ # rect = self.statusBar.GetFieldRect(1)
1907
+ # self.downloadGauge.SetPosition((rect.x+2, rect.y+2))
1908
+ # self.downloadGauge.SetSize((rect.width-4, rect.height-4))
1909
+ self.sizeChanged = False
1910
+
1911
+
1912
+ def OnSearchMenu(self, event):
1913
+
1914
+ # Catch the search type (name or content)
1915
+ searchMenu = self.filter.GetMenu().GetMenuItems()
1916
+ fullSearch = searchMenu[1].IsChecked()
1917
+
1918
+ if fullSearch:
1919
+ self.OnSearch()
1920
+ else:
1921
+ self.RecreateTree()
1922
+
1923
+
1924
+ def OnSearch(self, event=None):
1925
+
1926
+ value = self.filter.GetValue()
1927
+ if not value:
1928
+ self.RecreateTree()
1929
+ return
1930
+
1931
+ wx.BeginBusyCursor()
1932
+
1933
+ for category, items in _treeList:
1934
+ self.searchItems[category] = []
1935
+ for childItem in items:
1936
+ if SearchDemo(childItem, value):
1937
+ self.searchItems[category].append(childItem)
1938
+
1939
+ wx.EndBusyCursor()
1940
+ self.RecreateTree()
1941
+
1942
+
1943
+ def SetTreeModified(self, modified):
1944
+ item = self.tree.GetSelection()
1945
+ if modified:
1946
+ image = len(_demoPngs)
1947
+ else:
1948
+ image = self.tree.GetItemData(item)
1949
+ self.tree.SetItemImage(item, image)
1950
+
1951
+
1952
+ def WriteText(self, text):
1953
+ if text[-1:] == '\n':
1954
+ text = text[:-1]
1955
+ wx.LogMessage(text)
1956
+
1957
+ def write(self, txt):
1958
+ self.WriteText(txt)
1959
+
1960
+ #---------------------------------------------
1961
+ def OnItemExpanded(self, event):
1962
+ item = event.GetItem()
1963
+ wx.LogMessage("OnItemExpanded: %s" % self.tree.GetItemText(item))
1964
+ event.Skip()
1965
+
1966
+ #---------------------------------------------
1967
+ def OnItemCollapsed(self, event):
1968
+ item = event.GetItem()
1969
+ wx.LogMessage("OnItemCollapsed: %s" % self.tree.GetItemText(item))
1970
+ event.Skip()
1971
+
1972
+ #---------------------------------------------
1973
+ def OnTreeLeftDown(self, event):
1974
+ # reset the overview text if the tree item is clicked on again
1975
+ pt = event.GetPosition()
1976
+ item, flags = self.tree.HitTest(pt)
1977
+ if item == self.tree.GetSelection():
1978
+ self.SetOverview(self.tree.GetItemText(item)+" Overview", self.curOverview)
1979
+ event.Skip()
1980
+
1981
+ #---------------------------------------------
1982
+ def OnSelChanged(self, event):
1983
+ if self.dying or not self.loaded or self.skipLoad:
1984
+ return
1985
+
1986
+ self.StopDownload()
1987
+
1988
+ item = event.GetItem()
1989
+ itemText = self.tree.GetItemText(item)
1990
+ self.LoadDemo(itemText)
1991
+
1992
+ self.StartDownload()
1993
+
1994
+ #---------------------------------------------
1995
+ def LoadDemo(self, demoName):
1996
+ try:
1997
+ wx.BeginBusyCursor()
1998
+ self.pnl.Freeze()
1999
+
2000
+ os.chdir(self.cwd)
2001
+ self.ShutdownDemoModule()
2002
+
2003
+ if demoName == self.overviewText:
2004
+ # User selected the "wxPython Overview" node
2005
+ # ie: _this_ module
2006
+ # Changing the main window at runtime not yet supported...
2007
+ self.demoModules = DemoModules(__name__)
2008
+ self.SetOverview(self.overviewText, mainOverview)
2009
+ self.LoadDemoSource()
2010
+ self.UpdateNotebook(0)
2011
+ else:
2012
+ if os.path.exists(GetOriginalFilename(demoName)):
2013
+ wx.LogMessage("Loading demo %s.py..." % demoName)
2014
+ self.demoModules = DemoModules(demoName)
2015
+ self.LoadDemoSource()
2016
+
2017
+ else:
2018
+
2019
+ package, overview = LookForExternals(self.externalDemos, demoName)
2020
+
2021
+ if package:
2022
+ wx.LogMessage("Loading demo %s.py..." % ("%s/%s"%(package, demoName)))
2023
+ self.demoModules = DemoModules("%s/%s"%(package, demoName))
2024
+ self.LoadDemoSource()
2025
+ elif overview:
2026
+ self.SetOverview(demoName, overview)
2027
+ self.codePage = None
2028
+ self.UpdateNotebook(0)
2029
+ else:
2030
+ self.SetOverview("wxPython", mainOverview)
2031
+ self.codePage = None
2032
+ self.UpdateNotebook(0)
2033
+
2034
+ finally:
2035
+ wx.EndBusyCursor()
2036
+ self.pnl.Thaw()
2037
+
2038
+ #---------------------------------------------
2039
+ def LoadDemoSource(self):
2040
+ self.codePage = None
2041
+ self.codePage = DemoCodePanel(self.nb, self)
2042
+ self.codePage.LoadDemo(self.demoModules)
2043
+
2044
+ #---------------------------------------------
2045
+ def RunModule(self):
2046
+ """Runs the active module"""
2047
+
2048
+ module = self.demoModules.GetActive()
2049
+ self.ShutdownDemoModule()
2050
+ overviewText = ""
2051
+
2052
+ # o The RunTest() for all samples must now return a window that can
2053
+ # be palced in a tab in the main notebook.
2054
+ # o If an error occurs (or has occurred before) an error tab is created.
2055
+
2056
+ if module is not None:
2057
+ wx.LogMessage("Running demo module...")
2058
+ if hasattr(module, "overview"):
2059
+ overviewText = module.overview
2060
+
2061
+ try:
2062
+ self.demoPage = module.runTest(self, self.nb, self)
2063
+ except:
2064
+ self.demoPage = DemoErrorPanel(self.nb, self.codePage,
2065
+ DemoError(sys.exc_info()), self)
2066
+
2067
+ bg = self.nb.GetThemeBackgroundColour()
2068
+ if bg:
2069
+ self.demoPage.SetBackgroundColour(bg)
2070
+
2071
+ assert self.demoPage is not None, "runTest must return a window!"
2072
+
2073
+ else:
2074
+ # There was a previous error in compiling or exec-ing
2075
+ self.demoPage = DemoErrorPanel(self.nb, self.codePage,
2076
+ self.demoModules.GetErrorInfo(), self)
2077
+
2078
+ self.SetOverview(self.demoModules.name + " Overview", overviewText)
2079
+
2080
+ if self.firstTime:
2081
+ # change to the demo page the first time a module is run
2082
+ self.UpdateNotebook(2)
2083
+ self.firstTime = False
2084
+ else:
2085
+ # otherwise just stay on the same tab in case the user has changed to another one
2086
+ self.UpdateNotebook()
2087
+
2088
+ #---------------------------------------------
2089
+ def ShutdownDemoModule(self):
2090
+ if self.demoPage:
2091
+ # inform the window that it's time to quit if it cares
2092
+ if hasattr(self.demoPage, "ShutdownDemo"):
2093
+ self.demoPage.ShutdownDemo()
2094
+ ## wx.YieldIfNeeded() # in case the page has pending events
2095
+ self.demoPage = None
2096
+
2097
+ #---------------------------------------------
2098
+ def UpdateNotebook(self, select = -1):
2099
+ nb = self.nb
2100
+ debug = False
2101
+ self.pnl.Freeze()
2102
+
2103
+ def UpdatePage(page, pageText):
2104
+ pageExists = False
2105
+ pagePos = -1
2106
+ for i in range(nb.GetPageCount()):
2107
+ if nb.GetPageText(i) == pageText:
2108
+ pageExists = True
2109
+ pagePos = i
2110
+ break
2111
+
2112
+ if page:
2113
+ if not pageExists:
2114
+ # Add a new page
2115
+ nb.AddPage(page, pageText, imageId=nb.GetPageCount())
2116
+ if debug: wx.LogMessage("DBG: ADDED %s" % pageText)
2117
+ else:
2118
+ if nb.GetPage(pagePos) != page:
2119
+ # Reload an existing page
2120
+ nb.DeletePage(pagePos)
2121
+ nb.InsertPage(pagePos, page, pageText, imageId=pagePos)
2122
+ if debug: wx.LogMessage("DBG: RELOADED %s" % pageText)
2123
+ else:
2124
+ # Excellent! No redraw/flicker
2125
+ if debug: wx.LogMessage("DBG: SAVED from reloading %s" % pageText)
2126
+ elif pageExists:
2127
+ # Delete a page
2128
+ nb.DeletePage(pagePos)
2129
+ if debug: wx.LogMessage("DBG: DELETED %s" % pageText)
2130
+ else:
2131
+ if debug: wx.LogMessage("DBG: STILL GONE - %s" % pageText)
2132
+
2133
+ if select == -1:
2134
+ select = nb.GetSelection()
2135
+
2136
+ UpdatePage(self.codePage, "Demo Code")
2137
+ UpdatePage(self.demoPage, "Demo")
2138
+
2139
+ if select >= 0 and select < nb.GetPageCount():
2140
+ nb.SetSelection(select)
2141
+
2142
+ self.pnl.Thaw()
2143
+
2144
+ #---------------------------------------------
2145
+ def SetOverview(self, name, text):
2146
+ self.curOverview = text
2147
+ lead = text[:6]
2148
+ if lead != '<html>' and lead != '<HTML>':
2149
+ text = '<br>'.join(text.split('\n'))
2150
+ # if wx.USE_UNICODE:
2151
+ # text = text.decode('iso8859_1')
2152
+ self.ovr.SetPage(text)
2153
+ self.nb.SetPageText(0, os.path.split(name)[1])
2154
+
2155
+ #---------------------------------------------
2156
+
2157
+ def StartDownload(self):
2158
+
2159
+ if self.downloading or not self.allowDocs:
2160
+ return
2161
+
2162
+ item = self.tree.GetSelection()
2163
+ if self.tree.ItemHasChildren(item):
2164
+ return
2165
+
2166
+ itemText = self.tree.GetItemText(item)
2167
+
2168
+ if itemText in self.pickledData:
2169
+ self.LoadDocumentation(self.pickledData[itemText])
2170
+ return
2171
+
2172
+ text = self.curOverview
2173
+ text += "<br><p><b>Checking for documentation on the wxWidgets website, please stand by...</b><br>"
2174
+
2175
+ lead = text[:6]
2176
+ if lead != '<html>' and lead != '<HTML>':
2177
+ text = '<br>'.join(text.split('\n'))
2178
+
2179
+ self.ovr.SetPage(text)
2180
+
2181
+ self.downloadTimer.Start(100)
2182
+ self.downloadGauge.Show()
2183
+ self.Reposition()
2184
+ self.downloading = True
2185
+ self.internetThread = InternetThread(self, itemText)
2186
+
2187
+ #---------------------------------------------
2188
+
2189
+ def StopDownload(self, error=None):
2190
+
2191
+ self.downloadTimer.Stop()
2192
+
2193
+ if not self.downloading:
2194
+ return
2195
+
2196
+ if error:
2197
+ if self.sendDownloadError:
2198
+ self.log.AppendText("Warning: problems in downloading documentation from the wxWidgets website.\n")
2199
+ self.log.AppendText("Error message from the documentation downloader was:\n")
2200
+ self.log.AppendText("\n".join(error))
2201
+ self.sendDownloadError = False
2202
+
2203
+ self.nb.SetPageImage(0, 0)
2204
+
2205
+ self.internetThread.keepRunning = False
2206
+ self.internetThread = None
2207
+
2208
+ self.downloading = False
2209
+ self.downloadGauge.Hide()
2210
+ self.Reposition()
2211
+
2212
+ text = self.curOverview
2213
+
2214
+ lead = text[:6]
2215
+ if lead != '<html>' and lead != '<HTML>':
2216
+ text = '<br>'.join(text.split('\n'))
2217
+
2218
+ self.ovr.SetPage(text)
2219
+
2220
+ #---------------------------------------------
2221
+
2222
+ def LoadDocumentation(self, data):
2223
+
2224
+ text = self.curOverview
2225
+ addHtml = False
2226
+
2227
+ if '<html>' not in text and '<HTML>' not in text:
2228
+ text = '<br>'.join(text.split('\n'))
2229
+
2230
+ styles, events, extra, appearance = data
2231
+
2232
+ if appearance:
2233
+ text += FormatImages(appearance)
2234
+
2235
+ for names, values in zip(["Styles", "Extra Styles", "Events"], [styles, extra, events]):
2236
+ if not values:
2237
+ continue
2238
+
2239
+ headers = (names == "Events" and [2] or [3])[0]
2240
+ text += "<p>" + FormatDocs(names, values, headers)
2241
+
2242
+ item = self.tree.GetSelection()
2243
+ itemText = self.tree.GetItemText(item)
2244
+
2245
+ self.pickledData[itemText] = data
2246
+
2247
+ if six.PY2:
2248
+ # TODO: verify that this encoding is correct
2249
+ text = text.decode('iso8859_1')
2250
+
2251
+ self.StopDownload()
2252
+ self.ovr.SetPage(text)
2253
+ #print("load time: ", time.time() - start)
2254
+
2255
+ # Menu methods
2256
+ def OnFileExit(self, *event):
2257
+ self.Close()
2258
+
2259
+ def OnToggleRedirect(self, event):
2260
+ app = wx.GetApp()
2261
+ if event.IsChecked():
2262
+ app.RedirectStdio()
2263
+ print("Print statements and other standard output will now be directed to this window.")
2264
+ else:
2265
+ app.RestoreStdio()
2266
+ print("Print statements and other standard output will now be sent to the usual location.")
2267
+
2268
+
2269
+ def OnAllowDownload(self, event):
2270
+
2271
+ self.allowDocs = event.IsChecked()
2272
+ if self.allowDocs:
2273
+ self.StartDownload()
2274
+ else:
2275
+ self.StopDownload()
2276
+
2277
+
2278
+ def OnDeleteDocs(self, event):
2279
+
2280
+ deleteMsg = "You are about to delete the downloaded documentation.\n" + \
2281
+ "Do you want to continue?"
2282
+ dlg = wx.MessageDialog(self, deleteMsg, "wxPython Demo",
2283
+ wx.YES_NO | wx.NO_DEFAULT| wx.ICON_QUESTION)
2284
+ result = dlg.ShowModal()
2285
+ if result == wx.ID_NO:
2286
+ dlg.Destroy()
2287
+ return
2288
+
2289
+ dlg.Destroy()
2290
+
2291
+ busy = wx.BusyInfo("Deleting downloaded data...")
2292
+ wx.SafeYield()
2293
+
2294
+ pickledFile = GetDocFile()
2295
+ docDir = os.path.split(pickledFile)[0]
2296
+
2297
+ if os.path.exists(docDir):
2298
+ shutil.rmtree(docDir, ignore_errors=True)
2299
+
2300
+ self.pickledData = {}
2301
+ del busy
2302
+ self.sendDownloadError = True
2303
+
2304
+
2305
+ def OnAllowAuiFloating(self, event):
2306
+
2307
+ self.allowAuiFloating = event.IsChecked()
2308
+ for pane in self.mgr.GetAllPanes():
2309
+ if pane.name != "Notebook":
2310
+ pane.Floatable(self.allowAuiFloating)
2311
+
2312
+ self.EnableAUIMenu()
2313
+ self.mgr.Update()
2314
+
2315
+
2316
+ def EnableAUIMenu(self):
2317
+
2318
+ menuItems = self.options_menu.GetMenuItems()
2319
+ for indx in range(4, len(menuItems)-1):
2320
+ item = menuItems[indx]
2321
+ item.Enable(self.allowAuiFloating)
2322
+
2323
+
2324
+ def OnAUIPerspectives(self, event):
2325
+ perspective = self.perspectives_menu.GetLabel(event.GetId())
2326
+ self.mgr.LoadPerspective(self.auiConfigurations[perspective])
2327
+ self.mgr.Update()
2328
+
2329
+
2330
+ def OnSavePerspective(self, event):
2331
+ dlg = wx.TextEntryDialog(self, "Enter a name for the new perspective:", "AUI Configuration")
2332
+
2333
+ dlg.SetValue(("Perspective %d")%(len(self.auiConfigurations)+1))
2334
+ if dlg.ShowModal() != wx.ID_OK:
2335
+ return
2336
+
2337
+ perspectiveName = dlg.GetValue()
2338
+ menuItems = self.perspectives_menu.GetMenuItems()
2339
+ for item in menuItems:
2340
+ if item.GetLabel() == perspectiveName:
2341
+ wx.MessageBox("The selected perspective name:\n\n%s\n\nAlready exists."%perspectiveName,
2342
+ "Error", style=wx.ICON_ERROR)
2343
+ return
2344
+
2345
+ item = wx.MenuItem(self.perspectives_menu, -1, dlg.GetValue(),
2346
+ "Load user perspective %d"%(len(self.auiConfigurations)+1),
2347
+ wx.ITEM_RADIO)
2348
+ self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item)
2349
+ self.perspectives_menu.Append(item)
2350
+ item.Check(True)
2351
+ self.auiConfigurations.update({dlg.GetValue(): self.mgr.SavePerspective()})
2352
+
2353
+
2354
+ def OnDeletePerspective(self, event):
2355
+ menuItems = self.perspectives_menu.GetMenuItems()
2356
+ lst = []
2357
+ loadDefault = False
2358
+
2359
+ for indx, item in enumerate(menuItems):
2360
+ if indx > 0:
2361
+ lst.append(item.GetLabel())
2362
+
2363
+ dlg = wx.MultiChoiceDialog(self,
2364
+ "Please select the perspectives\nyou would like to delete:",
2365
+ "Delete AUI Perspectives", lst)
2366
+
2367
+ if dlg.ShowModal() == wx.ID_OK:
2368
+ selections = dlg.GetSelections()
2369
+ strings = [lst[x] for x in selections]
2370
+ for sel in strings:
2371
+ self.auiConfigurations.pop(sel)
2372
+ item = menuItems[lst.index(sel)+1]
2373
+ if item.IsChecked():
2374
+ loadDefault = True
2375
+ self.perspectives_menu.GetMenuItems()[0].Check(True)
2376
+ self.perspectives_menu.DeleteItem(item)
2377
+ lst.remove(sel)
2378
+
2379
+ if loadDefault:
2380
+ self.mgr.LoadPerspective(self.auiConfigurations[DEFAULT_PERSPECTIVE])
2381
+ self.mgr.Update()
2382
+
2383
+
2384
+ def OnTreeExpansion(self, event):
2385
+ self.tree.SetExpansionState(self.expansionState)
2386
+
2387
+
2388
+ def OnHelpAbout(self, event):
2389
+ from About import MyAboutBox
2390
+ about = MyAboutBox(self)
2391
+ about.ShowModal()
2392
+ about.Destroy()
2393
+
2394
+ def OnHelpFind(self, event):
2395
+ if self.finddlg is not None:
2396
+ return
2397
+
2398
+ self.nb.SetSelection(1)
2399
+ self.finddlg = wx.FindReplaceDialog(self, self.finddata, "Find",
2400
+ wx.FR_NOMATCHCASE | wx.FR_NOWHOLEWORD)
2401
+ self.finddlg.Show(True)
2402
+
2403
+
2404
+ def OnUpdateFindItems(self, evt):
2405
+ evt.Enable(self.finddlg is None)
2406
+
2407
+
2408
+ def OnFind(self, event):
2409
+ editor = self.codePage.editor
2410
+ self.nb.SetSelection(1)
2411
+ end = editor.GetLastPosition()
2412
+ textstring = editor.GetRange(0, end).lower()
2413
+ findstring = self.finddata.GetFindString().lower()
2414
+ backward = not (self.finddata.GetFlags() & wx.FR_DOWN)
2415
+ if backward:
2416
+ start = editor.GetSelection()[0]
2417
+ loc = textstring.rfind(findstring, 0, start)
2418
+ else:
2419
+ start = editor.GetSelection()[1]
2420
+ loc = textstring.find(findstring, start)
2421
+ if loc == -1 and start != 0:
2422
+ # string not found, start at beginning
2423
+ if backward:
2424
+ start = end
2425
+ loc = textstring.rfind(findstring, 0, start)
2426
+ else:
2427
+ start = 0
2428
+ loc = textstring.find(findstring, start)
2429
+ if loc == -1:
2430
+ dlg = wx.MessageDialog(self, 'Find String Not Found',
2431
+ 'Find String Not Found in Demo File',
2432
+ wx.OK | wx.ICON_INFORMATION)
2433
+ dlg.ShowModal()
2434
+ dlg.Destroy()
2435
+ if self.finddlg:
2436
+ if loc == -1:
2437
+ self.finddlg.SetFocus()
2438
+ return
2439
+ else:
2440
+ self.finddlg.Destroy()
2441
+ self.finddlg = None
2442
+ editor.ShowPosition(loc)
2443
+ editor.SetSelection(loc, loc + len(findstring))
2444
+
2445
+
2446
+
2447
+ def OnFindNext(self, event):
2448
+ if self.finddata.GetFindString():
2449
+ self.OnFind(event)
2450
+ else:
2451
+ self.OnHelpFind(event)
2452
+
2453
+ def OnFindClose(self, event):
2454
+ event.GetDialog().Destroy()
2455
+ self.finddlg = None
2456
+
2457
+
2458
+ def OnOpenShellWindow(self, evt):
2459
+ if self.shell:
2460
+ # if it already exists then just make sure it's visible
2461
+ s = self.shell
2462
+ if s.IsIconized():
2463
+ s.Iconize(False)
2464
+ s.Raise()
2465
+ else:
2466
+ # Make a PyShell window
2467
+ from wx import py
2468
+ namespace = { 'wx' : wx,
2469
+ 'app' : wx.GetApp(),
2470
+ 'frame' : self,
2471
+ }
2472
+ self.shell = py.shell.ShellFrame(None, locals=namespace)
2473
+ self.shell.SetSize((640,480))
2474
+ self.shell.Show()
2475
+
2476
+ # Hook the close event of the main frame window so that we
2477
+ # close the shell at the same time if it still exists
2478
+ def CloseShell(evt):
2479
+ if self.shell:
2480
+ self.shell.Close()
2481
+ evt.Skip()
2482
+ self.Bind(wx.EVT_CLOSE, CloseShell)
2483
+
2484
+
2485
+ def OnOpenWidgetInspector(self, evt):
2486
+ # Activate the widget inspection tool, giving it a widget to preselect
2487
+ # in the tree. Use either the one under the cursor, if any, or this
2488
+ # frame.
2489
+ from wx.lib.inspection import InspectionTool
2490
+ wnd = wx.FindWindowAtPointer()
2491
+ if not wnd:
2492
+ wnd = self
2493
+ InspectionTool().Show(wnd, True)
2494
+
2495
+
2496
+ #---------------------------------------------
2497
+ def OnCloseWindow(self, event):
2498
+ self.mgr.UnInit()
2499
+ self.dying = True
2500
+ self.demoPage = None
2501
+ self.codePage = None
2502
+ self.mainmenu = None
2503
+ self.StopDownload()
2504
+
2505
+ if self.tbicon is not None:
2506
+ self.tbicon.Destroy()
2507
+
2508
+ config = GetConfig()
2509
+ config.Write('ExpansionState', str(self.tree.GetExpansionState()))
2510
+ config.Write('AUIPerspectives', str(self.auiConfigurations))
2511
+ config.Write('AllowDownloads', str(self.allowDocs))
2512
+ config.Write('AllowAUIFloating', str(self.allowAuiFloating))
2513
+
2514
+ config.Flush()
2515
+
2516
+ MakeDocDirs()
2517
+ pickledFile = GetDocFile()
2518
+ with open(pickledFile, "wb") as fid:
2519
+ cPickle.dump(self.pickledData, fid, cPickle.HIGHEST_PROTOCOL)
2520
+
2521
+ self.Destroy()
2522
+
2523
+
2524
+ #---------------------------------------------
2525
+ def OnIdle(self, event):
2526
+ if self.otherWin:
2527
+ self.otherWin.Raise()
2528
+ self.demoPage = self.otherWin
2529
+ self.otherWin = None
2530
+
2531
+
2532
+ #---------------------------------------------
2533
+
2534
+ def OnDownloadTimer(self, event):
2535
+
2536
+ self.downloadGauge.Pulse()
2537
+
2538
+ self.downloadImage += 1
2539
+ if self.downloadImage > 9:
2540
+ self.downloadImage = 3
2541
+
2542
+ self.nb.SetPageImage(0, self.downloadImage)
2543
+ ## wx.SafeYield()
2544
+
2545
+ #---------------------------------------------
2546
+
2547
+ def ShowTip(self):
2548
+ config = GetConfig()
2549
+ showTipText = config.Read("tips")
2550
+ if showTipText:
2551
+ showTip, index = eval(showTipText)
2552
+ else:
2553
+ showTip, index = (1, 0)
2554
+
2555
+ # if showTip:
2556
+ # tp = wx.CreateFileTipProvider(opj("data/tips.txt"), index)
2557
+ # showTip = wx.ShowTip(self, tp)
2558
+ # index = tp.GetCurrentTip()
2559
+ # config.Write("tips", str( (showTip, index) ))
2560
+ # config.Flush()
2561
+
2562
+ #---------------------------------------------
2563
+ def OnDemoMenu(self, event):
2564
+ try:
2565
+ selectedDemo = self.treeMap[self.mainmenu.GetLabel(event.GetId())]
2566
+ except:
2567
+ selectedDemo = None
2568
+ if selectedDemo:
2569
+ self.tree.SelectItem(selectedDemo)
2570
+ self.tree.EnsureVisible(selectedDemo)
2571
+
2572
+
2573
+ #---------------------------------------------
2574
+ def OnIconfiy(self, evt):
2575
+ wx.LogMessage("OnIconfiy: %s" % evt.IsIconized())
2576
+ evt.Skip()
2577
+
2578
+ #---------------------------------------------
2579
+ def OnMaximize(self, evt):
2580
+ wx.LogMessage("OnMaximize")
2581
+ evt.Skip()
2582
+
2583
+ #---------------------------------------------
2584
+ def OnActivate(self, evt):
2585
+ wx.LogMessage("OnActivate: %s" % evt.GetActive())
2586
+ evt.Skip()
2587
+
2588
+ #---------------------------------------------
2589
+ def OnAppActivate(self, evt):
2590
+ wx.LogMessage("OnAppActivate: %s" % evt.GetActive())
2591
+ evt.Skip()
2592
+
2593
+ #---------------------------------------------------------------------------
2594
+ #---------------------------------------------------------------------------
2595
+
2596
+ class MySplashScreen(SplashScreen):
2597
+ def __init__(self):
2598
+ bmp = wx.Image(opj("bitmaps/splash.png")).ConvertToBitmap()
2599
+ SplashScreen.__init__(self, bmp,
2600
+ wx.adv.SPLASH_CENTRE_ON_SCREEN | wx.adv.SPLASH_TIMEOUT,
2601
+ 5000, None, -1)
2602
+ self.Bind(wx.EVT_CLOSE, self.OnClose)
2603
+ self.fc = wx.CallLater(1000, self.ShowMain)
2604
+
2605
+
2606
+ def OnClose(self, evt):
2607
+ # Make sure the default handler runs too so this window gets
2608
+ # destroyed
2609
+ evt.Skip()
2610
+ self.Hide()
2611
+
2612
+ # if the timer is still running then go ahead and show the
2613
+ # main frame now
2614
+ if self.fc.IsRunning():
2615
+ self.fc.Stop()
2616
+ self.ShowMain()
2617
+
2618
+
2619
+ def ShowMain(self):
2620
+ frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
2621
+ frame.Show()
2622
+ if self.fc.IsRunning():
2623
+ self.Raise()
2624
+ wx.CallAfter(frame.ShowTip)
2625
+
2626
+
2627
+
2628
+
2629
+ #---------------------------------------------------------------------------
2630
+
2631
+ from wx.lib.mixins.treemixin import ExpansionState
2632
+ if USE_CUSTOMTREECTRL:
2633
+ import wx.lib.agw.customtreectrl as CT
2634
+ TreeBaseClass = CT.CustomTreeCtrl
2635
+ else:
2636
+ TreeBaseClass = wx.TreeCtrl
2637
+
2638
+
2639
+ class wxPythonDemoTree(ExpansionState, TreeBaseClass):
2640
+ def __init__(self, parent):
2641
+ TreeBaseClass.__init__(self, parent, style=wx.TR_DEFAULT_STYLE|
2642
+ wx.TR_HAS_VARIABLE_ROW_HEIGHT)
2643
+ self.BuildTreeImageList()
2644
+ if USE_CUSTOMTREECTRL:
2645
+ self.SetSpacing(10)
2646
+ self.SetWindowStyle(self.GetWindowStyle() & ~wx.TR_LINES_AT_ROOT)
2647
+
2648
+ self.SetInitialSize((100,80))
2649
+
2650
+
2651
+ def AppendItem(self, parent, text, image=-1, wnd=None):
2652
+ if USE_CUSTOMTREECTRL:
2653
+ item = TreeBaseClass.AppendItem(self, parent, text, image=image, wnd=wnd)
2654
+ else:
2655
+ item = TreeBaseClass.AppendItem(self, parent, text, image=image)
2656
+ return item
2657
+
2658
+ def BuildTreeImageList(self):
2659
+ imgList = wx.ImageList(16, 16)
2660
+ for png in _demoPngs:
2661
+ imgList.Add(images.catalog[png].GetBitmap())
2662
+
2663
+ # add the image for modified demos.
2664
+ imgList.Add(images.catalog["custom"].GetBitmap())
2665
+
2666
+ self.AssignImageList(imgList)
2667
+
2668
+
2669
+ def GetItemIdentity(self, item):
2670
+ return self.GetItemData(item)
2671
+
2672
+
2673
+ #---------------------------------------------------------------------------
2674
+
2675
+ class MyApp(wx.App, wx.lib.mixins.inspection.InspectionMixin):
2676
+ def OnInit(self):
2677
+
2678
+ # Check runtime version
2679
+ if version.VERSION_STRING != wx.VERSION_STRING:
2680
+ wx.MessageBox(caption="Warning",
2681
+ message="You're using version %s of wxPython, but this copy of the demo was written for version %s.\n"
2682
+ "There may be some version incompatibilities..."
2683
+ % (wx.VERSION_STRING, version.VERSION_STRING))
2684
+
2685
+ self.InitInspection() # for the InspectionMixin base class
2686
+
2687
+ # Now that we've warned the user about possible problems,
2688
+ # lets import images
2689
+ import images as i
2690
+ global images
2691
+ images = i
2692
+
2693
+ # For debugging
2694
+ #self.SetAssertMode(wx.PYAPP_ASSERT_DIALOG|wx.PYAPP_ASSERT_EXCEPTION)
2695
+
2696
+ wx.SystemOptions.SetOption("mac.window-plain-transition", 1)
2697
+ self.SetAppName("wxPyDemo")
2698
+
2699
+ # Create and show the splash screen. It will then create and
2700
+ # show the main frame when it is time to do so. Normally when
2701
+ # using a SplashScreen you would create it, show it and then
2702
+ # continue on with the application's initialization, finally
2703
+ # creating and showing the main application window(s). In
2704
+ # this case we have nothing else to do so we'll delay showing
2705
+ # the main frame until later (see ShowMain above) so the users
2706
+ # can see the SplashScreen effect.
2707
+ splash = MySplashScreen()
2708
+ splash.Show()
2709
+
2710
+ return True
2711
+
2712
+
2713
+
2714
+ #---------------------------------------------------------------------------
2715
+
2716
+ def main():
2717
+ try:
2718
+ demoPath = os.path.dirname(__file__)
2719
+ os.chdir(demoPath)
2720
+ except:
2721
+ pass
2722
+ app = MyApp(False)
2723
+ app.MainLoop()
2724
+
2725
+ #---------------------------------------------------------------------------
2726
+
2727
+
2728
+ mainOverview = """<html><body>
2729
+ <h2>wxPython</h2>
2730
+
2731
+ <p> wxPython is a <b>GUI toolkit</b> for the Python programming
2732
+ language. It allows Python programmers to create programs with a
2733
+ robust, highly functional graphical user interface, simply and easily.
2734
+ It is implemented as a Python extension module (native code) that
2735
+ wraps the popular wxWindows cross platform GUI library, which is
2736
+ written in C++.
2737
+
2738
+ <p> Like Python and wxWindows, wxPython is <b>Open Source</b> which
2739
+ means that it is free for anyone to use and the source code is
2740
+ available for anyone to look at and modify. Or anyone can contribute
2741
+ fixes or enhancements to the project.
2742
+
2743
+ <p> wxPython is a <b>cross-platform</b> toolkit. This means that the
2744
+ same program will run on multiple platforms without modification.
2745
+ Currently supported platforms are 32-bit Microsoft Windows, most Unix
2746
+ or unix-like systems, and Macintosh OS X. Since the language is
2747
+ Python, wxPython programs are <b>simple, easy</b> to write and easy to
2748
+ understand.
2749
+
2750
+ <p> <b>This demo</b> is not only a collection of test cases for
2751
+ wxPython, but is also designed to help you learn about and how to use
2752
+ wxPython. Each sample is listed in the tree control on the left.
2753
+ When a sample is selected in the tree then a module is loaded and run
2754
+ (usually in a tab of this notebook,) and the source code of the module
2755
+ is loaded in another tab for you to browse and learn from.
2756
+
2757
+ """
2758
+
2759
+
2760
+ #----------------------------------------------------------------------------
2761
+ #----------------------------------------------------------------------------
2762
+
2763
+ if __name__ == '__main__':
2764
+ __name__ = 'Main'
2765
+ main()
2766
+
2767
+ #----------------------------------------------------------------------------
2768
+