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/lib/agw/xlsgrid.py ADDED
@@ -0,0 +1,2113 @@
1
+ # --------------------------------------------------------------------------------- #
2
+ # XLSGRID wxPython IMPLEMENTATION
3
+ #
4
+ # Andrea Gavana @ 08 Aug 2011
5
+ # Latest Revision: 27 Dec 2012, 21.00 GMT
6
+ #
7
+ #
8
+ # TODO List
9
+ #
10
+ # Current todo list:
11
+ #
12
+ # 1. There is currently no support for rich text, i.e. strings containing partial
13
+ # bold, italic and underlined text, change of font inside a string, etc... xlrd
14
+ # supports those (from version 0.7.2 in SVN) but there is no easy way to handle
15
+ # changing fonts/colours/formatting in the same string in wxPython;
16
+ #
17
+ # 2. XLSGrid is sufficiently efficient and fast for reasonably small Excel files.
18
+ # There might be some improvement to be made in the code to make it work with
19
+ # bigger files and in a faster way;
20
+ #
21
+ # 3. There is currently no support for strikethrough fonts, although xlrd correctly
22
+ # reports this format. The issue is a bug in wxWidgets itself which doesn't
23
+ # allow the creation of strikethrough fonts (http://trac.wxwidgets.org/ticket/9907).
24
+ #
25
+ # For all kind of problems, requests of enhancements and bug reports, please write
26
+ # to me at:
27
+ #
28
+ # andrea.gavana@gmail.com
29
+ # andrea.gavana@maerskoil.com
30
+ #
31
+ # Or, obviously, to the wxPython mailing list!!!
32
+ #
33
+ # Tags: phoenix-port, documented, unittest, py3-port
34
+ #
35
+ # End of comments
36
+ # --------------------------------------------------------------------------------- #
37
+
38
+
39
+ """
40
+ :class:`~wx.lib.agw.xlsgrid.XLSGrid` is a class based on :class:`grid.Grid` that can be used to faithfully
41
+ reproduce the appearance of a Microsoft Excel spreadsheet (one worksheet per
42
+ every instance of :class:`XLSGrid`).
43
+
44
+
45
+ Description
46
+ ===========
47
+
48
+ :class:`XLSGrid` is a class based on :class:`grid.Grid` that can be used to faithfully
49
+ reproduce the appearance of a Microsoft Excel spreadsheet (one worksheet per
50
+ every instance of :class:`XLSGrid`).
51
+
52
+ :class:`XLSGrid` is a completely owner-drawn control, and it relies on the power of
53
+ :class:`grid.PyGridTableBase` and :class:`grid.PyGridCellRenderer` to draw the cell
54
+ content. For this reasons (and for some others, see the TODOs section), it will
55
+ work efficiently only for relatively small Excel files.
56
+
57
+ :note:
58
+
59
+ :class:`XLSGrid` **requires** the `xlrd` package from:
60
+
61
+ http://pypi.python.org/pypi/xlrd
62
+
63
+ Minimum version requirement for `xlrd` is 0.7.1. If you wish to have
64
+ support for hyperlinks inside cells and rich text content, you need the
65
+ SVN version of `xlrd`.
66
+
67
+
68
+ :note:
69
+
70
+ On Windows, it is **strongly** recommended to install Mark Hammonds'
71
+ `pywin32` package:
72
+
73
+ http://sourceforge.net/projects/pywin32/
74
+
75
+ This will allow you to perfectly reproduce the appearance of the Excel
76
+ worksheet in your instance of :class:`XLSGrid`.
77
+
78
+ .. warning::
79
+
80
+ If Mark Hammonds' `pywin32` package is not available, the formatting
81
+ capabilities of :class:`XLSGrid` are severely limited; for instance, you won't
82
+ probably get the exact WYSIWYG between the Excel spreadsheet and :class:`XLSGrid`.
83
+
84
+
85
+ .. warning::
86
+
87
+ :class:`XLSGrid` can only read Excel `.xls` files, not the newer versions
88
+ `.xlsx` generated by Office 2007/2010. If you have a `.xlsx` file, you will
89
+ need to save it in 1997-2003 Office compatibility mode.
90
+
91
+
92
+ Currently this class provides a read-only subclass of :class:`grid.Grid`, with
93
+ the following formatting features already implemented:
94
+
95
+ * Cell background: support for any cell background colour and fill pattern
96
+ (hatching) in the Excel default set. There currently is no support for
97
+ gradient shading inside a cell as `xlrd` doesn't report this information.
98
+
99
+ * Cell borders: support for all the border types and colours exposed by Excel
100
+ (left, top, bottom, right and diagonal borders, thin, double, thick, ect...
101
+ line styles).
102
+
103
+ * Cell text: support for all kind of fonts (except strikethrough, but this is
104
+ a bug in wxWidgets), and font colours. As a subset of text/font capabilities,
105
+ :class:`XLSGrid` supports the following features found in Excel:
106
+
107
+ - Horizontal alignment: left, right, centered, left-indented;
108
+ - Vertical alignment: left, right, centered;
109
+ - Text direction: left-to-right or right-to-left;
110
+ - Text-wrapping: wrapping long texts inside a grid cell;
111
+ - Shrink-to-fit: text font is reduced until the text can fit in a one-line
112
+ inside the grid cell;
113
+ - Text rotation: text can be rotated from +90 to -90 degrees.
114
+
115
+ * Cell rich text (new in version 0.2): support for strings containing partial
116
+ bold, italic and underlined text, change of font inside a string etc...
117
+ Cells with rich text content can not be multi-line and they will not honour
118
+ the `shrink-to-fit` and `wrapping` settings.
119
+
120
+ * Cell text appearance: if you are using Mark Hammonds' `pywin32` package, the
121
+ text displayed in the :class:`XLSGrid` cells has exactly the same appearance as in
122
+ the Excel spreadsheet.
123
+
124
+ * Cell comments (notes): if you are using Mark Hammonds' `pywin32` package,
125
+ cell comments (notes) are extracted and you will see a small red triangle at
126
+ the top-right corner of any cell containing a comment. Hovering with the
127
+ mouse on that cell will pop-up a "comment-window" displaying the comment
128
+ text (the comment window is based on :mod:`lib.agw.supertooltip`).
129
+
130
+ * Cell hyperlinks: starting from version 0.7.2 (SVN), `xlrd` is capable of
131
+ extracting hyperlinks from Excel cells. This will be appropriately displayed
132
+ in :class:`XLSGrid` with a cursor changing and a tooltip on that cell.
133
+
134
+ * Cell merging: merged cells in the Excel spreadsheet will be correctly handled
135
+ by :class:`XLSGrid`.
136
+
137
+ * Columns and rows sizes: :class:`XLSGrid` calculates the correct rows and columns
138
+ sizes based on the Excel reported values in characters. The calculations are
139
+ based on the default width of the text in 1/256 of the width of the zero
140
+ character, using default Excel font (first FONT record in the Excel file).
141
+
142
+
143
+ And a lot more. Check the demo for an almost complete review of the functionalities.
144
+
145
+
146
+ Usage
147
+ =====
148
+
149
+ Sample usage::
150
+
151
+ import wx
152
+ import xlrd
153
+ import os
154
+
155
+ import xlsgrid as XG
156
+
157
+ class MyFrame(wx.Frame):
158
+
159
+ def __init__(self):
160
+
161
+ wx.Frame.__init__(self, parent, -1, "XLSGrid Demo", size=(1000, 800))
162
+
163
+ filename = os.path.join(os.getcwd(), "Excel", "Example_1.xls")
164
+ sheetname = "Example_1"
165
+
166
+ book = xlrd.open_workbook(filename, formatting_info=1)
167
+
168
+ sheet = book.sheet_by_name(sheetname)
169
+ rows, cols = sheet.nrows, sheet.ncols
170
+
171
+ comments, texts = XG.ReadExcelCOM(filename, sheetname, rows, cols)
172
+
173
+ xls_grid = XG.XLSGrid(self)
174
+ xls_grid.PopulateGrid(book, sheet, texts, comments)
175
+
176
+
177
+ # our normal wxApp-derived class, as usual
178
+
179
+ app = wx.App(0)
180
+
181
+ frame = MyFrame(None)
182
+ app.SetTopWindow(frame)
183
+ frame.Show()
184
+
185
+ app.MainLoop()
186
+
187
+
188
+ :note: Please note that you **have to** pass the keyword `formatting_info` to
189
+ the method `xlrd.open_workbook` to obtain the cell formatting.
190
+
191
+
192
+ TODOs
193
+ =====
194
+
195
+ 1. :class:`XLSGrid` is sufficiently efficient and fast for reasonably small Excel files.
196
+ There might be some improvement to be made in the code to make it work with
197
+ bigger files and in a faster way;
198
+ 2. :class:`grid.Grid` seems to completely redraw itself at every resize event, even
199
+ if the cell content has not changed and it has not been damaged (this seems
200
+ to be fixed in wxPython 2.9.2.1);
201
+ 3. There is currently no support for strikethrough fonts, although `xlrd` correctly
202
+ reports this format. The issue is a bug in wxWidgets itself which doesn't
203
+ allow the creation of strikethrough fonts (http://trac.wxwidgets.org/ticket/9907).
204
+
205
+
206
+ Supported Platforms
207
+ ===================
208
+
209
+ :class:`XLSGrid` has been tested on the following platforms:
210
+ * Windows (Windows Vista and 7);
211
+
212
+
213
+ Window Styles
214
+ =============
215
+
216
+ `No particular window styles are available for this class.`
217
+
218
+
219
+ Events Processing
220
+ =================
221
+
222
+ `No custom events are available for this class.`
223
+
224
+
225
+ License And Version
226
+ ===================
227
+
228
+ :class:`XLSGrid` is distributed under the wxPython license.
229
+
230
+ Latest Revision: Andrea Gavana @ 27 Dec 2012, 21.00 GMT
231
+
232
+ Version 0.4
233
+
234
+ """
235
+
236
+ # Version Info
237
+ __version__ = "0.4"
238
+
239
+ # Start the imports
240
+ import wx
241
+ import os
242
+
243
+ try:
244
+ import xlrd
245
+ except ImportError:
246
+ pass
247
+
248
+ import datetime
249
+ import string
250
+
251
+ import wx.grid as gridlib
252
+
253
+ import six
254
+
255
+ from wx.lib.embeddedimage import PyEmbeddedImage
256
+ from wx.lib.wordwrap import wordwrap
257
+
258
+ from . import supertooltip as STT
259
+
260
+ from math import pi, sin, cos
261
+ from operator import attrgetter
262
+
263
+ _hasWin32 = False
264
+
265
+ if wx.Platform == "__WXMSW__":
266
+ try:
267
+ from win32com.client import Dispatch
268
+ import pywintypes
269
+ _hasWin32 = True
270
+ except ImportError:
271
+ pass
272
+
273
+
274
+ #----------------------------------------------------------------------
275
+ # Constants used to translate xlrd stuff into wxPython stuff
276
+ #----------------------------------------------------------------------
277
+
278
+ BOTTOM = wx.BOTTOM
279
+ TOP = wx.TOP
280
+ LEFT = wx.LEFT
281
+ RIGHT = wx.RIGHT
282
+ DIAGONAL = 2 << 7
283
+
284
+ XF_BORDER_STYLES = {"bottom": BOTTOM, "left": LEFT, "right": RIGHT,
285
+ "top": TOP, "diag": DIAGONAL}
286
+
287
+ HORIZONTAL_ALIGNMENTS = {0: 0, 1: 0, 2: wx.ALIGN_CENTER_HORIZONTAL, 3: wx.ALIGN_RIGHT}
288
+ VERTICAL_ALIGNMENTS = {0: 0, 1: wx.ALIGN_CENTER_VERTICAL, 2: wx.ALIGN_BOTTOM,
289
+ 3: wx.ALIGN_CENTER_VERTICAL, 4:wx.ALIGN_CENTER_VERTICAL}
290
+
291
+ NO_LINE = 0x0
292
+ THIN = 0x1
293
+ MEDIUM = 0x2
294
+ DASHED = 0x3
295
+ DOTTED = 0x4
296
+ THICK = 0x5
297
+ DOUBLE = 0x6
298
+ HAIR = 0x7
299
+ MEDIUM_DASHED = 0x8
300
+ THIN_DASH_DOTTED = 0x9
301
+ MEDIUM_DASH_DOTTED = 0xA
302
+ THIN_DASH_DOT_DOTTED = 0xB
303
+ MEDIUM_DASH_DOT_DOTTED = 0xC
304
+ SLANTED_MEDIUM_DASH_DOTTED = 0xD
305
+
306
+ XF_PEN_STYLES = {NO_LINE: (0, None), THIN: (1, wx.PENSTYLE_SOLID), MEDIUM: (2, wx.PENSTYLE_SOLID),
307
+ DASHED: (1, wx.PENSTYLE_SHORT_DASH), DOTTED: (1, wx.PENSTYLE_DOT),
308
+ THICK: (3, wx.PENSTYLE_SOLID), DOUBLE: (1, wx.PENSTYLE_SOLID), HAIR: (1, wx.PENSTYLE_DOT),
309
+ MEDIUM_DASHED: (2, wx.PENSTYLE_LONG_DASH), THIN_DASH_DOTTED: (1, wx.PENSTYLE_DOT_DASH),
310
+ MEDIUM_DASH_DOTTED: (2, wx.PENSTYLE_DOT_DASH), THIN_DASH_DOT_DOTTED: (1, wx.PENSTYLE_DOT_DASH),
311
+ MEDIUM_DASH_DOT_DOTTED: (2, wx.PENSTYLE_DOT_DASH),
312
+ SLANTED_MEDIUM_DASH_DOTTED: (2, wx.PENSTYLE_DOT_DASH)
313
+ }
314
+
315
+ XF_FONT_FAMILY = {0: wx.FONTFAMILY_SWISS, 1: wx.FONTFAMILY_ROMAN, 2: wx.FONTFAMILY_SWISS,
316
+ 3: wx.FONTFAMILY_MODERN, 4: wx.FONTFAMILY_SCRIPT, 5: wx.FONTFAMILY_DECORATIVE}
317
+
318
+ # Unicode ordinals for Hebrew, Arabic and Syriac
319
+ # I don't know if there are other RTL languages
320
+ RTL_UNICODE = list(range(1424, 1872))
321
+
322
+ # To guess text direction we exclude digits and punctuation
323
+ USELESS_CHARS = string.punctuation + string.digits + " "
324
+
325
+
326
+ #----------------------------------------------------------------------
327
+ # Images used to draw the hatching on Excel cells background
328
+ #----------------------------------------------------------------------
329
+
330
+ _xls_background_01 = PyEmbeddedImage(
331
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAADElE"
332
+ "QVQImWNgIB0AAAA0AAEjQ4N1AAAAAElFTkSuQmCC")
333
+
334
+ #----------------------------------------------------------------------
335
+ _xls_background_02 = PyEmbeddedImage(
336
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAFklE"
337
+ "QVQImWNgYGD4//8/lESwIAC7DABt4hfpI2a12wAAAABJRU5ErkJggg==")
338
+
339
+ #----------------------------------------------------------------------
340
+ _xls_background_03 = PyEmbeddedImage(
341
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAE0lE"
342
+ "QVQImWP4//8/AxqACuGUAQBI+Qv1NTPP3AAAAABJRU5ErkJggg==")
343
+
344
+ #----------------------------------------------------------------------
345
+ _xls_background_04 = PyEmbeddedImage(
346
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAH0lE"
347
+ "QVQImXXJsQ0AIAAEIc79d34LazsSwjbgPFXoOxdcCQwBh7OgqgAAAABJRU5ErkJggg==")
348
+
349
+ #----------------------------------------------------------------------
350
+ _xls_background_05 = PyEmbeddedImage(
351
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAFUlE"
352
+ "QVQImWNgwAUY////D+cwIcsAAEggAwHHgMubAAAAAElFTkSuQmCC")
353
+
354
+ #----------------------------------------------------------------------
355
+ _xls_background_06 = PyEmbeddedImage(
356
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAG0lE"
357
+ "QVQImWNkYGBgYGD4//8/AwMDEwMSwM0BAISAAwUnufp7AAAAAElFTkSuQmCC")
358
+
359
+ #----------------------------------------------------------------------
360
+ _xls_background_07 = PyEmbeddedImage(
361
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAHklE"
362
+ "QVQImWNkYGBgYGD4//8/EgVh/P//H86HikH4APOCFO3yiGicAAAAAElFTkSuQmCC")
363
+
364
+ #----------------------------------------------------------------------
365
+ _xls_background_08 = PyEmbeddedImage(
366
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAHUlE"
367
+ "QVQImWP4////////GSAAzvr//z8jmhADXCUAQSkU7eggG3gAAAAASUVORK5CYII=")
368
+
369
+ #----------------------------------------------------------------------
370
+ _xls_background_09 = PyEmbeddedImage(
371
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAIElE"
372
+ "QVQImWNkYGBgYGD4//8/AwMDEwMy+P//P0QYXQYACtQI/cTE6U0AAAAASUVORK5CYII=")
373
+
374
+ #----------------------------------------------------------------------
375
+ _xls_background_10 = PyEmbeddedImage(
376
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAG0lE"
377
+ "QVQImW3IsQ0AAAjAIPz/6LobGRmgclVfswpsCPmQczsGAAAAAElFTkSuQmCC")
378
+
379
+ #----------------------------------------------------------------------
380
+ _xls_background_11 = PyEmbeddedImage(
381
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAFklE"
382
+ "QVQImWNgQAKM////h3OYkGVQOABvOgMD4NUKkwAAAABJRU5ErkJggg==")
383
+
384
+ #----------------------------------------------------------------------
385
+ _xls_background_12 = PyEmbeddedImage(
386
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAG0lE"
387
+ "QVQImWNkYGD4//8/AwMDAwMDEwMSwM0BAI13AwWY+Mx+AAAAAElFTkSuQmCC")
388
+
389
+ #----------------------------------------------------------------------
390
+ _xls_background_13 = PyEmbeddedImage(
391
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAI0lE"
392
+ "QVQImT3KsQ0AMAyAMMj/P9MhUUcLBCoAmEo9bFn7H/UBXEwMBN75abEAAAAASUVORK5CYII=")
393
+
394
+ #----------------------------------------------------------------------
395
+ _xls_background_14 = PyEmbeddedImage(
396
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAIElE"
397
+ "QVQImT3KoQEAAAwCINz/P7tmI5C2QJKb2t6EYPMBOOUMBIWcMEIAAAAASUVORK5CYII=")
398
+
399
+ #----------------------------------------------------------------------
400
+ _xls_background_15 = PyEmbeddedImage(
401
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAGUlE"
402
+ "QVQImWNgQAKMDAwM////h3CYkGVQOABmQwMDJpgq9gAAAABJRU5ErkJggg==")
403
+
404
+ #----------------------------------------------------------------------
405
+ _xls_background_16 = PyEmbeddedImage(
406
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAHklE"
407
+ "QVQImWNgYGD4//8/lISzIAwEnxEqwMDAyMgIALKwF+2ym+hoAAAAAElFTkSuQmCC")
408
+
409
+ #----------------------------------------------------------------------
410
+ _xls_background_17 = PyEmbeddedImage(
411
+ "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAA3NCSVQICAjb4U/gAAAAIklE"
412
+ "QVQImWNkYGD4//8/AwMDAwMDI5zFwMDABBVjZESXAQAc+AkAQ4bzDAAAAABJRU5ErkJggg==")
413
+
414
+ #----------------------------------------------------------------------
415
+ _xls_background_18 = PyEmbeddedImage(
416
+ "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAIAAAA8r+mnAAAAA3NCSVQICAjb4U/gAAAAH0lE"
417
+ "QVQImWNkYGD4//8/AwZgxCrKwMDAhKKKkZGwDgA83QkAy10JvwAAAABJRU5ErkJggg==")
418
+
419
+ #----------------------------------------------------------------------
420
+
421
+
422
+ def SplitThousands(s, tSep=',', dSep='.'):
423
+ """
424
+ Splits a general float on thousands. GIGO on general input.
425
+
426
+ :param `s`: can be a float or a string, representing a number;
427
+ :param `tSep`: the character to be used as thousands separator;
428
+ :param `dSep`: the character to be used as decimal separator.
429
+
430
+ :returns: a string properly formatted with thousands and decimal
431
+ separators in it.
432
+
433
+ :note: This method is used only if Mark Hammonds' `pywin32` package is
434
+ not available to try and format a number in an intelligent way.
435
+
436
+ :note: This code has been obtained from the public domain:
437
+
438
+ http://code.activestate.com/recipes/498181-add-thousands-separator-commas-to-formatted-number/#c14
439
+
440
+ """
441
+
442
+ if not isinstance(s, six.string_types):
443
+ s = six.u(s)
444
+
445
+ cnt = 0
446
+ numChars = dSep + '0123456789'
447
+ ls = len(s)
448
+
449
+ while cnt < ls and s[cnt] not in numChars:
450
+ cnt += 1
451
+
452
+ lhs = s[0:cnt]
453
+ s = s[cnt:]
454
+
455
+ if dSep == '':
456
+ cnt = -1
457
+ else:
458
+ cnt = s.rfind(dSep)
459
+
460
+ if cnt > 0:
461
+ rhs = dSep + s[cnt+1:]
462
+ s = s[:cnt]
463
+ else:
464
+ rhs = ''
465
+
466
+ splt = ''
467
+ while s != '':
468
+ splt = s[-3:] + tSep + splt
469
+ s = s[:-3]
470
+
471
+ return lhs + splt[:-1] + rhs
472
+
473
+
474
+ def ReadExcelCOM(filename, sheetname, rows, cols):
475
+ """
476
+ Reads and Excel spreadsheet (a single worksheet) using Mark Hammonds' `pywin32`
477
+ package. If this package is not available, it returns two empty nested lists.
478
+
479
+ :param `filename`: a valid Excel `.xls` filename;
480
+ :param `sheetname`: the worksheet name inside the Excel file (i.e., the label
481
+ on the workbook tab at the bottom of the workbook);
482
+ :param `rows`: the number of significant rows in the worksheet, as returned
483
+ by `xlrd`;
484
+ :param `cols`: the number of significant columns in the worksheet, as returned
485
+ by `xlrd`.
486
+
487
+ :returns: two nested lists representing the comments (notes) on every cell and
488
+ the WYSIWYG representation of the cell content.
489
+
490
+ :note: If Mark Hammonds' `pywin32` package is not available, this method
491
+ returns two empty nested lists.
492
+ """
493
+
494
+ comments = [["" for i in range(cols)] for j in range(rows)]
495
+ texts = [[None for i in range(cols)] for j in range(rows)]
496
+
497
+ if not _hasWin32:
498
+ return comments, texts
499
+
500
+ try:
501
+ workbook = Excel(filename, sheetname)
502
+
503
+ for i in range(1, rows+1):
504
+ for j in range(1, cols+1):
505
+ texts[i-1][j-1] = workbook.GetText(i, j)
506
+
507
+ comm_range = workbook.GetCommentsRange()
508
+ if comm_range is not None:
509
+ for comm in comm_range:
510
+ comments[comm.Row-1][comm.Column-1] = comm.Comment.Text()
511
+
512
+ workbook.Close()
513
+
514
+ except pywintypes.com_error:
515
+ pass
516
+
517
+ return comments, texts
518
+
519
+
520
+ def FontFromFont(font):
521
+ """
522
+ Creates a copy of the input `font`.
523
+
524
+ :param `font`: an instance of :class:`wx.Font`.
525
+ """
526
+
527
+ new_font = wx.Font(font.GetPointSize(), font.GetFamily(), font.GetStyle(),
528
+ font.GetWeight(), font.GetUnderlined(),
529
+ font.GetFaceName(), font.GetEncoding())
530
+
531
+ return new_font
532
+
533
+
534
+ class Excel(object):
535
+ """
536
+ A simple class that holds a COM interface to Excel.
537
+
538
+ By using the `win32com` module from Mark Hammonds' `pywin32` package, we
539
+ can manipulate various workbook/worksheet methods inside this class.
540
+ """
541
+
542
+ def __init__(self, filename, sheetname):
543
+ """
544
+ Default class constructor.
545
+
546
+ :param `filename`: a valid Excel `.xls` filename;
547
+ :param `sheetname`: the worksheet name inside the Excel file (i.e., the label
548
+ on the workbook tab at the bottom of the workbook).
549
+ """
550
+
551
+ self.xlApp = Dispatch('Excel.Application')
552
+ self.filename = filename
553
+ self.xlBook = self.xlApp.Workbooks.Open(filename)
554
+ self.sheet = self.xlBook.Worksheets(sheetname)
555
+
556
+ self.xlApp.Visible = 0
557
+
558
+
559
+ def Close(self, save=False):
560
+ """
561
+ Closes the Excel workbook, interrupting the COM interface.
562
+
563
+ :param `save`: ``True`` to save the changes you made to the workbook,
564
+ ``False`` otherwise.
565
+ """
566
+
567
+ self.xlBook.Close(SaveChanges=save)
568
+ del self.xlApp
569
+
570
+
571
+ def GetCommentsRange(self):
572
+ """
573
+ Returns a range of cells containing comments, using the VBA API.
574
+
575
+ """
576
+
577
+ try:
578
+ return self.sheet.Cells.SpecialCells(-4144)
579
+ except pywintypes.com_error:
580
+ return None
581
+
582
+
583
+ def GetText(self, row, col):
584
+ """
585
+ Returns the WYSIWYG text contained in a cell.
586
+
587
+ :param `row`: the row in which the cell lives;
588
+ :param `col`: the column in which the cell lives.
589
+
590
+ :note: The `row` and `col` parameters are not real Python index, as they
591
+ use the Excel indexing mode (i.e., first index is 1 and not 0).
592
+ """
593
+
594
+ cell = self.sheet.Cells(row, col)
595
+
596
+ if cell:
597
+ return cell.Text
598
+
599
+
600
+ class XLSText(object):
601
+ """
602
+ This is a class which holds information about the cell content, in terms
603
+ of actual cell value, font, text colour, alignment and formatting.
604
+ """
605
+
606
+ def __init__(self, book, cell, xf_index, display_text=None, hyperlink=None, default_width=10):
607
+ """
608
+ Default class constructor.
609
+
610
+ :param `book`: an instance of the `xlrd.Book` class;
611
+ :param `cell`: an instance of `xlrd.sheet.Cell` class;
612
+ :param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
613
+ reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`);
614
+ :param `display_text`: if Mark Hammonds' `pywin32` package is available,
615
+ this is the WYSIWYG cell content;
616
+ :param `hyperlink`: if this cell contains a hyperlink, it will be displayed
617
+ accordingly;
618
+ :param `default_width`: this is the default width of the text in 1/256
619
+ of the width of the zero character, using default Excel font (first FONT
620
+ record in the Excel file).
621
+
622
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the *hyperlink*
623
+ parameter will always be ``None`` as this feature is available only in
624
+ `xlrd` 0.7.2 (SVN).
625
+ """
626
+
627
+ XFClass = book.xf_list[xf_index]
628
+
629
+ font = book.font_list[XFClass.font_index]
630
+ self.font = self.CreateFont(font)
631
+
632
+ text_colour = book.colour_map[font.colour_index]
633
+ self.text_colour = self.CreateTextColour(text_colour)
634
+
635
+ if display_text is not None:
636
+ self.value = display_text
637
+ else:
638
+ format = book.format_map[XFClass.format_key]
639
+ self.CreateFormat(format, cell, book.datemode)
640
+
641
+ alignment = XFClass.alignment
642
+ self.CreateAlignment(alignment, default_width)
643
+
644
+ if hyperlink is not None:
645
+ self.SetupHyperlink(hyperlink)
646
+ else:
647
+ self.tooltip = None
648
+
649
+
650
+ def CreateFont(self, font):
651
+ """
652
+ Creates a suitable wxPython font starting from an Excel font.
653
+
654
+ :param `font`: an instance of `xlrd.formatting.Font` class.
655
+
656
+ :note: There is currently no support for strikethrough fonts, although
657
+ `xlrd` correctly reports this format. The issue is a bug in wxWidgets
658
+ itself which doesn't allow the creation of strikethrough fonts. See
659
+ (http://trac.wxwidgets.org/ticket/9907).
660
+ """
661
+
662
+ style, bold, underline = wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False
663
+ if font.italic:
664
+ style = wx.FONTSTYLE_ITALIC
665
+ if font.underline_type > 0:
666
+ underline = True
667
+ if font.weight > 600:
668
+ bold = wx.FONTWEIGHT_BOLD
669
+
670
+ family = XF_FONT_FAMILY[font.family]
671
+ name = font.name
672
+ size = int(font.height/20.0)
673
+
674
+ if font.escapement > 0:
675
+ # subscript/superscript
676
+ size = int(size*0.7)
677
+
678
+ # No support for strike-through fonts in wxWidgets
679
+ # if font.struck_out:
680
+ # style = wx.FONTFLAG_DEFAULT
681
+ # if bold:
682
+ # style += wx.FONTFLAG_BOLD
683
+ # if underline:
684
+ # style += wx.FONTFLAG_UNDERLINED
685
+ # if font.italic:
686
+ # style += wx.FONTFLAG_ITALIC
687
+ #
688
+ # style += wx.FONTFLAG_STRIKETHROUGH
689
+ # self.font = wx.FFont(size, family, style, name.encode())
690
+ # else:
691
+
692
+ return wx.Font(size, family, style, bold, underline, name.encode())
693
+
694
+
695
+ def CreateTextColour(self, text_colour):
696
+ """
697
+ Creates a suitable wxPython colour for the text starting from a `xlrd`
698
+ tuple representing this colour.
699
+
700
+ :param `text_colour`: a tuple representing the RGB components of the
701
+ colour. If `text_colour` is ``None``, use the default ``wx.SYS_COLOUR_WINDOWTEXT``.
702
+ """
703
+
704
+ if text_colour is not None:
705
+ text_colour = wx.Colour(*text_colour)
706
+ else:
707
+ text_colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
708
+
709
+ return text_colour
710
+
711
+
712
+ def CreateAlignment(self, alignment, default_width):
713
+ """
714
+ Creates a suitable wxPython alignment flag for the text starting from a
715
+ `xlrd` class representing this alignment.
716
+
717
+ :param `alignment`: an instance of `xlrd.formatting.XFAlignment` class;
718
+ :param `default_width`: this is the default width of the text in 1/256
719
+ of the width of the zero character, using default Excel font (first FONT
720
+ record in the Excel file).
721
+ """
722
+
723
+ hor_align, vert_align = alignment.hor_align, alignment.vert_align
724
+ self.horizontal_alignment = HORIZONTAL_ALIGNMENTS[hor_align]
725
+ self.vertical_alignment = VERTICAL_ALIGNMENTS[vert_align]
726
+
727
+ self.indent_level = alignment.indent_level
728
+ self.shrink_to_fit = alignment.shrink_to_fit
729
+ self.text_wrapped = alignment.text_wrapped
730
+
731
+ text_direction = 1
732
+
733
+ if alignment.text_direction == 0:
734
+ for char in self.value:
735
+ if char not in USELESS_CHARS:
736
+ if ord(char) in RTL_UNICODE:
737
+ text_direction = 2
738
+ break
739
+
740
+ self.text_direction = text_direction
741
+ self.default_width = default_width
742
+
743
+ if alignment.rotation > 90:
744
+ self.rotation = 90 - alignment.rotation
745
+ else:
746
+ self.rotation = alignment.rotation
747
+
748
+
749
+ def CreateFormat(self, format, cell, datemode):
750
+ """
751
+ This method tries to guess the best format to apply to the current text
752
+ value.
753
+
754
+ :param `format`: an instance of `xlrd.formatting.Format` class;
755
+ :param `cell`: an instance of `xlrd.sheet.Cell` class;
756
+ :param `datemode`: the datemode associated with this Excel workbook.
757
+
758
+ :note: This method is used only if Mark Hammonds' `pywin32` package is
759
+ not available to try and format the cell text in an intelligent way.
760
+
761
+ .. warning::
762
+
763
+ The formatting applied by this method is severely limited; for
764
+ instance, you won't probably get the exact WYSIWYG between the Excel
765
+ spreadsheet and :class:`XLSGrid`.
766
+ """
767
+
768
+ ctype, value = cell.ctype, cell.value
769
+
770
+ self.value = "%s"%value
771
+ isDate = False
772
+
773
+ if ctype == xlrd.XL_CELL_DATE:
774
+ value = xlrd.xldate_as_tuple(value, datemode)
775
+ isDate = True
776
+ elif ctype in [xlrd.XL_CELL_EMPTY, xlrd.XL_CELL_BLANK]:
777
+ return
778
+ elif ctype == xlrd.XL_CELL_TEXT:
779
+ self.value = "%s"%value
780
+ return
781
+ elif ctype == xlrd.XL_CELL_ERROR:
782
+ value = xlrd.error_text_from_code(ctype)
783
+ self.value = "%s"%value
784
+ return
785
+
786
+ self.FormatString(value, isDate, format.format_str)
787
+
788
+
789
+ def FormatString(self, value, isDate, format_str):
790
+ """
791
+ This method tries to guess the best format to apply to the current text
792
+ value.
793
+
794
+ :param `value`: the actual raw cell text value;
795
+ :param `isDate`: ``True`` if this value represents a `xlrd` date object,
796
+ ``False`` otherwise;
797
+ :param `format_str`: the actual formatting string as extracted from Excel.
798
+
799
+ :note: This method is used only if Mark Hammonds' `pywin32` package is
800
+ not available to try and format the cell text in an intelligent way.
801
+
802
+ .. warning::
803
+
804
+ The formatting applied by this method is severely limited; for
805
+ instance, you won't probably get the exact WYSIWYG between the Excel
806
+ spreadsheet and :class:`XLSGrid`.
807
+
808
+ """
809
+
810
+ if "General" in format_str:
811
+ self.value = "%s"%value
812
+ return
813
+
814
+ number_format = format_str
815
+ currency = percentage = ""
816
+
817
+ if not isDate:
818
+ symbol = ""
819
+ split = format_str.split()
820
+ if len(split) > 1:
821
+ # Accounting and currency shit
822
+ currency = split[0].split(".")[0] + "."
823
+ number_format = ".".join(split[1:])
824
+
825
+ if "%" in number_format:
826
+ percentage = "%"
827
+ value = 100*value
828
+ number_format = number_format[0:-1]
829
+
830
+ representation = "%d"
831
+ if "." in number_format:
832
+ split = number_format.split(".")
833
+ num_decimals = len(split[1])
834
+ representation = "%0." + str(num_decimals) + "f"
835
+
836
+ try:
837
+ value = representation%value
838
+ except ValueError:
839
+ # Fall back to string
840
+ value = six.u(value)
841
+
842
+ if "#," in number_format:
843
+ value = SplitThousands(value)
844
+
845
+ value = currency + value + percentage
846
+
847
+ else:
848
+ number_format = format_str.replace("\\", "")
849
+ number_format = number_format.replace("-", "-%").replace("/", "/%")
850
+ value = datetime.datetime(*value)
851
+ try:
852
+ value = value.strftime(number_format)
853
+ except (ValueError, TypeError):
854
+ value = value.strftime("%d.%m.%Y")
855
+
856
+ self.value = value
857
+
858
+
859
+ def SetupHyperlink(self, hyperlink):
860
+ """
861
+ Sets up the cell text value in case it represents a hyperlink.
862
+
863
+ :param `hyperlink`: an instance of `xlrd.sheet.hyperlink`.
864
+
865
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the *hyperlink*
866
+ parameter will always be ``None`` as this feature is available only in
867
+ `xlrd` 0.7.2 (SVN).
868
+ """
869
+
870
+ url = (hyperlink.url_or_path and [hyperlink.url_or_path] or [hyperlink.textmark])[0]
871
+ self.tooltip = url
872
+
873
+
874
+ def IsHyperLink(self):
875
+ """
876
+ Returns whether the cell text is representing a hyperlink.
877
+
878
+ :returns: ``True`` if the cell text represents a hyperlink, ``False``
879
+ otherwise.
880
+ """
881
+
882
+ return self.tooltip is not None
883
+
884
+
885
+ def CombineAttr(self, attr):
886
+ """
887
+ Combines the input attribute `attr` with the features of the :class:`XLSText` class.
888
+
889
+ :param `attr`: an instance of :class:`grid.GridCellAttr`.
890
+ """
891
+
892
+ attr.SetAlignment(self.horizontal_alignment, self.vertical_alignment)
893
+ attr.SetTextColour(self.text_colour)
894
+ attr.SetFont(self.font)
895
+
896
+
897
+ def GetValue(self):
898
+ """ Returns the string representation of the cell text value. """
899
+
900
+ return self.value
901
+
902
+
903
+ def Draw(self, dc, rect):
904
+ """
905
+ Actually draws the text value on a grid cell.
906
+
907
+ :param `dc`: an instance of :class:`wx.DC`;
908
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
909
+ """
910
+
911
+ new_rect = wx.Rect(*rect)
912
+
913
+ xshift = yshift = 0
914
+ if self.rotation:
915
+ xshift = cos(self.rotation*pi/180)
916
+ yshift = sin(self.rotation*pi/180)
917
+
918
+ dc.SetTextForeground(self.text_colour)
919
+ dc.SetFont(self.font)
920
+
921
+ value = self.value
922
+ text_width, text_height = dc.GetTextExtent(value)
923
+
924
+ default_width = int(round(float(self.default_width)*text_width/256.0))
925
+
926
+ indentation = int(256.0*default_width/float(self.default_width))
927
+
928
+ if xshift == 0 and self.indent_level:
929
+ new_rect.SetLeft(new_rect.x + indentation)
930
+ else:
931
+ if self.horizontal_alignment == wx.ALIGN_LEFT:
932
+ new_rect.SetLeft(new_rect.x + 3)
933
+ elif self.horizontal_alignment == wx.ALIGN_RIGHT:
934
+ new_rect.SetWidth(new_rect.width - 1)
935
+
936
+ new_width = rect.width
937
+
938
+ if xshift > 0:
939
+ new_width = new_width/xshift
940
+
941
+ if self.shrink_to_fit:
942
+
943
+ font = FontFromFont(self.font)
944
+ point_size = font.GetPointSize()
945
+
946
+ while 1:
947
+ value = wordwrap(self.value, new_width, dc)
948
+ if "\n" not in value or point_size < 2:
949
+ break
950
+
951
+ point_size -= 1
952
+ font.SetPointSize(point_size)
953
+ dc.SetFont(font)
954
+
955
+ elif self.text_wrapped:
956
+
957
+ value = wordwrap(self.value, new_width, dc)
958
+ text_width, text_height, dummy = dc.GetFullMultiLineTextExtent(value)
959
+
960
+ if self.rotation:
961
+ if self.shrink_to_fit:
962
+ text_width, text_height = dc.GetTextExtent(value)
963
+
964
+ xc, yc = (rect.x+rect.width/2, rect.y+rect.height/2)
965
+ xp = xc - (text_width/2)*xshift - (text_height/2)*yshift
966
+ yp = yc + (text_width/2)*yshift - (text_height/2)*xshift
967
+
968
+ dc.DrawRotatedText(value, xp, yp, self.rotation)
969
+
970
+ else:
971
+
972
+ dc.DrawLabel(value, new_rect, self.horizontal_alignment|self.vertical_alignment)
973
+
974
+
975
+ class XLSRichText(XLSText):
976
+ """
977
+ This is a class which holds information about the cell content, in terms
978
+ of actual cell value, font, text colour, alignment and formatting. In addition
979
+ to what :class:`XLSText` does, this class attempts to handle cells with rich text
980
+ content.
981
+ """
982
+
983
+ def __init__(self, book, cell, xf_index, display_text=None, hyperlink=None, rich_text=None, default_width=10):
984
+ """
985
+ Default class constructor.
986
+
987
+ :param `book`: an instance of the `xlrd.Book` class;
988
+ :param `cell`: an instance of `xlrd.sheet.Cell` class;
989
+ :param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
990
+ reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`);
991
+ :param `display_text`: if Mark Hammonds' `pywin32` package is available,
992
+ this is the WYSIWYG cell content;
993
+ :param `hyperlink`: if this cell contains a hyperlink, it will be displayed
994
+ accordingly;
995
+ :param `rich_text`: if this cell contains text in rich text format, :class:`XLSGrid`
996
+ will do its best to render the text as rich text;
997
+ :param `default_width`: this is the default width of the text in 1/256
998
+ of the width of the zero character, using default Excel font (first FONT
999
+ record in the Excel file).
1000
+
1001
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the *hyperlink*
1002
+ parameter will always be ``None`` as this feature is available only in
1003
+ `xlrd` 0.7.2 (SVN).
1004
+
1005
+ :note: If you are using version 0.7.1 or lower for `xlrd`, this class will
1006
+ note be used by :class:`XLSGrid`.
1007
+
1008
+ .. warning::
1009
+
1010
+ This class currently supports only single-line non-rotated text,
1011
+ and it discards properties like `shrink-to-fit` and `wrapping`.
1012
+
1013
+ """
1014
+
1015
+ XLSText.__init__(self, book, cell, xf_index, display_text, hyperlink, default_width)
1016
+
1017
+ self.BuildChunks(book, xf_index, rich_text)
1018
+
1019
+
1020
+ def BuildChunks(self, book, xf_index, rich_text):
1021
+ """
1022
+ Splits the cell content accordingly to their rich text format index.
1023
+
1024
+ :param `book`: an instance of the `xlrd.Book` class;
1025
+ :param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
1026
+ reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`);
1027
+ :param `rich_text`: if this cell contains text in rich text format, :class:`XLSGrid`
1028
+ will do its best to render the text as rich text.
1029
+ """
1030
+
1031
+ XFClass = book.xf_list[xf_index]
1032
+ offset, index = rich_text[0]
1033
+
1034
+ if offset != 0:
1035
+ new_tuple = (0, XFClass.font_index)
1036
+ rich_text.insert(0, new_tuple)
1037
+
1038
+ value = self.value
1039
+ rich_text.append((len(value), rich_text[-1][1]))
1040
+ attributes = []
1041
+
1042
+ for indx in range(len(rich_text)-1):
1043
+ offset_start, index_start = rich_text[indx]
1044
+ offset_end, index_end = rich_text[indx+1]
1045
+
1046
+ chunk = value[offset_start:offset_end]
1047
+
1048
+ font = book.font_list[index_start]
1049
+ ffont = self.CreateFont(font)
1050
+ text_colour = book.colour_map[font.colour_index]
1051
+ colour = self.CreateTextColour(text_colour)
1052
+
1053
+ ffont.escapement = font.escapement
1054
+ attributes.append([chunk, ffont, colour])
1055
+
1056
+ self.attributes = attributes
1057
+
1058
+
1059
+ def Measure(self, dc):
1060
+ """
1061
+ Convenience method to measure the maximum height and total width of all
1062
+ the chunks of text composing our rich text string.
1063
+
1064
+ :param `dc`: an instance of :class:`wx.DC`.
1065
+ """
1066
+
1067
+ maxH = -1
1068
+ full_width = 0
1069
+ for chunk, font, colour in self.attributes:
1070
+ dc.SetFont(font)
1071
+ width, height, descent, leading = dc.GetFullTextExtent(chunk, font)
1072
+ maxH = max(maxH, height-leading)
1073
+ full_width += width
1074
+
1075
+ return maxH, full_width
1076
+
1077
+
1078
+ def Draw(self, dc, rect):
1079
+ """
1080
+ Actually draws all the chunks of text on a grid cell, one by one.
1081
+
1082
+ :param `dc`: an instance of :class:`wx.DC`;
1083
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1084
+ """
1085
+
1086
+ new_rect = wx.Rect(*rect)
1087
+
1088
+ text_width, text_height = dc.GetTextExtent(self.value)
1089
+ default_width = int(round(float(self.default_width)*text_width/256.0))
1090
+ indentation = int(256.0*default_width/float(self.default_width))
1091
+
1092
+ maxH, full_width = self.Measure(dc)
1093
+
1094
+ if self.indent_level:
1095
+ new_rect.SetLeft(new_rect.x + indentation)
1096
+ else:
1097
+ if self.horizontal_alignment == wx.ALIGN_LEFT:
1098
+ new_rect.SetLeft(new_rect.x + 3)
1099
+ elif self.horizontal_alignment == wx.ALIGN_RIGHT:
1100
+ new_rect.SetLeft(new_rect.x + (new_rect.width - full_width) - 1)
1101
+ else:
1102
+ space = int((new_rect.width - full_width)/2.0)
1103
+ new_rect.SetLeft(new_rect.x + space)
1104
+ new_rect.SetWidth(full_width+space)
1105
+
1106
+ if self.vertical_alignment == wx.ALIGN_TOP:
1107
+ vspace = 0
1108
+ elif self.vertical_alignment == wx.ALIGN_BOTTOM:
1109
+ vspace = (new_rect.height - maxH - 1)
1110
+ else:
1111
+ vspace = int((new_rect.height - maxH)/2.0)
1112
+
1113
+ start = new_rect.x
1114
+ y = new_rect.y
1115
+
1116
+ for chunk, font, colour in self.attributes:
1117
+ dc.SetTextForeground(colour)
1118
+ dc.SetFont(font)
1119
+ width, height, descent, leading = dc.GetFullTextExtent(chunk, font)
1120
+ if font.escapement > 0:
1121
+ height = height*0.7
1122
+
1123
+ ypos = y-height+maxH+vspace
1124
+
1125
+ if font.escapement == 1:
1126
+ ypos = ypos - maxH + height
1127
+
1128
+ dc.DrawText(chunk, start, ypos)
1129
+ start += width
1130
+
1131
+
1132
+ class XLSBackground(object):
1133
+ """
1134
+ This is a class which holds information about the cell background, in terms
1135
+ of background colour and background pattern (hatching).
1136
+ """
1137
+
1138
+ def __init__(self, book, xf_index):
1139
+ """
1140
+ Default class constructor.
1141
+
1142
+ :param `book`: an instance of the `xlrd.Book` class;
1143
+ :param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
1144
+ reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`).
1145
+ """
1146
+
1147
+ XFClass = book.xf_list[xf_index]
1148
+
1149
+ background = XFClass.background
1150
+ background_colour = book.colour_map[background.background_colour_index]
1151
+ pattern_colour = book.colour_map[background.pattern_colour_index]
1152
+ fill_pattern = background.fill_pattern
1153
+
1154
+ self.CreateBackgroundColour(background_colour, pattern_colour, fill_pattern)
1155
+
1156
+
1157
+ def CreateBackgroundColour(self, background_colour, pattern_colour, fill_pattern):
1158
+ """
1159
+ Creates a suitable wxPython colour for the cell background starting from
1160
+ a `xlrd` tuple representing this colour.
1161
+
1162
+ :param `background_colour`: a tuple representing the RGB components of the
1163
+ cell background colour. If `background_colour` is ``None``, use the
1164
+ default ``wx.SYS_COLOUR_WINDOW``;
1165
+ :param `pattern_colour`: a tuple representing the RGB components of the
1166
+ cell pattern colour;
1167
+ :param `fill_pattern`: the pattern to use to draw hatches on top of the
1168
+ background.
1169
+ """
1170
+
1171
+ if background_colour is not None:
1172
+ background_colour = wx.Colour(*background_colour)
1173
+ else:
1174
+ background_colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
1175
+
1176
+ if pattern_colour is not None:
1177
+ pattern_colour = wx.Colour(*pattern_colour)
1178
+
1179
+ self.background_brush = wx.Brush(background_colour)
1180
+ self.background_colour = background_colour
1181
+
1182
+ self.fill_brush = None
1183
+
1184
+ if fill_pattern <= 0:
1185
+ return
1186
+
1187
+ r, g, b, a = pattern_colour
1188
+
1189
+ fill_image = eval("_xls_background_%02d.GetImage()"%fill_pattern)
1190
+ fill_image.Replace(0, 0, 0, r, g, b)
1191
+ r, g, b = background_colour.Red(), background_colour.Green(), background_colour.Blue()
1192
+ fill_image.Replace(255, 255, 255, r, g, b)
1193
+ fill_bitmap = fill_image.ConvertToBitmap()
1194
+
1195
+ self.fill_brush = wx.Brush(fill_bitmap)
1196
+
1197
+
1198
+ def CombineAttr(self, attr):
1199
+ """
1200
+ Combines the input attribute `attr` with the features of the :class:`XLSBackground` class.
1201
+
1202
+ :param `attr`: an instance of :class:`grid.GridCellAttr`.
1203
+ """
1204
+
1205
+ attr.SetBackgroundColour(self.background_colour)
1206
+ return attr
1207
+
1208
+
1209
+ def Draw(self, dc, rect):
1210
+ """
1211
+ Actually draws the cell background and pattern hatching on a grid cell.
1212
+
1213
+ :param `dc`: an instance of :class:`wx.DC`;
1214
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1215
+ """
1216
+
1217
+ dc.SetClippingRegion(rect)
1218
+
1219
+ dc.SetBackgroundMode(wx.SOLID)
1220
+ dc.SetBrush(self.background_brush)
1221
+ dc.SetPen(wx.TRANSPARENT_PEN)
1222
+ dc.DrawRectangle(rect)
1223
+
1224
+ if self.fill_brush:
1225
+
1226
+ dc.SetBrush(self.fill_brush)
1227
+ dc.SetBackgroundMode(wx.TRANSPARENT)
1228
+ dc.DrawRectangle(rect)
1229
+
1230
+ dc.DestroyClippingRegion()
1231
+
1232
+
1233
+ class XLSBorder(object):
1234
+ """
1235
+ This is a class which holds information about a single cell border, in terms
1236
+ of its location (top, left, bottom, right, diagonal), its colour, width and
1237
+ shape.
1238
+ """
1239
+
1240
+ def __init__(self, location, line_style, border_colour, default_colour, diagonals):
1241
+ """
1242
+ Default class constructor.
1243
+
1244
+ :param `location`: the actual border location (top, left, bottom, right,
1245
+ diagonal);
1246
+ :param `line_style`: the line style used by Excel to draw this border;
1247
+ :param `border_colour`: the colour used by Excel to draw this border;
1248
+ :param `default_colour`: the "magic" colour used by Excel to draw non-custom
1249
+ border lines;
1250
+ :param `diagonals`: a tuple containing whether or not to draw the up and down
1251
+ diagonal borders.
1252
+ """
1253
+
1254
+ self.draw_priority = 2
1255
+
1256
+ if line_style == NO_LINE:
1257
+
1258
+ if border_colour == (0, 0, 0):
1259
+ self.draw_priority = 0
1260
+ border_colour = wx.Colour(*default_colour)
1261
+ else:
1262
+ self.draw_priority = 1
1263
+ border_colour = wx.BLACK
1264
+
1265
+ self.pen = wx.Pen(border_colour, 1, wx.PENSTYLE_SOLID)
1266
+ pen_style = THIN
1267
+
1268
+ else:
1269
+
1270
+ if border_colour == (0, 0, 0):
1271
+ border_colour = wx.Colour(*default_colour)
1272
+ self.draw_priority = 2
1273
+ elif border_colour is None:
1274
+ border_colour = wx.BLACK
1275
+ self.draw_priority = 2
1276
+ else:
1277
+ border_colour = wx.Colour(*border_colour)
1278
+
1279
+ pen_width, pen_style = XF_PEN_STYLES[line_style]
1280
+ if pen_width > 2:
1281
+ self.draw_priority = 4
1282
+ elif pen_width > 1:
1283
+ self.draw_priority = 3
1284
+
1285
+ self.pen = wx.Pen(border_colour, pen_width, pen_style)
1286
+
1287
+ self.diagonals = diagonals
1288
+ self.location = location
1289
+ self.pen_style = pen_style
1290
+ self.line_style = line_style
1291
+
1292
+
1293
+ def Draw(self, dc, rect):
1294
+ """
1295
+ Actually draws the cell border.
1296
+
1297
+ :param `dc`: an instance of :class:`wx.DC`;
1298
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1299
+ """
1300
+
1301
+ dc.SetBackgroundMode(wx.TRANSPARENT)
1302
+ dc.SetPen(self.pen)
1303
+
1304
+ if self.location == DIAGONAL:
1305
+ self.DrawDiagonals(dc, rect)
1306
+ else:
1307
+ self.DrawBorder(dc, rect)
1308
+
1309
+
1310
+ def DrawDiagonals(self, dc, rect):
1311
+ """
1312
+ Actually draws the cell diagonal border.
1313
+
1314
+ :param `dc`: an instance of :class:`wx.DC`;
1315
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1316
+ """
1317
+
1318
+ diag_up, diag_down = self.diagonals
1319
+
1320
+ if diag_down:
1321
+ xstart, ystart = rect.GetTopLeft()
1322
+ xend, yend = rect.GetBottomRight()
1323
+
1324
+ if self.line_style == DOUBLE:
1325
+ dc.DrawLine(xstart+2, ystart, xend, yend-2)
1326
+ dc.DrawLine(xstart, ystart+2, xend-2, yend)
1327
+ else:
1328
+ dc.DrawLine(xstart, ystart, xend, yend)
1329
+
1330
+ if diag_up:
1331
+
1332
+ xstart, ystart = rect.GetBottomLeft()
1333
+ xend, yend = rect.GetTopRight()
1334
+
1335
+ if self.line_style == DOUBLE:
1336
+ dc.DrawLine(xstart, ystart-2, xend-2, yend)
1337
+ dc.DrawLine(xstart+2, ystart, xend, yend+2)
1338
+ else:
1339
+ dc.DrawLine(xstart, ystart, xend, yend)
1340
+
1341
+
1342
+ def DrawBorder(self, dc, rect):
1343
+ """
1344
+ Actually draws the cell border (one of left, right, bottom, top).
1345
+
1346
+ :param `dc`: an instance of :class:`wx.DC`;
1347
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1348
+ """
1349
+
1350
+ pen_width = self.pen.GetWidth()
1351
+ location = self.location
1352
+ new_rect = wx.Rect(*rect)
1353
+
1354
+ x, y, w, h = new_rect
1355
+ line_style = self.line_style
1356
+
1357
+ shift = 0
1358
+ if pen_width == 2:
1359
+ shift = pen_width - 1
1360
+ if pen_width > 2:
1361
+ shift = pen_width - 2
1362
+
1363
+ if location == BOTTOM:
1364
+
1365
+ if self.draw_priority < 2:
1366
+ return
1367
+
1368
+ if line_style == DOUBLE:
1369
+ dc.DrawLine(x, y+h-1, x+w, y+h-1)
1370
+ dc.DrawLine(x, y+h+1, x+w, y+h+1)
1371
+ else:
1372
+ dc.DrawLine(x+1, y+h, x+w, y+h)
1373
+
1374
+
1375
+ elif location == TOP:
1376
+
1377
+ if line_style == DOUBLE:
1378
+ dc.DrawLine(x, y-1, x+w, y-1)
1379
+ dc.DrawLine(x, y+1, x+w, y+1)
1380
+ else:
1381
+ dc.DrawLine(x+1, y+shift, x+w, y+shift)
1382
+
1383
+ elif location == LEFT:
1384
+
1385
+ if line_style == DOUBLE:
1386
+ dc.DrawLine(x-1, y, x-1, y+h)
1387
+ dc.DrawLine(x+1, y, x+1, y+h)
1388
+ else:
1389
+ dc.DrawLine(x+shift, y+1, x+shift, y+h)
1390
+
1391
+ elif location == RIGHT:
1392
+
1393
+ if self.draw_priority < 2:
1394
+ return
1395
+
1396
+ if line_style == DOUBLE:
1397
+ dc.DrawLine(x+w-1, y, x+w-1, y+h)
1398
+ dc.DrawLine(x+w+1, y, x+w+1, y+h)
1399
+ else:
1400
+ dc.DrawLine(x+w+1, y+1, x+w+1, y+h)
1401
+
1402
+
1403
+ class XLSBorderFactory(object):
1404
+ """
1405
+ This is a factory class which holds information about all the borders in a
1406
+ cell. Its implementation and use is merely to simplify the handling of the
1407
+ different cell borders (left, top, bottom, right, diagonal).
1408
+ """
1409
+
1410
+ def __init__(self, book, border, default_colour):
1411
+ """
1412
+ Default class constructor.
1413
+
1414
+ :param `book`: an instance of the `xlrd.Book` class;
1415
+ :param `border`: an instance of `xlrd.formatting.XFBorder` class;
1416
+ :param `default_colour`: the "magic" colour used by Excel to draw non-custom
1417
+ border lines.
1418
+ """
1419
+
1420
+ borders = {}
1421
+ diagonals = border.diag_up, border.diag_down
1422
+
1423
+ for label, location in list(XF_BORDER_STYLES.items()):
1424
+ line_style = getattr(border, "%s_line_style"%label)
1425
+ colour_index = getattr(border, "%s_colour_index"%label)
1426
+ border_colour = book.colour_map[colour_index]
1427
+
1428
+ border_class = XLSBorder(location, line_style, border_colour, default_colour, diagonals)
1429
+ borders[location] = border_class
1430
+
1431
+ self.draw_priority = sorted(list(borders.values()), key=attrgetter('draw_priority'))
1432
+
1433
+
1434
+ def Draw(self, dc, rect):
1435
+ """
1436
+ Actually draws all the cell borders based on their drawing priority.
1437
+
1438
+ :param `dc`: an instance of :class:`wx.DC`;
1439
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1440
+
1441
+ :note: The drawing priority is assigned depending on if the border is a
1442
+ custom one or not. Customized borders are drawn last.
1443
+ """
1444
+
1445
+ for border in self.draw_priority:
1446
+ border.Draw(dc, rect)
1447
+
1448
+
1449
+ class XLSComment(object):
1450
+ """
1451
+ This is a class which holds information about the content of the "comment
1452
+ window" (aka note) in Excel.
1453
+
1454
+ :note: If Mark Hammonds' `pywin32` package is not available, this class can
1455
+ not be used.
1456
+ """
1457
+
1458
+ def __init__(self, comment):
1459
+ """
1460
+ Default class constructor.
1461
+
1462
+ :param `comment`: the actual text contained in the Excel cell comment (note).
1463
+ """
1464
+
1465
+ self.comment = comment
1466
+
1467
+
1468
+ def Draw(self, dc, rect):
1469
+ """
1470
+ Actually draws a small red triangle in the top-right corder of the cell
1471
+ to indicate that a comment is present.
1472
+
1473
+ :param `dc`: an instance of :class:`wx.DC`;
1474
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle.
1475
+ """
1476
+
1477
+ right = rect.GetTopRight()
1478
+ points = [wx.Point(right.x-5, right.y),
1479
+ right,
1480
+ wx.Point(right.x, right.y+5)]
1481
+
1482
+ dc.SetBrush(wx.RED_BRUSH)
1483
+ dc.SetPen(wx.RED_PEN)
1484
+ dc.DrawPolygon(points)
1485
+
1486
+
1487
+ class XLSCell(object):
1488
+ """
1489
+ This is a class which holds information about a single cell in :class:`XLSGrid`.
1490
+ It stores (via auxiliary classes), all details about cell background, text,
1491
+ font, colours and borders.
1492
+ """
1493
+
1494
+ def __init__(self, book, cell, xf_index, xls_text, xls_comment, hyperlink, rich_text, default_width, default_colour):
1495
+ """
1496
+ Default class constructor.
1497
+
1498
+ :param `book`: an instance of the `xlrd.Book` class;
1499
+ :param `cell`: an instance of `xlrd.sheet.Cell` class;
1500
+ :param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
1501
+ reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`);
1502
+ :param `xls_text`: the actual WYSIWYG cell text, if available;
1503
+ :param `xls_comment`: the cell comment (note), if any;
1504
+ :param `hyperlink`: an instance of `xlrd.sheet.hyperlink`;
1505
+ :param `rich_text`: if this cell contains text in rich text format, :class:`XLSGrid`
1506
+ will do its best to render the text as rich text;
1507
+ :param `default_width`: this is the default width of the text in 1/256
1508
+ of the width of the zero character, using default Excel font (first FONT
1509
+ record in the Excel file);
1510
+ :param `default_colour`: the "magic" colour used by Excel to draw non-custom
1511
+ border lines.
1512
+
1513
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the *hyperlink*
1514
+ parameter will always be ``None`` as this feature is available only in
1515
+ `xlrd` 0.7.2 (SVN).
1516
+
1517
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the `rich_text`
1518
+ parameter will always be ``None`` as this feature is available only in
1519
+ `xlrd` 0.7.2 (SVN).
1520
+
1521
+ :note: if Mark Hammonds' `pywin32` package is not available, the `xls_text`
1522
+ parameter will almost surely not be the WYSIWYG representation of the cell
1523
+ text.
1524
+
1525
+ :note: If Mark Hammonds' `pywin32` package is not available, the `xls_comment`
1526
+ parameter will always be ``None``.
1527
+ """
1528
+
1529
+ self.size = 1, 1
1530
+
1531
+ self.comment = None
1532
+ self.hyperlink = None
1533
+
1534
+ self.SetupCell(book, cell, xf_index, xls_text, xls_comment, hyperlink, rich_text, default_width, default_colour)
1535
+
1536
+
1537
+ def SetupCell(self, book, cell, xf_index, xls_text, xls_comment, hyperlink, rich_text, default_width, default_colour):
1538
+ """
1539
+ Actually sets up the :class:`XLSCell` class. This is an auxiliary method to
1540
+ avoid cluttering the :meth:`~xlsgrid.XLSCell.__init__` method.
1541
+
1542
+ :param `book`: an instance of the `xlrd.Book` class;
1543
+ :param `cell`: an instance of `xlrd.sheet.Cell` class;
1544
+ :param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
1545
+ reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`);
1546
+ :param `xls_text`: the actual WYSIWYG cell text, if available;
1547
+ :param `xls_comment`: the cell comment (note), if any;
1548
+ :param `hyperlink`: an instance of `xlrd.sheet.hyperlink`;
1549
+ :param `rich_text`: if this cell contains text in rich text format, :class:`XLSGrid`
1550
+ will do its best to render the text as rich text;
1551
+ :param `default_width`: this is the default width of the text in 1/256
1552
+ of the width of the zero character, using default Excel font (first FONT
1553
+ record in the Excel file);
1554
+ :param `default_colour`: the "magic" colour used by Excel to draw non-custom
1555
+ border lines.
1556
+
1557
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the *hyperlink*
1558
+ parameter will always be ``None`` as this feature is available only in
1559
+ `xlrd` 0.7.2 (SVN).
1560
+
1561
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the `rich_text`
1562
+ parameter will always be ``None`` as this feature is available only in
1563
+ `xlrd` 0.7.2 (SVN).
1564
+
1565
+ :note: if Mark Hammonds' `pywin32` package is not available, the `xls_text`
1566
+ parameter will almost surely not be the WYSIWYG representation of the cell
1567
+ text.
1568
+
1569
+ :note: If Mark Hammonds' `pywin32` package is not available, the `xls_comment`
1570
+ parameter will always be ``None``.
1571
+ """
1572
+
1573
+ cvalue = cell.value
1574
+ self.raw_value = cvalue
1575
+
1576
+ if rich_text:
1577
+ self.text = XLSRichText(book, cell, xf_index, xls_text, hyperlink, rich_text, default_width)
1578
+ else:
1579
+ self.text = XLSText(book, cell, xf_index, xls_text, hyperlink, default_width)
1580
+
1581
+ self.background = XLSBackground(book, xf_index)
1582
+
1583
+ XFClass = book.xf_list[xf_index]
1584
+ border = XFClass.border
1585
+
1586
+ self.borders = XLSBorderFactory(book, border, default_colour)
1587
+
1588
+ if xls_comment:
1589
+ self.comment = XLSComment(xls_comment)
1590
+
1591
+ self.attr = None
1592
+
1593
+
1594
+ def GetAttr(self):
1595
+ """
1596
+ Returns the attribute to use for this specific cell.
1597
+
1598
+ :returns: an instance of :class:`grid.GridCellAttr`.
1599
+ """
1600
+
1601
+ if self.attr is not None:
1602
+ self.attr.IncRef()
1603
+ return self.attr
1604
+
1605
+ attr = gridlib.GridCellAttr()
1606
+
1607
+ attr.SetRenderer(XLSRenderer(self))
1608
+
1609
+ attr.SetSize(*self.size)
1610
+ attr.SetOverflow(True)
1611
+ self.attr = attr
1612
+ self.attr.IncRef()
1613
+
1614
+ return self.attr
1615
+
1616
+
1617
+ def GetValue(self):
1618
+ """ Returns the actual WYSIWYG representation of the cell value. """
1619
+
1620
+ return self.text.GetValue()
1621
+
1622
+
1623
+ def SetValue(self, value):
1624
+ """
1625
+ Sets the actual WYSIWYG representation of the cell value.
1626
+
1627
+ :param `value`: the current text value to insert in the cell.
1628
+
1629
+ :note: This method is currently unused as everything is handled inside the :class:`XLSText` class.
1630
+
1631
+ :see: :meth:`~xlsgrid.XLSCell.GetValue`
1632
+ """
1633
+
1634
+ self.value = value
1635
+
1636
+
1637
+ def SetCellSize(self, rows, cols):
1638
+ """
1639
+ Sets the size of the cell.
1640
+
1641
+ Specifying a value of more than 1 in `rows` or `cols` will make the cell
1642
+ at (`row`, `col`) span the block of the specified size, covering the other
1643
+ cells which would be normally shown in it. Passing 1 for both arguments
1644
+ resets the cell to normal appearance.
1645
+
1646
+ :param `rows`: number of rows to be occupied by this cell, must be >= 1;
1647
+ :param `cols`: number of columns to be occupied by this cell, must be >= 1.
1648
+ """
1649
+
1650
+ self.size = (rows, cols)
1651
+
1652
+
1653
+ def GetComment(self):
1654
+ """
1655
+ Returns the cell comment, if any.
1656
+
1657
+ :returns: an instance of :class:`XLSComment`.
1658
+
1659
+ :note: If Mark Hammonds' `pywin32` package is not available, this method
1660
+ always returns ``None``.
1661
+ """
1662
+
1663
+ return self.comment
1664
+
1665
+
1666
+ class XLSRenderer(gridlib.GridCellRenderer):
1667
+ """
1668
+ This class is responsible for actually drawing the cell in the grid.
1669
+
1670
+ """
1671
+
1672
+ def __init__(self, cell):
1673
+ """
1674
+ Default class constructor.
1675
+
1676
+ :param `cell`: an instance of :class:`XLSCell`.
1677
+ """
1678
+
1679
+ gridlib.GridCellRenderer.__init__(self)
1680
+ self.cell = cell
1681
+
1682
+
1683
+ def Draw(self, grid, attr, dc, rect, row, col, isSelected):
1684
+ """
1685
+ Draw the given cell on the provided `dc` inside the given rectangle using
1686
+ default or selected state corresponding to the `isSelected` value.
1687
+
1688
+ :param `grid`: an instance of :class:`grid.Grid`;
1689
+ :param `attr`: an instance of :class:`grid.GridCellAttr`;
1690
+ :param `dc`: an instance of :class:`wx.DC`;
1691
+ :param `rect`: an instance of :class:`wx.Rect`, representing the cell rectangle;
1692
+ :param `row`: the row in which this cell lives;
1693
+ :param `col`: the column in which this cell lives;
1694
+ :param `isSelected`: ``True`` if the cell is selected, ``False`` otherwise.
1695
+ """
1696
+
1697
+ # clear the background
1698
+ dc.SetBackgroundMode(wx.SOLID)
1699
+
1700
+ cell = self.cell
1701
+
1702
+ cell.background.Draw(dc, rect)
1703
+
1704
+ if cell.borders:
1705
+ cell.borders.Draw(dc, rect)
1706
+
1707
+ cell.text.Draw(dc, rect)
1708
+
1709
+ if cell.comment:
1710
+ cell.comment.Draw(dc, rect)
1711
+
1712
+ if isSelected:
1713
+
1714
+ gdc = wx.GCDC(dc)
1715
+
1716
+ sys_colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)
1717
+ brush_colour = wx.Colour(sys_colour.Red(), sys_colour.Green(), sys_colour.Blue(), 90)
1718
+
1719
+ gdc.SetBrush(wx.Brush(brush_colour))
1720
+ gdc.SetPen(wx.TRANSPARENT_PEN)
1721
+
1722
+ gdc.DrawRectangle(rect)
1723
+
1724
+
1725
+ class XLSTable(gridlib.GridTableBase):
1726
+ """
1727
+ The almost abstract base class for grid tables.
1728
+
1729
+ A grid table is responsible for storing the grid data and, indirectly, grid
1730
+ cell attributes. The data can be stored in the way most convenient for the
1731
+ application but has to be provided in string form to :class:`grid.Grid`.
1732
+ """
1733
+
1734
+ def __init__(self, grid, cells, rows, cols):
1735
+ """
1736
+ Default class constructor.
1737
+
1738
+ :param `grid`: an instance of :class:`grid.Grid`;
1739
+ :param `cells`: a Python dictionary. For every key `(row, col)`, the
1740
+ corresponding value is an instance of :class:`XLSCell`;
1741
+ :param `rows`: the number of rows in the table;
1742
+ :param `cols`: the number of columns in the table.
1743
+ """
1744
+
1745
+ # The base class must be initialized *first*
1746
+ gridlib.GridTableBase.__init__(self)
1747
+
1748
+ self.cells = cells
1749
+ self.dimens = (rows, cols)
1750
+
1751
+
1752
+ def GetNumberCols(self):
1753
+ """ Returns the number of columns in the table. """
1754
+
1755
+ return self.dimens[1]
1756
+
1757
+
1758
+ def GetNumberRows(self):
1759
+ """ Returns the number of rows in the table. """
1760
+
1761
+ return self.dimens[0]
1762
+
1763
+
1764
+ def GetValue(self, row, col):
1765
+ """
1766
+ Returns the cell content for the specified row and column.
1767
+
1768
+ :param `row`: the row in which this cell lives;
1769
+ :param `col`: the column in which this cell lives.
1770
+ """
1771
+
1772
+ cell = self.cells[(row, col)]
1773
+ return cell.GetValue()
1774
+
1775
+
1776
+ def SetValue(self, row, col, value):
1777
+ """
1778
+ sets the cell content for the specified row and column.
1779
+
1780
+ :param `row`: the row in which this cell lives;
1781
+ :param `col`: the column in which this cell lives;
1782
+ :param `value`: the new value to assign to the specified cell.
1783
+ """
1784
+
1785
+ cell = self.cells[(row, col)]
1786
+ cell.SetValue(value)
1787
+
1788
+
1789
+ def GetAttr(self, row, col, kind):
1790
+ """
1791
+ Return the attribute for the given cell.
1792
+
1793
+ :param `row`: the row in which this cell lives;
1794
+ :param `col`: the column in which this cell lives;
1795
+ :param `kind`: the kind of the attribute to return.
1796
+ """
1797
+
1798
+ cell = self.cells[(row, col)]
1799
+ return cell.GetAttr()
1800
+
1801
+
1802
+ def GetRawValue(self, row, col):
1803
+ """
1804
+ Returns the "raw" value for the cell content.
1805
+
1806
+ :param `row`: the row in which this cell lives;
1807
+ :param `col`: the column in which this cell lives.
1808
+ """
1809
+
1810
+ cell = self.cells[(row, col)]
1811
+ return cell.raw_value
1812
+
1813
+
1814
+ class XLSGrid(gridlib.Grid):
1815
+ """
1816
+ :class:`XLSGrid` is a class based on :class:`grid.Grid` that can be used to faithfully
1817
+ reproduce the appearance of a Microsoft Excel spreadsheet (one worksheet per
1818
+ every instance of :class:`XLSGrid`).
1819
+
1820
+ :class:`XLSGrid` is a completely owner-drawn control, and it relies on the power of
1821
+ :class:`grid.PyGridTableBase` and :class:`grid.PyGridCellRenderer` to draw the cell
1822
+ content. For this reasons (and for some others, see the TODOs section), it will
1823
+ work efficiently only for relatively small Excel files.
1824
+ """
1825
+
1826
+ def __init__(self, parent):
1827
+ """
1828
+ Default class constructor.
1829
+
1830
+ :param `parent`: the grid parent window. Must not be ``None``.
1831
+ """
1832
+
1833
+ gridlib.Grid.__init__(self, parent)
1834
+
1835
+ self.SetMargins(0, 0)
1836
+ self.SetDefaultCellBackgroundColour(parent.GetBackgroundColour())
1837
+ self.SetDefaultCellOverflow(True)
1838
+
1839
+ self.tip_window = None
1840
+ self.tip_shown = False
1841
+
1842
+
1843
+ def DestroyTip(self):
1844
+ """
1845
+ If a comment window or a tooltip over a hyperlink have been created, this
1846
+ method destroys them.
1847
+ """
1848
+
1849
+ if self.tip_window:
1850
+ try:
1851
+ self.tip_window.GetTipWindow().Destroy()
1852
+ except RuntimeError:
1853
+ pass
1854
+
1855
+ del self.tip_window
1856
+ self.tip_window = None
1857
+
1858
+ if self.tip_shown:
1859
+ self.GetGridWindow().SetToolTip("")
1860
+ self.GetGridWindow().SetCursor(wx.NullCursor)
1861
+ self.tip_shown = False
1862
+
1863
+
1864
+ def InstallGridHint(self):
1865
+ """
1866
+ Auxiliary method used to bind a ``wx.EVT_MOTION`` event to :class:`XLSGrid`.
1867
+ """
1868
+
1869
+ self.prev_rowcol = [None, None]
1870
+
1871
+ def OnMouseMotion(event):
1872
+ """
1873
+ Handles a the ``wx.EVT_MOTION`` events for :class:`XLSGrid`.
1874
+
1875
+ :param `event`: a :class:`MouseEvent` event to be processed.
1876
+ """
1877
+
1878
+ # evt.GetRow() and evt.GetCol() would be nice to have here,
1879
+ # but as this is a mouse event, not a grid event, they are not
1880
+ # available and we need to compute them by hand.
1881
+ position = event.GetPosition()
1882
+ x, y = self.CalcUnscrolledPosition(position)
1883
+ row = self.YToRow(y)
1884
+ col = self.XToCol(x)
1885
+
1886
+ if [row, col] != self.prev_rowcol and row >= 0 and col >= 0:
1887
+
1888
+ self.prev_rowcol[:] = [row, col]
1889
+ self.DestroyTip()
1890
+ cell = self.cells[(row, col)]
1891
+ rect = self.CellToRect(row, col)
1892
+ comment = cell.GetComment()
1893
+
1894
+ window = self.GetGridWindow()
1895
+ if cell.text.IsHyperLink():
1896
+ window.SetCursor(wx.Cursor(wx.CURSOR_HAND))
1897
+ window.SetToolTip(cell.text.tooltip)
1898
+ self.tip_shown = True
1899
+ if not comment:
1900
+ return
1901
+
1902
+ if comment:
1903
+ self.tip_window = TransientPopup(window, comment, wx.GetMousePosition())
1904
+ event.Skip()
1905
+
1906
+ self.GetGridWindow().Bind(wx.EVT_MOTION, OnMouseMotion)
1907
+
1908
+
1909
+ def PopulateGrid(self, book, sheet, display_texts, comments):
1910
+ """
1911
+ This is the main method of this class, and it is used to actually create
1912
+ the cells, size the columns and rows, merging cells, etc...
1913
+
1914
+ :param `book`: an instance of the `xlrd.Book` class;
1915
+ :param `sheet`: an instance of the `xlrd.sheet` class;
1916
+ :param `display_texts`: if Mark Hammonds' `pywin32` package is available,
1917
+ this is the WYSIWYG cell content for all the cells in the Excel worksheet;
1918
+ :param `comments`: if Mark Hammonds' `pywin32` package is available,
1919
+ this is a nested list of cell comments (notes) for all the cells in the
1920
+ Excel worksheet.
1921
+ """
1922
+
1923
+ self.BeginBatch()
1924
+
1925
+ nrows = sheet.nrows
1926
+ ncols = sheet.ncols
1927
+
1928
+ default_width, default_height = self.GetDefaultFontData(book)
1929
+ default_colour = self.GetGridLineColour()
1930
+
1931
+ hyperlinks, rich_text_list = {}, {}
1932
+ if hasattr(sheet, "hyperlink_map"):
1933
+ # New in xlrd version 0.7.2 from SVN
1934
+ hyperlinks = sheet.hyperlink_map
1935
+
1936
+ if hasattr(sheet, "rich_text_runlist_map"):
1937
+ # New in xlrd version 0.7.2 from SVN
1938
+ rich_text_list = sheet.rich_text_runlist_map
1939
+
1940
+ self.cells = {}
1941
+
1942
+ for i in range(nrows):
1943
+
1944
+ for j in range(ncols):
1945
+
1946
+ hyperlink = rich_text = None
1947
+
1948
+ if (i, j) in hyperlinks:
1949
+ hyperlink = hyperlinks[(i, j)]
1950
+ if (i, j) in rich_text_list:
1951
+ rich_text = rich_text_list[(i, j)]
1952
+
1953
+ self.FormatCell(book, sheet, i, j, display_texts, comments, hyperlink, rich_text, default_width, default_colour)
1954
+
1955
+ self.table = XLSTable(self, self.cells, nrows, ncols)
1956
+ self.SetTable(self.table)
1957
+
1958
+ row_height = sheet.default_row_height
1959
+ col_width = sheet.defcolwidth
1960
+
1961
+ for i in range(nrows):
1962
+ if i in sheet.rowinfo_map:
1963
+ current = sheet.rowinfo_map[i].height
1964
+ else:
1965
+ current = sheet.default_row_height
1966
+
1967
+ row_height = int(round(float(default_height)*current/256.0))
1968
+ self.SetRowSize(i, row_height)
1969
+
1970
+ for j in range(ncols):
1971
+ if j in sheet.colinfo_map:
1972
+ current = sheet.colinfo_map[j].width
1973
+ else:
1974
+ current = sheet.defcolwidth
1975
+
1976
+ col_width = int(round(float(default_width)*current/256.0))
1977
+ self.SetColSize(j, col_width)
1978
+
1979
+ for merged in sheet.merged_cells:
1980
+ rlo, rhi, clo, chi = merged
1981
+ if rlo >= 0 and rlo < len(self.cells) and clo >= 0:
1982
+ self.cells[(rlo, clo)].SetCellSize(rhi-rlo, chi-clo)
1983
+
1984
+ self.EnableEditing(False)
1985
+ self.EnableGridLines(False)
1986
+ self.EndBatch()
1987
+ self.ForceRefresh()
1988
+ self.InstallGridHint()
1989
+
1990
+
1991
+ def FormatCell(self, book, sheet, row, col, display_texts, comments, hyperlink, rich_text, default_width, default_colour):
1992
+ """
1993
+ Processes the creation of a single cell (an instance of :class:`XLSCell`).
1994
+
1995
+ :param `book`: an instance of the `xlrd.Book` class;
1996
+ :param `sheet`: an instance of the `xlrd.sheet` class;
1997
+ :param `row`: the row in which this cell lives;
1998
+ :param `col`: the column in which this cell lives;
1999
+ :param `display_texts`: if Mark Hammonds' `pywin32` package is available,
2000
+ this is the WYSIWYG cell content for all the cells in the Excel worksheet;
2001
+ :param `comments`: if Mark Hammonds' `pywin32` package is available,
2002
+ this is a nested list of cell comments (notes) for all the cells in the
2003
+ Excel worksheet;
2004
+ :param `hyperlink`: if this cell contains a hyperlink, it will be displayed
2005
+ accordingly;
2006
+ :param `rich_text`: if this cell contains text in rich text format, :class:`XLSGrid`
2007
+ will do its best to render the text as rich text;
2008
+ :param `default_width`: this is the default width of the text in 1/256
2009
+ of the width of the zero character, using default Excel font (first FONT
2010
+ record in the Excel file);
2011
+ :param `default_colour`: the "magic" colour used by Excel to draw non-custom
2012
+ border lines.
2013
+
2014
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the *hyperlink*
2015
+ parameter will always be ``None`` as this feature is available only in
2016
+ `xlrd` 0.7.2 (SVN).
2017
+
2018
+ :note: If you are using version 0.7.1 or lower for `xlrd`, the `rich_text`
2019
+ parameter will always be ``None`` as this feature is available only in
2020
+ `xlrd` 0.7.2 (SVN).
2021
+
2022
+ :note: If Mark Hammonds' `pywin32` package is not available, the `display_texts`
2023
+ and `comments` parameter will be two empty nested lists.
2024
+ """
2025
+
2026
+ cell = sheet.cell(row, col)
2027
+
2028
+ xf_index = sheet.cell_xf_index(row, col)
2029
+ xls_text, xls_comment = display_texts[row][col], comments[row][col]
2030
+
2031
+ gridCell = XLSCell(book, cell, xf_index, xls_text, xls_comment, hyperlink, rich_text, default_width, default_colour)
2032
+
2033
+ self.cells[(row, col)] = gridCell
2034
+
2035
+
2036
+ def GetDefaultFontData(self, book):
2037
+ """
2038
+ Returns suitable width and height (in pixels) starting from Excel's own
2039
+ measurements (in characters, whatever that means).
2040
+
2041
+ :param `book`: an instance of the `xlrd.Book` class.
2042
+
2043
+ :returns: a `default_width` and `default_height` in pixels, based on the
2044
+ default width of the text in 1/256 of the width of the zero character,
2045
+ using default Excel font (first FONT record in the Excel file).
2046
+ """
2047
+
2048
+ font = book.font_list[0]
2049
+ style, bold, underline = wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False
2050
+
2051
+ if font.italic:
2052
+ style = wx.FONTSTYLE_ITALIC
2053
+ if font.underline_type > 0:
2054
+ underline = True
2055
+ if font.weight > 600:
2056
+ bold = wx.FONTWEIGHT_BOLD
2057
+
2058
+ family = XF_FONT_FAMILY[font.family]
2059
+ name = font.name
2060
+ size = int(font.height/20.0)
2061
+
2062
+ dc = wx.ClientDC(self)
2063
+ font = wx.Font(size, family, style, bold, underline, name.encode())
2064
+ dc.SetFont(font)
2065
+ width, height, descent, leading = dc.GetFullTextExtent("0", font)
2066
+
2067
+ return width, height + descent - leading
2068
+
2069
+
2070
+ class TransientPopup(STT.SuperToolTip):
2071
+ """
2072
+ This is a sublass of :class:`SuperToolTip` and it is used to display a
2073
+ "comment-window" on the cells containing a comment (a note).
2074
+
2075
+ :note: If Mark Hammonds' `pywin32` package is not available, this class is
2076
+ never invoked.
2077
+ """
2078
+
2079
+ def __init__(self, grid_window, comment, position):
2080
+ """
2081
+ Default class constructor.
2082
+
2083
+ :param `grid_window`: the actual window representing the grid;
2084
+ :param `comment`: an instance of :class:`XLSComment`, containing the
2085
+ text for this comment;
2086
+ :param `position`: the position at which we pop up the comment
2087
+ window (currently unused).
2088
+ """
2089
+
2090
+ STT.SuperToolTip.__init__(self, grid_window)
2091
+
2092
+ xls_comment = comment.comment
2093
+
2094
+ split = xls_comment.split(":")
2095
+ header, rest = split[0], split[1:]
2096
+ rest = ":".join(rest)
2097
+
2098
+ dc = wx.ClientDC(grid_window)
2099
+ rest = wordwrap(rest, 400, dc)
2100
+
2101
+ self.SetHeader(header)
2102
+ self.SetMessage(rest)
2103
+ self.SetTarget(grid_window)
2104
+ self.SetDrawHeaderLine(True)
2105
+
2106
+ self.SetStartDelay(100000)
2107
+ self.SetEndDelay(100000)
2108
+ self.ApplyStyle("Office 2007 Blue")
2109
+
2110
+ self.SetDropShadow(True)
2111
+ self.DoShowNow()
2112
+
2113
+ grid_window.SetFocus()