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
@@ -0,0 +1,4031 @@
1
+ # -*- coding: utf-8 -*-
2
+ #----------------------------------------------------------------------------
3
+ # Name: auibar.py
4
+ # Purpose:
5
+ #
6
+ # Author: Andrea Gavana <andrea.gavana@gmail.com>
7
+ #
8
+ # Created:
9
+ # Version:
10
+ # Date: 31 March 2009
11
+ # Licence: wxWindows license
12
+ # Tags: phoenix-port, unittest, documented, py3-port
13
+ #----------------------------------------------------------------------------
14
+ """
15
+ `auibar.py` contains an implementation of
16
+ :class:`~wx.lib.agw.aui.auibar.AuiToolBar`, which is a completely owner-drawn
17
+ toolbar perfectly integrated with the AUI layout system. This allows drag and
18
+ drop of toolbars, docking/floating behaviour and the possibility to define
19
+ "overflow" items in the toolbar itself.
20
+
21
+ The default theme that is used is :class:`AuiToolBar`, which provides a modern,
22
+ glossy look and feel. The theme can be changed by calling
23
+ :meth:`AuiToolBar.SetArtProvider`.
24
+ """
25
+
26
+ __author__ = "Andrea Gavana <andrea.gavana@gmail.com>"
27
+ __date__ = "31 March 2009"
28
+
29
+
30
+ import wx
31
+
32
+ from .aui_utilities import BitmapFromBits, StepColour, GetLabelSize
33
+ from .aui_utilities import GetBaseColour, MakeDisabledBitmap
34
+
35
+ import six
36
+
37
+ from .aui_constants import *
38
+
39
+
40
+ # AuiToolBar events
41
+ wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN = wx.NewEventType()
42
+ wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK = wx.NewEventType()
43
+ wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK = wx.NewEventType()
44
+ wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK = wx.NewEventType()
45
+ wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG = wx.NewEventType()
46
+
47
+ EVT_AUITOOLBAR_TOOL_DROPDOWN = wx.PyEventBinder(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 1)
48
+ """ A dropdown `AuiToolBarItem` is being shown. """
49
+ EVT_AUITOOLBAR_OVERFLOW_CLICK = wx.PyEventBinder(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 1)
50
+ """ The user left-clicked on the overflow button in `AuiToolBar`. """
51
+ EVT_AUITOOLBAR_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 1)
52
+ """ Fires an event when the user right-clicks on a `AuiToolBarItem`. """
53
+ EVT_AUITOOLBAR_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 1)
54
+ """ Fires an event when the user middle-clicks on a `AuiToolBarItem`. """
55
+ EVT_AUITOOLBAR_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 1)
56
+ """ A drag operation involving a toolbar item has started. """
57
+
58
+ # ----------------------------------------------------------------------
59
+
60
+ class CommandToolBarEvent(wx.PyCommandEvent):
61
+ """ A specialized command event class for events sent by :class:`AuiToolBar`. """
62
+
63
+ def __init__(self, command_type, win_id):
64
+ """
65
+ Default class constructor.
66
+
67
+ :param `command_type`: the event kind or an instance of :class:`PyCommandEvent`.
68
+ :param integer `win_id`: the window identification number.
69
+ """
70
+
71
+ if type(command_type) in six.integer_types:
72
+ wx.PyCommandEvent.__init__(self, command_type, win_id)
73
+ else:
74
+ wx.PyCommandEvent.__init__(self, command_type.GetEventType(), command_type.GetId())
75
+
76
+ self.is_dropdown_clicked = False
77
+ self.click_pt = wx.Point(-1, -1)
78
+ self.rect = wx.Rect(-1, -1, 0, 0)
79
+ self.tool_id = -1
80
+
81
+
82
+ def IsDropDownClicked(self):
83
+ """ Returns whether the drop down menu has been clicked. """
84
+
85
+ return self.is_dropdown_clicked
86
+
87
+
88
+ def SetDropDownClicked(self, c):
89
+ """
90
+ Sets whether the drop down menu has been clicked.
91
+
92
+ :param bool `c`: ``True`` to set the drop down as clicked, ``False`` otherwise.
93
+ """
94
+
95
+ self.is_dropdown_clicked = c
96
+
97
+
98
+ def GetClickPoint(self):
99
+ """ Returns the point where the user clicked with the mouse. """
100
+
101
+ return self.click_pt
102
+
103
+
104
+ def SetClickPoint(self, p):
105
+ """
106
+ Sets the clicking point.
107
+
108
+ :param wx.Point `p`: the location of the mouse click.
109
+ """
110
+
111
+ self.click_pt = p
112
+
113
+
114
+ def GetItemRect(self):
115
+ """ Returns the :class:`AuiToolBarItem` rectangle. """
116
+
117
+ return self.rect
118
+
119
+
120
+ def SetItemRect(self, r):
121
+ """
122
+ Sets the :class:`AuiToolBarItem` rectangle.
123
+
124
+ :param wx.Rect `r`: the toolbar item rectangle.
125
+ """
126
+
127
+ self.rect = r
128
+
129
+
130
+ def GetToolId(self):
131
+ """ Returns the :class:`AuiToolBarItem` identifier. """
132
+
133
+ return self.tool_id
134
+
135
+
136
+ def SetToolId(self, id):
137
+ """
138
+ Sets the :class:`AuiToolBarItem` identifier.
139
+
140
+ :param integer `id`: the toolbar item identifier.
141
+ """
142
+
143
+ self.tool_id = id
144
+
145
+
146
+ # ----------------------------------------------------------------------
147
+
148
+ class AuiToolBarEvent(CommandToolBarEvent):
149
+ """ A specialized command event class for events sent by :class:`AuiToolBar`. """
150
+
151
+ def __init__(self, command_type=None, win_id=0):
152
+ """
153
+ Default class constructor.
154
+
155
+ :param `command_type`: the event kind or an instance of :class:`PyCommandEvent`.
156
+ :param integer `win_id`: the window identification number.
157
+ """
158
+
159
+ CommandToolBarEvent.__init__(self, command_type, win_id)
160
+
161
+ if type(command_type) in six.integer_types:
162
+ self.notify = wx.NotifyEvent(command_type, win_id)
163
+ else:
164
+ self.notify = wx.NotifyEvent(command_type.GetEventType(), command_type.GetId())
165
+
166
+
167
+ def GetNotifyEvent(self):
168
+ """ Returns the actual :class:`NotifyEvent`. """
169
+
170
+ return self.notify
171
+
172
+
173
+ def IsAllowed(self):
174
+ """ Returns whether the event is allowed or not. """
175
+
176
+ return self.notify.IsAllowed()
177
+
178
+
179
+ def Veto(self):
180
+ """
181
+ Prevents the change announced by this event from happening.
182
+
183
+ It is in general a good idea to notify the user about the reasons for
184
+ vetoing the change because otherwise the applications behaviour (which
185
+ just refuses to do what the user wants) might be quite surprising.
186
+ """
187
+
188
+ self.notify.Veto()
189
+
190
+
191
+ def Allow(self):
192
+ """
193
+ This is the opposite of :meth:`Veto`: it explicitly allows the event to be
194
+ processed. For most events it is not necessary to call this method as the
195
+ events are allowed anyhow but some are forbidden by default (this will
196
+ be mentioned in the corresponding event description).
197
+ """
198
+
199
+ self.notify.Allow()
200
+
201
+
202
+ # ----------------------------------------------------------------------
203
+
204
+ class ToolbarCommandCapture(wx.EvtHandler):
205
+ """ A class to handle the dropdown window menu. """
206
+
207
+ def __init__(self):
208
+ """ Default class constructor. """
209
+
210
+ wx.EvtHandler.__init__(self)
211
+ self._last_id = 0
212
+
213
+
214
+ def GetCommandId(self):
215
+ """ Returns the event command identifier. """
216
+
217
+ return self._last_id
218
+
219
+
220
+ def ProcessEvent(self, event):
221
+ """
222
+ Processes an event, searching event tables and calling zero or more suitable
223
+ event handler function(s).
224
+
225
+ :param `event`: the event to process.
226
+
227
+ :note: Normally, your application would not call this function: it is called
228
+ in the wxPython implementation to dispatch incoming user interface events
229
+ to the framework (and application).
230
+ However, you might need to call it if implementing new functionality (such as
231
+ a new control) where you define new event types, as opposed to allowing the
232
+ user to override functions.
233
+
234
+ An instance where you might actually override the :meth:`ProcessEvent` function is where
235
+ you want to direct event processing to event handlers not normally noticed by
236
+ wxPython. For example, in the document/view architecture, documents and views
237
+ are potential event handlers. When an event reaches a frame, :meth:`ProcessEvent` will
238
+ need to be called on the associated document and view in case event handler
239
+ functions are associated with these objects.
240
+
241
+ The normal order of event table searching is as follows:
242
+
243
+ 1. If the object is disabled (via a call to :meth:`~EvtHandler.SetEvtHandlerEnabled`) the function
244
+ skips to step (6).
245
+ 2. If the object is a :class:`wx.Window`, :meth:`ProcessEvent` is recursively called on the window's
246
+ :class:`wx.Validator`. If this returns ``True``, the function exits.
247
+ 3. wxWidgets `SearchEventTable` is called for this event handler. If this fails, the
248
+ base class table is tried, and so on until no more tables exist or an appropriate
249
+ function was found, in which case the function exits.
250
+ 4. The search is applied down the entire chain of event handlers (usually the chain
251
+ has a length of one). If this succeeds, the function exits.
252
+ 5. If the object is a :class:`wx.Window` and the event is a :class:`CommandEvent`, :meth:`ProcessEvent` is
253
+ recursively applied to the parent window's event handler. If this returns ``True``,
254
+ the function exits.
255
+ 6. Finally, :meth:`ProcessEvent` is called on the :class:`App` object.
256
+ """
257
+
258
+ if event.GetEventType() == wx.wxEVT_COMMAND_MENU_SELECTED:
259
+ self._last_id = event.GetId()
260
+ return True
261
+
262
+ if self.GetNextHandler():
263
+ return self.GetNextHandler().ProcessEvent(event)
264
+
265
+ return False
266
+
267
+
268
+ # ----------------------------------------------------------------------
269
+
270
+ class AuiToolBarItem(object):
271
+ """
272
+ AuiToolBarItem is a toolbar element.
273
+
274
+ It has a unique id (except for the separators which always have id = -1), the
275
+ style (telling whether it is a normal button, separator or a control), the
276
+ state (toggled or not, enabled or not) and short and long help strings. The
277
+ default implementations use the short help string for the tooltip text which
278
+ is popped up when the mouse pointer enters the tool and the long help string
279
+ for the applications status bar.
280
+ """
281
+
282
+ def __init__(self, item=None):
283
+ """
284
+ Default class constructor.
285
+
286
+ :param `item`: another instance of :class:`AuiToolBarItem`.
287
+ """
288
+
289
+ if item:
290
+ self.Assign(item)
291
+ return
292
+
293
+ self.window = None
294
+ self.clockwisebmp = wx.NullBitmap
295
+ self.counterclockwisebmp = wx.NullBitmap
296
+ self.clockwisedisbmp = wx.NullBitmap
297
+ self.counterclockwisedisbmp = wx.NullBitmap
298
+ self.sizer_item = None
299
+ self.spacer_pixels = 0
300
+ self.id = 0
301
+ self.kind = ITEM_NORMAL
302
+ self.state = 0 # normal, enabled
303
+ self.proportion = 0
304
+ self.active = True
305
+ self.dropdown = True
306
+ self.sticky = True
307
+ self.user_data = 0
308
+
309
+ self.label = ""
310
+ self.bitmap = wx.NullBitmap
311
+ self.disabled_bitmap = wx.NullBitmap
312
+ self.hover_bitmap = wx.NullBitmap
313
+ self.short_help = ""
314
+ self.long_help = ""
315
+ self.target = None
316
+ self.min_size = wx.Size(-1, -1)
317
+ self.alignment = wx.ALIGN_CENTER
318
+ self.orientation = AUI_TBTOOL_HORIZONTAL
319
+
320
+
321
+ def Assign(self, c):
322
+ """
323
+ Assigns the properties of the :class:`AuiToolBarItem` `c` to `self`.
324
+
325
+ :param `c`: another instance of :class:`AuiToolBarItem`.
326
+ """
327
+
328
+ self.window = c.window
329
+ self.label = c.label
330
+ self.bitmap = c.bitmap
331
+ self.disabled_bitmap = c.disabled_bitmap
332
+ self.hover_bitmap = c.hover_bitmap
333
+ self.short_help = c.short_help
334
+ self.long_help = c.long_help
335
+ self.sizer_item = c.sizer_item
336
+ self.min_size = c.min_size
337
+ self.spacer_pixels = c.spacer_pixels
338
+ self.id = c.id
339
+ self.kind = c.kind
340
+ self.state = c.state
341
+ self.proportion = c.proportion
342
+ self.active = c.active
343
+ self.dropdown = c.dropdown
344
+ self.sticky = c.sticky
345
+ self.user_data = c.user_data
346
+ self.alignment = c.alignment
347
+ self.orientation = c.orientation
348
+ self.target = c.target
349
+
350
+
351
+ def SetWindow(self, w):
352
+ """
353
+ Assigns a window to the toolbar item.
354
+
355
+ :param wx.Window `w`: associate this window `w` to the :class:`AuiToolBarItem`.
356
+ """
357
+
358
+ self.window = w
359
+
360
+
361
+ def GetWindow(self):
362
+ """ Returns window associated to the toolbar item. """
363
+
364
+ return self.window
365
+
366
+
367
+ def SetId(self, new_id):
368
+ """
369
+ Sets the toolbar item identifier.
370
+
371
+ :param integer `new_id`: the new tool id.
372
+ """
373
+
374
+ self.id = new_id
375
+
376
+
377
+ def GetId(self):
378
+ """ Returns the toolbar item identifier. """
379
+
380
+ return self.id
381
+
382
+
383
+ def SetKind(self, new_kind):
384
+ """
385
+ Sets the :class:`AuiToolBarItem` kind.
386
+
387
+ :param integer `new_kind`: can be one of the following items:
388
+
389
+ ======================== =============================
390
+ Item Kind Description
391
+ ======================== =============================
392
+ ``ITEM_CONTROL`` The item in the :class:`AuiToolBar` is a control
393
+ ``ITEM_LABEL`` The item in the :class:`AuiToolBar` is a text label
394
+ ``ITEM_SPACER`` The item in the :class:`AuiToolBar` is a spacer
395
+ ``ITEM_SEPARATOR`` The item in the :class:`AuiToolBar` is a separator
396
+ ``ITEM_CHECK`` The item in the :class:`AuiToolBar` is a toolbar check item
397
+ ``ITEM_NORMAL`` The item in the :class:`AuiToolBar` is a standard toolbar item
398
+ ``ITEM_RADIO`` The item in the :class:`AuiToolBar` is a toolbar radio item
399
+ ======================== =============================
400
+ """
401
+
402
+ self.kind = new_kind
403
+
404
+
405
+ def GetKind(self):
406
+ """
407
+ Returns the toolbar item kind.
408
+
409
+ See :meth:`SetKind` for more details.
410
+ """
411
+
412
+ return self.kind
413
+
414
+
415
+ def SetState(self, new_state):
416
+ """
417
+ Sets the toolbar item state.
418
+
419
+ :param `new_state`: can be one of the following states:
420
+
421
+ ============================================ ======================================
422
+ Button State Constant Description
423
+ ============================================ ======================================
424
+ ``AUI_BUTTON_STATE_NORMAL`` Normal button state
425
+ ``AUI_BUTTON_STATE_HOVER`` Hovered button state
426
+ ``AUI_BUTTON_STATE_PRESSED`` Pressed button state
427
+ ``AUI_BUTTON_STATE_DISABLED`` Disabled button state
428
+ ``AUI_BUTTON_STATE_HIDDEN`` Hidden button state
429
+ ``AUI_BUTTON_STATE_CHECKED`` Checked button state
430
+ ============================================ ======================================
431
+
432
+ """
433
+
434
+ self.state = new_state
435
+
436
+
437
+ def GetState(self):
438
+ """
439
+ Returns the toolbar item state.
440
+
441
+ :see: :meth:`SetState` for more details.
442
+ """
443
+
444
+ return self.state
445
+
446
+
447
+ def SetSizerItem(self, s):
448
+ """
449
+ Associates a sizer item to this toolbar item.
450
+
451
+ :param `s`: an instance of :class:`wx.SizerItem`.
452
+ """
453
+
454
+ self.sizer_item = s
455
+
456
+
457
+ def GetSizerItem(self):
458
+ """ Returns the associated sizer item. """
459
+
460
+ return self.sizer_item
461
+
462
+
463
+ def SetLabel(self, s):
464
+ """
465
+ Sets the toolbar item label.
466
+
467
+ :param string `s`: the toolbar item label.
468
+ """
469
+
470
+ self.label = s
471
+
472
+
473
+ def GetLabel(self):
474
+ """ Returns the toolbar item label. """
475
+
476
+ return self.label
477
+
478
+
479
+ def SetBitmap(self, bmp):
480
+ """
481
+ Sets the toolbar item bitmap.
482
+
483
+ :param wx.Bitmap `bmp`: the image associated with this :class:`AuiToolBarItem`.
484
+ """
485
+
486
+ self.bitmap = bmp
487
+
488
+
489
+ def GetBitmap(self):
490
+ """ Returns the toolbar item bitmap. """
491
+
492
+ return self.GetRotatedBitmap(False)
493
+
494
+
495
+ def SetDisabledBitmap(self, bmp):
496
+ """
497
+ Sets the toolbar item disabled bitmap.
498
+
499
+ :param wx.Bitmap `bmp`: the disabled image associated with this :class:`AuiToolBarItem`.
500
+ """
501
+
502
+ self.disabled_bitmap = bmp
503
+
504
+
505
+ def GetDisabledBitmap(self):
506
+ """ Returns the toolbar item disabled bitmap. """
507
+
508
+ return self.GetRotatedBitmap(True)
509
+
510
+
511
+ def SetHoverBitmap(self, bmp):
512
+ """
513
+ Sets the toolbar item hover bitmap.
514
+
515
+ :param wx.Bitmap `bmp`: the hover image associated with this :class:`AuiToolBarItem`.
516
+ """
517
+
518
+ self.hover_bitmap = bmp
519
+
520
+
521
+ def SetOrientation(self, a):
522
+ """
523
+ Sets the toolbar tool orientation.
524
+
525
+ :param integer `a`: one of ``AUI_TBTOOL_HORIZONTAL``, ``AUI_TBTOOL_VERT_CLOCKWISE`` or
526
+ ``AUI_TBTOOL_VERT_COUNTERCLOCKWISE``.
527
+ """
528
+
529
+ self.orientation = a
530
+
531
+
532
+ def GetOrientation(self):
533
+ """ Returns the toolbar tool orientation. """
534
+
535
+ return self.orientation
536
+
537
+
538
+ def GetHoverBitmap(self):
539
+ """ Returns the toolbar item hover bitmap. """
540
+
541
+ return self.hover_bitmap
542
+
543
+
544
+ def GetRotatedBitmap(self, disabled):
545
+ """
546
+ Returns the correct bitmap depending on the tool orientation.
547
+
548
+ :param bool `disabled`: whether to return the disabled bitmap or not.
549
+ """
550
+
551
+ bitmap_to_rotate = (disabled and [self.disabled_bitmap] or [self.bitmap])[0]
552
+ if not bitmap_to_rotate.IsOk() or self.orientation == AUI_TBTOOL_HORIZONTAL:
553
+ return bitmap_to_rotate
554
+
555
+ rotated_bitmap = wx.NullBitmap
556
+ clockwise = True
557
+ if self.orientation == AUI_TBTOOL_VERT_CLOCKWISE:
558
+ rotated_bitmap = (disabled and [self.clockwisedisbmp] or [self.clockwisebmp])[0]
559
+
560
+ elif self.orientation == AUI_TBTOOL_VERT_COUNTERCLOCKWISE:
561
+ rotated_bitmap = (disabled and [self.counterclockwisedisbmp] or [self.counterclockwisebmp])[0]
562
+ clockwise = False
563
+
564
+ if not rotated_bitmap.IsOk():
565
+ rotated_bitmap = wx.Bitmap(bitmap_to_rotate.ConvertToImage().Rotate90(clockwise))
566
+
567
+ return rotated_bitmap
568
+
569
+
570
+ def SetShortHelp(self, s):
571
+ """
572
+ Sets the short help string for the :class:`AuiToolBarItem`, to be displayed in a
573
+ :class:`ToolTip` when the mouse hover over the toolbar item.
574
+
575
+ :param string `s`: the tool short help string.
576
+ """
577
+
578
+ self.short_help = s
579
+
580
+
581
+ def GetShortHelp(self):
582
+ """ Returns the short help string for the :class:`AuiToolBarItem`. """
583
+
584
+ return self.short_help
585
+
586
+
587
+ def SetLongHelp(self, s):
588
+ """
589
+ Sets the long help string for the toolbar item. This string is shown in the
590
+ statusbar (if any) of the parent frame when the mouse pointer is inside the
591
+ tool.
592
+
593
+ :param string `s`: the tool long help string.
594
+ """
595
+
596
+ self.long_help = s
597
+
598
+
599
+ def GetLongHelp(self):
600
+ """ Returns the long help string for the :class:`AuiToolBarItem`. """
601
+
602
+ return self.long_help
603
+
604
+
605
+ def SetMinSize(self, s):
606
+ """
607
+ Sets the toolbar item minimum size.
608
+
609
+ :param wx.Size `s`: the toolbar item minimum size.
610
+ """
611
+
612
+ self.min_size = wx.Size(*s)
613
+
614
+
615
+ def GetMinSize(self):
616
+ """ Returns the toolbar item minimum size. """
617
+
618
+ return self.min_size
619
+
620
+
621
+ def SetSpacerPixels(self, s):
622
+ """
623
+ Sets the number of pixels for a toolbar item with kind = ``ITEM_SEPARATOR``.
624
+
625
+ :param integer `s`: number of pixels.
626
+ """
627
+
628
+ self.spacer_pixels = s
629
+
630
+
631
+ def GetSpacerPixels(self):
632
+ """ Returns the number of pixels for a toolbar item with kind = ``ITEM_SEPARATOR``. """
633
+
634
+ return self.spacer_pixels
635
+
636
+
637
+ def SetProportion(self, p):
638
+ """
639
+ Sets the :class:`AuiToolBarItem` proportion in the toolbar.
640
+
641
+ :param integer `p`: the item proportion.
642
+ """
643
+
644
+ self.proportion = p
645
+
646
+
647
+ def GetProportion(self):
648
+ """ Returns the :class:`AuiToolBarItem` proportion in the toolbar. """
649
+
650
+ return self.proportion
651
+
652
+
653
+ def SetActive(self, b):
654
+ """
655
+ Activates/deactivates the toolbar item.
656
+
657
+ :param bool `b`: ``True`` to activate the item, ``False`` to deactivate it.
658
+ """
659
+
660
+ self.active = b
661
+
662
+
663
+ def IsActive(self):
664
+ """ Returns whether the toolbar item is active or not. """
665
+
666
+ return self.active
667
+
668
+
669
+ def SetHasDropDown(self, b):
670
+ """
671
+ Sets whether the toolbar item has an associated dropdown menu.
672
+
673
+ :param bool `b`: ``True`` to set a dropdown menu, ``False`` otherwise.
674
+ """
675
+
676
+ self.dropdown = b
677
+
678
+
679
+ def HasDropDown(self):
680
+ """ Returns whether the toolbar item has an associated dropdown menu or not. """
681
+
682
+ return self.dropdown
683
+
684
+
685
+ def SetSticky(self, b):
686
+ """
687
+ Sets whether the toolbar item is sticky (permanent highlight after mouse enter)
688
+ or not.
689
+
690
+ :param bool `b`: ``True`` to set the item as sticky, ``False`` otherwise.
691
+ """
692
+
693
+ self.sticky = b
694
+
695
+
696
+ def IsSticky(self):
697
+ """ Returns whether the toolbar item has a sticky behaviour or not. """
698
+
699
+ return self.sticky
700
+
701
+
702
+ def SetUserData(self, data):
703
+ """
704
+ Associates some kind of user data to the toolbar item.
705
+
706
+ :param PyObject `data`: a Python object.
707
+
708
+ :note: The user data can be any Python object.
709
+ """
710
+
711
+ self.user_data = data
712
+
713
+
714
+ def GetUserData(self):
715
+ """ Returns the associated user data. """
716
+
717
+ return self.user_data
718
+
719
+
720
+ def SetAlignment(self, align):
721
+ """
722
+ Sets the toolbar item alignment.
723
+
724
+ :param integer `align`: the item alignment, which can be one of the available :class:`wx.Sizer`
725
+ alignments.
726
+ """
727
+
728
+ self.alignment = align
729
+
730
+
731
+ def GetAlignment(self):
732
+ """ Returns the toolbar item alignment. """
733
+
734
+ return self.alignment
735
+
736
+
737
+ # ----------------------------------------------------------------------
738
+
739
+ class AuiDefaultToolBarArt(object):
740
+ """
741
+ Toolbar art provider code - a tab provider provides all drawing functionality to the :class:`AuiToolBar`.
742
+ This allows the :class:`AuiToolBar` to have a plugable look-and-feel.
743
+
744
+ By default, a :class:`AuiToolBar` uses an instance of this class called :class:`AuiDefaultToolBarArt`
745
+ which provides bitmap art and a colour scheme that is adapted to the major platforms'
746
+ look. You can either derive from that class to alter its behaviour or write a
747
+ completely new tab art class. Call :meth:`AuiToolBar.SetArtProvider` to make use this new tab art.
748
+ """
749
+
750
+ def __init__(self):
751
+ """ Default class constructor. """
752
+
753
+ self.SetDefaultColours()
754
+
755
+ self._agwFlags = 0
756
+ self._text_orientation = AUI_TBTOOL_TEXT_BOTTOM
757
+ self._highlight_colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)
758
+
759
+ self._separator_size = 7
760
+ self._orientation = AUI_TBTOOL_HORIZONTAL
761
+ self._gripper_size = 7
762
+ self._overflow_size = 16
763
+
764
+ button_dropdown_bits = b"\xe0\xf1\xfb"
765
+ overflow_bits = b"\x80\xff\x80\xc1\xe3\xf7"
766
+
767
+ self._button_dropdown_bmp = BitmapFromBits(button_dropdown_bits, 5, 3, wx.BLACK)
768
+ self._disabled_button_dropdown_bmp = BitmapFromBits(button_dropdown_bits, 5, 3,
769
+ wx.Colour(128, 128, 128))
770
+ self._overflow_bmp = BitmapFromBits(overflow_bits, 7, 6, wx.BLACK)
771
+ self._disabled_overflow_bmp = BitmapFromBits(overflow_bits, 7, 6, wx.Colour(128, 128, 128))
772
+
773
+ self._font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
774
+
775
+
776
+ def SetDefaultColours(self, base_colour=None):
777
+ """
778
+ Sets the default colours, which are calculated from the given base colour.
779
+
780
+ :param `base_colour`: an instance of :class:`wx.Colour`. If defaulted to ``None``, a colour
781
+ is generated accordingly to the platform and theme.
782
+ """
783
+
784
+ if base_colour is None:
785
+ self._base_colour = GetBaseColour()
786
+ else:
787
+ self._base_colour = base_colour
788
+
789
+ darker3_colour = StepColour(self._base_colour, 60)
790
+ darker5_colour = StepColour(self._base_colour, 40)
791
+
792
+ self._gripper_pen1 = wx.Pen(darker5_colour)
793
+ self._gripper_pen2 = wx.Pen(darker3_colour)
794
+ self._gripper_pen3 = wx.WHITE_PEN
795
+
796
+
797
+ def Clone(self):
798
+ """ Clones the :class:`AuiDefaultToolBarArt` art. """
799
+
800
+ return AuiDefaultToolBarArt()
801
+
802
+
803
+ def SetAGWFlags(self, agwFlags):
804
+ """
805
+ Sets the toolbar art flags.
806
+
807
+ :param integer `agwFlags`: a combination of the following values:
808
+
809
+ ==================================== ==================================
810
+ Flag name Description
811
+ ==================================== ==================================
812
+ ``AUI_TB_TEXT`` Shows the text in the toolbar buttons; by default only icons are shown
813
+ ``AUI_TB_NO_TOOLTIPS`` Don't show tooltips on :class:`AuiToolBar` items
814
+ ``AUI_TB_NO_AUTORESIZE`` Do not auto-resize the :class:`AuiToolBar`
815
+ ``AUI_TB_GRIPPER`` Shows a gripper on the :class:`AuiToolBar`
816
+ ``AUI_TB_OVERFLOW`` The :class:`AuiToolBar` can contain overflow items
817
+ ``AUI_TB_VERTICAL`` The :class:`AuiToolBar` is vertical
818
+ ``AUI_TB_HORZ_LAYOUT`` Shows the text and the icons alongside, not vertically stacked. This style
819
+ must be used with ``AUI_TB_TEXT``
820
+ ``AUI_TB_PLAIN_BACKGROUND`` Don't draw a gradient background on the toolbar
821
+ ``AUI_TB_HORZ_TEXT`` Combination of ``AUI_TB_HORZ_LAYOUT`` and ``AUI_TB_TEXT``
822
+ ==================================== ==================================
823
+
824
+ """
825
+
826
+ self._agwFlags = agwFlags
827
+
828
+
829
+ def GetAGWFlags(self):
830
+ """
831
+ Returns the :class:`AuiDefaultToolBarArt` flags.
832
+
833
+ :see: :meth:`~AuiDefaultToolBarArt.SetAGWFlags` for more details.
834
+ """
835
+
836
+ return self._agwFlags
837
+
838
+
839
+ def SetFont(self, font):
840
+ """
841
+ Sets the :class:`AuiDefaultToolBarArt` font.
842
+
843
+ :param wx.Font `font`: the font used for displaying toolbar item labels.
844
+ """
845
+
846
+ self._font = font
847
+
848
+
849
+ def SetTextOrientation(self, orientation):
850
+ """
851
+ Sets the text orientation.
852
+
853
+ :param integer `orientation`: can be one of the following constants:
854
+
855
+ ==================================== ==================================
856
+ Orientation Switches Description
857
+ ==================================== ==================================
858
+ ``AUI_TBTOOL_TEXT_LEFT`` Text in :class:`AuiToolBar` items is aligned left
859
+ ``AUI_TBTOOL_TEXT_RIGHT`` Text in :class:`AuiToolBar` items is aligned right
860
+ ``AUI_TBTOOL_TEXT_TOP`` Text in :class:`AuiToolBar` items is aligned top
861
+ ``AUI_TBTOOL_TEXT_BOTTOM`` Text in :class:`AuiToolBar` items is aligned bottom
862
+ ==================================== ==================================
863
+
864
+ """
865
+
866
+ self._text_orientation = orientation
867
+
868
+
869
+ def GetFont(self):
870
+ """ Returns the :class:`AuiDefaultToolBarArt` font. """
871
+
872
+ return self._font
873
+
874
+
875
+ def GetTextOrientation(self):
876
+ """
877
+ Returns the :class:`AuiDefaultToolBarArt` text orientation.
878
+
879
+ :see: :meth:`~AuiDefaultToolBarArt.SetTextOrientation` for more details.
880
+ """
881
+
882
+ return self._text_orientation
883
+
884
+
885
+ def SetOrientation(self, orientation):
886
+ """
887
+ Sets the toolbar tool orientation.
888
+
889
+ :param integer `orientation`: one of ``AUI_TBTOOL_HORIZONTAL``, ``AUI_TBTOOL_VERT_CLOCKWISE`` or
890
+ ``AUI_TBTOOL_VERT_COUNTERCLOCKWISE``.
891
+ """
892
+
893
+ self._orientation = orientation
894
+
895
+
896
+ def GetOrientation(self):
897
+ """ Returns the toolbar orientation. """
898
+
899
+ return self._orientation
900
+
901
+
902
+ def DrawBackground(self, dc, wnd, _rect, horizontal=True):
903
+ """
904
+ Draws a toolbar background with a gradient shading.
905
+
906
+ :param `dc`: a :class:`wx.DC` device context;
907
+ :param `wnd`: a :class:`wx.Window` derived window;
908
+ :param wx.Rect `_rect`: the :class:`AuiToolBarItem` rectangle;
909
+ :param bool `horizontal`: ``True`` if the toolbar is horizontal, ``False`` if it is vertical.
910
+ """
911
+
912
+ rect = wx.Rect(*_rect)
913
+
914
+ start_colour = StepColour(self._base_colour, 180)
915
+ end_colour = StepColour(self._base_colour, 85)
916
+ reflex_colour = StepColour(self._base_colour, 95)
917
+
918
+ dc.GradientFillLinear(rect, start_colour, end_colour,
919
+ (horizontal and [wx.SOUTH] or [wx.EAST])[0])
920
+
921
+ left = rect.GetLeft()
922
+ right = rect.GetRight()
923
+ top = rect.GetTop()
924
+ bottom = rect.GetBottom()
925
+
926
+ dc.SetPen(wx.Pen(reflex_colour))
927
+ if horizontal:
928
+ dc.DrawLine(left, bottom, right+1, bottom)
929
+ else:
930
+ dc.DrawLine(right, top, right, bottom+1)
931
+
932
+
933
+ def DrawPlainBackground(self, dc, wnd, _rect):
934
+ """
935
+ Draws a toolbar background with a plain colour.
936
+
937
+ This method contrasts with the default behaviour of the :class:`AuiToolBar` that
938
+ draws a background gradient and this break the window design when putting
939
+ it within a control that has margin between the borders and the toolbar
940
+ (example: put :class:`AuiToolBar` within a :class:`StaticBoxSizer` that has a plain background).
941
+
942
+ :param `dc`: a :class:`wx.DC` device context;
943
+ :param `wnd`: a :class:`wx.Window` derived window;
944
+ :param wx.Rect `_rect`: the :class:`AuiToolBarItem` rectangle.
945
+ """
946
+
947
+ rect = wx.Rect(*_rect)
948
+ rect.height += 1
949
+
950
+ dc.SetBrush(wx.Brush(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)))
951
+ dc.DrawRectangle(rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 1)
952
+
953
+
954
+ def DrawLabel(self, dc, wnd, item, rect):
955
+ """
956
+ Draws a toolbar item label.
957
+
958
+ :param `dc`: a :class:`wx.DC` device context;
959
+ :param `wnd`: a :class:`wx.Window` derived window;
960
+ :param `item`: an instance of :class:`AuiToolBarItem`;
961
+ :param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
962
+ """
963
+
964
+ dc.SetFont(self._font)
965
+
966
+ if item.state & AUI_BUTTON_STATE_DISABLED:
967
+ dc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))
968
+ else:
969
+ dc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNTEXT))
970
+
971
+ orient = item.GetOrientation()
972
+
973
+ horizontal = orient == AUI_TBTOOL_HORIZONTAL
974
+ # we only care about the text height here since the text
975
+ # will get cropped based on the width of the item
976
+ label_size = GetLabelSize(dc, item.GetLabel(), not horizontal)
977
+ text_width = label_size.GetWidth()
978
+ text_height = label_size.GetHeight()
979
+
980
+ if orient == AUI_TBTOOL_HORIZONTAL:
981
+ text_x = rect.x
982
+ text_y = rect.y + (rect.height-text_height)//2
983
+ dc.DrawText(item.GetLabel(), text_x, text_y)
984
+
985
+ elif orient == AUI_TBTOOL_VERT_CLOCKWISE:
986
+ text_x = rect.x + (rect.width+text_width)//2
987
+ text_y = rect.y
988
+ dc.DrawRotatedText(item.GetLabel(), text_x, text_y, 270)
989
+
990
+ elif AUI_TBTOOL_VERT_COUNTERCLOCKWISE:
991
+ text_x = rect.x + (rect.width-text_width)//2
992
+ text_y = rect.y + text_height
993
+ dc.DrawRotatedText(item.GetLabel(), text_x, text_y, 90)
994
+
995
+
996
+ def DrawButton(self, dc, wnd, item, rect):
997
+ """
998
+ Draws a toolbar item button.
999
+
1000
+ :param `dc`: a :class:`wx.DC` device context;
1001
+ :param `wnd`: a :class:`wx.Window` derived window;
1002
+ :param `item`: an instance of :class:`AuiToolBarItem`;
1003
+ :param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
1004
+ """
1005
+
1006
+ bmp_rect, text_rect = self.GetToolsPosition(dc, item, rect)
1007
+
1008
+ item_state = item.GetState()
1009
+ if not item_state & AUI_BUTTON_STATE_DISABLED:
1010
+
1011
+ if item_state & AUI_BUTTON_STATE_PRESSED:
1012
+
1013
+ dc.SetPen(wx.Pen(self._highlight_colour))
1014
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 150)))
1015
+ dc.DrawRectangle(rect)
1016
+
1017
+ elif item_state & AUI_BUTTON_STATE_HOVER or item.IsSticky():
1018
+
1019
+ dc.SetPen(wx.Pen(self._highlight_colour))
1020
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 170)))
1021
+
1022
+ # draw an even lighter background for checked item hovers (since
1023
+ # the hover background is the same colour as the check background)
1024
+ if item_state & AUI_BUTTON_STATE_CHECKED:
1025
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 180)))
1026
+
1027
+ dc.DrawRectangle(rect)
1028
+
1029
+ elif item_state & AUI_BUTTON_STATE_CHECKED:
1030
+
1031
+ # it's important to put this code in an else statment after the
1032
+ # hover, otherwise hovers won't draw properly for checked items
1033
+ dc.SetPen(wx.Pen(self._highlight_colour))
1034
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 170)))
1035
+ dc.DrawRectangle(rect)
1036
+
1037
+ if item_state & AUI_BUTTON_STATE_DISABLED:
1038
+ bmp = item.GetDisabledBitmap()
1039
+ elif item_state & AUI_BUTTON_STATE_HOVER or item_state & AUI_BUTTON_STATE_PRESSED:
1040
+ bmp = item.GetHoverBitmap()
1041
+ if not bmp:
1042
+ bmp = item.GetBitmap()
1043
+ else:
1044
+ bmp = item.GetBitmap()
1045
+
1046
+ if bmp.IsOk():
1047
+ dc.DrawBitmap(bmp, bmp_rect.x, bmp_rect.y, True)
1048
+
1049
+ # set the item's text colour based on if it is disabled
1050
+ dc.SetTextForeground(wx.BLACK)
1051
+ if item_state & AUI_BUTTON_STATE_DISABLED:
1052
+ dc.SetTextForeground(DISABLED_TEXT_COLOUR)
1053
+
1054
+ if self._agwFlags & AUI_TB_TEXT and item.GetLabel() != "":
1055
+ self.DrawLabel(dc, wnd, item, text_rect)
1056
+
1057
+
1058
+ def DrawDropDownButton(self, dc, wnd, item, rect):
1059
+ """
1060
+ Draws a toolbar dropdown button.
1061
+
1062
+ :param `dc`: a :class:`wx.DC` device context;
1063
+ :param `wnd`: a :class:`wx.Window` derived window;
1064
+ :param `item`: an instance of :class:`AuiToolBarItem`;
1065
+ :param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
1066
+ """
1067
+
1068
+ dropbmp_x = dropbmp_y = 0
1069
+
1070
+ button_rect = wx.Rect(rect.x, rect.y, rect.width-BUTTON_DROPDOWN_WIDTH, rect.height)
1071
+ dropdown_rect = wx.Rect(rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1, rect.y, BUTTON_DROPDOWN_WIDTH+1, rect.height)
1072
+
1073
+ horizontal = item.GetOrientation() == AUI_TBTOOL_HORIZONTAL
1074
+
1075
+ if horizontal:
1076
+ button_rect = wx.Rect(rect.x, rect.y, rect.width-BUTTON_DROPDOWN_WIDTH, rect.height)
1077
+ dropdown_rect = wx.Rect(rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1, rect.y, BUTTON_DROPDOWN_WIDTH+1, rect.height)
1078
+ else:
1079
+ button_rect = wx.Rect(rect.x, rect.y, rect.width, rect.height-BUTTON_DROPDOWN_WIDTH)
1080
+ dropdown_rect = wx.Rect(rect.x, rect.y+rect.height-BUTTON_DROPDOWN_WIDTH-1, rect.width, BUTTON_DROPDOWN_WIDTH+1)
1081
+
1082
+ dropbmp_width = self._button_dropdown_bmp.GetWidth()
1083
+ dropbmp_height = self._button_dropdown_bmp.GetHeight()
1084
+ if not horizontal:
1085
+ tmp = dropbmp_width
1086
+ dropbmp_width = dropbmp_height
1087
+ dropbmp_height = tmp
1088
+
1089
+ dropbmp_x = dropdown_rect.x + (dropdown_rect.width//2) - dropbmp_width//2
1090
+ dropbmp_y = dropdown_rect.y + (dropdown_rect.height//2) - dropbmp_height//2
1091
+
1092
+ bmp_rect, text_rect = self.GetToolsPosition(dc, item, button_rect)
1093
+
1094
+ item_state = item.GetState()
1095
+ if item_state & AUI_BUTTON_STATE_PRESSED:
1096
+
1097
+ dc.SetPen(wx.Pen(self._highlight_colour))
1098
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 140)))
1099
+ dc.DrawRectangle(button_rect)
1100
+ dc.DrawRectangle(dropdown_rect)
1101
+
1102
+ elif item_state & AUI_BUTTON_STATE_HOVER or item.IsSticky():
1103
+
1104
+ dc.SetPen(wx.Pen(self._highlight_colour))
1105
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 170)))
1106
+ dc.DrawRectangle(button_rect)
1107
+ dc.DrawRectangle(dropdown_rect)
1108
+
1109
+ elif item_state & AUI_BUTTON_STATE_CHECKED:
1110
+ # it's important to put this code in an else statment after the
1111
+ # hover, otherwise hovers won't draw properly for checked items
1112
+ dc.SetPen(wx.Pen(self._highlight_colour))
1113
+ dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 170)))
1114
+ dc.DrawRectangle(button_rect)
1115
+ dc.DrawRectangle(dropdown_rect)
1116
+
1117
+ if item_state & AUI_BUTTON_STATE_DISABLED:
1118
+
1119
+ bmp = item.GetDisabledBitmap()
1120
+ dropbmp = self._disabled_button_dropdown_bmp
1121
+
1122
+ else:
1123
+
1124
+ bmp = item.GetBitmap()
1125
+ dropbmp = self._button_dropdown_bmp
1126
+
1127
+ if bmp.IsOk():
1128
+ dc.DrawBitmap(bmp, bmp_rect.x, bmp_rect.y, True)
1129
+
1130
+ if horizontal:
1131
+ dc.DrawBitmap(dropbmp, dropbmp_x, dropbmp_y, True)
1132
+ else:
1133
+ dc.DrawBitmap(wx.Bitmap(dropbmp.ConvertToImage().Rotate90(item.GetOrientation() == AUI_TBTOOL_VERT_CLOCKWISE)),
1134
+ dropbmp_x, dropbmp_y, True)
1135
+
1136
+ # set the item's text colour based on if it is disabled
1137
+ dc.SetTextForeground(wx.BLACK)
1138
+ if item_state & AUI_BUTTON_STATE_DISABLED:
1139
+ dc.SetTextForeground(DISABLED_TEXT_COLOUR)
1140
+
1141
+ if self._agwFlags & AUI_TB_TEXT and item.GetLabel() != "":
1142
+ self.DrawLabel(dc, wnd, item, text_rect)
1143
+
1144
+
1145
+ def DrawControlLabel(self, dc, wnd, item, rect):
1146
+ """
1147
+ Draws a label for a toolbar control.
1148
+
1149
+ :param `dc`: a :class:`wx.DC` device context;
1150
+ :param `wnd`: a :class:`wx.Window` derived window;
1151
+ :param `item`: an instance of :class:`AuiToolBarItem`;
1152
+ :param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
1153
+ """
1154
+
1155
+ label_size = GetLabelSize(dc, item.GetLabel(), item.GetOrientation() != AUI_TBTOOL_HORIZONTAL)
1156
+ text_height = label_size.GetHeight()
1157
+ text_width = label_size.GetWidth()
1158
+
1159
+ dc.SetFont(self._font)
1160
+
1161
+ if self._agwFlags & AUI_TB_TEXT:
1162
+
1163
+ tx, text_height = dc.GetTextExtent("ABCDHgj")
1164
+
1165
+ text_width, ty = dc.GetTextExtent(item.GetLabel())
1166
+
1167
+ # don't draw the label if it is wider than the item width
1168
+ if text_width > rect.width:
1169
+ return
1170
+
1171
+ # set the label's text colour
1172
+ dc.SetTextForeground(wx.BLACK)
1173
+
1174
+ text_x = rect.x + (rect.width//2) - (text_width//2) + 1
1175
+ text_y = rect.y + rect.height - text_height - 1
1176
+
1177
+ if self._agwFlags & AUI_TB_TEXT and item.GetLabel() != "":
1178
+ dc.DrawText(item.GetLabel(), text_x, text_y)
1179
+
1180
+
1181
+ def GetLabelSize(self, dc, wnd, item):
1182
+ """
1183
+ Returns the label size for a toolbar item.
1184
+
1185
+ :param `dc`: a :class:`wx.DC` device context;
1186
+ :param `wnd`: a :class:`wx.Window` derived window;
1187
+ :param `item`: an instance of :class:`AuiToolBarItem`.
1188
+ """
1189
+
1190
+ dc.SetFont(self._font)
1191
+ label_size = GetLabelSize(dc, item.GetLabel(), self._orientation != AUI_TBTOOL_HORIZONTAL)
1192
+
1193
+ return wx.Size(item.GetMinSize().GetWidth(), label_size.GetHeight())
1194
+
1195
+
1196
+ def GetToolSize(self, dc, wnd, item):
1197
+ """
1198
+ Returns the toolbar item size.
1199
+
1200
+ :param `dc`: a :class:`wx.DC` device context;
1201
+ :param `wnd`: a :class:`wx.Window` derived window;
1202
+ :param `item`: an instance of :class:`AuiToolBarItem`.
1203
+ """
1204
+
1205
+ if not item.GetBitmap().IsOk() and not self._agwFlags & AUI_TB_TEXT:
1206
+ return wx.Size(16, 16)
1207
+
1208
+ width = item.GetBitmap().GetWidth()
1209
+ height = item.GetBitmap().GetHeight()
1210
+
1211
+ if self._agwFlags & AUI_TB_TEXT:
1212
+
1213
+ dc.SetFont(self._font)
1214
+ label_size = GetLabelSize(dc, item.GetLabel(), self.GetOrientation() != AUI_TBTOOL_HORIZONTAL)
1215
+ padding = 6
1216
+
1217
+ if self._text_orientation == AUI_TBTOOL_TEXT_BOTTOM:
1218
+
1219
+ if self.GetOrientation() != AUI_TBTOOL_HORIZONTAL:
1220
+ height += 3 # space between top border and bitmap
1221
+ height += 3 # space between bitmap and text
1222
+ padding = 0
1223
+
1224
+ height += label_size.GetHeight()
1225
+
1226
+ if item.GetLabel() != "":
1227
+ width = max(width, label_size.GetWidth()+padding)
1228
+
1229
+ elif self._text_orientation == AUI_TBTOOL_TEXT_RIGHT and item.GetLabel() != "":
1230
+
1231
+ if self.GetOrientation() == AUI_TBTOOL_HORIZONTAL:
1232
+
1233
+ width += 3 # space between left border and bitmap
1234
+ width += 3 # space between bitmap and text
1235
+ padding = 0
1236
+
1237
+ width += label_size.GetWidth()
1238
+ height = max(height, label_size.GetHeight()+padding)
1239
+
1240
+ # if the tool has a dropdown button, add it to the width
1241
+ if item.HasDropDown():
1242
+ if item.GetOrientation() == AUI_TBTOOL_HORIZONTAL:
1243
+ width += BUTTON_DROPDOWN_WIDTH+4
1244
+ else:
1245
+ height += BUTTON_DROPDOWN_WIDTH+4
1246
+
1247
+ return wx.Size(width, height)
1248
+
1249
+
1250
+ def DrawSeparator(self, dc, wnd, _rect):
1251
+ """
1252
+ Draws a toolbar separator.
1253
+
1254
+ :param `dc`: a :class:`wx.DC` device context;
1255
+ :param `wnd`: a :class:`wx.Window` derived window;
1256
+ :param wx.Rect `_rect`: the :class:`AuiToolBarItem` rectangle.
1257
+ """
1258
+
1259
+ horizontal = True
1260
+ if self._agwFlags & AUI_TB_VERTICAL:
1261
+ horizontal = False
1262
+
1263
+ rect = wx.Rect(*_rect)
1264
+
1265
+ if horizontal:
1266
+
1267
+ rect.x += (rect.width//2)
1268
+ rect.width = 1
1269
+ new_height = (rect.height*3)//4
1270
+ rect.y += (rect.height//2) - (new_height//2)
1271
+ rect.height = new_height
1272
+
1273
+ else:
1274
+
1275
+ rect.y += (rect.height//2)
1276
+ rect.height = 1
1277
+ new_width = (rect.width*3)//4
1278
+ rect.x += (rect.width//2) - (new_width//2)
1279
+ rect.width = new_width
1280
+
1281
+ start_colour = StepColour(self._base_colour, 80)
1282
+ end_colour = StepColour(self._base_colour, 80)
1283
+ dc.GradientFillLinear(rect, start_colour, end_colour, (horizontal and [wx.SOUTH] or [wx.EAST])[0])
1284
+
1285
+
1286
+ def DrawGripper(self, dc, wnd, rect):
1287
+ """
1288
+ Draws the toolbar gripper.
1289
+
1290
+ :param `dc`: a :class:`wx.DC` device context;
1291
+ :param `wnd`: a :class:`wx.Window` derived window;
1292
+ :param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
1293
+ """
1294
+ # local opts
1295
+ dc_DrawPoint = dc.DrawPoint
1296
+ dc_SetPen = dc.SetPen
1297
+ _gripper_pen1, _gripper_pen2, _gripper_pen3 = self._gripper_pen1, self._gripper_pen2, self._gripper_pen3
1298
+ toolbar_is_vertical = self._agwFlags & AUI_TB_VERTICAL
1299
+ rect_x, rect_y, rect_width, rect_height = rect.x, rect.y, rect.GetWidth(), rect.GetHeight()
1300
+
1301
+ i = 0
1302
+ while 1:
1303
+
1304
+ if toolbar_is_vertical:
1305
+
1306
+ x = rect_x + (i*4) + 4
1307
+ y = rect_y + 3
1308
+ if x > rect_width - 4:
1309
+ break
1310
+
1311
+ else:
1312
+
1313
+ x = rect_x + 3
1314
+ y = rect_y + (i*4) + 4
1315
+ if y > rect_height - 4:
1316
+ break
1317
+
1318
+ dc_SetPen(_gripper_pen1)
1319
+ dc_DrawPoint(x, y)
1320
+ dc_SetPen(_gripper_pen2)
1321
+ dc_DrawPoint(x, y+1)
1322
+ dc_DrawPoint(x+1, y)
1323
+ dc_SetPen(_gripper_pen3)
1324
+ dc_DrawPoint(x+2, y+1)
1325
+ dc_DrawPoint(x+2, y+2)
1326
+ dc_DrawPoint(x+1, y+2)
1327
+
1328
+ i += 1
1329
+
1330
+
1331
+ def DrawOverflowButton(self, dc, wnd, rect, state):
1332
+ """
1333
+ Draws the overflow button for the :class:`AuiToolBar`.
1334
+
1335
+ :param `dc`: a :class:`wx.DC` device context;
1336
+ :param `wnd`: a :class:`wx.Window` derived window;
1337
+ :param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle;
1338
+ :param integer `state`: the overflow button state.
1339
+ """
1340
+
1341
+ if state & AUI_BUTTON_STATE_HOVER or state & AUI_BUTTON_STATE_PRESSED:
1342
+
1343
+ cli_rect = wnd.GetClientRect()
1344
+ light_gray_bg = StepColour(self._highlight_colour, 170)
1345
+
1346
+ if self._agwFlags & AUI_TB_VERTICAL:
1347
+
1348
+ dc.SetPen(wx.Pen(self._highlight_colour))
1349
+ dc.DrawLine(rect.x, rect.y, rect.x+rect.width, rect.y)
1350
+ dc.SetPen(wx.Pen(light_gray_bg))
1351
+ dc.SetBrush(wx.Brush(light_gray_bg))
1352
+ dc.DrawRectangle(rect.x, rect.y+1, rect.width, rect.height)
1353
+
1354
+ else:
1355
+
1356
+ dc.SetPen(wx.Pen(self._highlight_colour))
1357
+ dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height)
1358
+ dc.SetPen(wx.Pen(light_gray_bg))
1359
+ dc.SetBrush(wx.Brush(light_gray_bg))
1360
+ dc.DrawRectangle(rect.x+1, rect.y, rect.width, rect.height)
1361
+
1362
+ x = rect.x + 1 + (rect.width-self._overflow_bmp.GetWidth())//2
1363
+ y = rect.y + 1 + (rect.height-self._overflow_bmp.GetHeight())//2
1364
+ dc.DrawBitmap(self._overflow_bmp, x, y, True)
1365
+
1366
+
1367
+ def GetElementSize(self, element_id):
1368
+ """
1369
+ Returns the size of a UI element in the :class:`AuiToolBar`.
1370
+
1371
+ :param integer `element_id`: can be one of the following:
1372
+
1373
+ ==================================== ==================================
1374
+ Element Identifier Description
1375
+ ==================================== ==================================
1376
+ ``AUI_TBART_SEPARATOR_SIZE`` Separator size in :class:`AuiToolBar`
1377
+ ``AUI_TBART_GRIPPER_SIZE`` Gripper size in :class:`AuiToolBar`
1378
+ ``AUI_TBART_OVERFLOW_SIZE`` Overflow button size in :class:`AuiToolBar`
1379
+ ==================================== ==================================
1380
+ """
1381
+
1382
+ if element_id == AUI_TBART_SEPARATOR_SIZE:
1383
+ return self._separator_size
1384
+ elif element_id == AUI_TBART_GRIPPER_SIZE:
1385
+ return self._gripper_size
1386
+ elif element_id == AUI_TBART_OVERFLOW_SIZE:
1387
+ return self._overflow_size
1388
+
1389
+ return 0
1390
+
1391
+
1392
+ def SetElementSize(self, element_id, size):
1393
+ """
1394
+ Sets the size of a UI element in the :class:`AuiToolBar`.
1395
+
1396
+ :param integer `element_id`: can be one of the following:
1397
+
1398
+ ==================================== ==================================
1399
+ Element Identifier Description
1400
+ ==================================== ==================================
1401
+ ``AUI_TBART_SEPARATOR_SIZE`` Separator size in :class:`AuiToolBar`
1402
+ ``AUI_TBART_GRIPPER_SIZE`` Gripper size in :class:`AuiToolBar`
1403
+ ``AUI_TBART_OVERFLOW_SIZE`` Overflow button size in :class:`AuiToolBar`
1404
+ ==================================== ==================================
1405
+
1406
+ :param integer `size`: the new size of the UI element.
1407
+ """
1408
+
1409
+ if element_id == AUI_TBART_SEPARATOR_SIZE:
1410
+ self._separator_size = size
1411
+ elif element_id == AUI_TBART_GRIPPER_SIZE:
1412
+ self._gripper_size = size
1413
+ elif element_id == AUI_TBART_OVERFLOW_SIZE:
1414
+ self._overflow_size = size
1415
+
1416
+
1417
+ def ShowDropDown(self, wnd, items):
1418
+ """
1419
+ Shows the drop down window menu for overflow items.
1420
+
1421
+ :param `wnd`: an instance of :class:`wx.Window`;
1422
+ :param list `items`: a list of the overflow toolbar items.
1423
+ """
1424
+
1425
+ menuPopup = wx.Menu()
1426
+ items_added = 0
1427
+
1428
+ for item in items:
1429
+
1430
+ if item.GetKind() not in [ITEM_SEPARATOR, ITEM_SPACER, ITEM_CONTROL]:
1431
+
1432
+ text = item.GetShortHelp()
1433
+ if text == "":
1434
+ text = item.GetLabel()
1435
+ if text == "":
1436
+ text = " "
1437
+
1438
+ kind = item.GetKind()
1439
+ m = wx.MenuItem(menuPopup, item.GetId(), text, item.GetShortHelp(), kind)
1440
+ orientation = item.GetOrientation()
1441
+ item.SetOrientation(AUI_TBTOOL_HORIZONTAL)
1442
+
1443
+ if kind not in [ITEM_CHECK, ITEM_RADIO]:
1444
+ m.SetBitmap(item.GetBitmap())
1445
+
1446
+ item.SetOrientation(orientation)
1447
+
1448
+ menuPopup.Append(m)
1449
+ if kind in [ITEM_CHECK, ITEM_RADIO]:
1450
+ state = (item.state & AUI_BUTTON_STATE_CHECKED and [True] or [False])[0]
1451
+ m.Check(state)
1452
+
1453
+ items_added += 1
1454
+
1455
+ else:
1456
+
1457
+ if items_added > 0 and item.GetKind() == ITEM_SEPARATOR:
1458
+ menuPopup.AppendSeparator()
1459
+
1460
+ cc = ToolbarCommandCapture()
1461
+ wnd.PushEventHandler(cc)
1462
+
1463
+ wnd.PopupMenu(menuPopup)
1464
+ command = cc.GetCommandId()
1465
+ wnd.PopEventHandler(True)
1466
+
1467
+ return command
1468
+
1469
+
1470
+ def GetToolsPosition(self, dc, item, rect):
1471
+ """
1472
+ Returns the bitmap and text rectangles for a toolbar item.
1473
+
1474
+ :param `dc`: a :class:`wx.DC` device context;
1475
+ :param `item`: an instance of :class:`AuiToolBarItem`;
1476
+ :param wx.Rect `rect`: the tool rectangle.
1477
+ """
1478
+
1479
+ text_width = text_height = 0
1480
+ horizontal = self._orientation == AUI_TBTOOL_HORIZONTAL
1481
+ text_bottom = self._text_orientation == AUI_TBTOOL_TEXT_BOTTOM
1482
+ text_right = self._text_orientation == AUI_TBTOOL_TEXT_RIGHT
1483
+ bmp_width = item.GetBitmap().GetWidth()
1484
+ bmp_height = item.GetBitmap().GetHeight()
1485
+
1486
+ if self._agwFlags & AUI_TB_TEXT:
1487
+ dc.SetFont(self._font)
1488
+ label_size = GetLabelSize(dc, item.GetLabel(), not horizontal)
1489
+ text_height = label_size.GetHeight()
1490
+ text_width = label_size.GetWidth()
1491
+
1492
+ bmp_x = bmp_y = text_x = text_y = 0
1493
+
1494
+ if horizontal and text_bottom:
1495
+ bmp_x = rect.x + (rect.width//2) - (bmp_width//2)
1496
+ bmp_y = rect.y + 3
1497
+ text_x = rect.x + (rect.width//2) - (text_width//2)
1498
+ text_y = rect.y + ((bmp_y - rect.y) * 2) + bmp_height
1499
+
1500
+ elif horizontal and text_right:
1501
+ bmp_x = rect.x + 3
1502
+ bmp_y = rect.y + (rect.height//2) - (bmp_height // 2)
1503
+ text_x = rect.x + ((bmp_x - rect.x) * 2) + bmp_width
1504
+ text_y = rect.y + (rect.height//2) - (text_height//2)
1505
+
1506
+ elif not horizontal and text_bottom:
1507
+ bmp_x = rect.x + (rect.width // 2) - (bmp_width // 2)
1508
+ bmp_y = rect.y + 3
1509
+ text_x = rect.x + (rect.width // 2) - (text_width // 2)
1510
+ text_y = rect.y + ((bmp_y - rect.y) * 2) + bmp_height
1511
+
1512
+ bmp_rect = wx.Rect(bmp_x, bmp_y, bmp_width, bmp_height)
1513
+ text_rect = wx.Rect(text_x, text_y, text_width, text_height)
1514
+
1515
+ return bmp_rect, text_rect
1516
+
1517
+
1518
+ class AuiToolBar(wx.Control):
1519
+ """
1520
+ AuiToolBar is a completely owner-drawn toolbar perfectly integrated with the AUI layout system.
1521
+ This allows drag and drop of toolbars, docking/floating behaviour and the possibility to define
1522
+ "overflow" items in the toolbar itself.
1523
+
1524
+ The default theme that is used is :class:`AuiDefaultToolBarArt`, which provides a modern,
1525
+ glossy look and feel. The theme can be changed by calling :meth:`AuiToolBar.SetArtProvider`.
1526
+ """
1527
+
1528
+ def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
1529
+ size=wx.DefaultSize, style=0, agwStyle=AUI_TB_DEFAULT_STYLE):
1530
+ """
1531
+ Default class constructor.
1532
+
1533
+ :param wx.Window `parent`: the :class:`AuiToolBar` parent;
1534
+ :param integer `id`: an identifier for the control: a value of -1 is taken to mean a default;
1535
+ :param wx.Point `pos`: the control position. A value of (-1, -1) indicates a default position,
1536
+ chosen by either the windowing system or wxPython, depending on platform;
1537
+ :param wx.Size `size`: the control size. A value of (-1, -1) indicates a default size,
1538
+ chosen by either the windowing system or wxPython, depending on platform;
1539
+ :param integer `style`: the control window style;
1540
+ :param integer `agwStyle`: the AGW-specific window style. This can be a combination of the
1541
+ following bits:
1542
+
1543
+ ==================================== ==================================
1544
+ Flag name Description
1545
+ ==================================== ==================================
1546
+ ``AUI_TB_TEXT`` Shows the text in the toolbar buttons; by default only icons are shown
1547
+ ``AUI_TB_NO_TOOLTIPS`` Don't show tooltips on :class:`AuiToolBar` items
1548
+ ``AUI_TB_NO_AUTORESIZE`` Do not auto-resize the :class:`AuiToolBar`
1549
+ ``AUI_TB_GRIPPER`` Shows a gripper on the :class:`AuiToolBar`
1550
+ ``AUI_TB_OVERFLOW`` The :class:`AuiToolBar` can contain overflow items
1551
+ ``AUI_TB_VERTICAL`` The :class:`AuiToolBar` is vertical
1552
+ ``AUI_TB_HORZ_LAYOUT`` Shows the text and the icons alongside, not vertically stacked.
1553
+ This style must be used with ``AUI_TB_TEXT``
1554
+ ``AUI_TB_PLAIN_BACKGROUND`` Don't draw a gradient background on the toolbar
1555
+ ``AUI_TB_HORZ_TEXT`` Combination of ``AUI_TB_HORZ_LAYOUT`` and ``AUI_TB_TEXT``
1556
+ ==================================== ==================================
1557
+
1558
+ The default value for `agwStyle` is: ``AUI_TB_DEFAULT_STYLE`` = 0
1559
+
1560
+ """
1561
+
1562
+ wx.Control.__init__(self, parent, id, pos, size, style|wx.BORDER_NONE)
1563
+
1564
+ self._sizer = wx.BoxSizer(wx.HORIZONTAL)
1565
+ self.SetSizer(self._sizer)
1566
+ self._button_width = -1
1567
+ self._button_height = -1
1568
+ self._sizer_element_count = 0
1569
+ self._action_pos = wx.Point(-1, -1)
1570
+ self._action_item = None
1571
+ self._tip_item = None
1572
+ self._art = AuiDefaultToolBarArt()
1573
+ self._tool_packing = 2
1574
+ self._tool_border_padding = 3
1575
+ self._tool_text_orientation = AUI_TBTOOL_TEXT_BOTTOM
1576
+ self._tool_orientation = AUI_TBTOOL_HORIZONTAL
1577
+ self._tool_alignment = wx.EXPAND
1578
+ self._gripper_sizer_item = None
1579
+ self._overflow_sizer_item = None
1580
+ self._dragging = False
1581
+
1582
+ self._agwStyle = self._originalStyle = agwStyle
1583
+
1584
+ self._gripper_visible = (self._agwStyle & AUI_TB_GRIPPER and [True] or [False])[0]
1585
+ self._overflow_visible = (self._agwStyle & AUI_TB_OVERFLOW and [True] or [False])[0]
1586
+ self._overflow_state = 0
1587
+ self._custom_overflow_prepend = []
1588
+ self._custom_overflow_append = []
1589
+
1590
+ self._items = []
1591
+
1592
+ self.SetMargins(5, 5, 2, 2)
1593
+ self.SetFont(wx.NORMAL_FONT)
1594
+ self._art.SetAGWFlags(self._agwStyle)
1595
+ self.SetExtraStyle(wx.WS_EX_PROCESS_IDLE)
1596
+
1597
+ if agwStyle & AUI_TB_HORZ_LAYOUT:
1598
+ self.SetToolTextOrientation(AUI_TBTOOL_TEXT_RIGHT)
1599
+ elif agwStyle & AUI_TB_VERTICAL:
1600
+ if agwStyle & AUI_TB_CLOCKWISE:
1601
+ self.SetToolOrientation(AUI_TBTOOL_VERT_CLOCKWISE)
1602
+ elif agwStyle & AUI_TB_COUNTERCLOCKWISE:
1603
+ self.SetToolOrientation(AUI_TBTOOL_VERT_COUNTERCLOCKWISE)
1604
+
1605
+ self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
1606
+
1607
+ self.Bind(wx.EVT_SIZE, self.OnSize)
1608
+ self.Bind(wx.EVT_IDLE, self.OnIdle)
1609
+ self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
1610
+ self.Bind(wx.EVT_PAINT, self.OnPaint)
1611
+ self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
1612
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
1613
+ self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
1614
+ self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
1615
+ self.Bind(wx.EVT_RIGHT_DCLICK, self.OnRightDown)
1616
+ self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
1617
+ self.Bind(wx.EVT_MIDDLE_DOWN, self.OnMiddleDown)
1618
+ self.Bind(wx.EVT_MIDDLE_DCLICK, self.OnMiddleDown)
1619
+ self.Bind(wx.EVT_MIDDLE_UP, self.OnMiddleUp)
1620
+ self.Bind(wx.EVT_MOTION, self.OnMotion)
1621
+ self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
1622
+ self.Bind(wx.EVT_SET_CURSOR, self.OnSetCursor)
1623
+
1624
+
1625
+ def SetWindowStyleFlag(self, style):
1626
+ """
1627
+ Sets the style of the window.
1628
+
1629
+ :param integer `style`: the new window style.
1630
+
1631
+ :note: Please note that some styles cannot be changed after the window
1632
+ creation and that `Refresh` might need to be be called after changing the
1633
+ others for the change to take place immediately.
1634
+
1635
+ :note: Overridden from :class:`wx.Control`.
1636
+ """
1637
+
1638
+ wx.Control.SetWindowStyleFlag(self, style|wx.BORDER_NONE)
1639
+
1640
+
1641
+ def SetAGWWindowStyleFlag(self, agwStyle):
1642
+ """
1643
+ Sets the AGW-specific style of the window.
1644
+
1645
+ :param integer `agwStyle`: the new window style. This can be a combination of the
1646
+ following bits:
1647
+
1648
+ ==================================== ==================================
1649
+ Flag name Description
1650
+ ==================================== ==================================
1651
+ ``AUI_TB_TEXT`` Shows the text in the toolbar buttons; by default only icons are shown
1652
+ ``AUI_TB_NO_TOOLTIPS`` Don't show tooltips on :class:`AuiToolBar` items
1653
+ ``AUI_TB_NO_AUTORESIZE`` Do not auto-resize the :class:`AuiToolBar`
1654
+ ``AUI_TB_GRIPPER`` Shows a gripper on the :class:`AuiToolBar`
1655
+ ``AUI_TB_OVERFLOW`` The :class:`AuiToolBar` can contain overflow items
1656
+ ``AUI_TB_VERTICAL`` The :class:`AuiToolBar` is vertical
1657
+ ``AUI_TB_HORZ_LAYOUT`` Shows the text and the icons alongside, not vertically stacked.
1658
+ This style must be used with ``AUI_TB_TEXT``
1659
+ ``AUI_TB_PLAIN_BACKGROUND`` Don't draw a gradient background on the toolbar
1660
+ ``AUI_TB_HORZ_TEXT`` Combination of ``AUI_TB_HORZ_LAYOUT`` and ``AUI_TB_TEXT``
1661
+ ==================================== ==================================
1662
+
1663
+ :note: Please note that some styles cannot be changed after the window
1664
+ creation and that `Refresh` might need to be be called after changing the
1665
+ others for the change to take place immediately.
1666
+ """
1667
+
1668
+ self._agwStyle = self._originalStyle = agwStyle
1669
+
1670
+ if self._art:
1671
+ self._art.SetAGWFlags(self._agwStyle)
1672
+
1673
+ if agwStyle & AUI_TB_GRIPPER:
1674
+ self._gripper_visible = True
1675
+ else:
1676
+ self._gripper_visible = False
1677
+
1678
+ if agwStyle & AUI_TB_OVERFLOW:
1679
+ self._overflow_visible = True
1680
+ else:
1681
+ self._overflow_visible = False
1682
+
1683
+ if agwStyle & AUI_TB_HORZ_LAYOUT:
1684
+ self.SetToolTextOrientation(AUI_TBTOOL_TEXT_RIGHT)
1685
+ else:
1686
+ self.SetToolTextOrientation(AUI_TBTOOL_TEXT_BOTTOM)
1687
+
1688
+ if agwStyle & AUI_TB_VERTICAL:
1689
+ if agwStyle & AUI_TB_CLOCKWISE:
1690
+ self.SetToolOrientation(AUI_TBTOOL_VERT_CLOCKWISE)
1691
+ elif agwStyle & AUI_TB_COUNTERCLOCKWISE:
1692
+ self.SetToolOrientation(AUI_TBTOOL_VERT_COUNTERCLOCKWISE)
1693
+
1694
+
1695
+ def GetAGWWindowStyleFlag(self):
1696
+ """
1697
+ Returns the AGW-specific window style flag.
1698
+
1699
+ :see: :meth:`SetAGWWindowStyleFlag` for an explanation of various AGW-specific style.
1700
+ """
1701
+
1702
+ return self._originalStyle
1703
+
1704
+
1705
+ def SetArtProvider(self, art):
1706
+ """
1707
+ Instructs :class:`AuiToolBar` to use art provider specified by parameter `art`
1708
+ for all drawing calls. This allows plugable look-and-feel features.
1709
+
1710
+ :param `art`: an art provider.
1711
+
1712
+ :note: The previous art provider object, if any, will be deleted by :class:`AuiToolBar`.
1713
+ """
1714
+
1715
+ del self._art
1716
+ self._art = art
1717
+
1718
+ if self._art:
1719
+ self._art.SetAGWFlags(self._agwStyle)
1720
+ self._art.SetTextOrientation(self._tool_text_orientation)
1721
+ self._art.SetOrientation(self._tool_orientation)
1722
+
1723
+
1724
+ def GetArtProvider(self):
1725
+ """ Returns the current art provider being used. """
1726
+
1727
+ return self._art
1728
+
1729
+
1730
+ def AddSimpleTool(self, tool_id, label, bitmap, short_help_string="", kind=ITEM_NORMAL, target=None):
1731
+ """
1732
+ Adds a tool to the toolbar. This is the simplest method you can use to
1733
+ add an item to the :class:`AuiToolBar`.
1734
+
1735
+ :param integer `tool_id`: an integer by which the tool may be identified in subsequent operations;
1736
+ :param string `label`: the toolbar tool label;
1737
+ :param wx.Bitmap `bitmap`: the primary tool bitmap;
1738
+ :param string `short_help_string`: this string is used for the tools tooltip;
1739
+ :param integer `kind`: the item kind. Can be one of the following:
1740
+
1741
+ ======================== =============================
1742
+ Item Kind Description
1743
+ ======================== =============================
1744
+ ``ITEM_CONTROL`` The item in the :class:`AuiToolBar` is a control
1745
+ ``ITEM_LABEL`` The item in the :class:`AuiToolBar` is a text label
1746
+ ``ITEM_SPACER`` The item in the :class:`AuiToolBar` is a spacer
1747
+ ``ITEM_SEPARATOR`` The item in the :class:`AuiToolBar` is a separator
1748
+ ``ITEM_CHECK`` The item in the :class:`AuiToolBar` is a toolbar check item
1749
+ ``ITEM_NORMAL`` The item in the :class:`AuiToolBar` is a standard toolbar item
1750
+ ``ITEM_RADIO`` The item in the :class:`AuiToolBar` is a toolbar radio item
1751
+ ======================== =============================
1752
+
1753
+ :param `target`: a custom string indicating that an instance of :class:`~wx.lib.agw.aui.framemanager.AuiPaneInfo`
1754
+ has been minimized into this toolbar.
1755
+ """
1756
+
1757
+ return self.AddTool(tool_id, label, bitmap, wx.NullBitmap, kind, short_help_string, "", None, target)
1758
+
1759
+
1760
+ def AddToggleTool(self, tool_id, bitmap, disabled_bitmap, toggle=False, client_data=None, short_help_string="", long_help_string=""):
1761
+ """
1762
+ Adds a toggle tool to the toolbar.
1763
+
1764
+ :param integer `tool_id`: an integer by which the tool may be identified in subsequent operations;
1765
+ :param wx.Bitmap `bitmap`: the primary tool bitmap;
1766
+ :param wx.Bitmap `disabled_bitmap`: the bitmap to use when the tool is disabled. If it is equal to
1767
+ :class:`NullBitmap`, the disabled bitmap is automatically generated by greing the normal one;
1768
+ :param PyObject `client_data`: whatever Python object to associate with the toolbar item;
1769
+ :param string `short_help_string`: this string is used for the tools tooltip;
1770
+ :param string `long_help_string`: this string is shown in the statusbar (if any) of the parent
1771
+ frame when the mouse pointer is inside the tool.
1772
+ """
1773
+
1774
+ kind = (toggle and [ITEM_CHECK] or [ITEM_NORMAL])[0]
1775
+ return self.AddTool(tool_id, "", bitmap, disabled_bitmap, kind, short_help_string, long_help_string, client_data)
1776
+
1777
+
1778
+ def AddTool(self, tool_id, label, bitmap, disabled_bitmap, kind, short_help_string='', long_help_string='', client_data=None, target=None):
1779
+ """
1780
+ Adds a tool to the toolbar. This is the full feature version of :meth:`AddTool`.
1781
+
1782
+ :param integer `tool_id`: an integer by which the tool may be identified in subsequent operations;
1783
+ :param string `label`: the toolbar tool label;
1784
+ :param wx.Bitmap `bitmap`: the primary tool bitmap;
1785
+ :param wx.Bitmap `disabled_bitmap`: the bitmap to use when the tool is disabled. If it is equal to
1786
+ :class:`NullBitmap`, the disabled bitmap is automatically generated by greing the normal one;
1787
+ :param integer `kind`: the item kind. Can be one of the following:
1788
+
1789
+ ======================== =============================
1790
+ Item Kind Description
1791
+ ======================== =============================
1792
+ ``ITEM_CONTROL`` The item in the :class:`AuiToolBar` is a control
1793
+ ``ITEM_LABEL`` The item in the :class:`AuiToolBar` is a text label
1794
+ ``ITEM_SPACER`` The item in the :class:`AuiToolBar` is a spacer
1795
+ ``ITEM_SEPARATOR`` The item in the :class:`AuiToolBar` is a separator
1796
+ ``ITEM_CHECK`` The item in the :class:`AuiToolBar` is a toolbar check item
1797
+ ``ITEM_NORMAL`` The item in the :class:`AuiToolBar` is a standard toolbar item
1798
+ ``ITEM_RADIO`` The item in the :class:`AuiToolBar` is a toolbar radio item
1799
+ ======================== =============================
1800
+
1801
+ :param string `short_help_string`: this string is used for the tools tooltip;
1802
+ :param string `long_help_string`: this string is shown in the statusbar (if any) of the parent
1803
+ frame when the mouse pointer is inside the tool.
1804
+ :param PyObject `client_data`: whatever Python object to associate with the toolbar item.
1805
+ :param `target`: a custom string indicating that an instance of :class:`~wx.lib.agw.aui.framemanager.AuiPaneInfo`
1806
+ has been minimized into this toolbar.
1807
+ """
1808
+
1809
+ item = AuiToolBarItem()
1810
+ item.window = None
1811
+ item.label = label
1812
+ item.bitmap = bitmap
1813
+ item.disabled_bitmap = disabled_bitmap
1814
+ item.short_help = short_help_string
1815
+ item.long_help = long_help_string
1816
+ item.target = target
1817
+ item.active = True
1818
+ item.dropdown = False
1819
+ item.spacer_pixels = 0
1820
+
1821
+ if tool_id == wx.ID_ANY:
1822
+ tool_id = wx.NewIdRef()
1823
+
1824
+ item.id = tool_id
1825
+ item.state = 0
1826
+ item.proportion = 0
1827
+ item.kind = kind
1828
+ item.sizer_item = None
1829
+ item.min_size = wx.Size(-1, -1)
1830
+ item.user_data = 0
1831
+ item.sticky = False
1832
+ item.orientation = self._tool_orientation
1833
+
1834
+ if not item.disabled_bitmap.IsOk():
1835
+ # no disabled bitmap specified, we need to make one
1836
+ if item.bitmap.IsOk():
1837
+ item.disabled_bitmap = MakeDisabledBitmap(item.bitmap)
1838
+
1839
+ self._items.append(item)
1840
+ return self._items[-1]
1841
+
1842
+
1843
+ def AddCheckTool(self, tool_id, label, bitmap, disabled_bitmap, short_help_string="", long_help_string="", client_data=None):
1844
+ """
1845
+ Adds a new check (or toggle) tool to the :class:`AuiToolBar`.
1846
+
1847
+ :see: :meth:`AddTool` for an explanation of the input parameters.
1848
+ """
1849
+
1850
+ return self.AddTool(tool_id, label, bitmap, disabled_bitmap, ITEM_CHECK, short_help_string, long_help_string, client_data)
1851
+
1852
+
1853
+ def AddRadioTool(self, tool_id, label, bitmap, disabled_bitmap, short_help_string="", long_help_string="", client_data=None):
1854
+ """
1855
+ Adds a new radio tool to the toolbar.
1856
+
1857
+ Consecutive radio tools form a radio group such that exactly one button
1858
+ in the group is pressed at any moment, in other words whenever a button
1859
+ in the group is pressed the previously pressed button is automatically
1860
+ released. You should avoid having the radio groups of only one element
1861
+ as it would be impossible for the user to use such button.
1862
+
1863
+ :note: By default, the first button in the radio group is initially pressed,
1864
+ the others are not.
1865
+
1866
+ :see: :meth:`AddTool` for an explanation of the input parameters.
1867
+ """
1868
+
1869
+ return self.AddTool(tool_id, label, bitmap, disabled_bitmap, ITEM_RADIO, short_help_string, long_help_string, client_data)
1870
+
1871
+
1872
+ def AddControl(self, control, label=""):
1873
+ """
1874
+ Adds any control to the toolbar, typically e.g. a :class:`ComboBox`.
1875
+
1876
+ :param wx.Window `control`: the control to be added;
1877
+ :param string `label`: the label which appears if the control goes into the
1878
+ overflow items in the toolbar.
1879
+ """
1880
+
1881
+ item = AuiToolBarItem()
1882
+ item.window = control
1883
+ item.label = label
1884
+ item.bitmap = wx.NullBitmap
1885
+ item.disabled_bitmap = wx.NullBitmap
1886
+ item.active = True
1887
+ item.dropdown = False
1888
+ item.spacer_pixels = 0
1889
+ item.id = control.GetId()
1890
+ item.state = 0
1891
+ item.proportion = 0
1892
+ item.kind = ITEM_CONTROL
1893
+ item.sizer_item = None
1894
+ item.min_size = control.GetEffectiveMinSize()
1895
+ item.user_data = 0
1896
+ item.sticky = False
1897
+ item.orientation = self._tool_orientation
1898
+
1899
+ self._items.append(item)
1900
+ return self._items[-1]
1901
+
1902
+
1903
+ def AddLabel(self, tool_id, label="", width=0):
1904
+ """
1905
+ Adds a label tool to the :class:`AuiToolBar`.
1906
+
1907
+ :param integer `tool_id`: an integer by which the tool may be identified in subsequent operations;
1908
+ :param string `label`: the toolbar tool label;
1909
+ :param integer `width`: the tool width.
1910
+ """
1911
+
1912
+ min_size = wx.Size(-1, -1)
1913
+
1914
+ if width != -1:
1915
+ min_size.x = width
1916
+
1917
+ item = AuiToolBarItem()
1918
+ item.window = None
1919
+ item.label = label
1920
+ item.bitmap = wx.NullBitmap
1921
+ item.disabled_bitmap = wx.NullBitmap
1922
+ item.active = True
1923
+ item.dropdown = False
1924
+ item.spacer_pixels = 0
1925
+
1926
+ if tool_id == wx.ID_ANY:
1927
+ tool_id = wx.NewIdRef()
1928
+
1929
+ item.id = tool_id
1930
+ item.state = 0
1931
+ item.proportion = 0
1932
+ item.kind = ITEM_LABEL
1933
+ item.sizer_item = None
1934
+ item.min_size = min_size
1935
+ item.user_data = 0
1936
+ item.sticky = False
1937
+ item.orientation = self._tool_orientation
1938
+
1939
+ self._items.append(item)
1940
+ return self._items[-1]
1941
+
1942
+
1943
+ def AddSeparator(self):
1944
+ """ Adds a separator for spacing groups of tools. """
1945
+
1946
+ item = AuiToolBarItem()
1947
+ item.window = None
1948
+ item.label = ""
1949
+ item.bitmap = wx.NullBitmap
1950
+ item.disabled_bitmap = wx.NullBitmap
1951
+ item.active = True
1952
+ item.dropdown = False
1953
+ item.id = -1
1954
+ item.state = 0
1955
+ item.proportion = 0
1956
+ item.kind = ITEM_SEPARATOR
1957
+ item.sizer_item = None
1958
+ item.min_size = wx.Size(-1, -1)
1959
+ item.user_data = 0
1960
+ item.sticky = False
1961
+ item.orientation = self._tool_orientation
1962
+
1963
+ self._items.append(item)
1964
+ return self._items[-1]
1965
+
1966
+
1967
+ def AddSpacer(self, pixels):
1968
+ """
1969
+ Adds a spacer for spacing groups of tools.
1970
+
1971
+ :param integer `pixels`: the width of the spacer.
1972
+ """
1973
+
1974
+ item = AuiToolBarItem()
1975
+ item.window = None
1976
+ item.label = ""
1977
+ item.bitmap = wx.NullBitmap
1978
+ item.disabled_bitmap = wx.NullBitmap
1979
+ item.active = True
1980
+ item.dropdown = False
1981
+ item.spacer_pixels = pixels
1982
+ item.id = -1
1983
+ item.state = 0
1984
+ item.proportion = 0
1985
+ item.kind = ITEM_SPACER
1986
+ item.sizer_item = None
1987
+ item.min_size = wx.Size(-1, -1)
1988
+ item.user_data = 0
1989
+ item.sticky = False
1990
+ item.orientation = self._tool_orientation
1991
+
1992
+ self._items.append(item)
1993
+ return self._items[-1]
1994
+
1995
+
1996
+ def AddStretchSpacer(self, proportion=1):
1997
+ """
1998
+ Adds a stretchable spacer for spacing groups of tools.
1999
+
2000
+ :param integer `proportion`: the stretchable spacer proportion.
2001
+ """
2002
+
2003
+ item = AuiToolBarItem()
2004
+ item.window = None
2005
+ item.label = ""
2006
+ item.bitmap = wx.NullBitmap
2007
+ item.disabled_bitmap = wx.NullBitmap
2008
+ item.active = True
2009
+ item.dropdown = False
2010
+ item.spacer_pixels = 0
2011
+ item.id = -1
2012
+ item.state = 0
2013
+ item.proportion = proportion
2014
+ item.kind = ITEM_SPACER
2015
+ item.sizer_item = None
2016
+ item.min_size = wx.Size(-1, -1)
2017
+ item.user_data = 0
2018
+ item.sticky = False
2019
+ item.orientation = self._tool_orientation
2020
+
2021
+ self._items.append(item)
2022
+ return self._items[-1]
2023
+
2024
+
2025
+ def Clear(self):
2026
+ """ Deletes all the tools in the :class:`AuiToolBar`. """
2027
+
2028
+ self._items = []
2029
+ self._sizer_element_count = 0
2030
+
2031
+
2032
+ def ClearTools(self):
2033
+ """ Deletes all the tools in the :class:`AuiToolBar`. """
2034
+
2035
+ self.Clear()
2036
+
2037
+
2038
+ def DeleteTool(self, tool_id):
2039
+ """
2040
+ Removes the specified tool from the toolbar and deletes it.
2041
+
2042
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier.
2043
+
2044
+ :returns: ``True`` if the tool was deleted, ``False`` otherwise.
2045
+
2046
+ :note: Note that it is unnecessary to call :meth:`Realize` for the change to
2047
+ take place, it will happen immediately.
2048
+ """
2049
+
2050
+ idx = self.GetToolIndex(tool_id)
2051
+
2052
+ if idx >= 0 and idx < len(self._items):
2053
+ self._items.pop(idx)
2054
+ self.Realize()
2055
+ return True
2056
+
2057
+ return False
2058
+
2059
+
2060
+ def DeleteToolByPos(self, pos):
2061
+ """
2062
+ This function behaves like :meth:`DeleteTool` but it deletes the tool at the specified position and not the one with the given id.
2063
+
2064
+ :param integer `pos`: the tool position.
2065
+
2066
+ :see: :meth:`~AuiToolBar.DeleteTool`
2067
+ """
2068
+
2069
+ if pos >= 0 and pos < len(self._items):
2070
+
2071
+ self._items.pop(pos)
2072
+ self.Realize()
2073
+ return True
2074
+
2075
+ return False
2076
+
2077
+
2078
+ def FindControl(self, id):
2079
+ """
2080
+ Returns a pointer to the control identified by `id` or ``None`` if no corresponding control is found.
2081
+
2082
+ :param integer `id`: the control identifier.
2083
+ """
2084
+
2085
+ wnd = self.FindWindow(id)
2086
+ return wnd
2087
+
2088
+
2089
+ def FindTool(self, tool_id):
2090
+ """
2091
+ Finds a tool for the given tool id.
2092
+
2093
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier.
2094
+ """
2095
+
2096
+ for item in self._items:
2097
+ if item.id == tool_id:
2098
+ return item
2099
+
2100
+ return None
2101
+
2102
+
2103
+ def FindToolByLabel(self, label):
2104
+ """
2105
+ Finds a tool for the given label.
2106
+
2107
+ :param string `label`: the :class:`AuiToolBarItem` label.
2108
+ """
2109
+
2110
+ for item in self._items:
2111
+ if item.label == label:
2112
+ return item
2113
+
2114
+ return None
2115
+
2116
+
2117
+ def FindToolForPosition(self, x, y):
2118
+ """
2119
+ Finds a tool for the given mouse position.
2120
+
2121
+ :param integer `x`: mouse `x` position;
2122
+ :param integer `y`: mouse `y` position.
2123
+
2124
+ :returns: a pointer to a :class:`AuiToolBarItem` if a tool is found, or ``None`` otherwise.
2125
+ """
2126
+
2127
+ for i, item in enumerate(self._items):
2128
+ if not item.sizer_item:
2129
+ continue
2130
+
2131
+ rect = item.sizer_item.GetRect()
2132
+ if rect.Contains((x,y)):
2133
+
2134
+ # if the item doesn't fit on the toolbar, return None
2135
+ if not self.GetToolFitsByIndex(i):
2136
+ return None
2137
+
2138
+ return item
2139
+
2140
+ return None
2141
+
2142
+
2143
+ def HitTest(self, x, y):
2144
+ """
2145
+ Finds a tool for the given mouse position.
2146
+
2147
+ :param integer `x`: mouse `x` screen position;
2148
+ :param integer `y`: mouse `y` screen position.
2149
+
2150
+ :returns: a pointer to a :class:`AuiToolBarItem` if a tool is found, or ``None`` otherwise.
2151
+
2152
+ :note: This method is similar to :meth:`FindToolForPosition` but it works with absolute coordinates.
2153
+ """
2154
+
2155
+ return self.FindToolForPosition(*self.ScreenToClient((x,y)))
2156
+
2157
+
2158
+ def FindToolForPositionWithPacking(self, x, y):
2159
+ """
2160
+ Finds a tool for the given mouse position, taking into account also the tool packing.
2161
+
2162
+ :param integer `x`: mouse `x` position;
2163
+ :param integer `y`: mouse `y` position.
2164
+
2165
+ :returns: a pointer to a :class:`AuiToolBarItem` if a tool is found, or ``None`` otherwise.
2166
+ """
2167
+
2168
+ count = len(self._items)
2169
+
2170
+ for i, item in enumerate(self._items):
2171
+ if not item.sizer_item:
2172
+ continue
2173
+
2174
+ rect = item.sizer_item.GetRect()
2175
+
2176
+ # apply tool packing
2177
+ if i+1 < count:
2178
+ rect.width += self._tool_packing
2179
+
2180
+ if rect.Contains((x,y)):
2181
+
2182
+ # if the item doesn't fit on the toolbar, return None
2183
+ if not self.GetToolFitsByIndex(i):
2184
+ return None
2185
+
2186
+ return item
2187
+
2188
+ return None
2189
+
2190
+
2191
+ def FindToolByIndex(self, pos):
2192
+ """
2193
+ Finds a tool for the given tool position in the :class:`AuiToolBar`.
2194
+
2195
+ :param integer `pos`: the tool position in the toolbar.
2196
+
2197
+ :returns: a pointer to a :class:`AuiToolBarItem` if a tool is found, or ``None`` otherwise.
2198
+ """
2199
+
2200
+ if pos < 0 or pos >= len(self._items):
2201
+ return None
2202
+
2203
+ return self._items[pos]
2204
+
2205
+
2206
+ def SetToolBitmapSize(self, size):
2207
+ """
2208
+ Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels.
2209
+
2210
+ :param wx.Size `size`: the size of the bitmaps in the toolbar.
2211
+
2212
+ :note: This should be called to tell the toolbar what the tool bitmap
2213
+ size is. Call it before you add tools.
2214
+
2215
+ :note: Note that this is the size of the bitmap you pass to :meth:`AddTool`,
2216
+ and not the eventual size of the tool button.
2217
+
2218
+ .. todo::
2219
+
2220
+ Add :class:`ToolBar` compatibility, actually implementing this method.
2221
+
2222
+ """
2223
+
2224
+ # TODO: wx.ToolBar compatibility
2225
+ pass
2226
+
2227
+
2228
+ def GetToolBitmapSize(self):
2229
+ """
2230
+ Returns the size of bitmap that the toolbar expects to have. The default bitmap size is 16 by 15 pixels.
2231
+
2232
+ :note: Note that this is the size of the bitmap you pass to :meth:`AddTool`,
2233
+ and not the eventual size of the tool button.
2234
+
2235
+ .. todo::
2236
+
2237
+ Add :class:`ToolBar` compatibility, actually implementing this method.
2238
+
2239
+ """
2240
+
2241
+ # TODO: wx.ToolBar compatibility
2242
+ return wx.Size(16, 15)
2243
+
2244
+
2245
+ def SetToolProportion(self, tool_id, proportion):
2246
+ """
2247
+ Sets the tool proportion in the toolbar.
2248
+
2249
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier;
2250
+ :param integer `proportion`: the tool proportion in the toolbar.
2251
+ """
2252
+
2253
+ item = self.FindTool(tool_id)
2254
+ if not item:
2255
+ return
2256
+
2257
+ item.proportion = proportion
2258
+
2259
+
2260
+ def GetToolProportion(self, tool_id):
2261
+ """
2262
+ Returns the tool proportion in the toolbar.
2263
+
2264
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier.
2265
+ """
2266
+
2267
+ item = self.FindTool(tool_id)
2268
+ if not item:
2269
+ return
2270
+
2271
+ return item.proportion
2272
+
2273
+
2274
+ def SetToolSeparation(self, separation):
2275
+ """
2276
+ Sets the separator size for the toolbar.
2277
+
2278
+ :param integer `separation`: the separator size in pixels.
2279
+ """
2280
+
2281
+ if self._art:
2282
+ self._art.SetElementSize(AUI_TBART_SEPARATOR_SIZE, separation)
2283
+
2284
+
2285
+ def GetToolSeparation(self):
2286
+ """ Returns the separator size for the toolbar, in pixels. """
2287
+
2288
+ if self._art:
2289
+ return self._art.GetElementSize(AUI_TBART_SEPARATOR_SIZE)
2290
+
2291
+ return 5
2292
+
2293
+
2294
+ def SetToolDropDown(self, tool_id, dropdown):
2295
+ """
2296
+ Assigns a drop down window menu to the toolbar item.
2297
+
2298
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier;
2299
+ :param bool `dropdown`: whether to assign a drop down menu or not.
2300
+ """
2301
+
2302
+ item = self.FindTool(tool_id)
2303
+ if not item:
2304
+ return
2305
+
2306
+ item.dropdown = dropdown
2307
+
2308
+
2309
+ def GetToolDropDown(self, tool_id):
2310
+ """
2311
+ Returns whether the toolbar item identified by `tool_id` has an associated drop down window menu or not.
2312
+
2313
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier.
2314
+ """
2315
+
2316
+ item = self.FindTool(tool_id)
2317
+ if not item:
2318
+ return
2319
+
2320
+ return item.dropdown
2321
+
2322
+
2323
+ def SetToolSticky(self, tool_id, sticky):
2324
+ """
2325
+ Sets the toolbar item as sticky or non-sticky.
2326
+
2327
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier;
2328
+ :param bool `sticky`: whether the tool should be sticky or not.
2329
+ """
2330
+
2331
+ # ignore separators
2332
+ if tool_id == -1:
2333
+ return
2334
+
2335
+ item = self.FindTool(tool_id)
2336
+ if not item:
2337
+ return
2338
+
2339
+ if item.sticky == sticky:
2340
+ return
2341
+
2342
+ item.sticky = sticky
2343
+
2344
+ self.Refresh(False)
2345
+ self.Update()
2346
+
2347
+
2348
+ def GetToolSticky(self, tool_id):
2349
+ """
2350
+ Returns whether the toolbar item identified by `tool_id` has a sticky behaviour or not.
2351
+
2352
+ :param integer `tool_id`: the :class:`AuiToolBarItem` identifier.
2353
+ """
2354
+
2355
+ item = self.FindTool(tool_id)
2356
+ if not item:
2357
+ return
2358
+
2359
+ return item.sticky
2360
+
2361
+
2362
+ def SetToolBorderPadding(self, padding):
2363
+ """
2364
+ Sets the padding between the tool border and the label.
2365
+
2366
+ :param integer `padding`: the padding in pixels.
2367
+ """
2368
+
2369
+ self._tool_border_padding = padding
2370
+
2371
+
2372
+ def GetToolBorderPadding(self):
2373
+ """ Returns the padding between the tool border and the label, in pixels. """
2374
+
2375
+ return self._tool_border_padding
2376
+
2377
+
2378
+ def SetToolTextOrientation(self, orientation):
2379
+ """
2380
+ Sets the label orientation for the toolbar items.
2381
+
2382
+ :param integer `orientation`: the :class:`AuiToolBarItem` label orientation.
2383
+ """
2384
+
2385
+ self._tool_text_orientation = orientation
2386
+
2387
+ if self._art:
2388
+ self._art.SetTextOrientation(orientation)
2389
+
2390
+
2391
+ def GetToolTextOrientation(self):
2392
+ """ Returns the label orientation for the toolbar items. """
2393
+
2394
+ return self._tool_text_orientation
2395
+
2396
+
2397
+ def SetToolOrientation(self, orientation):
2398
+ """
2399
+ Sets the tool orientation for the toolbar items.
2400
+
2401
+ :param integer `orientation`: the :class:`AuiToolBarItem` orientation.
2402
+ """
2403
+
2404
+ self._tool_orientation = orientation
2405
+ if self._art:
2406
+ self._art.SetOrientation(orientation)
2407
+
2408
+
2409
+ def GetToolOrientation(self):
2410
+ """ Returns the orientation for the toolbar items. """
2411
+
2412
+ return self._tool_orientation
2413
+
2414
+
2415
+ def SetToolPacking(self, packing):
2416
+ """
2417
+ Sets the value used for spacing tools. The default value is 1 pixel.
2418
+
2419
+ :param integer `packing`: the value for packing.
2420
+ """
2421
+
2422
+ self._tool_packing = packing
2423
+
2424
+
2425
+ def GetToolPacking(self):
2426
+ """ Returns the value used for spacing tools. The default value is 1 pixel. """
2427
+
2428
+ return self._tool_packing
2429
+
2430
+
2431
+ def SetOrientation(self, orientation):
2432
+ """
2433
+ Sets the toolbar orientation.
2434
+
2435
+ :param integer `orientation`: either ``wx.VERTICAL`` or ``wx.HORIZONTAL``.
2436
+
2437
+ :note: This can be temporarily overridden by :class:`~wx.lib.agw.aui.framemanager.AuiManager` when floating and
2438
+ docking a :class:`AuiToolBar`.
2439
+ """
2440
+
2441
+ pass
2442
+
2443
+
2444
+ def SetMargins(self, left=-1, right=-1, top=-1, bottom=-1):
2445
+ """
2446
+ Set the values to be used as margins for the toolbar.
2447
+
2448
+ :param integer `left`: the left toolbar margin;
2449
+ :param integer `right`: the right toolbar margin;
2450
+ :param integer `top`: the top toolbar margin;
2451
+ :param integer `bottom`: the bottom toolbar margin.
2452
+ """
2453
+
2454
+ if left != -1:
2455
+ self._left_padding = left
2456
+ if right != -1:
2457
+ self._right_padding = right
2458
+ if top != -1:
2459
+ self._top_padding = top
2460
+ if bottom != -1:
2461
+ self._bottom_padding = bottom
2462
+
2463
+
2464
+ def SetMarginsSize(self, size):
2465
+ """
2466
+ Set the values to be used as margins for the toolbar.
2467
+
2468
+ :param wx.Size `size`: the margin size (an instance of :class:`wx.Size`).
2469
+ """
2470
+
2471
+ self.SetMargins(size.x, size.x, size.y, size.y)
2472
+
2473
+
2474
+ def SetMarginsXY(self, x, y):
2475
+ """
2476
+ Set the values to be used as margins for the toolbar.
2477
+
2478
+ :param integer `x`: left margin, right margin and inter-tool separation value;
2479
+ :param integer `y`: top margin, bottom margin and inter-tool separation value.
2480
+ """
2481
+
2482
+ self.SetMargins(x, x, y, y)
2483
+
2484
+
2485
+ def GetGripperVisible(self):
2486
+ """ Returns whether the toolbar gripper is visible or not. """
2487
+
2488
+ return self._gripper_visible
2489
+
2490
+
2491
+ def SetGripperVisible(self, visible):
2492
+ """
2493
+ Sets whether the toolbar gripper is visible or not.
2494
+
2495
+ :param bool `visible`: ``True`` for a visible gripper, ``False`` otherwise.
2496
+ """
2497
+
2498
+ self._gripper_visible = visible
2499
+ if visible:
2500
+ self._agwStyle |= AUI_TB_GRIPPER
2501
+ else:
2502
+ self._agwStyle &= ~AUI_TB_GRIPPER
2503
+
2504
+ self.Realize()
2505
+ self.Refresh(False)
2506
+
2507
+
2508
+ def GetOverflowVisible(self):
2509
+ """ Returns whether the overflow button is visible or not. """
2510
+
2511
+ return self._overflow_visible
2512
+
2513
+
2514
+ def SetOverflowVisible(self, visible):
2515
+ """
2516
+ Sets whether the overflow button is visible or not.
2517
+
2518
+ :param bool `visible`: ``True`` for a visible overflow button, ``False`` otherwise.
2519
+ """
2520
+
2521
+ self._overflow_visible = visible
2522
+ if visible:
2523
+ self._agwStyle |= AUI_TB_OVERFLOW
2524
+ else:
2525
+ self._agwStyle &= ~AUI_TB_OVERFLOW
2526
+
2527
+ self.Refresh(False)
2528
+
2529
+
2530
+ def SetFont(self, font):
2531
+ """
2532
+ Sets the :class:`AuiToolBar` font.
2533
+
2534
+ :param wx.Font `font`: the new toolbar font.
2535
+
2536
+ :note: Overridden from :class:`wx.Control`.
2537
+ """
2538
+
2539
+ res = wx.Control.SetFont(self, font)
2540
+
2541
+ if self._art:
2542
+ self._art.SetFont(font)
2543
+
2544
+ return res
2545
+
2546
+
2547
+ def SetHoverItem(self, pitem):
2548
+ """
2549
+ Sets a toolbar item to be currently hovered by the mouse.
2550
+
2551
+ :param `pitem`: an instance of :class:`AuiToolBarItem`.
2552
+ """
2553
+
2554
+ former_hover = None
2555
+
2556
+ for item in self._items:
2557
+
2558
+ if item.state & AUI_BUTTON_STATE_HOVER:
2559
+ former_hover = item
2560
+
2561
+ item.state &= ~AUI_BUTTON_STATE_HOVER
2562
+
2563
+ if pitem:
2564
+ pitem.state |= AUI_BUTTON_STATE_HOVER
2565
+
2566
+ if former_hover != pitem:
2567
+ self.Refresh(False)
2568
+ self.Update()
2569
+
2570
+
2571
+ def SetPressedItem(self, pitem):
2572
+ """
2573
+ Sets a toolbar item to be currently in a "pressed" state.
2574
+
2575
+ :param `pitem`: an instance of :class:`AuiToolBarItem`.
2576
+ """
2577
+
2578
+ former_item = None
2579
+
2580
+ for item in self._items:
2581
+
2582
+ if item.state & AUI_BUTTON_STATE_PRESSED:
2583
+ former_item = item
2584
+
2585
+ item.state &= ~AUI_BUTTON_STATE_PRESSED
2586
+
2587
+ if pitem:
2588
+ pitem.state &= ~AUI_BUTTON_STATE_HOVER
2589
+ pitem.state |= AUI_BUTTON_STATE_PRESSED
2590
+
2591
+ if former_item != pitem:
2592
+ self.Refresh(False)
2593
+ self.Update()
2594
+
2595
+
2596
+ def RefreshOverflowState(self):
2597
+ """ Refreshes the overflow button. """
2598
+
2599
+ if not self.GetOverflowVisible():
2600
+ self._overflow_state = 0
2601
+ return
2602
+
2603
+ overflow_state = 0
2604
+ overflow_rect = self.GetOverflowRect()
2605
+
2606
+ # find out the mouse's current position
2607
+ pt = wx.GetMousePosition()
2608
+ pt = self.ScreenToClient(pt)
2609
+
2610
+ # find out if the mouse cursor is inside the dropdown rectangle
2611
+ if overflow_rect.Contains((pt.x, pt.y)):
2612
+
2613
+ if wx.GetMouseState().LeftIsDown():
2614
+ overflow_state = AUI_BUTTON_STATE_PRESSED
2615
+ else:
2616
+ overflow_state = AUI_BUTTON_STATE_HOVER
2617
+
2618
+ if overflow_state != self._overflow_state:
2619
+ self._overflow_state = overflow_state
2620
+ self.Refresh(False)
2621
+ self.Update()
2622
+
2623
+ self._overflow_state = overflow_state
2624
+
2625
+
2626
+ def ToggleTool(self, tool_id, state):
2627
+ """
2628
+ Toggles a tool on or off. This does not cause any event to get emitted.
2629
+
2630
+ :param integer `tool_id`: tool in question.
2631
+ :param bool `state`: if ``True``, toggles the tool on, otherwise toggles it off.
2632
+
2633
+ :note: This only applies to a tool that has been specified as a toggle tool.
2634
+ """
2635
+
2636
+ tool = self.FindTool(tool_id)
2637
+
2638
+ if tool:
2639
+ if tool.kind not in [ITEM_CHECK, ITEM_RADIO]:
2640
+ return
2641
+
2642
+ if tool.kind == ITEM_RADIO:
2643
+ idx = self.GetToolIndex(tool_id)
2644
+ if idx >= 0 and idx < len(self._items):
2645
+ for i in range(idx, len(self._items)):
2646
+ tool = self.FindToolByIndex(i)
2647
+ if tool.kind != ITEM_RADIO:
2648
+ break
2649
+ tool.state &= ~AUI_BUTTON_STATE_CHECKED
2650
+
2651
+ for i in range(idx, -1, -1):
2652
+ tool = self.FindToolByIndex(i)
2653
+ if tool.kind != ITEM_RADIO:
2654
+ break
2655
+ tool.state &= ~AUI_BUTTON_STATE_CHECKED
2656
+
2657
+ tool = self.FindTool(tool_id)
2658
+ tool.state |= AUI_BUTTON_STATE_CHECKED
2659
+ else:
2660
+ if state:
2661
+ tool.state |= AUI_BUTTON_STATE_CHECKED
2662
+ else:
2663
+ tool.state &= ~AUI_BUTTON_STATE_CHECKED
2664
+
2665
+
2666
+ def GetToolToggled(self, tool_id):
2667
+ """
2668
+ Returns whether a tool is toggled or not.
2669
+
2670
+ :param integer `tool_id`: the toolbar item identifier.
2671
+
2672
+ :note: This only applies to a tool that has been specified as a toggle tool.
2673
+ """
2674
+
2675
+ tool = self.FindTool(tool_id)
2676
+
2677
+ if tool:
2678
+ if tool.kind not in [ITEM_CHECK, ITEM_RADIO]:
2679
+ return False
2680
+
2681
+ return (tool.state & AUI_BUTTON_STATE_CHECKED and [True] or [False])[0]
2682
+
2683
+ return False
2684
+
2685
+
2686
+ def EnableTool(self, tool_id, state):
2687
+ """
2688
+ Enables or disables the tool.
2689
+
2690
+ :param integer `tool_id`: identifier for the tool to enable or disable.
2691
+ :param bool `state`: if ``True``, enables the tool, otherwise disables it.
2692
+ """
2693
+
2694
+ tool = self.FindTool(tool_id)
2695
+
2696
+ if tool:
2697
+
2698
+ if state:
2699
+ tool.state &= ~AUI_BUTTON_STATE_DISABLED
2700
+ else:
2701
+ tool.state |= AUI_BUTTON_STATE_DISABLED
2702
+
2703
+
2704
+ def GetToolEnabled(self, tool_id):
2705
+ """
2706
+ Returns whether the tool identified by `tool_id` is enabled or not.
2707
+
2708
+ :param integer `tool_id`: the tool identifier.
2709
+ """
2710
+
2711
+ tool = self.FindTool(tool_id)
2712
+
2713
+ if tool:
2714
+ return (tool.state & AUI_BUTTON_STATE_DISABLED and [False] or [True])[0]
2715
+
2716
+ return False
2717
+
2718
+
2719
+ def GetToolLabel(self, tool_id):
2720
+ """
2721
+ Returns the tool label for the tool identified by `tool_id`.
2722
+
2723
+ :param integer `tool_id`: the tool identifier.
2724
+ """
2725
+
2726
+ tool = self.FindTool(tool_id)
2727
+ if not tool:
2728
+ return ""
2729
+
2730
+ return tool.label
2731
+
2732
+
2733
+ def SetToolLabel(self, tool_id, label):
2734
+ """
2735
+ Sets the tool label for the tool identified by `tool_id`.
2736
+
2737
+ :param integer `tool_id`: the tool identifier;
2738
+ :param string `label`: the new toolbar item label.
2739
+ """
2740
+
2741
+ tool = self.FindTool(tool_id)
2742
+ if tool:
2743
+ tool.label = label
2744
+
2745
+
2746
+ def GetToolBitmap(self, tool_id):
2747
+ """
2748
+ Returns the tool bitmap for the tool identified by `tool_id`.
2749
+
2750
+ :param integer `tool_id`: the tool identifier.
2751
+ """
2752
+
2753
+ tool = self.FindTool(tool_id)
2754
+ if not tool:
2755
+ return wx.NullBitmap
2756
+
2757
+ return tool.bitmap
2758
+
2759
+
2760
+ def SetToolBitmap(self, tool_id, bitmap):
2761
+ """
2762
+ Sets the tool bitmap for the tool identified by `tool_id`.
2763
+
2764
+ :param integer `tool_id`: the tool identifier;
2765
+ :param wx.Bitmap `bitmap`: the new bitmap for the toolbar item.
2766
+ """
2767
+
2768
+ tool = self.FindTool(tool_id)
2769
+ if tool:
2770
+ tool.bitmap = bitmap
2771
+
2772
+
2773
+ def SetToolNormalBitmap(self, tool_id, bitmap):
2774
+ """
2775
+ Sets the tool bitmap for the tool identified by `tool_id`.
2776
+
2777
+ :param integer `tool_id`: the tool identifier;
2778
+ :param wx.Bitmap `bitmap`: the new bitmap for the toolbar item.
2779
+ """
2780
+
2781
+ self.SetToolBitmap(tool_id, bitmap)
2782
+
2783
+
2784
+ def SetToolDisabledBitmap(self, tool_id, bitmap):
2785
+ """
2786
+ Sets the tool disabled bitmap for the tool identified by `tool_id`.
2787
+
2788
+ :param integer `tool_id`: the tool identifier;
2789
+ :param wx.Bitmap `bitmap`: the new disabled bitmap for the toolbar item.
2790
+ """
2791
+
2792
+ tool = self.FindTool(tool_id)
2793
+ if tool:
2794
+ tool.disabled_bitmap = bitmap
2795
+
2796
+
2797
+ def GetToolShortHelp(self, tool_id):
2798
+ """
2799
+ Returns the short help for the given tool.
2800
+
2801
+ :param integer `tool_id`: the tool identifier.
2802
+ """
2803
+
2804
+ tool = self.FindTool(tool_id)
2805
+ if not tool:
2806
+ return ""
2807
+
2808
+ return tool.short_help
2809
+
2810
+
2811
+ def SetToolShortHelp(self, tool_id, help_string):
2812
+ """
2813
+ Sets the short help for the given tool.
2814
+
2815
+ :param integer `tool_id`: the tool identifier;
2816
+ :param string `help_string`: the string for the short help.
2817
+ """
2818
+
2819
+ tool = self.FindTool(tool_id)
2820
+ if tool:
2821
+ tool.short_help = help_string
2822
+
2823
+
2824
+ def GetToolLongHelp(self, tool_id):
2825
+ """
2826
+ Returns the long help for the given tool.
2827
+
2828
+ :param integer `tool_id`: the tool identifier.
2829
+ """
2830
+
2831
+ tool = self.FindTool(tool_id)
2832
+ if not tool:
2833
+ return ""
2834
+
2835
+ return tool.long_help
2836
+
2837
+
2838
+ def SetToolAlignment(self, alignment=wx.EXPAND):
2839
+ """
2840
+ This sets the alignment for all of the tools within the toolbar
2841
+ (only has an effect when the toolbar is expanded).
2842
+
2843
+ :param integer `alignment`: :class:`wx.Sizer` alignment value
2844
+ (``wx.ALIGN_CENTER_HORIZONTAL`` or ``wx.ALIGN_CENTER_VERTICAL``).
2845
+ """
2846
+
2847
+ self._tool_alignment = alignment
2848
+
2849
+
2850
+
2851
+ def SetToolLongHelp(self, tool_id, help_string):
2852
+ """
2853
+ Sets the long help for the given tool.
2854
+
2855
+ :param integer `tool_id`: the tool identifier;
2856
+ :param string `help_string`: the string for the long help.
2857
+ """
2858
+
2859
+ tool = self.FindTool(tool_id)
2860
+ if tool:
2861
+ tool.long_help = help_string
2862
+
2863
+
2864
+ def SetCustomOverflowItems(self, prepend, append):
2865
+ """
2866
+ Sets the two lists `prepend` and `append` as custom overflow items.
2867
+
2868
+ :param list `prepend`: a list of :class:`AuiToolBarItem` to be prepended;
2869
+ :param list `append`: a list of :class:`AuiToolBarItem` to be appended.
2870
+ """
2871
+
2872
+ self._custom_overflow_prepend = prepend
2873
+ self._custom_overflow_append = append
2874
+
2875
+
2876
+ def GetToolCount(self):
2877
+ """ Returns the number of tools in the :class:`AuiToolBar`. """
2878
+
2879
+ return len(self._items)
2880
+
2881
+
2882
+ def GetToolIndex(self, tool_id):
2883
+ """
2884
+ Returns the position of the tool in the toolbar given its identifier.
2885
+
2886
+ :param integer `tool_id`: the toolbar item identifier.
2887
+ """
2888
+
2889
+ # this will prevent us from returning the index of the
2890
+ # first separator in the toolbar since its id is equal to -1
2891
+ if tool_id == -1:
2892
+ return wx.NOT_FOUND
2893
+
2894
+ for i, item in enumerate(self._items):
2895
+ if item.id == tool_id:
2896
+ return i
2897
+
2898
+ return wx.NOT_FOUND
2899
+
2900
+
2901
+ def GetToolPos(self, tool_id):
2902
+ """
2903
+ Returns the position of the tool in the toolbar given its identifier.
2904
+
2905
+ :param integer `tool_id`: the toolbar item identifier.
2906
+ """
2907
+
2908
+ return self.GetToolIndex(tool_id)
2909
+
2910
+
2911
+ def GetToolFitsByIndex(self, tool_id):
2912
+ """
2913
+ Returns whether the tool identified by `tool_id` fits into the toolbar or not.
2914
+
2915
+ :param integer `tool_id`: the toolbar item identifier.
2916
+ """
2917
+
2918
+ if tool_id < 0 or tool_id >= len(self._items):
2919
+ return False
2920
+
2921
+ if not self._items[tool_id].sizer_item:
2922
+ return False
2923
+
2924
+ cli_w, cli_h = self.GetClientSize()
2925
+ rect = self._items[tool_id].sizer_item.GetRect()
2926
+ dropdown_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
2927
+
2928
+ if self._agwStyle & AUI_TB_VERTICAL:
2929
+ # take the dropdown size into account
2930
+ if self._overflow_visible:
2931
+ cli_h -= dropdown_size
2932
+
2933
+ if rect.y+rect.height < cli_h:
2934
+ return True
2935
+
2936
+ else:
2937
+
2938
+ # take the dropdown size into account
2939
+ if self._overflow_visible:
2940
+ cli_w -= dropdown_size
2941
+
2942
+ if rect.x+rect.width < cli_w:
2943
+ return True
2944
+
2945
+ return False
2946
+
2947
+
2948
+ def GetToolFits(self, tool_id):
2949
+ """
2950
+ Returns whether the tool identified by `tool_id` fits into the toolbar or not.
2951
+
2952
+ :param integer `tool_id`: the toolbar item identifier.
2953
+ """
2954
+
2955
+ return self.GetToolFitsByIndex(self.GetToolIndex(tool_id))
2956
+
2957
+
2958
+ def GetToolRect(self, tool_id):
2959
+ """
2960
+ Returns the toolbar item rectangle
2961
+
2962
+ :param integer `tool_id`: the toolbar item identifier.
2963
+ """
2964
+
2965
+ tool = self.FindTool(tool_id)
2966
+ if tool and tool.sizer_item:
2967
+ return tool.sizer_item.GetRect()
2968
+
2969
+ return wx.Rect()
2970
+
2971
+
2972
+ def GetToolBarFits(self):
2973
+ """ Returns whether the :class:`AuiToolBar` size fits in a specified size. """
2974
+
2975
+ if len(self._items) == 0:
2976
+ # empty toolbar always 'fits'
2977
+ return True
2978
+
2979
+ # entire toolbar content fits if the last tool fits
2980
+ return self.GetToolFitsByIndex(len(self._items) - 1)
2981
+
2982
+
2983
+ def Realize(self):
2984
+ """ Realizes the toolbar. This function should be called after you have added tools. """
2985
+
2986
+ dc = wx.ClientDC(self)
2987
+
2988
+ if not dc.IsOk():
2989
+ return False
2990
+
2991
+ horizontal = True
2992
+ if self._agwStyle & AUI_TB_VERTICAL:
2993
+ horizontal = False
2994
+
2995
+ # create the new sizer to add toolbar elements to
2996
+ sizer = wx.BoxSizer((horizontal and [wx.HORIZONTAL] or [wx.VERTICAL])[0])
2997
+ # local opts
2998
+ sizer_Add, sizer_AddSpacer, sizer_AddStretchSpacer, sizer_SetItemMinSize = sizer.Add, sizer.AddSpacer, sizer.AddStretchSpacer, sizer.SetItemMinSize
2999
+
3000
+ # add gripper area
3001
+ separator_size = self._art.GetElementSize(AUI_TBART_SEPARATOR_SIZE)
3002
+ gripper_size = self._art.GetElementSize(AUI_TBART_GRIPPER_SIZE)
3003
+
3004
+ if gripper_size > 0 and self._gripper_visible:
3005
+ if horizontal:
3006
+ self._gripper_sizer_item = sizer_Add((gripper_size, 1), 0, wx.EXPAND)
3007
+ else:
3008
+ self._gripper_sizer_item = sizer_Add((1, gripper_size), 0, wx.EXPAND)
3009
+ else:
3010
+ self._gripper_sizer_item = None
3011
+
3012
+ # add "left" padding
3013
+ if self._left_padding > 0:
3014
+ if horizontal:
3015
+ sizer_Add((self._left_padding, 1))
3016
+ else:
3017
+ sizer_Add((1, self._left_padding))
3018
+
3019
+ count = len(self._items)
3020
+ for i, item in enumerate(self._items):
3021
+
3022
+ sizer_item = None
3023
+ kind = item.kind
3024
+
3025
+ if kind == ITEM_LABEL:
3026
+
3027
+ size = self._art.GetLabelSize(dc, self, item)
3028
+ sizer_item = sizer_Add((size.x + (self._tool_border_padding*2),
3029
+ size.y + (self._tool_border_padding*2)),
3030
+ item.proportion,
3031
+ item.alignment)
3032
+ if i+1 < count:
3033
+ sizer_AddSpacer(self._tool_packing)
3034
+
3035
+ elif kind in [ITEM_CHECK, ITEM_NORMAL, ITEM_RADIO]:
3036
+
3037
+ size = self._art.GetToolSize(dc, self, item)
3038
+ sizer_item = sizer_Add((size.x + (self._tool_border_padding*2),
3039
+ size.y + (self._tool_border_padding*2)),
3040
+ 0,
3041
+ item.alignment)
3042
+ # add tool packing
3043
+ if i+1 < count:
3044
+ sizer_AddSpacer(self._tool_packing)
3045
+
3046
+ elif kind == ITEM_SEPARATOR:
3047
+
3048
+ if horizontal:
3049
+ sizer_item = sizer_Add((separator_size, 1), 0, wx.EXPAND)
3050
+ else:
3051
+ sizer_item = sizer_Add((1, separator_size), 0, wx.EXPAND)
3052
+
3053
+ # add tool packing
3054
+ if i+1 < count:
3055
+ sizer_AddSpacer(self._tool_packing)
3056
+
3057
+ elif kind == ITEM_SPACER:
3058
+
3059
+ if item.proportion > 0:
3060
+ sizer_item = sizer_AddStretchSpacer(item.proportion)
3061
+ else:
3062
+ sizer_item = sizer_Add((item.spacer_pixels, 1))
3063
+
3064
+ elif kind == ITEM_CONTROL:
3065
+ if item.window and item.window.GetContainingSizer():
3066
+ # Make sure that there is only one sizer to this control
3067
+ item.window.GetContainingSizer().Detach(item.window);
3068
+
3069
+ if item.window and not item.window.IsShown():
3070
+ item.window.Show(True)
3071
+
3072
+ vert_sizer = wx.BoxSizer(wx.VERTICAL)
3073
+ vert_sizer.AddStretchSpacer(1)
3074
+ ctrl_sizer_item = vert_sizer.Add(item.window, 0, wx.EXPAND)
3075
+ vert_sizer.AddStretchSpacer(1)
3076
+
3077
+ if self._agwStyle & AUI_TB_TEXT and \
3078
+ self._tool_text_orientation == AUI_TBTOOL_TEXT_BOTTOM and \
3079
+ item.GetLabel() != "":
3080
+
3081
+ s = self.GetLabelSize(item.GetLabel())
3082
+ vert_sizer.Add((1, s.y))
3083
+
3084
+ sizer_item = sizer_Add(vert_sizer, item.proportion, wx.EXPAND)
3085
+ min_size = item.min_size
3086
+
3087
+ # proportional items will disappear from the toolbar if
3088
+ # their min width is not set to something really small
3089
+ if item.proportion != 0:
3090
+ min_size.x = 1
3091
+
3092
+ if min_size.IsFullySpecified():
3093
+ sizer_SetItemMinSize(vert_sizer, min_size)
3094
+ vert_sizer.SetItemMinSize(item.window, min_size)
3095
+
3096
+ # add tool packing
3097
+ if i+1 < count:
3098
+ sizer_AddSpacer(self._tool_packing)
3099
+
3100
+ item.sizer_item = sizer_item
3101
+
3102
+
3103
+ # add "right" padding
3104
+ if self._right_padding > 0:
3105
+ if horizontal:
3106
+ sizer_Add((self._right_padding, 1))
3107
+ else:
3108
+ sizer_Add((1, self._right_padding))
3109
+
3110
+ # add drop down area
3111
+ self._overflow_sizer_item = None
3112
+
3113
+ if self._agwStyle & AUI_TB_OVERFLOW:
3114
+
3115
+ overflow_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
3116
+ if overflow_size > 0 and (self._custom_overflow_append or \
3117
+ self._custom_overflow_prepend):
3118
+ # add drop down area only if there is any custom overflow
3119
+ # item; otherwise, the overflow button should not affect the
3120
+ # min size.
3121
+
3122
+ if horizontal:
3123
+ self._overflow_sizer_item = sizer_Add((overflow_size, 1), 0, wx.EXPAND)
3124
+ else:
3125
+ self._overflow_sizer_item = sizer_Add((1, overflow_size), 0, wx.EXPAND)
3126
+
3127
+ else:
3128
+
3129
+ self._overflow_sizer_item = None
3130
+
3131
+ # the outside sizer helps us apply the "top" and "bottom" padding
3132
+ outside_sizer = wx.BoxSizer((horizontal and [wx.VERTICAL] or [wx.HORIZONTAL])[0])
3133
+
3134
+ # add "top" padding
3135
+ if self._top_padding > 0:
3136
+
3137
+ if horizontal:
3138
+ outside_sizer.Add((1, self._top_padding))
3139
+ else:
3140
+ outside_sizer.Add((self._top_padding, 1))
3141
+
3142
+ # add the sizer that contains all of the toolbar elements
3143
+ outside_sizer.Add(sizer, 1, self._tool_alignment)
3144
+
3145
+ # add "bottom" padding
3146
+ if self._bottom_padding > 0:
3147
+
3148
+ if horizontal:
3149
+ outside_sizer.Add((1, self._bottom_padding))
3150
+ else:
3151
+ outside_sizer.Add((self._bottom_padding, 1))
3152
+
3153
+ del self._sizer # remove old sizer
3154
+ self._sizer = outside_sizer
3155
+ self.SetSizer(outside_sizer)
3156
+
3157
+ # calculate the rock-bottom minimum size
3158
+ for item in self._items:
3159
+
3160
+ if item.sizer_item and item.proportion > 0 and item.min_size.IsFullySpecified():
3161
+ item.sizer_item.SetMinSize((0, 0))
3162
+
3163
+ self._absolute_min_size = self._sizer.GetMinSize()
3164
+
3165
+ # reset the min sizes to what they were
3166
+ for item in self._items:
3167
+
3168
+ if item.sizer_item and item.proportion > 0 and item.min_size.IsFullySpecified():
3169
+ item.sizer_item.SetMinSize(item.min_size)
3170
+
3171
+ # set control size
3172
+ size = self._sizer.GetMinSize()
3173
+ self.SetMinSize(size)
3174
+ self._minWidth = size.x
3175
+ self._minHeight = size.y
3176
+
3177
+ if self._agwStyle & AUI_TB_NO_AUTORESIZE == 0:
3178
+
3179
+ cur_size = self.GetClientSize()
3180
+ new_size = self.GetMinSize()
3181
+
3182
+ if new_size != cur_size:
3183
+
3184
+ self.SetClientSize(new_size)
3185
+
3186
+ else:
3187
+
3188
+ self._sizer.SetDimension(0, 0, cur_size.x, cur_size.y)
3189
+
3190
+ else:
3191
+
3192
+ cur_size = self.GetClientSize()
3193
+ self._sizer.SetDimension(0, 0, cur_size.x, cur_size.y)
3194
+
3195
+ self.Refresh(False)
3196
+ return True
3197
+
3198
+
3199
+ def GetOverflowState(self):
3200
+ """ Returns the state of the overflow button. """
3201
+
3202
+ return self._overflow_state
3203
+
3204
+
3205
+ def GetOverflowRect(self):
3206
+ """ Returns the rectangle of the overflow button. """
3207
+
3208
+ cli_rect = wx.Rect(wx.Point(0, 0), self.GetClientSize())
3209
+ overflow_rect = wx.Rect(0, 0, 0, 0)
3210
+ overflow_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
3211
+
3212
+ if self._agwStyle & AUI_TB_VERTICAL:
3213
+
3214
+ overflow_rect.y = cli_rect.height - overflow_size
3215
+ overflow_rect.x = 0
3216
+ overflow_rect.width = cli_rect.width
3217
+ overflow_rect.height = overflow_size
3218
+
3219
+ else:
3220
+
3221
+ overflow_rect.x = cli_rect.width - overflow_size
3222
+ overflow_rect.y = 0
3223
+ overflow_rect.width = overflow_size
3224
+ overflow_rect.height = cli_rect.height
3225
+
3226
+ return overflow_rect
3227
+
3228
+
3229
+ def GetLabelSize(self, label):
3230
+ """
3231
+ Returns the standard size of a toolbar item.
3232
+
3233
+ :param string `label`: a test label.
3234
+ """
3235
+
3236
+ dc = wx.ClientDC(self)
3237
+ dc.SetFont(self._font)
3238
+
3239
+ return GetLabelSize(dc, label, self._tool_orientation != AUI_TBTOOL_HORIZONTAL)
3240
+
3241
+
3242
+ def GetAuiManager(self):
3243
+ """ Returns the :class:`~wx.lib.agw.aui.framemanager.AuiManager` which manages the toolbar. """
3244
+
3245
+ try:
3246
+ return self._auiManager
3247
+ except AttributeError:
3248
+ return False
3249
+
3250
+
3251
+ def SetAuiManager(self, auiManager):
3252
+ """ Sets the :class:`~wx.lib.agw.aui.framemanager.AuiManager` which manages the toolbar. """
3253
+
3254
+ self._auiManager = auiManager
3255
+
3256
+
3257
+ def DoIdleUpdate(self):
3258
+ """ Updates the toolbar during idle times. """
3259
+
3260
+ handler = self.GetEventHandler()
3261
+ if not handler:
3262
+ return
3263
+
3264
+ need_refresh = False
3265
+
3266
+ for item in self._items:
3267
+
3268
+ if item.id == -1:
3269
+ continue
3270
+
3271
+ evt = wx.UpdateUIEvent(item.id)
3272
+ evt.SetEventObject(self)
3273
+
3274
+ if handler.ProcessEvent(evt):
3275
+
3276
+ if evt.GetSetEnabled():
3277
+
3278
+ if item.window:
3279
+ is_enabled = item.window.IsEnabled()
3280
+ else:
3281
+ is_enabled = (item.state & AUI_BUTTON_STATE_DISABLED and [False] or [True])[0]
3282
+
3283
+ new_enabled = evt.GetEnabled()
3284
+ if new_enabled != is_enabled:
3285
+
3286
+ if item.window:
3287
+ item.window.Enable(new_enabled)
3288
+ else:
3289
+ if new_enabled:
3290
+ item.state &= ~AUI_BUTTON_STATE_DISABLED
3291
+ else:
3292
+ item.state |= AUI_BUTTON_STATE_DISABLED
3293
+
3294
+ need_refresh = True
3295
+
3296
+ if evt.GetSetChecked():
3297
+
3298
+ # make sure we aren't checking an item that can't be
3299
+ if item.kind != ITEM_CHECK and item.kind != ITEM_RADIO:
3300
+ continue
3301
+
3302
+ is_checked = (item.state & AUI_BUTTON_STATE_CHECKED and [True] or [False])[0]
3303
+ new_checked = evt.GetChecked()
3304
+
3305
+ if new_checked != is_checked:
3306
+
3307
+ if new_checked:
3308
+ item.state |= AUI_BUTTON_STATE_CHECKED
3309
+ else:
3310
+ item.state &= ~AUI_BUTTON_STATE_CHECKED
3311
+
3312
+ need_refresh = True
3313
+
3314
+ if need_refresh:
3315
+ self.Refresh(False)
3316
+
3317
+
3318
+ def OnSize(self, event):
3319
+ """
3320
+ Handles the ``wx.EVT_SIZE`` event for :class:`AuiToolBar`.
3321
+
3322
+ :param `event`: a :class:`wx.SizeEvent` event to be processed.
3323
+ """
3324
+
3325
+ x, y = self.GetClientSize()
3326
+ realize = False
3327
+
3328
+ if x > y:
3329
+ self.SetOrientation(wx.HORIZONTAL)
3330
+ else:
3331
+ self.SetOrientation(wx.VERTICAL)
3332
+
3333
+ horizontal = True
3334
+ if self._agwStyle & AUI_TB_VERTICAL:
3335
+ horizontal = False
3336
+
3337
+ if (horizontal and self._absolute_min_size.x > x) or \
3338
+ (not horizontal and self._absolute_min_size.y > y):
3339
+
3340
+ if self._originalStyle & AUI_TB_OVERFLOW:
3341
+ if not self.GetOverflowVisible():
3342
+ self.SetOverflowVisible(True)
3343
+
3344
+ # hide all flexible items and items that do not fit into toolbar
3345
+ self_GetToolFitsByIndex = self.GetToolFitsByIndex
3346
+ for i, item in enumerate(self._items):
3347
+ sizer_item = item.sizer_item
3348
+ if not sizer_item:
3349
+ continue
3350
+
3351
+ if item.proportion > 0:
3352
+ if sizer_item.IsShown():
3353
+ sizer_item.Show(False)
3354
+ sizer_item.SetProportion(0)
3355
+ elif self_GetToolFitsByIndex(i):
3356
+ if not sizer_item.IsShown():
3357
+ sizer_item.Show(True)
3358
+ else:
3359
+ if sizer_item.IsShown():
3360
+ sizer_item.Show(False)
3361
+
3362
+ else:
3363
+
3364
+ if self._originalStyle & AUI_TB_OVERFLOW and not self._custom_overflow_append and \
3365
+ not self._custom_overflow_prepend:
3366
+ if self.GetOverflowVisible():
3367
+ self.SetOverflowVisible(False)
3368
+
3369
+ # show all items
3370
+ for item in self._items:
3371
+ sizer_item = item.sizer_item
3372
+ if not sizer_item:
3373
+ continue
3374
+
3375
+ if not sizer_item.IsShown():
3376
+ sizer_item.Show(True)
3377
+ if item.proportion > 0:
3378
+ sizer_item.SetProportion(item.proportion)
3379
+
3380
+ self._sizer.SetDimension(0, 0, x, y)
3381
+
3382
+ self.Refresh(False)
3383
+
3384
+ self.Update()
3385
+
3386
+
3387
+ def DoSetSize(self, x, y, width, height, sizeFlags=wx.SIZE_AUTO):
3388
+ """
3389
+ Sets the position and size of the window in pixels. The `sizeFlags`
3390
+ parameter indicates the interpretation of the other params if they are
3391
+ equal to -1.
3392
+
3393
+ :param integer `x`: the window `x` position;
3394
+ :param integer `y`: the window `y` position;
3395
+ :param integer `width`: the window width;
3396
+ :param integer `height`: the window height;
3397
+ :param integer `sizeFlags`: may have one of this bit set:
3398
+
3399
+ =================================== ======================================
3400
+ Size Flags Description
3401
+ =================================== ======================================
3402
+ ``wx.SIZE_AUTO`` A -1 indicates that a class-specific default should be used.
3403
+ ``wx.SIZE_AUTO_WIDTH`` A -1 indicates that a class-specific default should be used for the width.
3404
+ ``wx.SIZE_AUTO_HEIGHT`` A -1 indicates that a class-specific default should be used for the height.
3405
+ ``wx.SIZE_USE_EXISTING`` Existing dimensions should be used if -1 values are supplied.
3406
+ ``wx.SIZE_ALLOW_MINUS_ONE`` Allow dimensions of -1 and less to be interpreted as real dimensions, not default values.
3407
+ ``wx.SIZE_FORCE`` Normally, if the position and the size of the window are already the same as the
3408
+ parameters of this function, nothing is done. but with this flag a window resize may
3409
+ be forced even in this case (supported in wx 2.6.2 and later and only implemented
3410
+ for MSW and ignored elsewhere currently)
3411
+ =================================== ======================================
3412
+
3413
+ :note: Overridden from :class:`wx.Control`.
3414
+ """
3415
+
3416
+ parent_size = self.GetParent().GetClientSize()
3417
+ if x + width > parent_size.x:
3418
+ width = max(0, parent_size.x - x)
3419
+ if y + height > parent_size.y:
3420
+ height = max(0, parent_size.y - y)
3421
+
3422
+ wx.Control.DoSetSize(self, x, y, width, height, sizeFlags)
3423
+
3424
+
3425
+ def OnIdle(self, event):
3426
+ """
3427
+ Handles the ``wx.EVT_IDLE`` event for :class:`AuiToolBar`.
3428
+
3429
+ :param `event`: a :class:`IdleEvent` event to be processed.
3430
+ """
3431
+
3432
+ self.DoIdleUpdate()
3433
+ event.Skip()
3434
+
3435
+
3436
+ def DoGetBestSize(self):
3437
+ """
3438
+ Gets the size which best suits the window: for a control, it would be the
3439
+ minimal size which doesn't truncate the control, for a panel - the same
3440
+ size as it would have after a call to `Fit()`.
3441
+
3442
+ :note: Overridden from :class:`wx.Control`.
3443
+ """
3444
+
3445
+ return self._absolute_min_size
3446
+
3447
+
3448
+ def OnPaint(self, event):
3449
+ """
3450
+ Handles the ``wx.EVT_PAINT`` event for :class:`AuiToolBar`.
3451
+
3452
+ :param `event`: a :class:`PaintEvent` event to be processed.
3453
+ """
3454
+
3455
+ dc = wx.AutoBufferedPaintDC(self)
3456
+ cli_rect = wx.Rect(wx.Point(0, 0), self.GetClientSize())
3457
+
3458
+ horizontal = True
3459
+ if self._agwStyle & AUI_TB_VERTICAL:
3460
+ horizontal = False
3461
+
3462
+ if self._agwStyle & AUI_TB_PLAIN_BACKGROUND:
3463
+ self._art.DrawPlainBackground(dc, self, cli_rect)
3464
+ else:
3465
+ self._art.DrawBackground(dc, self, cli_rect, horizontal)
3466
+
3467
+ gripper_size = self._art.GetElementSize(AUI_TBART_GRIPPER_SIZE)
3468
+ dropdown_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
3469
+
3470
+ # paint the gripper
3471
+ if self._agwStyle & AUI_TB_GRIPPER and gripper_size > 0 and self._gripper_sizer_item:
3472
+ gripper_rect = wx.Rect(*self._gripper_sizer_item.GetRect())
3473
+ if horizontal:
3474
+ gripper_rect.width = gripper_size
3475
+ else:
3476
+ gripper_rect.height = gripper_size
3477
+
3478
+ self._art.DrawGripper(dc, self, gripper_rect)
3479
+
3480
+ # calculated how far we can draw items
3481
+ if horizontal:
3482
+ last_extent = cli_rect.width
3483
+ else:
3484
+ last_extent = cli_rect.height
3485
+
3486
+ if self._overflow_visible:
3487
+ last_extent -= dropdown_size
3488
+
3489
+ # paint each individual tool
3490
+ # local opts
3491
+ _art = self._art
3492
+ DrawSeparator, DrawLabel, DrawButton, DrawDropDownButton, DrawControlLabel = (
3493
+ _art.DrawSeparator, _art.DrawLabel, _art.DrawButton,
3494
+ _art.DrawDropDownButton, _art.DrawControlLabel)
3495
+ for item in self._items:
3496
+
3497
+ if not item.sizer_item:
3498
+ continue
3499
+
3500
+ item_rect = wx.Rect(*item.sizer_item.GetRect())
3501
+
3502
+ if (horizontal and item_rect.x + item_rect.width >= last_extent) or \
3503
+ (not horizontal and item_rect.y + item_rect.height >= last_extent):
3504
+
3505
+ break
3506
+
3507
+ item_kind = item.kind
3508
+ if item_kind == ITEM_SEPARATOR:
3509
+ # draw a separator
3510
+ DrawSeparator(dc, self, item_rect)
3511
+
3512
+ elif item_kind == ITEM_LABEL:
3513
+ # draw a text label only
3514
+ DrawLabel(dc, self, item, item_rect)
3515
+
3516
+ elif item_kind == ITEM_NORMAL:
3517
+ # draw a regular button or dropdown button
3518
+ if not item.dropdown:
3519
+ DrawButton(dc, self, item, item_rect)
3520
+ else:
3521
+ DrawDropDownButton(dc, self, item, item_rect)
3522
+
3523
+ elif item_kind == ITEM_CHECK:
3524
+ # draw a regular toggle button or a dropdown one
3525
+ if not item.dropdown:
3526
+ DrawButton(dc, self, item, item_rect)
3527
+ else:
3528
+ DrawDropDownButton(dc, self, item, item_rect)
3529
+
3530
+ elif item_kind == ITEM_RADIO:
3531
+ # draw a toggle button
3532
+ DrawButton(dc, self, item, item_rect)
3533
+
3534
+ elif item_kind == ITEM_CONTROL:
3535
+ # draw the control's label
3536
+ DrawControlLabel(dc, self, item, item_rect)
3537
+
3538
+ # fire a signal to see if the item wants to be custom-rendered
3539
+ self.OnCustomRender(dc, item, item_rect)
3540
+
3541
+ # paint the overflow button
3542
+ if dropdown_size > 0 and self.GetOverflowVisible():
3543
+ dropdown_rect = self.GetOverflowRect()
3544
+ _art.DrawOverflowButton(dc, self, dropdown_rect, self._overflow_state)
3545
+
3546
+
3547
+ def OnEraseBackground(self, event):
3548
+ """
3549
+ Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`AuiToolBar`.
3550
+
3551
+ :param `event`: a :class:`EraseEvent` event to be processed.
3552
+
3553
+ :note: This is intentionally empty, to reduce flicker.
3554
+ """
3555
+
3556
+ pass
3557
+
3558
+
3559
+ def OnLeftDown(self, event):
3560
+ """
3561
+ Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`AuiToolBar`.
3562
+
3563
+ :param `event`: a :class:`MouseEvent` event to be processed.
3564
+ """
3565
+
3566
+ cli_rect = wx.Rect(wx.Point(0, 0), self.GetClientSize())
3567
+ self.StopPreviewTimer()
3568
+
3569
+ if self._gripper_sizer_item:
3570
+
3571
+ gripper_rect = wx.Rect(*self._gripper_sizer_item.GetRect())
3572
+ if gripper_rect.Contains(event.GetPosition()):
3573
+
3574
+ # find aui manager
3575
+ manager = self.GetAuiManager()
3576
+ if not manager:
3577
+ return
3578
+
3579
+ x_drag_offset = event.GetX() - gripper_rect.GetX()
3580
+ y_drag_offset = event.GetY() - gripper_rect.GetY()
3581
+
3582
+ clientPt = wx.Point(*event.GetPosition())
3583
+ screenPt = self.ClientToScreen(clientPt)
3584
+ managedWindow = manager.GetManagedWindow()
3585
+ managerClientPt = managedWindow.ScreenToClient(screenPt)
3586
+
3587
+ # gripper was clicked
3588
+ manager.OnGripperClicked(self, managerClientPt, wx.Point(x_drag_offset, y_drag_offset))
3589
+ return
3590
+
3591
+ if self.GetOverflowVisible():
3592
+ overflow_rect = self.GetOverflowRect()
3593
+
3594
+ if self._art and self._overflow_visible and overflow_rect.Contains(event.GetPosition()):
3595
+
3596
+ e = AuiToolBarEvent(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, -1)
3597
+ e.SetEventObject(self)
3598
+ e.SetToolId(-1)
3599
+ e.SetClickPoint(event.GetPosition())
3600
+ processed = self.ProcessEvent(e)
3601
+
3602
+ if processed:
3603
+ self.DoIdleUpdate()
3604
+ else:
3605
+ overflow_items = []
3606
+
3607
+ # add custom overflow prepend items, if any
3608
+ count = len(self._custom_overflow_prepend)
3609
+ for i in range(count):
3610
+ overflow_items.append(self._custom_overflow_prepend[i])
3611
+
3612
+ # only show items that don't fit in the dropdown
3613
+ count = len(self._items)
3614
+ for i in range(count):
3615
+
3616
+ if not self.GetToolFitsByIndex(i):
3617
+ overflow_items.append(self._items[i])
3618
+
3619
+ # add custom overflow append items, if any
3620
+ count = len(self._custom_overflow_append)
3621
+ for i in range(count):
3622
+ overflow_items.append(self._custom_overflow_append[i])
3623
+
3624
+ res = self._art.ShowDropDown(self, overflow_items)
3625
+ self._overflow_state = 0
3626
+ self.Refresh(False)
3627
+ if res != -1:
3628
+ e = wx.CommandEvent(wx.wxEVT_COMMAND_MENU_SELECTED, res)
3629
+ e.SetEventObject(self)
3630
+ if not self.GetParent().ProcessEvent(e):
3631
+ tool = self.FindTool(res)
3632
+ if tool:
3633
+ state = (tool.state & AUI_BUTTON_STATE_CHECKED and [True] or [False])[0]
3634
+ self.ToggleTool(res, not state)
3635
+
3636
+ return
3637
+
3638
+ self._dragging = False
3639
+ self._action_pos = wx.Point(*event.GetPosition())
3640
+ self._action_item = self.FindToolForPosition(*event.GetPosition())
3641
+
3642
+ if self._action_item:
3643
+
3644
+ if self._action_item.state & AUI_BUTTON_STATE_DISABLED:
3645
+
3646
+ self._action_pos = wx.Point(-1, -1)
3647
+ self._action_item = None
3648
+ return
3649
+
3650
+ self.SetPressedItem(self._action_item)
3651
+
3652
+ # fire the tool dropdown event
3653
+ e = AuiToolBarEvent(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, self._action_item.id)
3654
+ e.SetEventObject(self)
3655
+ e.SetToolId(self._action_item.id)
3656
+ e.SetDropDownClicked(False)
3657
+
3658
+ mouse_x, mouse_y = event.GetX(), event.GetY()
3659
+ rect = wx.Rect(*self._action_item.sizer_item.GetRect())
3660
+
3661
+ if self._action_item.dropdown:
3662
+ if (self._action_item.orientation == AUI_TBTOOL_HORIZONTAL and \
3663
+ mouse_x >= (rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1) and \
3664
+ mouse_x < (rect.x+rect.width)) or \
3665
+ (self._action_item.orientation != AUI_TBTOOL_HORIZONTAL and \
3666
+ mouse_y >= (rect.y+rect.height-BUTTON_DROPDOWN_WIDTH-1) and \
3667
+ mouse_y < (rect.y+rect.height)):
3668
+
3669
+ e.SetDropDownClicked(True)
3670
+
3671
+ e.SetClickPoint(event.GetPosition())
3672
+ e.SetItemRect(rect)
3673
+ self.ProcessEvent(e)
3674
+ self.DoIdleUpdate()
3675
+
3676
+
3677
+ def OnLeftUp(self, event):
3678
+ """
3679
+ Handles the ``wx.EVT_LEFT_UP`` event for :class:`AuiToolBar`.
3680
+
3681
+ :param `event`: a :class:`MouseEvent` event to be processed.
3682
+ """
3683
+
3684
+ self.SetPressedItem(None)
3685
+
3686
+ hit_item = self.FindToolForPosition(*event.GetPosition())
3687
+
3688
+ if hit_item and not hit_item.state & AUI_BUTTON_STATE_DISABLED:
3689
+ self.SetHoverItem(hit_item)
3690
+
3691
+ if self._dragging:
3692
+ # reset drag and drop member variables
3693
+ self._dragging = False
3694
+ self._action_pos = wx.Point(-1, -1)
3695
+ self._action_item = None
3696
+
3697
+ else:
3698
+
3699
+ if self._action_item and hit_item == self._action_item:
3700
+ self.SetToolTip("")
3701
+
3702
+ if hit_item.kind in [ITEM_CHECK, ITEM_RADIO]:
3703
+ toggle = not (self._action_item.state & AUI_BUTTON_STATE_CHECKED)
3704
+ self.ToggleTool(self._action_item.id, toggle)
3705
+
3706
+ # repaint immediately
3707
+ self.Refresh(False)
3708
+ self.Update()
3709
+
3710
+ e = wx.CommandEvent(wx.wxEVT_COMMAND_MENU_SELECTED, self._action_item.id)
3711
+ e.SetEventObject(self)
3712
+ e.SetInt(toggle)
3713
+ self._action_pos = wx.Point(-1, -1)
3714
+ self._action_item = None
3715
+
3716
+ self.ProcessEvent(e)
3717
+ self.DoIdleUpdate()
3718
+
3719
+ else:
3720
+
3721
+ if self._action_item.id == ID_RESTORE_FRAME:
3722
+ # find aui manager
3723
+ manager = self.GetAuiManager()
3724
+
3725
+ if not manager:
3726
+ return
3727
+
3728
+ if self._action_item.target:
3729
+ pane = manager.GetPane(self._action_item.target)
3730
+ else:
3731
+ pane = manager.GetPane(self)
3732
+
3733
+ from . import framemanager
3734
+ e = framemanager.AuiManagerEvent(framemanager.wxEVT_AUI_PANE_MIN_RESTORE)
3735
+
3736
+ e.SetManager(manager)
3737
+ e.SetPane(pane)
3738
+
3739
+ manager.ProcessEvent(e)
3740
+ self.DoIdleUpdate()
3741
+
3742
+ else:
3743
+
3744
+ e = wx.CommandEvent(wx.wxEVT_COMMAND_MENU_SELECTED, self._action_item.id)
3745
+ e.SetEventObject(self)
3746
+ self.ProcessEvent(e)
3747
+ self.DoIdleUpdate()
3748
+
3749
+ # reset drag and drop member variables
3750
+ self._dragging = False
3751
+ self._action_pos = wx.Point(-1, -1)
3752
+ self._action_item = None
3753
+
3754
+
3755
+ def OnRightDown(self, event):
3756
+ """
3757
+ Handles the ``wx.EVT_RIGHT_DOWN`` event for :class:`AuiToolBar`.
3758
+
3759
+ :param `event`: a :class:`MouseEvent` event to be processed.
3760
+ """
3761
+
3762
+ cli_rect = wx.Rect(wx.Point(0, 0), self.GetClientSize())
3763
+
3764
+ if self._gripper_sizer_item:
3765
+ gripper_rect = self._gripper_sizer_item.GetRect()
3766
+ if gripper_rect.Contains(event.GetPosition()):
3767
+ return
3768
+
3769
+ if self.GetOverflowVisible():
3770
+
3771
+ dropdown_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
3772
+ if dropdown_size > 0 and event.GetX() > cli_rect.width - dropdown_size and \
3773
+ event.GetY() >= 0 and event.GetY() < cli_rect.height and self._art:
3774
+ return
3775
+
3776
+ self._action_pos = wx.Point(*event.GetPosition())
3777
+ self._action_item = self.FindToolForPosition(*event.GetPosition())
3778
+
3779
+ if self._action_item:
3780
+ if self._action_item.state & AUI_BUTTON_STATE_DISABLED:
3781
+
3782
+ self._action_pos = wx.Point(-1, -1)
3783
+ self._action_item = None
3784
+ return
3785
+
3786
+
3787
+ def OnRightUp(self, event):
3788
+ """
3789
+ Handles the ``wx.EVT_RIGHT_UP`` event for :class:`AuiToolBar`.
3790
+
3791
+ :param `event`: a :class:`MouseEvent` event to be processed.
3792
+ """
3793
+
3794
+ hit_item = self.FindToolForPosition(*event.GetPosition())
3795
+
3796
+ if self._action_item and hit_item == self._action_item:
3797
+
3798
+ e = AuiToolBarEvent(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, self._action_item.id)
3799
+ e.SetEventObject(self)
3800
+ e.SetToolId(self._action_item.id)
3801
+ e.SetClickPoint(self._action_pos)
3802
+ self.ProcessEvent(e)
3803
+ self.DoIdleUpdate()
3804
+
3805
+ else:
3806
+
3807
+ # right-clicked on the invalid area of the toolbar
3808
+ e = AuiToolBarEvent(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, -1)
3809
+ e.SetEventObject(self)
3810
+ e.SetToolId(-1)
3811
+ e.SetClickPoint(self._action_pos)
3812
+ self.ProcessEvent(e)
3813
+ self.DoIdleUpdate()
3814
+
3815
+ # reset member variables
3816
+ self._action_pos = wx.Point(-1, -1)
3817
+ self._action_item = None
3818
+
3819
+
3820
+ def OnMiddleDown(self, event):
3821
+ """
3822
+ Handles the ``wx.EVT_MIDDLE_DOWN`` event for :class:`AuiToolBar`.
3823
+
3824
+ :param `event`: a :class:`MouseEvent` event to be processed.
3825
+ """
3826
+
3827
+ cli_rect = wx.Rect(wx.Point(0, 0), self.GetClientSize())
3828
+
3829
+ if self._gripper_sizer_item:
3830
+
3831
+ gripper_rect = self._gripper_sizer_item.GetRect()
3832
+ if gripper_rect.Contains(event.GetPosition()):
3833
+ return
3834
+
3835
+ if self.GetOverflowVisible():
3836
+
3837
+ dropdown_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
3838
+ if dropdown_size > 0 and event.GetX() > cli_rect.width - dropdown_size and \
3839
+ event.GetY() >= 0 and event.GetY() < cli_rect.height and self._art:
3840
+ return
3841
+
3842
+ self._action_pos = wx.Point(*event.GetPosition())
3843
+ self._action_item = self.FindToolForPosition(*event.GetPosition())
3844
+
3845
+ if self._action_item:
3846
+ if self._action_item.state & AUI_BUTTON_STATE_DISABLED:
3847
+
3848
+ self._action_pos = wx.Point(-1, -1)
3849
+ self._action_item = None
3850
+ return
3851
+
3852
+
3853
+ def OnMiddleUp(self, event):
3854
+ """
3855
+ Handles the ``wx.EVT_MIDDLE_UP`` event for :class:`AuiToolBar`.
3856
+
3857
+ :param `event`: a :class:`MouseEvent` event to be processed.
3858
+ """
3859
+
3860
+ hit_item = self.FindToolForPosition(*event.GetPosition())
3861
+
3862
+ if self._action_item and hit_item == self._action_item:
3863
+ if hit_item.kind == ITEM_NORMAL:
3864
+
3865
+ e = AuiToolBarEvent(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, self._action_item.id)
3866
+ e.SetEventObject(self)
3867
+ e.SetToolId(self._action_item.id)
3868
+ e.SetClickPoint(self._action_pos)
3869
+ self.ProcessEvent(e)
3870
+ self.DoIdleUpdate()
3871
+
3872
+ # reset member variables
3873
+ self._action_pos = wx.Point(-1, -1)
3874
+ self._action_item = None
3875
+
3876
+
3877
+ def OnMotion(self, event):
3878
+ """
3879
+ Handles the ``wx.EVT_MOTION`` event for :class:`AuiToolBar`.
3880
+
3881
+ :param `event`: a :class:`MouseEvent` event to be processed.
3882
+ """
3883
+
3884
+ # start a drag event
3885
+ if not self._dragging and self._action_item is not None and self._action_pos != wx.Point(-1, -1) and \
3886
+ abs(event.GetX() - self._action_pos.x) + abs(event.GetY() - self._action_pos.y) > 5:
3887
+
3888
+ self.SetToolTip("")
3889
+ self._dragging = True
3890
+
3891
+ e = AuiToolBarEvent(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, self.GetId())
3892
+ e.SetEventObject(self)
3893
+ e.SetToolId(self._action_item.id)
3894
+ self.ProcessEvent(e)
3895
+ self.DoIdleUpdate()
3896
+ return
3897
+
3898
+ hit_item = self.FindToolForPosition(*event.GetPosition())
3899
+
3900
+ if hit_item:
3901
+ if not hit_item.state & AUI_BUTTON_STATE_DISABLED:
3902
+ self.SetHoverItem(hit_item)
3903
+ else:
3904
+ self.SetHoverItem(None)
3905
+
3906
+ else:
3907
+ # no hit item, remove any hit item
3908
+ self.SetHoverItem(hit_item)
3909
+
3910
+ # figure out tooltips
3911
+ packing_hit_item = self.FindToolForPositionWithPacking(*event.GetPosition())
3912
+
3913
+ if packing_hit_item:
3914
+
3915
+ if packing_hit_item != self._tip_item:
3916
+ self._tip_item = packing_hit_item
3917
+
3918
+ if packing_hit_item.short_help != "":
3919
+ self.StartPreviewTimer()
3920
+ self.SetToolTip(packing_hit_item.short_help)
3921
+ else:
3922
+ self.SetToolTip("")
3923
+ self.StopPreviewTimer()
3924
+
3925
+ else:
3926
+
3927
+ self.SetToolTip("")
3928
+ self._tip_item = None
3929
+ self.StopPreviewTimer()
3930
+
3931
+ # if we've pressed down an item and we're hovering
3932
+ # over it, make sure it's state is set to pressed
3933
+ if self._action_item:
3934
+
3935
+ if self._action_item == hit_item:
3936
+ self.SetPressedItem(self._action_item)
3937
+ else:
3938
+ self.SetPressedItem(None)
3939
+
3940
+ # figure out the dropdown button state (are we hovering or pressing it?)
3941
+ self.RefreshOverflowState()
3942
+
3943
+
3944
+ def OnLeaveWindow(self, event):
3945
+ """
3946
+ Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`AuiToolBar`.
3947
+
3948
+ :param `event`: a :class:`MouseEvent` event to be processed.
3949
+ """
3950
+
3951
+ self.RefreshOverflowState()
3952
+ self.SetHoverItem(None)
3953
+ self.SetPressedItem(None)
3954
+
3955
+ self._tip_item = None
3956
+ self.StopPreviewTimer()
3957
+
3958
+
3959
+ def OnSetCursor(self, event):
3960
+ """
3961
+ Handles the ``wx.EVT_SET_CURSOR`` event for :class:`AuiToolBar`.
3962
+
3963
+ :param `event`: a :class:`SetCursorEvent` event to be processed.
3964
+ """
3965
+
3966
+ cursor = wx.NullCursor
3967
+
3968
+ if self._gripper_sizer_item:
3969
+
3970
+ gripper_rect = self._gripper_sizer_item.GetRect()
3971
+ if gripper_rect.Contains((event.GetX(), event.GetY())):
3972
+ cursor = wx.Cursor(wx.CURSOR_SIZING)
3973
+
3974
+ event.SetCursor(cursor)
3975
+
3976
+
3977
+ def OnCustomRender(self, dc, item, rect):
3978
+ """
3979
+ Handles custom render for single :class:`AuiToolBar` items.
3980
+
3981
+ :param `dc`: a :class:`wx.DC` device context;
3982
+ :param `item`: an instance of :class:`AuiToolBarItem`;
3983
+ :param wx.Rect `rect`: the toolbar item rect.
3984
+
3985
+ :note: This method must be overridden to provide custom rendering of items.
3986
+ """
3987
+
3988
+ pass
3989
+
3990
+
3991
+ def IsPaneMinimized(self):
3992
+ """ Returns whether this :class:`AuiToolBar` contains a minimized pane tool. """
3993
+
3994
+ manager = self.GetAuiManager()
3995
+ if not manager:
3996
+ return False
3997
+
3998
+ if manager.GetAGWFlags() & AUI_MGR_PREVIEW_MINIMIZED_PANES == 0:
3999
+ # No previews here
4000
+ return False
4001
+
4002
+ self_name = manager.GetPane(self).name
4003
+
4004
+ if not self_name.endswith("_min"):
4005
+ # Wrong tool name
4006
+ return False
4007
+
4008
+ return self_name[0:-4]
4009
+
4010
+
4011
+ def StartPreviewTimer(self):
4012
+ """ Starts a timer in :class:`~wx.lib.agw.aui.framemanager.AuiManager` to slide-in/slide-out the minimized pane. """
4013
+
4014
+ self_name = self.IsPaneMinimized()
4015
+ if not self_name:
4016
+ return
4017
+
4018
+ manager = self.GetAuiManager()
4019
+ manager.StartPreviewTimer(self)
4020
+
4021
+
4022
+ def StopPreviewTimer(self):
4023
+ """ Stops a timer in :class:`~wx.lib.agw.aui.framemanager.AuiManager` to slide-in/slide-out the minimized pane. """
4024
+
4025
+ self_name = self.IsPaneMinimized()
4026
+ if not self_name:
4027
+ return
4028
+
4029
+ manager = self.GetAuiManager()
4030
+ manager.StopPreviewTimer()
4031
+