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,2736 @@
1
+ # -*- coding: utf-8 -*-
2
+ #----------------------------------------------------------------------------
3
+ # Name: art_msw.py
4
+ # Purpose:
5
+ #
6
+ # Author: Andrea Gavana <andrea.gavana@gmail.com>
7
+ #
8
+ # Created:
9
+ # Version:
10
+ # Date:
11
+ # Licence: wxWindows license
12
+ # Tags: phoenix-port, unittest, documented, py3-port
13
+ # (c) 2021 Zombie
14
+ #----------------------------------------------------------------------------
15
+ """
16
+ `art_msw` is responsible for drawing all the components of the ribbon
17
+ interface using a Windows appearance.
18
+
19
+
20
+ Description
21
+ ===========
22
+
23
+ This allows a ribbon bar to have a pluggable look-and-feel, while retaining the same
24
+ underlying behaviour. As a single art provider is used for all ribbon components, a
25
+ ribbon bar usually has a consistent (though unique) appearance.
26
+
27
+ By default, a :class:`~wx.lib.agw.ribbon.bar.RibbonBar` uses an instance of a class called
28
+ :class:`~wx.lib.agw.ribbon.art_default.RibbonDefaultArtProvider`,
29
+ which resolves to :class:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider`,
30
+ :class:`~wx.lib.agw.ribbon.art_msw.RibbonMSWArtProvider`, or
31
+ :class:`~wx.lib.agw.ribbon.art_osx.RibbonOSXArtProvider` - whichever is most appropriate
32
+ to the current platform. These art providers are all
33
+ slightly configurable with regard to colours and fonts, but for larger modifications,
34
+ you can derive from one of these classes, or write a completely new art provider class.
35
+
36
+ Call :meth:`RibbonBar.SetArtProvider() <lib.agw.ribbon.bar.RibbonBar.SetArtProvider>` to change the art provider being used.
37
+
38
+
39
+ See Also
40
+ ========
41
+
42
+ :class:`~wx.lib.agw.ribbon.bar.RibbonBar`
43
+ """
44
+
45
+ import wx
46
+
47
+ from math import cos
48
+ from math import pi as M_PI
49
+
50
+ from . import panel as PANEL
51
+ from . import page as PAGE
52
+
53
+ from .art_internal import RibbonLoadPixmap, RibbonInterpolateColour, RibbonDrawParallelGradientLines
54
+ from .art_internal import RibbonCanLabelBreakAtPosition
55
+ from .art_internal import RibbonHSLColour
56
+
57
+ from .art import *
58
+
59
+
60
+ gallery_up_xpm = [b"5 5 2 1", b" c None", b"x c #FF00FF", b" ", b" x ", b" xxx ", b"xxxxx", b" "]
61
+ gallery_down_xpm = [b"5 5 2 1", b" c None", b"x c #FF00FF", b" ", b"xxxxx", b" xxx ", b" x ", b" "]
62
+ gallery_left_xpm = [b"5 5 2 1", b" c None", b"x c #FF00FF", b" x ", b" xx ", b" xxx ", b" xx ", b" x "]
63
+ gallery_right_xpm = [b"5 5 2 1", b" c None", b"x c #FF00FF", b" x ", b" xx ", b" xxx ", b" xx ", b" x "]
64
+ gallery_extension_xpm = [b"5 5 2 1", b" c None", b"x c #FF00FF", b"xxxxx", b" ", b"xxxxx", b" xxx ", b" x "]
65
+ panel_extension_xpm = [b"7 7 2 1", b" c None", b"x c #FF00FF", b"xxxxxx ", b"x ", b"x ",
66
+ b"x x x", b"x xxx", b"x xxx", b" xxxx"]
67
+
68
+
69
+ def LikePrimary(primary_hsl, is_gray, h, s, l):
70
+
71
+ return primary_hsl.ShiftHue(h).Saturated((is_gray and [0] or [s])[0]).Lighter(l).ToRGB()
72
+
73
+
74
+ def LikeSecondary(secondary_hsl, is_gray, h, s, l):
75
+
76
+ return secondary_hsl.ShiftHue(h).Saturated((is_gray and [0] or [s])[0]).Lighter(l).ToRGB()
77
+
78
+
79
+ def SingleLine(dc, rect, start, finish):
80
+
81
+ dc.DrawLine(start.x + rect.x, start.y + rect.y, finish.x + rect.x, finish.y + rect.y)
82
+
83
+
84
+ class RibbonMSWArtProvider(object):
85
+
86
+ def __init__(self, set_colour_scheme=True):
87
+
88
+ self._flags = 0
89
+ self._tab_label_font = wx.NORMAL_FONT
90
+ self._button_bar_label_font = wx.NORMAL_FONT
91
+ self._panel_label_font = wx.NORMAL_FONT
92
+
93
+ self._gallery_up_bitmap = [wx.NullBitmap for i in range(4)]
94
+ self._gallery_down_bitmap = [wx.NullBitmap for i in range(4)]
95
+ self._gallery_extension_bitmap = [wx.NullBitmap for i in range(4)]
96
+ self._panel_extension_bitmap = [wx.NullBitmap for i in range(2)]
97
+
98
+ if set_colour_scheme:
99
+ self.SetColourScheme(wx.Colour(194, 216, 241), wx.Colour(255, 223, 114), wx.BLACK)
100
+
101
+ self._cached_tab_separator_visibility = -10.0 # valid visibilities are in range [0, 1]
102
+ self._tab_separation_size = 3
103
+ self._page_border_left = 2
104
+ self._page_border_top = 1
105
+ self._page_border_right = 2
106
+ self._page_border_bottom = 3
107
+ self._panel_x_separation_size = 1
108
+ self._panel_y_separation_size = 1
109
+ self._tool_group_separation_size = 3
110
+ self._gallery_bitmap_padding_left_size = 4
111
+ self._gallery_bitmap_padding_right_size = 4
112
+ self._gallery_bitmap_padding_top_size = 4
113
+ self._gallery_bitmap_padding_bottom__size = 4
114
+ self._cached_tab_separator = wx.NullBitmap
115
+
116
+
117
+ def GetColourScheme(self, primary, secondary, tertiary):
118
+ """
119
+ Get the current colour scheme.
120
+
121
+ Returns three colours such that if :meth:`~RibbonMSWArtProvider.SetColourScheme` were called with them, the
122
+ colour scheme would be restored to what it was when :meth:`~RibbonMSWArtProvider.SetColourScheme` was last
123
+ called. In practice, this usually means that the returned values are the three
124
+ colours given in the last call to :meth:`~RibbonMSWArtProvider.SetColourScheme`, however if
125
+ :meth:`~RibbonMSWArtProvider.SetColourScheme` performs an idempotent operation upon the colours it is given
126
+ (like clamping a component of the colour), then the returned values may not be
127
+ the three colours given in the last call to :meth:`~RibbonMSWArtProvider.SetColourScheme`.
128
+
129
+ If :meth:`~RibbonMSWArtProvider.SetColourScheme` has not been called, then the returned values should result
130
+ in a colour scheme similar to, if not identical to, the default colours of the
131
+ art provider. Note that if :meth:`~RibbonMSWArtProvider.SetColour` is called, then :meth:`~RibbonMSWArtProvider.GetColourScheme` does
132
+ not try and return a colour scheme similar to colours being used - it's return
133
+ values are dependant upon the last values given to :meth:`~RibbonMSWArtProvider.SetColourScheme`, as
134
+ described above.
135
+
136
+ :param `primary`: Pointer to a location to store the primary colour, or ``None``;
137
+ :param `secondary`: Pointer to a location to store the secondary colour, or ``None``;
138
+ :param `tertiary`: Pointer to a location to store the tertiary colour, or ``None``.
139
+
140
+ """
141
+
142
+ if primary is not None:
143
+ primary = self._primary_scheme_colour
144
+ if secondary is not None:
145
+ secondary = self._secondary_scheme_colour
146
+ if tertiary is not None:
147
+ tertiary = self._tertiary_scheme_colour
148
+
149
+ return primary, secondary, tertiary
150
+
151
+
152
+ def SetColourScheme(self, primary, secondary, tertiary):
153
+ """
154
+ Set all applicable colour settings from a few base colours.
155
+
156
+ Uses any or all of the three given colours to create a colour scheme, and then
157
+ sets all colour settings which are relevant to the art provider using that
158
+ scheme. Note that some art providers may not use the tertiary colour for
159
+ anything, and some may not use the secondary colour either.
160
+
161
+ :param `primary`: MISSING DESCRIPTION;
162
+ :param `secondary`: MISSING DESCRIPTION;
163
+ :param `tertiary`: MISSING DESCRIPTION.
164
+
165
+ :see: :meth:`~RibbonMSWArtProvider.SetColour`, :meth:`~RibbonMSWArtProvider.GetColourScheme`
166
+ """
167
+
168
+ self._primary_scheme_colour = primary
169
+ self._secondary_scheme_colour = secondary
170
+ self._tertiary_scheme_colour = tertiary
171
+
172
+ primary_hsl = RibbonHSLColour(primary)
173
+ secondary_hsl = RibbonHSLColour(secondary)
174
+ # tertiary not used for anything
175
+
176
+ # Map primary saturation from [0, 1] to [.25, .75]
177
+ primary_is_gray = False
178
+ gray_saturation_threshold = 0.01
179
+
180
+ if primary_hsl.saturation <= gray_saturation_threshold:
181
+ primary_is_gray = True
182
+ else:
183
+ primary_hsl.saturation = cos(primary_hsl.saturation * M_PI) * -0.25 + 0.5
184
+
185
+ # Map primary luminance from [0, 1] to [.23, .83]
186
+ primary_hsl.luminance = cos(primary_hsl.luminance * M_PI) * -0.3 + 0.53
187
+
188
+ # Map secondary saturation from [0, 1] to [0.16, 0.84]
189
+ secondary_is_gray = False
190
+
191
+ if secondary_hsl.saturation <= gray_saturation_threshold:
192
+ secondary_is_gray = True
193
+ else:
194
+ secondary_hsl.saturation = cos(secondary_hsl.saturation * M_PI) * -0.34 + 0.5
195
+
196
+ # Map secondary luminance from [0, 1] to [0.1, 0.9]
197
+ secondary_hsl.luminance = cos(secondary_hsl.luminance * M_PI) * -0.4 + 0.5
198
+
199
+ self._page_border_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, 1.4, 0.00, -0.08))
200
+ self._page_background_top_colour = LikePrimary(primary_hsl, primary_is_gray, -0.1, -0.03, 0.12)
201
+ self._page_hover_background_top_colour = LikePrimary(primary_hsl, primary_is_gray, -2.8, 0.27, 0.17)
202
+ self._page_background_top_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 0.1, -0.10, 0.08)
203
+ self._page_hover_background_top_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 3.2, 0.16, 0.13)
204
+ self._page_background_colour = LikePrimary(primary_hsl, primary_is_gray, 0.4, -0.09, 0.05)
205
+ self._page_hover_background_colour = LikePrimary(primary_hsl, primary_is_gray, 0.1, 0.19, 0.10)
206
+ self._page_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, -3.2, 0.27, 0.10)
207
+ self._page_hover_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.8, 0.01, 0.15)
208
+
209
+ self._tab_active_background_colour = LikePrimary(primary_hsl, primary_is_gray, -0.1, -0.31, 0.16)
210
+ self._tab_active_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, -0.1, -0.03, 0.12)
211
+ self._tab_separator_colour = LikePrimary(primary_hsl, primary_is_gray, 0.9, 0.24, 0.05)
212
+ self._tab_ctrl_background_brush = wx.Brush(LikePrimary(primary_hsl, primary_is_gray, 1.0, 0.39, 0.07))
213
+ self._tab_hover_background_colour = LikePrimary(primary_hsl, primary_is_gray, 1.3, 0.15, 0.10)
214
+ self._tab_hover_background_top_colour = LikePrimary(primary_hsl, primary_is_gray, 1.4, 0.36, 0.08)
215
+ self._tab_border_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, 1.4, 0.03, -0.05) )
216
+ self._tab_separator_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.7, -0.15, -0.18)
217
+ self._tab_hover_background_top_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.8, 0.34, 0.13)
218
+ self._tab_label_colour = LikePrimary(primary_hsl, primary_is_gray, 4.3, 0.13, -0.49)
219
+ self._tab_hover_background_gradient_colour = LikeSecondary(primary_hsl, secondary_is_gray, -1.5, -0.34, 0.01)
220
+
221
+ self._panel_minimised_border_gradient_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, -6.9, -0.17, -0.09))
222
+ self._panel_minimised_border_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, -5.3, -0.24, -0.06))
223
+ self._panel_border_gradient_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, -5.2, -0.15, -0.06))
224
+ self._panel_border_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, -2.8, -0.32, 0.02))
225
+ self._panel_label_background_brush = wx.Brush(LikePrimary(primary_hsl, primary_is_gray, -1.5, 0.03, 0.05))
226
+ self._panel_active_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 0.5, 0.34, 0.05)
227
+ self._panel_hover_label_background_brush = wx.Brush(LikePrimary(primary_hsl, primary_is_gray, 1.0, 0.30, 0.09))
228
+ self._panel_active_background_top_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.4, -0.17, -0.13)
229
+ self._panel_active_background_colour = LikePrimary(primary_hsl, primary_is_gray, 1.6, -0.18, -0.18)
230
+ self._panel_active_background_top_colour = LikePrimary(primary_hsl, primary_is_gray, 1.7, -0.20, -0.03)
231
+ self._panel_label_colour = LikePrimary(primary_hsl, primary_is_gray, 2.8, -0.14, -0.35)
232
+ self._panel_hover_label_colour = self._panel_label_colour
233
+ self._panel_minimised_label_colour = self._tab_label_colour
234
+
235
+ self._panel_hover_button_background_brush = wx.Brush(LikeSecondary(secondary_hsl, secondary_is_gray, -0.9, 0.16, -0.07))
236
+ self._panel_hover_button_border_pen = wx.Pen(LikeSecondary(secondary_hsl, secondary_is_gray, -3.9, -0.16, -0.14))
237
+ self.SetColour(RIBBON_ART_PANEL_BUTTON_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 1.4, -0.21, -0.23))
238
+ self.SetColour(RIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 1.5, -0.24, -0.29))
239
+
240
+ self._gallery_button_disabled_background_colour = LikePrimary(primary_hsl, primary_is_gray, -2.8, -0.46, 0.09)
241
+ self._gallery_button_disabled_background_top_brush = wx.Brush(LikePrimary(primary_hsl, primary_is_gray, -2.8, -0.36, 0.15))
242
+ self._gallery_hover_background_brush = wx.Brush(LikePrimary(primary_hsl, primary_is_gray, -0.8, 0.05, 0.15))
243
+ self._gallery_border_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, 0.7, -0.02, 0.03))
244
+ self._gallery_button_background_top_brush = wx.Brush(LikePrimary(primary_hsl, primary_is_gray, 0.8, 0.34, 0.13))
245
+ self._gallery_button_background_colour = LikePrimary(primary_hsl, primary_is_gray, 1.3, 0.10, 0.08)
246
+
247
+ # SetColour used so that the relevant bitmaps are generated
248
+ self.SetColour(RIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 1.4, -0.21, -0.23))
249
+ self.SetColour(RIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 1.5, -0.24, -0.29))
250
+ self.SetColour(RIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 1.5, -0.24, -0.29))
251
+ self.SetColour(RIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 0.0, -1.0, 0.0))
252
+ self._gallery_button_disabled_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.5, -0.43, 0.12)
253
+ self._gallery_button_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.7, 0.11, 0.09)
254
+ self._gallery_item_border_pen = wx.Pen(LikeSecondary(secondary_hsl, secondary_is_gray, -3.9, -0.16, -0.14))
255
+ self._gallery_button_hover_background_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -0.9, 0.16, -0.07)
256
+ self._gallery_button_hover_background_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, 0.1, 0.12, 0.03)
257
+ self._gallery_button_hover_background_top_brush = wx.Brush(LikeSecondary(secondary_hsl, secondary_is_gray, 4.3, 0.16, 0.17))
258
+
259
+ self._gallery_button_active_background_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -9.9, 0.03, -0.22)
260
+ self._gallery_button_active_background_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -9.5, 0.14, -0.11)
261
+ self._gallery_button_active_background_top_brush = wx.Brush(LikeSecondary(secondary_hsl, secondary_is_gray, -9.0, 0.15, -0.08))
262
+
263
+ self._button_bar_label_colour = self._tab_label_colour
264
+ self._button_bar_hover_border_pen = wx.Pen(LikeSecondary(secondary_hsl, secondary_is_gray, -6.2, -0.47, -0.14))
265
+ self._button_bar_hover_background_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -0.6, 0.16, 0.04)
266
+ self._button_bar_hover_background_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -0.2, 0.16, -0.10)
267
+ self._button_bar_hover_background_top_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, 0.2, 0.16, 0.03)
268
+ self._button_bar_hover_background_top_colour = LikeSecondary(secondary_hsl, secondary_is_gray, 8.8, 0.16, 0.17)
269
+ self._button_bar_active_border_pen = wx.Pen(LikeSecondary(secondary_hsl, secondary_is_gray, -6.2, -0.47, -0.25))
270
+ self._button_bar_active_background_top_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -8.4, 0.08, 0.06)
271
+ self._button_bar_active_background_top_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -9.7, 0.13, -0.07)
272
+ self._button_bar_active_background_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -9.9, 0.14, -0.14)
273
+ self._button_bar_active_background_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -8.7, 0.17, -0.03)
274
+
275
+ self._toolbar_border_pen = wx.Pen(LikePrimary(primary_hsl, primary_is_gray, 1.4, -0.21, -0.16))
276
+ self.SetColour(RIBBON_ART_TOOLBAR_FACE_COLOUR, LikePrimary(primary_hsl, primary_is_gray, 1.4, -0.17, -0.22))
277
+ self._tool_background_top_colour = LikePrimary(primary_hsl, primary_is_gray, -1.9, -0.07, 0.06)
278
+ self._tool_background_top_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.4, 0.12, 0.08)
279
+ self._tool_background_colour = LikePrimary(primary_hsl, primary_is_gray, 1.4, -0.09, 0.03)
280
+ self._tool_background_gradient_colour = LikePrimary(primary_hsl, primary_is_gray, 1.9, 0.11, 0.09)
281
+ self._tool_hover_background_top_colour = LikeSecondary(secondary_hsl, secondary_is_gray, 3.4, 0.11, 0.16)
282
+ self._tool_hover_background_top_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -1.4, 0.04, 0.08)
283
+ self._tool_hover_background_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -1.8, 0.16, -0.12)
284
+ self._tool_hover_background_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -2.6, 0.16, 0.05)
285
+ self._tool_active_background_top_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -9.9, -0.12, -0.09)
286
+ self._tool_active_background_top_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -8.5, 0.16, -0.12)
287
+ self._tool_active_background_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -7.9, 0.16, -0.20)
288
+ self._tool_active_background_gradient_colour = LikeSecondary(secondary_hsl, secondary_is_gray, -6.6, 0.16, -0.10)
289
+
290
+ # Invalidate cached tab separator
291
+ self._cached_tab_separator_visibility = -1.0
292
+
293
+
294
+ def Clone(self):
295
+ """
296
+ Create a new art provider which is a clone of this one.
297
+ """
298
+
299
+ copy = RibbonMSWArtProvider()
300
+ self.CloneTo(copy)
301
+ return copy
302
+
303
+
304
+ def CloneTo(self, copy):
305
+
306
+ for i in range(4):
307
+ copy._gallery_up_bitmap[i] = self._gallery_up_bitmap[i]
308
+ copy._gallery_down_bitmap[i] = self._gallery_down_bitmap[i]
309
+ copy._gallery_extension_bitmap[i] = self._gallery_extension_bitmap[i]
310
+
311
+ for i in range(2):
312
+ copy._panel_extension_bitmap[i] = self._panel_extension_bitmap[i]
313
+
314
+ copy._toolbar_drop_bitmap = self._toolbar_drop_bitmap
315
+
316
+ copy._primary_scheme_colour = self._primary_scheme_colour
317
+ copy._secondary_scheme_colour = self._secondary_scheme_colour
318
+ copy._tertiary_scheme_colour = self._tertiary_scheme_colour
319
+
320
+ copy._button_bar_label_colour = self._button_bar_label_colour
321
+ copy._tab_label_colour = self._tab_label_colour
322
+ copy._tab_separator_colour = self._tab_separator_colour
323
+ copy._tab_separator_gradient_colour = self._tab_separator_gradient_colour
324
+ copy._tab_active_background_colour = self._tab_hover_background_colour
325
+ copy._tab_active_background_gradient_colour = self._tab_hover_background_gradient_colour
326
+ copy._tab_hover_background_colour = self._tab_hover_background_colour
327
+ copy._tab_hover_background_gradient_colour = self._tab_hover_background_gradient_colour
328
+ copy._tab_hover_background_top_colour = self._tab_hover_background_top_colour
329
+ copy._tab_hover_background_top_gradient_colour = self._tab_hover_background_top_gradient_colour
330
+ copy._panel_label_colour = self._panel_label_colour
331
+ copy._panel_hover_label_colour = self._panel_hover_label_colour
332
+ copy._panel_minimised_label_colour = self._panel_minimised_label_colour
333
+ copy._panel_button_face_colour = self._panel_button_face_colour
334
+ copy._panel_button_hover_face_colour = self._panel_button_hover_face_colour
335
+ copy._panel_active_background_colour = self._panel_active_background_colour
336
+ copy._panel_active_background_gradient_colour = self._panel_active_background_gradient_colour
337
+ copy._panel_active_background_top_colour = self._panel_active_background_top_colour
338
+ copy._panel_active_background_top_gradient_colour = self._panel_active_background_top_gradient_colour
339
+ copy._page_background_colour = self._page_background_colour
340
+ copy._page_background_gradient_colour = self._page_background_gradient_colour
341
+ copy._page_background_top_colour = self._page_background_top_colour
342
+ copy._page_background_top_gradient_colour = self._page_background_top_gradient_colour
343
+ copy._page_hover_background_colour = self._page_hover_background_colour
344
+ copy._page_hover_background_gradient_colour = self._page_hover_background_gradient_colour
345
+ copy._page_hover_background_top_colour = self._page_hover_background_top_colour
346
+ copy._page_hover_background_top_gradient_colour = self._page_hover_background_top_gradient_colour
347
+ copy._button_bar_hover_background_colour = self._button_bar_hover_background_colour
348
+ copy._button_bar_hover_background_gradient_colour = self._button_bar_hover_background_gradient_colour
349
+ copy._button_bar_hover_background_top_colour = self._button_bar_hover_background_top_colour
350
+ copy._button_bar_hover_background_top_gradient_colour = self._button_bar_hover_background_top_gradient_colour
351
+ copy._button_bar_active_background_colour = self._button_bar_active_background_colour
352
+ copy._button_bar_active_background_gradient_colour = self._button_bar_active_background_gradient_colour
353
+ copy._button_bar_active_background_top_colour = self._button_bar_active_background_top_colour
354
+ copy._button_bar_active_background_top_gradient_colour = self._button_bar_active_background_top_gradient_colour
355
+ copy._gallery_button_background_colour = self._gallery_button_background_colour
356
+ copy._gallery_button_background_gradient_colour = self._gallery_button_background_gradient_colour
357
+ copy._gallery_button_hover_background_colour = self._gallery_button_hover_background_colour
358
+ copy._gallery_button_hover_background_gradient_colour = self._gallery_button_hover_background_gradient_colour
359
+ copy._gallery_button_active_background_colour = self._gallery_button_active_background_colour
360
+ copy._gallery_button_active_background_gradient_colour = self._gallery_button_active_background_gradient_colour
361
+ copy._gallery_button_disabled_background_colour = self._gallery_button_disabled_background_colour
362
+ copy._gallery_button_disabled_background_gradient_colour = self._gallery_button_disabled_background_gradient_colour
363
+ copy._gallery_button_face_colour = self._gallery_button_face_colour
364
+ copy._gallery_button_hover_face_colour = self._gallery_button_hover_face_colour
365
+ copy._gallery_button_active_face_colour = self._gallery_button_active_face_colour
366
+ copy._gallery_button_disabled_face_colour = self._gallery_button_disabled_face_colour
367
+
368
+ copy._tab_ctrl_background_brush = self._tab_ctrl_background_brush
369
+ copy._panel_label_background_brush = self._panel_label_background_brush
370
+ copy._panel_hover_label_background_brush = self._panel_hover_label_background_brush
371
+ copy._panel_hover_button_background_brush = self._panel_hover_button_background_brush
372
+ copy._gallery_hover_background_brush = self._gallery_hover_background_brush
373
+ copy._gallery_button_background_top_brush = self._gallery_button_background_top_brush
374
+ copy._gallery_button_hover_background_top_brush = self._gallery_button_hover_background_top_brush
375
+ copy._gallery_button_active_background_top_brush = self._gallery_button_active_background_top_brush
376
+ copy._gallery_button_disabled_background_top_brush = self._gallery_button_disabled_background_top_brush
377
+
378
+ copy._tab_label_font = self._tab_label_font
379
+ copy._button_bar_label_font = self._button_bar_label_font
380
+ copy._panel_label_font = self._panel_label_font
381
+
382
+ copy._page_border_pen = self._page_border_pen
383
+ copy._panel_border_pen = self._panel_border_pen
384
+ copy._panel_border_gradient_pen = self._panel_border_gradient_pen
385
+ copy._panel_hover_button_border_pen = self._panel_hover_button_border_pen
386
+ copy._panel_minimised_border_pen = self._panel_minimised_border_pen
387
+ copy._panel_minimised_border_gradient_pen = self._panel_minimised_border_gradient_pen
388
+ copy._tab_border_pen = self._tab_border_pen
389
+ copy._gallery_border_pen = self._gallery_border_pen
390
+ copy._button_bar_hover_border_pen = self._button_bar_hover_border_pen
391
+ copy._button_bar_active_border_pen = self._button_bar_active_border_pen
392
+ copy._gallery_item_border_pen = self._gallery_item_border_pen
393
+ copy._toolbar_border_pen = self._toolbar_border_pen
394
+
395
+ copy._flags = self._flags
396
+ copy._tab_separation_size = self._tab_separation_size
397
+ copy._page_border_left = self._page_border_left
398
+ copy._page_border_top = self._page_border_top
399
+ copy._page_border_right = self._page_border_right
400
+ copy._page_border_bottom = self._page_border_bottom
401
+ copy._panel_x_separation_size = self._panel_x_separation_size
402
+ copy._panel_y_separation_size = self._panel_y_separation_size
403
+ copy._gallery_bitmap_padding_left_size = self._gallery_bitmap_padding_left_size
404
+ copy._gallery_bitmap_padding_right_size = self._gallery_bitmap_padding_right_size
405
+ copy._gallery_bitmap_padding_top_size = self._gallery_bitmap_padding_top_size
406
+ copy._gallery_bitmap_padding_bottom__size = self._gallery_bitmap_padding_bottom__size
407
+
408
+
409
+ def GetFlags(self):
410
+ """
411
+ Get the previously set style flags.
412
+ """
413
+
414
+ return self._flags
415
+
416
+
417
+ def SetFlags(self, flags):
418
+ """
419
+ Set the style flags.
420
+
421
+ Normally called automatically by :meth:`RibbonBar.SetArtProvider() <lib.agw.ribbon.bar.RibbonBar.SetArtProvider>` with the ribbon
422
+ bar's style flags, so that the art provider has the same flags as the bar which
423
+ it is serving.
424
+
425
+ :param `flags`: MISSING DESCRIPTION.
426
+
427
+ """
428
+
429
+ if (flags ^ self._flags) & RIBBON_BAR_FLOW_VERTICAL:
430
+ if flags & RIBBON_BAR_FLOW_VERTICAL:
431
+ self._page_border_left += 1
432
+ self._page_border_right += 1
433
+ self._page_border_top -= 1
434
+ self._page_border_bottom -= 1
435
+ else:
436
+ self._page_border_left -= 1
437
+ self._page_border_right -= 1
438
+ self._page_border_top += 1
439
+ self._page_border_bottom += 1
440
+
441
+ self._flags = flags
442
+
443
+ # Need to reload some bitmaps when flags change
444
+ self.Reload(RIBBON_ART_GALLERY_BUTTON_FACE_COLOUR)
445
+ self.Reload(RIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR)
446
+ self.Reload(RIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR)
447
+ self.Reload(RIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR)
448
+ self.Reload(RIBBON_ART_PANEL_BUTTON_FACE_COLOUR)
449
+ self.Reload(RIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR)
450
+
451
+
452
+ def Reload(self, setting):
453
+
454
+ self.SetColour(setting, self.GetColour(setting))
455
+
456
+
457
+ def GetMetric(self, id):
458
+ """
459
+ Get the value of a certain integer setting.
460
+
461
+ can be one of the size values of `RibbonArtSetting`.
462
+
463
+ :param `id`: a metric id.
464
+
465
+ """
466
+
467
+ if id == RIBBON_ART_TAB_SEPARATION_SIZE:
468
+ return self._tab_separation_size
469
+ elif id == RIBBON_ART_PAGE_BORDER_LEFT_SIZE:
470
+ return self._page_border_left
471
+ elif id == RIBBON_ART_PAGE_BORDER_TOP_SIZE:
472
+ return self._page_border_top
473
+ elif id == RIBBON_ART_PAGE_BORDER_RIGHT_SIZE:
474
+ return self._page_border_right
475
+ elif id == RIBBON_ART_PAGE_BORDER_BOTTOM_SIZE:
476
+ return self._page_border_bottom
477
+ elif id == RIBBON_ART_PANEL_X_SEPARATION_SIZE:
478
+ return self._panel_x_separation_size
479
+ elif id == RIBBON_ART_PANEL_Y_SEPARATION_SIZE:
480
+ return self._panel_y_separation_size
481
+ elif id == RIBBON_ART_TOOL_GROUP_SEPARATION_SIZE:
482
+ return self._tool_group_separation_size
483
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE:
484
+ return self._gallery_bitmap_padding_left_size
485
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE:
486
+ return self._gallery_bitmap_padding_right_size
487
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE:
488
+ return self._gallery_bitmap_padding_top_size
489
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE:
490
+ return self._gallery_bitmap_padding_bottom__size
491
+ else:
492
+ raise Exception("Invalid Metric Ordinal")
493
+
494
+
495
+ def SetMetric(self, id, new_val):
496
+ """
497
+ Set the value of a certain integer setting to the value.
498
+
499
+ can be one of the size values of `RibbonArtSetting`.
500
+
501
+ :param `id`: a metric id;
502
+ :param `new_val`: the new value of the metric setting.
503
+
504
+ """
505
+
506
+ if id == RIBBON_ART_TAB_SEPARATION_SIZE:
507
+ self._tab_separation_size = new_val
508
+ elif id == RIBBON_ART_PAGE_BORDER_LEFT_SIZE:
509
+ self._page_border_left = new_val
510
+ elif id == RIBBON_ART_PAGE_BORDER_TOP_SIZE:
511
+ self._page_border_top = new_val
512
+ elif id == RIBBON_ART_PAGE_BORDER_RIGHT_SIZE:
513
+ self._page_border_right = new_val
514
+ elif id == RIBBON_ART_PAGE_BORDER_BOTTOM_SIZE:
515
+ self._page_border_bottom = new_val
516
+ elif id == RIBBON_ART_PANEL_X_SEPARATION_SIZE:
517
+ self._panel_x_separation_size = new_val
518
+ elif id == RIBBON_ART_PANEL_Y_SEPARATION_SIZE:
519
+ self._panel_y_separation_size = new_val
520
+ elif id == RIBBON_ART_TOOL_GROUP_SEPARATION_SIZE:
521
+ self._tool_group_separation_size = new_val
522
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE:
523
+ self._gallery_bitmap_padding_left_size = new_val
524
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE:
525
+ self._gallery_bitmap_padding_right_size = new_val
526
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE:
527
+ self._gallery_bitmap_padding_top_size = new_val
528
+ elif id == RIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE:
529
+ self._gallery_bitmap_padding_bottom__size = new_val
530
+ else:
531
+ raise Exception("Invalid Metric Ordinal")
532
+
533
+
534
+ def SetFont(self, id, font):
535
+ """
536
+ Set the value of a certain font setting to the value.
537
+
538
+ can be one of the font values of `RibbonArtSetting`.
539
+
540
+ :param `id`: a font id;
541
+ :param `font`: the new font.
542
+
543
+ """
544
+
545
+ if id == RIBBON_ART_TAB_LABEL_FONT:
546
+ self._tab_label_font = font
547
+ elif id == RIBBON_ART_BUTTON_BAR_LABEL_FONT:
548
+ self._button_bar_label_font = font
549
+ elif id == RIBBON_ART_PANEL_LABEL_FONT:
550
+ self._panel_label_font = font
551
+ else:
552
+ raise Exception("Invalid Font Ordinal")
553
+
554
+
555
+ def GetFont(self, id):
556
+ """
557
+ Get the value of a certain font setting.
558
+
559
+ can be one of the font values of `RibbonArtSetting`.
560
+
561
+ :param `id`: the font id.
562
+
563
+ """
564
+
565
+ if id == RIBBON_ART_TAB_LABEL_FONT:
566
+ return self._tab_label_font
567
+ elif id == RIBBON_ART_BUTTON_BAR_LABEL_FONT:
568
+ return self._button_bar_label_font
569
+ elif id == RIBBON_ART_PANEL_LABEL_FONT:
570
+ return self._panel_label_font
571
+ else:
572
+ raise Exception("Invalid Font Ordinal")
573
+
574
+
575
+ def GetColour(self, id):
576
+ """
577
+ Get the value of a certain colour setting.
578
+
579
+ can be one of the colour values of `RibbonArtSetting`.
580
+
581
+ :param `id`: the colour id.
582
+
583
+ """
584
+
585
+ if id == RIBBON_ART_BUTTON_BAR_LABEL_COLOUR:
586
+ return self._button_bar_label_colour
587
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BORDER_COLOUR:
588
+ return self._button_bar_hover_border_pen.GetColour()
589
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_COLOUR:
590
+ return self._button_bar_hover_background_top_colour
591
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR:
592
+ return self._button_bar_hover_background_top_gradient_colour
593
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_COLOUR:
594
+ return self._button_bar_hover_background_colour
595
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_GRADIENT_COLOUR:
596
+ return self._button_bar_hover_background_gradient_colour
597
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BORDER_COLOUR:
598
+ return self._button_bar_active_border_pen.GetColour()
599
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_COLOUR:
600
+ return self._button_bar_active_background_top_colour
601
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR:
602
+ return self._button_bar_active_background_top_gradient_colour
603
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_COLOUR:
604
+ return self._button_bar_active_background_colour
605
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
606
+ return self._button_bar_active_background_gradient_colour
607
+ elif id == RIBBON_ART_GALLERY_BORDER_COLOUR:
608
+ return self._gallery_border_pen.GetColour()
609
+ elif id == RIBBON_ART_GALLERY_HOVER_BACKGROUND_COLOUR:
610
+ return self._gallery_hover_background_brush.GetColour()
611
+ elif id == RIBBON_ART_GALLERY_BUTTON_BACKGROUND_COLOUR:
612
+ return self._gallery_button_background_colour
613
+ elif id == RIBBON_ART_GALLERY_BUTTON_BACKGROUND_GRADIENT_COLOUR:
614
+ return self._gallery_button_background_gradient_colour
615
+ elif id == RIBBON_ART_GALLERY_BUTTON_BACKGROUND_TOP_COLOUR:
616
+ return self._gallery_button_background_top_brush.GetColour()
617
+ elif id == RIBBON_ART_GALLERY_BUTTON_FACE_COLOUR:
618
+ return self._gallery_button_face_colour
619
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_COLOUR:
620
+ return self._gallery_button_hover_background_colour
621
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_GRADIENT_COLOUR:
622
+ return self._gallery_button_hover_background_gradient_colour
623
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_TOP_COLOUR:
624
+ return self._gallery_button_hover_background_top_brush.GetColour()
625
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR:
626
+ return self._gallery_button_face_colour
627
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_COLOUR:
628
+ return self._gallery_button_active_background_colour
629
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
630
+ return self._gallery_button_active_background_gradient_colour
631
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_TOP_COLOUR:
632
+ return self._gallery_button_background_top_brush.GetColour()
633
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR:
634
+ return self._gallery_button_active_face_colour
635
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_COLOUR:
636
+ return self._gallery_button_disabled_background_colour
637
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_GRADIENT_COLOUR:
638
+ return self._gallery_button_disabled_background_gradient_colour
639
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_TOP_COLOUR:
640
+ return self._gallery_button_disabled_background_top_brush.GetColour()
641
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR:
642
+ return self._gallery_button_disabled_face_colour
643
+ elif id == RIBBON_ART_GALLERY_ITEM_BORDER_COLOUR:
644
+ return self._gallery_item_border_pen.GetColour()
645
+ elif id in [RIBBON_ART_TAB_CTRL_BACKGROUND_COLOUR, RIBBON_ART_TAB_CTRL_BACKGROUND_GRADIENT_COLOUR]:
646
+ return self._tab_ctrl_background_brush.GetColour()
647
+ elif id == RIBBON_ART_TAB_LABEL_COLOUR:
648
+ return self._tab_label_colour
649
+ elif id == RIBBON_ART_TAB_SEPARATOR_COLOUR:
650
+ return self._tab_separator_colour
651
+ elif id == RIBBON_ART_TAB_SEPARATOR_GRADIENT_COLOUR:
652
+ return self._tab_separator_gradient_colour
653
+ elif id in [RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_COLOUR, RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR]:
654
+ return wx.BLACK
655
+ elif id == RIBBON_ART_TAB_ACTIVE_BACKGROUND_COLOUR:
656
+ return self._tab_active_background_colour
657
+ elif id == RIBBON_ART_TAB_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
658
+ return self._tab_active_background_gradient_colour
659
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_COLOUR:
660
+ return self._tab_hover_background_top_colour
661
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR:
662
+ return self._tab_hover_background_top_gradient_colour
663
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_COLOUR:
664
+ return self._tab_hover_background_colour
665
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_GRADIENT_COLOUR:
666
+ return self._tab_hover_background_gradient_colour
667
+ elif id == RIBBON_ART_TAB_BORDER_COLOUR:
668
+ return self._tab_border_pen.GetColour()
669
+ elif id == RIBBON_ART_PANEL_BORDER_COLOUR:
670
+ return self._panel_border_pen.GetColour()
671
+ elif id == RIBBON_ART_PANEL_BORDER_GRADIENT_COLOUR:
672
+ return self._panel_border_gradient_pen.GetColour()
673
+ elif id == RIBBON_ART_PANEL_MINIMISED_BORDER_COLOUR:
674
+ return self._panel_minimised_border_pen.GetColour()
675
+ elif id == RIBBON_ART_PANEL_MINIMISED_BORDER_GRADIENT_COLOUR:
676
+ return self._panel_minimised_border_gradient_pen.GetColour()
677
+ elif id in [RIBBON_ART_PANEL_LABEL_BACKGROUND_COLOUR, RIBBON_ART_PANEL_LABEL_BACKGROUND_GRADIENT_COLOUR]:
678
+ return self._panel_label_background_brush.GetColour()
679
+ elif id == RIBBON_ART_PANEL_LABEL_COLOUR:
680
+ return self._panel_label_colour
681
+ elif id == RIBBON_ART_PANEL_MINIMISED_LABEL_COLOUR:
682
+ return self._panel_minimised_label_colour
683
+ elif id in [RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR, RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR]:
684
+ return self._panel_hover_label_background_brush.GetColour()
685
+ elif id == RIBBON_ART_PANEL_HOVER_LABEL_COLOUR:
686
+ return self._panel_hover_label_colour
687
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_COLOUR:
688
+ return self._panel_active_background_top_colour
689
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR:
690
+ return self._panel_active_background_top_gradient_colour
691
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR:
692
+ return self._panel_active_background_colour
693
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
694
+ return self._panel_active_background_gradient_colour
695
+ elif id == RIBBON_ART_PANEL_BUTTON_FACE_COLOUR:
696
+ return self._panel_button_face_colour
697
+ elif id == RIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR:
698
+ return self._panel_button_hover_face_colour
699
+ elif id == RIBBON_ART_PAGE_BORDER_COLOUR:
700
+ return self._page_border_pen.GetColour()
701
+ elif id == RIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR:
702
+ return self._page_background_top_colour
703
+ elif id == RIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR:
704
+ return self._page_background_top_gradient_colour
705
+ elif id == RIBBON_ART_PAGE_BACKGROUND_COLOUR:
706
+ return self._page_background_colour
707
+ elif id == RIBBON_ART_PAGE_BACKGROUND_GRADIENT_COLOUR:
708
+ return self._page_background_gradient_colour
709
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_COLOUR:
710
+ return self._page_hover_background_top_colour
711
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR:
712
+ return self._page_hover_background_top_gradient_colour
713
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_COLOUR:
714
+ return self._page_hover_background_colour
715
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_GRADIENT_COLOUR:
716
+ return self._page_hover_background_gradient_colour
717
+ elif id in [RIBBON_ART_TOOLBAR_BORDER_COLOUR, RIBBON_ART_TOOLBAR_HOVER_BORDER_COLOUR]:
718
+ return self._toolbar_border_pen.GetColour()
719
+ elif id == RIBBON_ART_TOOLBAR_FACE_COLOUR:
720
+ return self._tool_face_colour
721
+ else:
722
+ raise Exception("Invalid Colour Ordinal")
723
+
724
+
725
+ def SetColour(self, id, colour):
726
+ """
727
+ Set the value of a certain colour setting to the value.
728
+
729
+ can be one of the colour values of `RibbonArtSetting`, though not all colour
730
+ settings will have an affect on every art provider.
731
+
732
+ :param `id`: the colour id;
733
+ :param `colour`: the colour.
734
+
735
+ :see: :meth:`~RibbonMSWArtProvider.SetColourScheme`
736
+ """
737
+
738
+ if id == RIBBON_ART_BUTTON_BAR_LABEL_COLOUR:
739
+ self._button_bar_label_colour = colour
740
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BORDER_COLOUR:
741
+ self._button_bar_hover_border_pen.SetColour(colour)
742
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_COLOUR:
743
+ self._button_bar_hover_background_top_colour = colour
744
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR:
745
+ self._button_bar_hover_background_top_gradient_colour = colour
746
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_COLOUR:
747
+ self._button_bar_hover_background_colour = colour
748
+ elif id == RIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_GRADIENT_COLOUR:
749
+ self._button_bar_hover_background_gradient_colour = colour
750
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BORDER_COLOUR:
751
+ self._button_bar_active_border_pen.SetColour(colour)
752
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_COLOUR:
753
+ self._button_bar_active_background_top_colour = colour
754
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR:
755
+ self._button_bar_active_background_top_gradient_colour = colour
756
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_COLOUR:
757
+ self._button_bar_active_background_colour = colour
758
+ elif id == RIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
759
+ self._button_bar_active_background_gradient_colour = colour
760
+ elif id == RIBBON_ART_GALLERY_BORDER_COLOUR:
761
+ self._gallery_border_pen.SetColour(colour)
762
+ elif id == RIBBON_ART_GALLERY_HOVER_BACKGROUND_COLOUR:
763
+ self._gallery_hover_background_brush.SetColour(colour)
764
+ elif id == RIBBON_ART_GALLERY_BUTTON_BACKGROUND_COLOUR:
765
+ self._gallery_button_background_colour = colour
766
+ elif id == RIBBON_ART_GALLERY_BUTTON_BACKGROUND_GRADIENT_COLOUR:
767
+ self._gallery_button_background_gradient_colour = colour
768
+ elif id == RIBBON_ART_GALLERY_BUTTON_BACKGROUND_TOP_COLOUR:
769
+ self._gallery_button_background_top_brush.SetColour(colour)
770
+ elif id == RIBBON_ART_GALLERY_BUTTON_FACE_COLOUR:
771
+ self._gallery_button_face_colour = colour
772
+
773
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
774
+ self._gallery_up_bitmap[0] = RibbonLoadPixmap(gallery_left_xpm, colour)
775
+ self._gallery_down_bitmap[0] = RibbonLoadPixmap(gallery_right_xpm, colour)
776
+ else:
777
+ self._gallery_up_bitmap[0] = RibbonLoadPixmap(gallery_up_xpm, colour)
778
+ self._gallery_down_bitmap[0] = RibbonLoadPixmap(gallery_down_xpm, colour)
779
+
780
+ self._gallery_extension_bitmap[0] = RibbonLoadPixmap(gallery_extension_xpm, colour)
781
+
782
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_COLOUR:
783
+ self._gallery_button_hover_background_colour = colour
784
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_GRADIENT_COLOUR:
785
+ self._gallery_button_hover_background_gradient_colour = colour
786
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_TOP_COLOUR:
787
+ self._gallery_button_hover_background_top_brush.SetColour(colour)
788
+ elif id == RIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR:
789
+ self._gallery_button_hover_face_colour = colour
790
+
791
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
792
+ self._gallery_up_bitmap[1] = RibbonLoadPixmap(gallery_left_xpm, colour)
793
+ self._gallery_down_bitmap[1] = RibbonLoadPixmap(gallery_right_xpm, colour)
794
+ else:
795
+ self._gallery_up_bitmap[1] = RibbonLoadPixmap(gallery_up_xpm, colour)
796
+ self._gallery_down_bitmap[1] = RibbonLoadPixmap(gallery_down_xpm, colour)
797
+
798
+ self._gallery_extension_bitmap[1] = RibbonLoadPixmap(gallery_extension_xpm, colour)
799
+
800
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_COLOUR:
801
+ self._gallery_button_active_background_colour = colour
802
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
803
+ self._gallery_button_active_background_gradient_colour = colour
804
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_TOP_COLOUR:
805
+ self._gallery_button_background_top_brush.SetColour(colour)
806
+ elif id == RIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR:
807
+ self._gallery_button_active_face_colour = colour
808
+
809
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
810
+ self._gallery_up_bitmap[2] = RibbonLoadPixmap(gallery_left_xpm, colour)
811
+ self._gallery_down_bitmap[2] = RibbonLoadPixmap(gallery_right_xpm, colour)
812
+ else:
813
+ self._gallery_up_bitmap[2] = RibbonLoadPixmap(gallery_up_xpm, colour)
814
+ self._gallery_down_bitmap[2] = RibbonLoadPixmap(gallery_down_xpm, colour)
815
+
816
+ self._gallery_extension_bitmap[2] = RibbonLoadPixmap(gallery_extension_xpm, colour)
817
+
818
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_COLOUR:
819
+ self._gallery_button_disabled_background_colour = colour
820
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_GRADIENT_COLOUR:
821
+ self._gallery_button_disabled_background_gradient_colour = colour
822
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_TOP_COLOUR:
823
+ self._gallery_button_disabled_background_top_brush.SetColour(colour)
824
+ elif id == RIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR:
825
+ self._gallery_button_disabled_face_colour = colour
826
+
827
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
828
+ self._gallery_up_bitmap[3] = RibbonLoadPixmap(gallery_left_xpm, colour)
829
+ self._gallery_down_bitmap[3] = RibbonLoadPixmap(gallery_right_xpm, colour)
830
+ else:
831
+ self._gallery_up_bitmap[3] = RibbonLoadPixmap(gallery_up_xpm, colour)
832
+ self._gallery_down_bitmap[3] = RibbonLoadPixmap(gallery_down_xpm, colour)
833
+
834
+ self._gallery_extension_bitmap[3] = RibbonLoadPixmap(gallery_extension_xpm, colour)
835
+
836
+ elif id == RIBBON_ART_GALLERY_ITEM_BORDER_COLOUR:
837
+ self._gallery_item_border_pen.SetColour(colour)
838
+
839
+ elif id in [RIBBON_ART_TAB_CTRL_BACKGROUND_COLOUR, RIBBON_ART_TAB_CTRL_BACKGROUND_GRADIENT_COLOUR]:
840
+ self._tab_ctrl_background_brush.SetColour(colour)
841
+ self._cached_tab_separator_visibility = -1.0
842
+ elif id == RIBBON_ART_TAB_LABEL_COLOUR:
843
+ self._tab_label_colour = colour
844
+ elif id == RIBBON_ART_TAB_SEPARATOR_COLOUR:
845
+ self._tab_separator_colour = colour
846
+ self._cached_tab_separator_visibility = -1.0
847
+ elif id == RIBBON_ART_TAB_SEPARATOR_GRADIENT_COLOUR:
848
+ self._tab_separator_gradient_colour = colour
849
+ self._cached_tab_separator_visibility = -1.0
850
+ elif id in [RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_COLOUR, RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR]:
851
+ pass
852
+ elif id == RIBBON_ART_TAB_ACTIVE_BACKGROUND_COLOUR:
853
+ self._tab_active_background_colour = colour
854
+ elif id == RIBBON_ART_TAB_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
855
+ self._tab_active_background_gradient_colour = colour
856
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_COLOUR:
857
+ self._tab_hover_background_top_colour = colour
858
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR:
859
+ self._tab_hover_background_top_gradient_colour = colour
860
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_COLOUR:
861
+ self._tab_hover_background_colour = colour
862
+ elif id == RIBBON_ART_TAB_HOVER_BACKGROUND_GRADIENT_COLOUR:
863
+ self._tab_hover_background_gradient_colour = colour
864
+ elif id == RIBBON_ART_TAB_BORDER_COLOUR:
865
+ self._tab_border_pen.SetColour(colour)
866
+ elif id == RIBBON_ART_PANEL_BORDER_COLOUR:
867
+ self._panel_border_pen.SetColour(colour)
868
+ elif id == RIBBON_ART_PANEL_BORDER_GRADIENT_COLOUR:
869
+ self._panel_border_gradient_pen.SetColour(colour)
870
+ elif id == RIBBON_ART_PANEL_MINIMISED_BORDER_COLOUR:
871
+ self._panel_minimised_border_pen.SetColour(colour)
872
+ elif id == RIBBON_ART_PANEL_MINIMISED_BORDER_GRADIENT_COLOUR:
873
+ self._panel_minimised_border_gradient_pen.SetColour(colour)
874
+ elif id in [RIBBON_ART_PANEL_LABEL_BACKGROUND_COLOUR, RIBBON_ART_PANEL_LABEL_BACKGROUND_GRADIENT_COLOUR]:
875
+ self._panel_label_background_brush.SetColour(colour)
876
+ elif id == RIBBON_ART_PANEL_LABEL_COLOUR:
877
+ self._panel_label_colour = colour
878
+ elif id in [RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR, RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR]:
879
+ self._panel_hover_label_background_brush.SetColour(colour)
880
+ elif id == RIBBON_ART_PANEL_HOVER_LABEL_COLOUR:
881
+ self._panel_hover_label_colour = colour
882
+ elif id == RIBBON_ART_PANEL_MINIMISED_LABEL_COLOUR:
883
+ self._panel_minimised_label_colour = colour
884
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_COLOUR:
885
+ self._panel_active_background_top_colour = colour
886
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR:
887
+ self._panel_active_background_top_gradient_colour = colour
888
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR:
889
+ self._panel_active_background_colour = colour
890
+ elif id == RIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR:
891
+ self._panel_active_background_gradient_colour = colour
892
+ elif id == RIBBON_ART_PANEL_BUTTON_FACE_COLOUR:
893
+ self._panel_button_face_colour = colour
894
+ self._panel_extension_bitmap[0] = RibbonLoadPixmap(panel_extension_xpm, colour)
895
+ elif id == RIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR:
896
+ self._panel_button_hover_face_colour = colour
897
+ self._panel_extension_bitmap[1] = RibbonLoadPixmap(panel_extension_xpm, colour)
898
+ elif id == RIBBON_ART_PAGE_BORDER_COLOUR:
899
+ self._page_border_pen.SetColour(colour)
900
+ elif id == RIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR:
901
+ self._page_background_top_colour = colour
902
+ elif id == RIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR:
903
+ self._page_background_top_gradient_colour = colour
904
+ elif id == RIBBON_ART_PAGE_BACKGROUND_COLOUR:
905
+ self._page_background_colour = colour
906
+ elif id == RIBBON_ART_PAGE_BACKGROUND_GRADIENT_COLOUR:
907
+ self._page_background_gradient_colour = colour
908
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_COLOUR:
909
+ self._page_hover_background_top_colour = colour
910
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR:
911
+ self._page_hover_background_top_gradient_colour = colour
912
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_COLOUR:
913
+ self._page_hover_background_colour = colour
914
+ elif id == RIBBON_ART_PAGE_HOVER_BACKGROUND_GRADIENT_COLOUR:
915
+ self._page_hover_background_gradient_colour = colour
916
+ elif id in [RIBBON_ART_TOOLBAR_BORDER_COLOUR, RIBBON_ART_TOOLBAR_HOVER_BORDER_COLOUR]:
917
+ self._toolbar_border_pen.SetColour(colour)
918
+ elif id == RIBBON_ART_TOOLBAR_FACE_COLOUR:
919
+ self._tool_face_colour = colour
920
+ self._toolbar_drop_bitmap = RibbonLoadPixmap(gallery_down_xpm, colour)
921
+ else:
922
+ raise Exception("Invalid Colour Ordinal")
923
+
924
+
925
+ def DrawTabCtrlBackground(self, dc, wnd, rect):
926
+ """
927
+ Draw the background of the tab region of a ribbon bar.
928
+
929
+ :param `dc`: The device context to draw onto;
930
+ :param `wnd`: The window which is being drawn onto;
931
+ :param `rect`: The rectangle within which to draw.
932
+
933
+ """
934
+
935
+ dc.SetPen(wx.TRANSPARENT_PEN)
936
+
937
+ dc.SetBrush(self._tab_ctrl_background_brush)
938
+ dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height)
939
+
940
+ dc.SetPen(self._page_border_pen)
941
+
942
+ if rect.width > 6:
943
+ dc.DrawLine(rect.x + 3, rect.y + rect.height - 1, rect.x + rect.width - 3, rect.y + rect.height - 1)
944
+ else:
945
+ dc.DrawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width, rect.y + rect.height - 1)
946
+
947
+
948
+ def DrawTab(self, dc, wnd, tab):
949
+ """
950
+ Draw a single tab in the tab region of a ribbon bar.
951
+
952
+ :param `dc`: The device context to draw onto;
953
+ :param `wnd`: The window which is being drawn onto (not the :class:`~wx.lib.agw.ribbon.page.RibbonPage` associated
954
+ with the tab being drawn);
955
+ :param `tab`: The rectangle within which to draw, and also the tab label, icon, and
956
+ state (active and/or hovered). The drawing rectangle will be entirely within a
957
+ rectangle on the same device context previously painted with :meth:`~RibbonMSWArtProvider.DrawTabCtrlBackground`.
958
+ The rectangle's width will be at least the minimum value returned by :meth:`~RibbonMSWArtProvider.GetBarTabWidth`,
959
+ and height will be the value returned by :meth:`~RibbonMSWArtProvider.GetTabCtrlHeight`.
960
+
961
+ """
962
+
963
+ if tab.rect.height <= 2:
964
+ return
965
+
966
+ if tab.active or tab.hovered:
967
+ if tab.active:
968
+ background = wx.Rect(*tab.rect)
969
+ background.x += 2
970
+ background.y += 2
971
+ background.width -= 4
972
+ background.height -= 2
973
+
974
+ dc.GradientFillLinear(background, self._tab_active_background_colour,
975
+ self._tab_active_background_gradient_colour, wx.SOUTH)
976
+
977
+ # TODO: active and hovered
978
+
979
+ elif tab.hovered:
980
+ background = wx.Rect(*tab.rect)
981
+ background.x += 2
982
+ background.y += 2
983
+ background.width -= 4
984
+ background.height -= 3
985
+ h = background.height
986
+ background.height //= 2
987
+ dc.GradientFillLinear(background, self._tab_hover_background_top_colour,
988
+ self._tab_hover_background_top_gradient_colour, wx.SOUTH)
989
+
990
+ background.y += background.height
991
+ background.height = h - background.height
992
+ dc.GradientFillLinear(background, self._tab_hover_background_colour,
993
+ self._tab_hover_background_gradient_colour, wx.SOUTH)
994
+
995
+ border_points = [wx.Point() for i in range(6)]
996
+ border_points[0] = wx.Point(1, tab.rect.height - 2)
997
+ border_points[1] = wx.Point(1, 3)
998
+ border_points[2] = wx.Point(3, 1)
999
+ border_points[3] = wx.Point(tab.rect.width - 4, 1)
1000
+ border_points[4] = wx.Point(tab.rect.width - 2, 3)
1001
+ border_points[5] = wx.Point(tab.rect.width - 2, tab.rect.height - 1)
1002
+
1003
+ dc.SetPen(self._tab_border_pen)
1004
+ dc.DrawLines(border_points, tab.rect.x, tab.rect.y)
1005
+
1006
+ if tab.active:
1007
+ # Give the tab a curved outward border at the bottom
1008
+ dc.DrawPoint(tab.rect.x, tab.rect.y + tab.rect.height - 2)
1009
+ dc.DrawPoint(tab.rect.x + tab.rect.width - 1, tab.rect.y + tab.rect.height - 2)
1010
+
1011
+ p = wx.Pen(self._tab_active_background_gradient_colour)
1012
+ dc.SetPen(p)
1013
+
1014
+ # Technically the first two points are the wrong colour, but they're near enough
1015
+ dc.DrawPoint(tab.rect.x + 1, tab.rect.y + tab.rect.height - 2)
1016
+ dc.DrawPoint(tab.rect.x + tab.rect.width - 2, tab.rect.y + tab.rect.height - 2)
1017
+ dc.DrawPoint(tab.rect.x + 1, tab.rect.y + tab.rect.height - 1)
1018
+ dc.DrawPoint(tab.rect.x, tab.rect.y + tab.rect.height - 1)
1019
+ dc.DrawPoint(tab.rect.x + tab.rect.width - 2, tab.rect.y + tab.rect.height - 1)
1020
+ dc.DrawPoint(tab.rect.x + tab.rect.width - 1, tab.rect.y + tab.rect.height - 1)
1021
+
1022
+ if self._flags & RIBBON_BAR_SHOW_PAGE_ICONS:
1023
+ icon = tab.page.GetIcon()
1024
+
1025
+ if icon.IsOk():
1026
+ x = tab.rect.x + 4
1027
+ if self._flags & RIBBON_BAR_SHOW_PAGE_LABELS == 0:
1028
+ x = tab.rect.x + (tab.rect.width - icon.GetWidth()) // 2
1029
+
1030
+ dc.DrawBitmap(icon, x, tab.rect.y + 1 + (tab.rect.height - 1 - icon.GetHeight()) // 2, True)
1031
+
1032
+ if self._flags & RIBBON_BAR_SHOW_PAGE_LABELS:
1033
+ label = tab.page.GetLabel()
1034
+ if label.strip():
1035
+ dc.SetFont(self._tab_label_font)
1036
+ dc.SetTextForeground(self._tab_label_colour)
1037
+ dc.SetBackgroundMode(wx.TRANSPARENT)
1038
+
1039
+ text_width, text_height = dc.GetTextExtent(label)
1040
+ width = tab.rect.width - 5
1041
+ x = tab.rect.x + 3
1042
+
1043
+ if self._flags & RIBBON_BAR_SHOW_PAGE_ICONS:
1044
+ x += 3 + tab.page.GetIcon().GetWidth()
1045
+ width -= 3 + tab.page.GetIcon().GetWidth()
1046
+
1047
+ y = tab.rect.y + (tab.rect.height - text_height) // 2
1048
+
1049
+ if width <= text_width:
1050
+ dc.SetClippingRegion(x, tab.rect.y, width, tab.rect.height)
1051
+ dc.DrawText(label, x, y)
1052
+ else:
1053
+ dc.DrawText(label, x + (width - text_width) // 2 + 1, y)
1054
+
1055
+
1056
+ def DrawTabSeparator(self, dc, wnd, rect, visibility):
1057
+ """
1058
+ Draw a separator between two tabs in a ribbon bar.
1059
+
1060
+ :param `dc`: The device context to draw onto;
1061
+ :param `wnd`: The window which is being drawn onto;
1062
+ :param `rect`: The rectangle within which to draw, which will be entirely
1063
+ within a rectangle on the same device context previously painted with
1064
+ :meth:`~RibbonMSWArtProvider.DrawTabCtrlBackground`;
1065
+ :param `visibility`: The opacity with which to draw the separator. Values
1066
+ are in the range [0, 1], with 0 being totally transparent, and 1 being totally
1067
+ opaque.
1068
+
1069
+ """
1070
+
1071
+ if visibility <= 0.0:
1072
+ return
1073
+
1074
+ if visibility > 1.0:
1075
+ visibility = 1.0
1076
+
1077
+ # The tab separator is relatively expensive to draw (for its size), and is
1078
+ # usually drawn multiple times sequentially (in different positions), so it
1079
+ # makes sense to draw it once and cache it.
1080
+ if not self._cached_tab_separator.IsOk() or self._cached_tab_separator.GetSize() != rect.GetSize() or \
1081
+ visibility != self._cached_tab_separator_visibility:
1082
+
1083
+ size = wx.Rect(0, 0, *rect.GetSize())
1084
+ self.ReallyDrawTabSeparator(wnd, size, visibility)
1085
+
1086
+ dc.DrawBitmap(self._cached_tab_separator, rect.x, rect.y, False)
1087
+
1088
+
1089
+ def ReallyDrawTabSeparator(self, wnd, rect, visibility):
1090
+
1091
+ if not self._cached_tab_separator.IsOk() or self._cached_tab_separator.GetSize() != rect.GetSize():
1092
+ self._cached_tab_separator = wx.Bitmap(*rect.GetSize())
1093
+
1094
+ dc = wx.MemoryDC(self._cached_tab_separator)
1095
+ self.DrawTabCtrlBackground(dc, wnd, rect)
1096
+
1097
+ x = rect.x + rect.width // 2
1098
+ h = float(rect.height - 1)
1099
+
1100
+ r1 = self._tab_ctrl_background_brush.GetColour().Red() * (1.0 - visibility) + 0.5
1101
+ g1 = self._tab_ctrl_background_brush.GetColour().Green() * (1.0 - visibility) + 0.5
1102
+ b1 = self._tab_ctrl_background_brush.GetColour().Blue() * (1.0 - visibility) + 0.5
1103
+ r2 = self._tab_separator_colour.Red()
1104
+ g2 = self._tab_separator_colour.Green()
1105
+ b2 = self._tab_separator_colour.Blue()
1106
+ r3 = self._tab_separator_gradient_colour.Red()
1107
+ g3 = self._tab_separator_gradient_colour.Green()
1108
+ b3 = self._tab_separator_gradient_colour.Blue()
1109
+
1110
+ for i in range(rect.height-1):
1111
+
1112
+ p = float(i)/h
1113
+
1114
+ r = int((p * r3 + (1.0 - p) * r2) * visibility + r1)
1115
+ g = int((p * g3 + (1.0 - p) * g2) * visibility + g1)
1116
+ b = int((p * b3 + (1.0 - p) * b2) * visibility + b1)
1117
+
1118
+ P = wx.Pen(wx.Colour(r, g, b))
1119
+ dc.SetPen(P)
1120
+ dc.DrawPoint(x, rect.y + i)
1121
+
1122
+ self._cached_tab_separator_visibility = visibility
1123
+
1124
+
1125
+ def DrawPartialPageBackground(self, dc, wnd, rect, allow_hovered_or_page=True, offset=None, hovered=False):
1126
+
1127
+ if isinstance(allow_hovered_or_page, bool):
1128
+ self.DrawPartialPageBackground2(dc, wnd, rect, allow_hovered_or_page)
1129
+ else:
1130
+ self.DrawPartialPageBackground1(dc, wnd, rect, allow_hovered_or_page, offset, hovered)
1131
+
1132
+
1133
+ def DrawPartialPageBackground1(self, dc, wnd, rect, page, offset, hovered=False):
1134
+
1135
+ background = wx.Rect(0, 0, *page.GetSize())
1136
+ background = page.AdjustRectToIncludeScrollButtons(background)
1137
+ background.height -= 2
1138
+
1139
+ # Page background isn't dependant upon the width of the page
1140
+ # (at least not the part of it intended to be painted by this
1141
+ # function). Set to wider than the page itself for when externally
1142
+ # expanded panels need a background - the expanded panel can be wider
1143
+ # than the bar.
1144
+
1145
+ background.x = 0
1146
+ background.width = 10000
1147
+
1148
+ # upper_rect, lower_rect, paint_rect are all in page co-ordinates
1149
+ upper_rect = wx.Rect(*background)
1150
+ upper_rect.height //= 5
1151
+
1152
+ lower_rect = wx.Rect(*background)
1153
+ lower_rect.y += upper_rect.height
1154
+ lower_rect.height -= upper_rect.height
1155
+
1156
+ paint_rect = wx.Rect(*rect)
1157
+ paint_rect.x += offset.x
1158
+ paint_rect.y += offset.y
1159
+
1160
+ if hovered:
1161
+ bg_top = self._page_hover_background_top_colour
1162
+ bg_top_grad = self._page_hover_background_top_gradient_colour
1163
+ bg_btm = self._page_hover_background_colour
1164
+ bg_btm_grad = self._page_hover_background_gradient_colour
1165
+ else:
1166
+ bg_top = self._page_background_top_colour
1167
+ bg_top_grad = self._page_background_top_gradient_colour
1168
+ bg_btm = self._page_background_colour
1169
+ bg_btm_grad = self._page_background_gradient_colour
1170
+
1171
+ if paint_rect.Intersects(upper_rect):
1172
+ rect = wx.Rect(*upper_rect)
1173
+ rect.Intersect(paint_rect)
1174
+ rect.x -= offset.x
1175
+ rect.y -= offset.y
1176
+ starting_colour = RibbonInterpolateColour(bg_top, bg_top_grad,
1177
+ paint_rect.y, upper_rect.y,
1178
+ upper_rect.y + upper_rect.height)
1179
+ ending_colour = RibbonInterpolateColour(bg_top, bg_top_grad,
1180
+ paint_rect.y + paint_rect.height, upper_rect.y,
1181
+ upper_rect.y + upper_rect.height)
1182
+ dc.GradientFillLinear(rect, starting_colour, ending_colour, wx.SOUTH)
1183
+
1184
+
1185
+ if paint_rect.Intersects(lower_rect):
1186
+ rect = wx.Rect(*lower_rect)
1187
+ rect.Intersect(paint_rect)
1188
+ rect.x -= offset.x
1189
+ rect.y -= offset.y
1190
+ starting_colour = RibbonInterpolateColour(bg_btm, bg_btm_grad,
1191
+ paint_rect.y, lower_rect.y,
1192
+ lower_rect.y + lower_rect.height)
1193
+ ending_colour = RibbonInterpolateColour(bg_btm, bg_btm_grad,
1194
+ paint_rect.y + paint_rect.height,
1195
+ lower_rect.y, lower_rect.y + lower_rect.height)
1196
+
1197
+ dc.GradientFillLinear(rect, starting_colour, ending_colour, wx.SOUTH)
1198
+
1199
+
1200
+ def DrawPageBackground(self, dc, wnd, rect):
1201
+ """
1202
+ Draw the background of a ribbon page.
1203
+
1204
+ :param `dc`: The device context to draw onto;
1205
+ :param `wnd`: The window which is being drawn onto (which is commonly the
1206
+ :class:`~wx.lib.agw.ribbon.page.RibbonPage` whose background is being drawn, but doesn't have to be);
1207
+ :param `rect`: The rectangle within which to draw.
1208
+
1209
+ :see: :meth:`~RibbonMSWArtProvider.GetPageBackgroundRedrawArea`
1210
+ """
1211
+
1212
+ dc.SetPen(wx.TRANSPARENT_PEN)
1213
+ dc.SetBrush(self._tab_ctrl_background_brush)
1214
+
1215
+ edge = wx.Rect(*rect)
1216
+
1217
+ edge.width = 2
1218
+ dc.DrawRectangle(edge.x, edge.y, edge.width, edge.height)
1219
+
1220
+ edge.x += rect.width - 2
1221
+ dc.DrawRectangle(edge.x, edge.y, edge.width, edge.height)
1222
+
1223
+ edge = wx.Rect(*rect)
1224
+ edge.height = 2
1225
+ edge.y += (rect.height - edge.height)
1226
+ dc.DrawRectangle(edge.x, edge.y, edge.width, edge.height)
1227
+
1228
+ background = wx.Rect(*rect)
1229
+ background.x += 2
1230
+ background.width -= 4
1231
+ background.height -= 2
1232
+
1233
+ background.height //= 5
1234
+ dc.GradientFillLinear(background, self._page_background_top_colour,
1235
+ self._page_background_top_gradient_colour, wx.SOUTH)
1236
+
1237
+ background.y += background.height
1238
+ background.height = rect.height - 2 - background.height
1239
+ dc.GradientFillLinear(background, self._page_background_colour,
1240
+ self._page_background_gradient_colour, wx.SOUTH)
1241
+
1242
+ border_points = [wx.Point() for i in range(8)]
1243
+ border_points[0] = wx.Point(2, 0)
1244
+ border_points[1] = wx.Point(1, 1)
1245
+ border_points[2] = wx.Point(1, rect.height - 4)
1246
+ border_points[3] = wx.Point(3, rect.height - 2)
1247
+ border_points[4] = wx.Point(rect.width - 4, rect.height - 2)
1248
+ border_points[5] = wx.Point(rect.width - 2, rect.height - 4)
1249
+ border_points[6] = wx.Point(rect.width - 2, 1)
1250
+ border_points[7] = wx.Point(rect.width - 4, -1)
1251
+
1252
+ dc.SetPen(self._page_border_pen)
1253
+ dc.DrawLines(border_points, rect.x, rect.y)
1254
+
1255
+
1256
+ def DrawScrollButton(self, dc, wnd, rect_, style):
1257
+ """
1258
+ Draw a ribbon-style scroll button.
1259
+
1260
+ :param `dc`: The device context to draw onto;
1261
+ :param `wnd`: The window which is being drawn onto;
1262
+ :param `rect`: The rectangle within which to draw. The size of this rectangle
1263
+ will be at least the size returned by :meth:`~RibbonMSWArtProvider.GetScrollButtonMinimumSize` for a
1264
+ scroll button with the same style. For tab scroll buttons, this rectangle
1265
+ will be entirely within a rectangle on the same device context previously
1266
+ painted with :meth:`~RibbonMSWArtProvider.DrawTabCtrlBackground`, but this is not guaranteed for other
1267
+ types of button (for example, page scroll buttons will not be painted on an
1268
+ area previously painted with :meth:`~RibbonMSWArtProvider.DrawPageBackground` );
1269
+ :param `style`: A combination of flags from `RibbonScrollButtonStyle`,
1270
+ including a direction, a for flag, and one or more states.
1271
+
1272
+ """
1273
+
1274
+ rect = wx.Rect(*rect_)
1275
+
1276
+ if (style & RIBBON_SCROLL_BTN_FOR_MASK) == RIBBON_SCROLL_BTN_FOR_PAGE:
1277
+
1278
+ # Page scroll buttons do not have the luxury of rendering on top of anything
1279
+ # else, and their size includes some padding, hence the background painting
1280
+ # and size adjustment.
1281
+ dc.SetPen(wx.TRANSPARENT_PEN)
1282
+ dc.SetBrush(self._tab_ctrl_background_brush)
1283
+ dc.DrawRectangle(rect)
1284
+ dc.SetClippingRegion(rect)
1285
+
1286
+ result = style & RIBBON_SCROLL_BTN_DIRECTION_MASK
1287
+
1288
+ if result == RIBBON_SCROLL_BTN_LEFT:
1289
+ rect.x += 1
1290
+ elif result == RIBBON_SCROLL_BTN_RIGHT:
1291
+ rect.y -= 1
1292
+ rect.width -= 1
1293
+ elif result == RIBBON_SCROLL_BTN_UP:
1294
+ rect.x += 1
1295
+ rect.y -= 1
1296
+ rect.width -= 2
1297
+ rect.height += 1
1298
+ elif result == RIBBON_SCROLL_BTN_DOWN:
1299
+ rect.x += 1
1300
+ rect.width -= 2
1301
+ rect.height -= 1
1302
+
1303
+ background = wx.Rect(*rect)
1304
+ background.x += 1
1305
+ background.y += 1
1306
+ background.width -= 2
1307
+ background.height -= 2
1308
+
1309
+ if style & RIBBON_SCROLL_BTN_UP:
1310
+ background.height //= 2
1311
+ else:
1312
+ background.height //= 5
1313
+
1314
+ dc.GradientFillLinear(background, self._page_background_top_colour,
1315
+ self._page_background_top_gradient_colour, wx.SOUTH)
1316
+
1317
+ background.y += background.height
1318
+ background.height = rect.height - 2 - background.height
1319
+ dc.GradientFillLinear(background, self._page_background_colour,
1320
+ self._page_background_gradient_colour, wx.SOUTH)
1321
+
1322
+ border_points = [wx.Point() for i in range(7)]
1323
+ result = style & RIBBON_SCROLL_BTN_DIRECTION_MASK
1324
+
1325
+ if result == RIBBON_SCROLL_BTN_LEFT:
1326
+ border_points[0] = wx.Point(2, 0)
1327
+ border_points[1] = wx.Point(rect.width - 1, 0)
1328
+ border_points[2] = wx.Point(rect.width - 1, rect.height - 1)
1329
+ border_points[3] = wx.Point(2, rect.height - 1)
1330
+ border_points[4] = wx.Point(0, rect.height - 3)
1331
+ border_points[5] = wx.Point(0, 2)
1332
+
1333
+ elif result == RIBBON_SCROLL_BTN_RIGHT:
1334
+ border_points[0] = wx.Point(0, 0)
1335
+ border_points[1] = wx.Point(rect.width - 3, 0)
1336
+ border_points[2] = wx.Point(rect.width - 1, 2)
1337
+ border_points[3] = wx.Point(rect.width - 1, rect.height - 3)
1338
+ border_points[4] = wx.Point(rect.width - 3, rect.height - 1)
1339
+ border_points[5] = wx.Point(0, rect.height - 1)
1340
+
1341
+ elif result == RIBBON_SCROLL_BTN_UP:
1342
+ border_points[0] = wx.Point(2, 0)
1343
+ border_points[1] = wx.Point(rect.width - 3, 0)
1344
+ border_points[2] = wx.Point(rect.width - 1, 2)
1345
+ border_points[3] = wx.Point(rect.width - 1, rect.height - 1)
1346
+ border_points[4] = wx.Point(0, rect.height - 1)
1347
+ border_points[5] = wx.Point(0, 2)
1348
+
1349
+ elif result == RIBBON_SCROLL_BTN_DOWN:
1350
+ border_points[0] = wx.Point(0, 0)
1351
+ border_points[1] = wx.Point(rect.width - 1, 0)
1352
+ border_points[2] = wx.Point(rect.width - 1, rect.height - 3)
1353
+ border_points[3] = wx.Point(rect.width - 3, rect.height - 1)
1354
+ border_points[4] = wx.Point(2, rect.height - 1)
1355
+ border_points[5] = wx.Point(0, rect.height - 3)
1356
+
1357
+ border_points[6] = border_points[0]
1358
+
1359
+ dc.SetPen(self._page_border_pen)
1360
+ dc.DrawLines(border_points, rect.x, rect.y)
1361
+
1362
+ # NB: Code for handling hovered/active state is temporary
1363
+ arrow_points = [wx.Point() for i in range(3)]
1364
+ result = style & RIBBON_SCROLL_BTN_DIRECTION_MASK
1365
+
1366
+ if result == RIBBON_SCROLL_BTN_LEFT:
1367
+ arrow_points[0] = wx.Point(rect.width // 2 - 2, rect.height // 2)
1368
+ if style & RIBBON_SCROLL_BTN_ACTIVE:
1369
+ arrow_points[0].y += 1
1370
+ arrow_points[1] = arrow_points[0] + wx.Point(3, -3)
1371
+ arrow_points[2] = arrow_points[0] + wx.Point(3, 3)
1372
+
1373
+ elif result == RIBBON_SCROLL_BTN_RIGHT:
1374
+ arrow_points[0] = wx.Point(rect.width // 2 + 2, rect.height // 2)
1375
+ if style & RIBBON_SCROLL_BTN_ACTIVE:
1376
+ arrow_points[0].y += 1
1377
+ arrow_points[1] = arrow_points[0] - wx.Point(3, 3)
1378
+ arrow_points[2] = arrow_points[0] - wx.Point(3, -3)
1379
+
1380
+ elif result == RIBBON_SCROLL_BTN_UP:
1381
+ arrow_points[0] = wx.Point(rect.width // 2, rect.height // 2 - 2)
1382
+ if style & RIBBON_SCROLL_BTN_ACTIVE:
1383
+ arrow_points[0].y += 1
1384
+ arrow_points[1] = arrow_points[0] + wx.Point( 3, 3)
1385
+ arrow_points[2] = arrow_points[0] + wx.Point(-3, 3)
1386
+
1387
+ elif result == RIBBON_SCROLL_BTN_DOWN:
1388
+ arrow_points[0] = wx.Point(rect.width // 2, rect.height // 2 + 2)
1389
+ if style & RIBBON_SCROLL_BTN_ACTIVE:
1390
+ arrow_points[0].y += 1
1391
+ arrow_points[1] = arrow_points[0] - wx.Point( 3, 3)
1392
+ arrow_points[2] = arrow_points[0] - wx.Point(-3, 3)
1393
+
1394
+ dc.SetPen(wx.TRANSPARENT_PEN)
1395
+ B = wx.Brush((style & RIBBON_SCROLL_BTN_HOVERED and [self._tab_active_background_colour] or [self._tab_label_colour])[0])
1396
+ dc.SetBrush(B)
1397
+ dc.DrawPolygon(arrow_points, rect.x, rect.y)
1398
+
1399
+
1400
+ def DrawDropdownArrow(self, dc, x, y, colour):
1401
+
1402
+ arrow_points = [wx.Point() for i in range(3)]
1403
+ brush = wx.Brush(colour)
1404
+ arrow_points[0] = wx.Point(1, 2)
1405
+ arrow_points[1] = arrow_points[0] + wx.Point(-3, -3)
1406
+ arrow_points[2] = arrow_points[0] + wx.Point( 3, -3)
1407
+ dc.SetPen(wx.TRANSPARENT_PEN)
1408
+ dc.SetBrush(brush)
1409
+ dc.DrawPolygon(arrow_points, x, y)
1410
+
1411
+
1412
+ def RemovePanelPadding(self, rect):
1413
+
1414
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1415
+ rect.y += 1
1416
+ rect.height -= 2
1417
+ else:
1418
+ rect.x += 1
1419
+ rect.width -= 2
1420
+
1421
+ return rect
1422
+
1423
+
1424
+ def DrawPanelBackground(self, dc, wnd, rect):
1425
+ """
1426
+ Draw the background and chrome for a ribbon panel.
1427
+
1428
+ This should draw the border, background, label, and any other items of a panel
1429
+ which are outside the client area of a panel. Note that when a panel is
1430
+ minimised, this function is not called - only :meth:`~RibbonMSWArtProvider.DrawMinimisedPanel` is called,
1431
+ so a background should be explicitly painted by that if required.
1432
+
1433
+ :param `dc`: The device context to draw onto;
1434
+ :param `wnd`: The window which is being drawn onto, which is always the panel
1435
+ whose background and chrome is being drawn. The panel label and other panel
1436
+ attributes can be obtained by querying this;
1437
+ :param `rect`: The rectangle within which to draw.
1438
+
1439
+ """
1440
+
1441
+ self.DrawPartialPageBackground(dc, wnd, rect, False)
1442
+
1443
+ true_rect = wx.Rect(*rect)
1444
+ true_rect = self.RemovePanelPadding(true_rect)
1445
+
1446
+ dc.SetFont(self._panel_label_font)
1447
+ dc.SetPen(wx.TRANSPARENT_PEN)
1448
+
1449
+ has_ext_button = wnd.HasExtButton()
1450
+
1451
+ if wnd.IsHovered():
1452
+ dc.SetBrush(self._panel_hover_label_background_brush)
1453
+ dc.SetTextForeground(self._panel_hover_label_colour)
1454
+ else:
1455
+ dc.SetBrush(self._panel_label_background_brush)
1456
+ dc.SetTextForeground(self._panel_label_colour)
1457
+
1458
+ label_rect = wx.Rect(*true_rect)
1459
+ label = wnd.GetLabel().strip()
1460
+ clip_label = False
1461
+ label_size = wx.Size(*dc.GetTextExtent(label))
1462
+
1463
+ label_rect.SetX(label_rect.GetX() + 1)
1464
+ label_rect.SetWidth(label_rect.GetWidth() - 2)
1465
+ label_rect.SetHeight(label_size.GetHeight() + 2)
1466
+ label_rect.SetY(true_rect.GetBottom() - label_rect.GetHeight())
1467
+ label_height = label_rect.GetHeight()
1468
+
1469
+ label_bg_rect = wx.Rect(*label_rect)
1470
+
1471
+ if has_ext_button:
1472
+ label_rect.SetWidth(label_rect.GetWidth() - 13)
1473
+
1474
+ if label_size.GetWidth() > label_rect.GetWidth():
1475
+ # Test if there is enough length for 3 letters and ...
1476
+ new_label = label[0:3] + "..."
1477
+ label_size = wx.Size(*dc.GetTextExtent(new_label))
1478
+
1479
+ if label_size.GetWidth() > label_rect.GetWidth():
1480
+ # Not enough room for three characters and ...
1481
+ # Display the entire label and just crop it
1482
+ clip_label = True
1483
+ else:
1484
+ # Room for some characters and ...
1485
+ # Display as many characters as possible and append ...
1486
+ for l in range(len(label)-1, 3, -1):
1487
+ new_label = label[0:l] + "..."
1488
+ label_size = wx.Size(*dc.GetTextExtent(new_label))
1489
+ if label_size.GetWidth() <= label_rect.GetWidth():
1490
+ label = new_label
1491
+ break
1492
+
1493
+ dc.DrawRectangle(label_rect)
1494
+
1495
+ if clip_label:
1496
+ clip = wx.DCClipper(dc, label_rect)
1497
+ dc.DrawText(label, label_rect.x, label_rect.y + (label_rect.GetHeight() - label_size.GetHeight()) // 2)
1498
+ else:
1499
+ dc.DrawText(label, label_rect.x + (label_rect.GetWidth() - label_size.GetWidth()) // 2,
1500
+ label_rect.y + (label_rect.GetHeight() - label_size.GetHeight()) // 2)
1501
+
1502
+ if has_ext_button:
1503
+ if wnd.IsExtButtonHovered():
1504
+ dc.SetPen(self._panel_hover_button_border_pen)
1505
+ dc.SetBrush(self._panel_hover_button_background_brush)
1506
+ dc.DrawRoundedRectangle(label_rect.GetRight(), label_rect.GetBottom() - 13, 13, 13, 1)
1507
+ dc.DrawBitmap(self._panel_extension_bitmap[1], label_rect.GetRight() + 3, label_rect.GetBottom() - 10, True)
1508
+ else:
1509
+ dc.DrawBitmap(self._panel_extension_bitmap[0], label_rect.GetRight() + 3, label_rect.GetBottom() - 10, True)
1510
+
1511
+ if wnd.IsHovered():
1512
+ client_rect = wx.Rect(*true_rect)
1513
+ client_rect.x += 1
1514
+ client_rect.width -= 2
1515
+ client_rect.y += 1
1516
+ client_rect.height -= 2 + label_height
1517
+ self.DrawPartialPageBackground(dc, wnd, client_rect, True)
1518
+
1519
+ self.DrawPanelBorder(dc, true_rect, self._panel_border_pen, self._panel_border_gradient_pen)
1520
+
1521
+
1522
+ def GetPanelExtButtonArea(self, dc, wnd, rect):
1523
+ """
1524
+ Retrieve the extension button area rectangle.
1525
+
1526
+ :param `dc`: The device context used to measure text extents;
1527
+ :param `wnd`: The panel where the extension button resides;
1528
+ :param `rect`: The panel client rectangle.
1529
+ """
1530
+
1531
+ true_rect = wx.Rect(self.RemovePanelPadding(rect))
1532
+ true_rect = wx.Rect(true_rect.GetRight()-13, true_rect.GetBottom()-13, 13, 13)
1533
+ return true_rect
1534
+
1535
+
1536
+ def DrawGalleryBackground(self, dc, wnd, rect):
1537
+ """
1538
+ Draw the background and chrome for a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control.
1539
+
1540
+ This should draw the border, brackground, scroll buttons, extension button, and
1541
+ any other UI elements which are not attached to a specific gallery item.
1542
+
1543
+ :param `dc`: The device context to draw onto;
1544
+ :param `wnd`: The window which is being drawn onto, which is always the gallery
1545
+ whose background and chrome is being drawn. Attributes used during drawing like
1546
+ the gallery hover state and individual button states can be queried from this
1547
+ parameter by :meth:`RibbonGallery.IsHovered() <lib.agw.ribbon.gallery.RibbonGallery.IsHovered>`,
1548
+ :meth:`RibbonGallery.GetExtensionButtonState() <lib.agw.ribbon.gallery.RibbonGallery.GetExtensionButtonState>`,
1549
+ :meth:`RibbonGallery.GetUpButtonState() <lib.agw.ribbon.gallery.RibbonGallery.GetUpButtonState>`, and
1550
+ :meth:`RibbonGallery.GetDownButtonState() <lib.agw.ribbon.gallery.RibbonGallery.GetDownButtonState>`;
1551
+ :param `rect`: The rectangle within which to draw. This rectangle is the entire
1552
+ area of the gallery control, not just the client rectangle.
1553
+ """
1554
+
1555
+ self.DrawPartialPageBackground(dc, wnd, rect)
1556
+
1557
+ if wnd.IsHovered():
1558
+ dc.SetPen(wx.TRANSPARENT_PEN)
1559
+ dc.SetBrush(self._gallery_hover_background_brush)
1560
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1561
+ dc.DrawRectangle(rect.x + 1, rect.y + 1, rect.width - 2, rect.height - 16)
1562
+ else:
1563
+ dc.DrawRectangle(rect.x + 1, rect.y + 1, rect.width - 16, rect.height - 2)
1564
+
1565
+ dc.SetPen(self._gallery_border_pen)
1566
+ # Outline
1567
+ dc.DrawLine(rect.x + 1, rect.y, rect.x + rect.width - 1, rect.y)
1568
+ dc.DrawLine(rect.x, rect.y + 1, rect.x, rect.y + rect.height - 1)
1569
+ dc.DrawLine(rect.x + 1, rect.y + rect.height - 1, rect.x + rect.width - 1, rect.y + rect.height - 1)
1570
+ dc.DrawLine(rect.x + rect.width - 1, rect.y + 1, rect.x + rect.width - 1, rect.y + rect.height - 1)
1571
+
1572
+ self.DrawGalleryBackgroundCommon(dc, wnd, rect)
1573
+
1574
+
1575
+ def DrawGalleryBackgroundCommon(self, dc, wnd, rect):
1576
+
1577
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1578
+ # Divider between items and buttons
1579
+ dc.DrawLine(rect.x, rect.y + rect.height - 15, rect.x + rect.width, rect.y + rect.height - 15)
1580
+
1581
+ up_btn = wx.Rect(rect.x, rect.y + rect.height - 15, rect.width // 3, 15)
1582
+ down_btn = wx.Rect(up_btn.GetRight() + 1, up_btn.GetTop(), up_btn.GetWidth(), up_btn.GetHeight())
1583
+ dc.DrawLine(down_btn.GetLeft(), down_btn.GetTop(), down_btn.GetLeft(), down_btn.GetBottom())
1584
+ ext_btn = wx.Rect(down_btn.GetRight() + 1, up_btn.GetTop(), rect.width - up_btn.GetWidth() - down_btn.GetWidth() - 1, up_btn.GetHeight())
1585
+ dc.DrawLine(ext_btn.GetLeft(), ext_btn.GetTop(), ext_btn.GetLeft(), ext_btn.GetBottom())
1586
+
1587
+ else:
1588
+ # Divider between items and buttons
1589
+ dc.DrawLine(rect.x + rect.width - 15, rect.y, rect.x + rect.width - 15, rect.y + rect.height)
1590
+
1591
+ up_btn = wx.Rect(rect.x + rect.width - 15, rect.y, 15, rect.height // 3)
1592
+ down_btn = wx.Rect(up_btn.GetLeft(), up_btn.GetBottom() + 1, up_btn.GetWidth(), up_btn.GetHeight())
1593
+ dc.DrawLine(down_btn.GetLeft(), down_btn.GetTop(), down_btn.GetRight(), down_btn.GetTop())
1594
+ ext_btn = wx.Rect(up_btn.GetLeft(), down_btn.GetBottom() + 1, up_btn.GetWidth(), rect.height - up_btn.GetHeight() - down_btn.GetHeight() - 1)
1595
+ dc.DrawLine(ext_btn.GetLeft(), ext_btn.GetTop(), ext_btn.GetRight(), ext_btn.GetTop())
1596
+
1597
+ self.DrawGalleryButton(dc, up_btn, wnd.GetUpButtonState(), self._gallery_up_bitmap)
1598
+ self.DrawGalleryButton(dc, down_btn, wnd.GetDownButtonState(), self._gallery_down_bitmap)
1599
+ self.DrawGalleryButton(dc, ext_btn, wnd.GetExtensionButtonState(), self._gallery_extension_bitmap)
1600
+
1601
+
1602
+ def DrawGalleryButton(self, dc, rect, state, bitmaps):
1603
+
1604
+ if state == RIBBON_GALLERY_BUTTON_NORMAL:
1605
+ btn_top_brush = self._gallery_button_background_top_brush
1606
+ btn_colour = self._gallery_button_background_colour
1607
+ btn_grad_colour = self._gallery_button_background_gradient_colour
1608
+ btn_bitmap = bitmaps[0]
1609
+ elif state == RIBBON_GALLERY_BUTTON_HOVERED:
1610
+ btn_top_brush = self._gallery_button_hover_background_top_brush
1611
+ btn_colour = self._gallery_button_hover_background_colour
1612
+ btn_grad_colour = self._gallery_button_hover_background_gradient_colour
1613
+ btn_bitmap = bitmaps[1]
1614
+ elif state == RIBBON_GALLERY_BUTTON_ACTIVE:
1615
+ btn_top_brush = self._gallery_button_active_background_top_brush
1616
+ btn_colour = self._gallery_button_active_background_colour
1617
+ btn_grad_colour = self._gallery_button_active_background_gradient_colour
1618
+ btn_bitmap = bitmaps[2]
1619
+ elif state == RIBBON_GALLERY_BUTTON_DISABLED:
1620
+ btn_top_brush = self._gallery_button_disabled_background_top_brush
1621
+ btn_colour = self._gallery_button_disabled_background_colour
1622
+ btn_grad_colour = self._gallery_button_disabled_background_gradient_colour
1623
+ btn_bitmap = bitmaps[3]
1624
+
1625
+ rect.x += 1
1626
+ rect.y += 1
1627
+
1628
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1629
+ rect.width -= 1
1630
+ rect.height -= 2
1631
+ else:
1632
+ rect.width -= 2
1633
+ rect.height -= 1
1634
+
1635
+ dc.SetPen(wx.TRANSPARENT_PEN)
1636
+ dc.SetBrush(btn_top_brush)
1637
+ dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height // 2)
1638
+
1639
+ lower = wx.Rect(*rect)
1640
+ lower.height = (lower.height + 1) // 2
1641
+ lower.y += rect.height - lower.height
1642
+ dc.GradientFillLinear(lower, btn_colour, btn_grad_colour, wx.SOUTH)
1643
+
1644
+ dc.DrawBitmap(btn_bitmap, rect.x + rect.width // 2 - 2, lower.y - 2, True)
1645
+
1646
+
1647
+ def DrawGalleryItemBackground(self, dc, wnd, rect, item):
1648
+ """
1649
+ Draw the background of a single item in a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control.
1650
+
1651
+ This is painted on top of a gallery background, and behind the items bitmap.
1652
+ Unlike :meth:`~RibbonMSWArtProvider.DrawButtonBarButton` and :meth:`~RibbonMSWArtProvider.DrawTool`, it is not expected to draw the
1653
+ item bitmap - that is done by the gallery control itself.
1654
+
1655
+ :param `dc`: The device context to draw onto;
1656
+ :param `wnd`: The window which is being drawn onto, which is always the gallery
1657
+ which contains the item being drawn;
1658
+ :param `rect`: The rectangle within which to draw. The size of this rectangle
1659
+ will be the size of the item's bitmap, expanded by gallery item padding values
1660
+ (``RIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE``, ``RIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE``,
1661
+ ``RIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE``, and ``RIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE``).
1662
+ The drawing rectangle will be entirely within a rectangle on the same device
1663
+ context previously painted with :meth:`~RibbonMSWArtProvider.DrawGalleryBackground`;
1664
+ :param `item`: The item whose background is being painted. Typically the background
1665
+ will vary if the item is hovered, active, or selected; :meth:`RibbonGallery.GetSelection() <lib.agw.ribbon.gallery.RibbonGallery.GetSelection>`,
1666
+ :meth:`RibbonGallery.GetActiveItem() <lib.agw.ribbon.gallery.RibbonGallery.GetActiveItem>`, and
1667
+ :meth:`RibbonGallery.GetHoveredItem() <lib.agw.ribbon.gallery.RibbonGallery.GetHoveredItem>` can be
1668
+ called to test if the given item is in one of these states.
1669
+
1670
+ """
1671
+
1672
+ if wnd.GetHoveredItem() != item and wnd.GetActiveItem() != item and \
1673
+ wnd.GetSelection() != item:
1674
+ return
1675
+
1676
+ dc.SetPen(self._gallery_item_border_pen)
1677
+ dc.DrawLine(rect.x + 1, rect.y, rect.x + rect.width - 1, rect.y)
1678
+ dc.DrawLine(rect.x, rect.y + 1, rect.x, rect.y + rect.height - 1)
1679
+ dc.DrawLine(rect.x + 1, rect.y + rect.height - 1, rect.x + rect.width - 1, rect.y + rect.height - 1)
1680
+ dc.DrawLine(rect.x + rect.width - 1, rect.y + 1, rect.x + rect.width - 1, rect.y + rect.height - 1)
1681
+
1682
+ if wnd.GetActiveItem() == item or wnd.GetSelection() == item:
1683
+ top_brush = self._gallery_button_active_background_top_brush
1684
+ bg_colour = self._gallery_button_active_background_colour
1685
+ bg_gradient_colour = self._gallery_button_active_background_gradient_colour
1686
+ else:
1687
+ top_brush = self._gallery_button_hover_background_top_brush
1688
+ bg_colour = self._gallery_button_hover_background_colour
1689
+ bg_gradient_colour = self._gallery_button_hover_background_gradient_colour
1690
+
1691
+ upper = wx.Rect(*rect)
1692
+ upper.x += 1
1693
+ upper.width -= 2
1694
+ upper.y += 1
1695
+ upper.height //= 3
1696
+ dc.SetPen(wx.TRANSPARENT_PEN)
1697
+ dc.SetBrush(top_brush)
1698
+ dc.DrawRectangle(upper.x, upper.y, upper.width, upper.height)
1699
+
1700
+ lower = wx.Rect(*upper)
1701
+ lower.y += lower.height
1702
+ lower.height = rect.height - 2 - lower.height
1703
+ dc.GradientFillLinear(lower, bg_colour, bg_gradient_colour, wx.SOUTH)
1704
+
1705
+
1706
+ def DrawPanelBorder(self, dc, rect, primary_colour, secondary_colour):
1707
+
1708
+ border_points = [wx.Point() for i in range(9)]
1709
+ border_points[0] = wx.Point(2, 0)
1710
+ border_points[1] = wx.Point(rect.width - 3, 0)
1711
+ border_points[2] = wx.Point(rect.width - 1, 2)
1712
+ border_points[3] = wx.Point(rect.width - 1, rect.height - 3)
1713
+ border_points[4] = wx.Point(rect.width - 3, rect.height - 1)
1714
+ border_points[5] = wx.Point(2, rect.height - 1)
1715
+ border_points[6] = wx.Point(0, rect.height - 3)
1716
+ border_points[7] = wx.Point(0, 2)
1717
+
1718
+ if primary_colour.GetColour() == secondary_colour.GetColour():
1719
+ border_points[8] = border_points[0]
1720
+ dc.SetPen(primary_colour)
1721
+ dc.DrawLines(border_points, rect.x, rect.y)
1722
+ else:
1723
+ dc.SetPen(primary_colour)
1724
+ dc.DrawLines(border_points[0:3], rect.x, rect.y)
1725
+
1726
+ SingleLine(dc, rect, border_points[0], border_points[7])
1727
+ dc.SetPen(secondary_colour)
1728
+ dc.DrawLines(border_points[4:7], rect.x, rect.y)
1729
+ SingleLine(dc, rect, border_points[4], border_points[3])
1730
+
1731
+ border_points[6] = border_points[2]
1732
+ RibbonDrawParallelGradientLines(dc, 2, border_points[6:8], 0, 1,
1733
+ border_points[3].y - border_points[2].y + 1, rect.x, rect.y,
1734
+ primary_colour.GetColour(), secondary_colour.GetColour())
1735
+
1736
+
1737
+ def DrawMinimisedPanel(self, dc, wnd, rect, bitmap):
1738
+ """
1739
+ Draw a minimised ribbon panel.
1740
+
1741
+ :param `dc`: The device context to draw onto;
1742
+ :param `wnd`: The window which is being drawn onto, which is always the panel
1743
+ which is minimised. The panel label can be obtained from this window. The
1744
+ minimised icon obtained from querying the window may not be the size requested
1745
+ by :meth:`~RibbonMSWArtProvider.GetMinimisedPanelMinimumSize` - the argument contains the icon in the
1746
+ requested size;
1747
+ :param `rect`: The rectangle within which to draw. The size of the rectangle
1748
+ will be at least the size returned by :meth:`~RibbonMSWArtProvider.GetMinimisedPanelMinimumSize`;
1749
+ :param `bitmap`: A copy of the panel's minimised bitmap rescaled to the size
1750
+ returned by :meth:`~RibbonMSWArtProvider.GetMinimisedPanelMinimumSize`.
1751
+
1752
+ """
1753
+
1754
+ self.DrawPartialPageBackground(dc, wnd, rect, False)
1755
+
1756
+ true_rect = wx.Rect(*rect)
1757
+ true_rect = self.RemovePanelPadding(true_rect)
1758
+
1759
+ if wnd.GetExpandedPanel() is not None:
1760
+ client_rect = wx.Rect(*true_rect)
1761
+ client_rect.x += 1
1762
+ client_rect.width -= 2
1763
+ client_rect.y += 1
1764
+ client_rect.height = (rect.y + rect.height // 5) - client_rect.x
1765
+ dc.GradientFillLinear(client_rect,
1766
+ self._panel_active_background_top_colour,
1767
+ self._panel_active_background_top_gradient_colour, wx.SOUTH)
1768
+
1769
+ client_rect.y += client_rect.height
1770
+ client_rect.height = (true_rect.y + true_rect.height) - client_rect.y
1771
+ dc.GradientFillLinear(client_rect,
1772
+ self._panel_active_background_colour,
1773
+ self._panel_active_background_gradient_colour, wx.SOUTH)
1774
+
1775
+ elif wnd.IsHovered():
1776
+ client_rect = wx.Rect(*true_rect)
1777
+ client_rect.x += 1
1778
+ client_rect.width -= 2
1779
+ client_rect.y += 1
1780
+ client_rect.height -= 2
1781
+ self.DrawPartialPageBackground(dc, wnd, client_rect, True)
1782
+
1783
+ preview = self.DrawMinimisedPanelCommon(dc, wnd, true_rect)
1784
+
1785
+ dc.SetBrush(self._panel_hover_label_background_brush)
1786
+ dc.SetPen(wx.TRANSPARENT_PEN)
1787
+ dc.DrawRectangle(preview.x + 1, preview.y + preview.height - 8, preview.width - 2, 7)
1788
+
1789
+ mid_pos = rect.y + rect.height // 5 - preview.y
1790
+
1791
+ if mid_pos < 0 or mid_pos >= preview.height:
1792
+ full_rect = wx.Rect(*preview)
1793
+ full_rect.x += 1
1794
+ full_rect.y += 1
1795
+ full_rect.width -= 2
1796
+ full_rect.height -= 9
1797
+ if mid_pos < 0:
1798
+ dc.GradientFillLinear(full_rect, self._page_hover_background_colour,
1799
+ self._page_hover_background_gradient_colour, wx.SOUTH)
1800
+ else:
1801
+ dc.GradientFillLinear(full_rect, self._page_hover_background_top_colour,
1802
+ self._page_hover_background_top_gradient_colour, wx.SOUTH)
1803
+
1804
+ else:
1805
+ top_rect = wx.Rect(*preview)
1806
+ top_rect.x += 1
1807
+ top_rect.y += 1
1808
+ top_rect.width -= 2
1809
+ top_rect.height = mid_pos
1810
+ dc.GradientFillLinear(top_rect, self._page_hover_background_top_colour,
1811
+ self._page_hover_background_top_gradient_colour, wx.SOUTH)
1812
+
1813
+ btm_rect = wx.Rect(*top_rect)
1814
+ btm_rect.y = preview.y + mid_pos
1815
+ btm_rect.height = preview.y + preview.height - 7 - btm_rect.y
1816
+ dc.GradientFillLinear(btm_rect, self._page_hover_background_colour,
1817
+ self._page_hover_background_gradient_colour, wx.SOUTH)
1818
+
1819
+ if bitmap.IsOk():
1820
+ dc.DrawBitmap(bitmap, preview.x + (preview.width - bitmap.GetWidth()) // 2,
1821
+ preview.y + (preview.height - 7 - bitmap.GetHeight()) // 2, True)
1822
+
1823
+ self.DrawPanelBorder(dc, preview, self._panel_border_pen, self._panel_border_gradient_pen)
1824
+ self.DrawPanelBorder(dc, true_rect, self._panel_minimised_border_pen, self._panel_minimised_border_gradient_pen)
1825
+
1826
+
1827
+ def DrawMinimisedPanelCommon(self, dc, wnd, true_rect):
1828
+
1829
+ preview = wx.Rect(0, 0, 32, 32)
1830
+
1831
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1832
+ preview.x = true_rect.x + 4
1833
+ preview.y = true_rect.y + (true_rect.height - preview.height) // 2
1834
+ else:
1835
+ preview.x = true_rect.x + (true_rect.width - preview.width) // 2
1836
+ preview.y = true_rect.y + 4
1837
+
1838
+ dc.SetFont(self._panel_label_font)
1839
+ label_width, label_height = dc.GetTextExtent(wnd.GetLabel())
1840
+
1841
+ xpos = true_rect.x + (true_rect.width - label_width + 1) // 2
1842
+ ypos = preview.y + preview.height + 5
1843
+
1844
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1845
+ xpos = preview.x + preview.width + 5
1846
+ ypos = true_rect.y + (true_rect.height - label_height) // 2
1847
+
1848
+ dc.SetTextForeground(self._panel_minimised_label_colour)
1849
+ dc.DrawText(wnd.GetLabel(), xpos, ypos)
1850
+
1851
+ arrow_points = [wx.Point() for i in range(3)]
1852
+
1853
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
1854
+ xpos += label_width
1855
+ arrow_points[0] = wx.Point(xpos + 5, ypos + label_height // 2)
1856
+ arrow_points[1] = arrow_points[0] + wx.Point(-3, 3)
1857
+ arrow_points[2] = arrow_points[0] + wx.Point(-3, -3)
1858
+ else:
1859
+ ypos += label_height
1860
+ arrow_points[0] = wx.Point(true_rect.width // 2, ypos + 5)
1861
+ arrow_points[1] = arrow_points[0] + wx.Point(-3, -3)
1862
+ arrow_points[2] = arrow_points[0] + wx.Point( 3, -3)
1863
+
1864
+ dc.SetPen(wx.TRANSPARENT_PEN)
1865
+ B = wx.Brush(self._panel_minimised_label_colour)
1866
+ dc.SetBrush(B)
1867
+ dc.DrawPolygon(arrow_points, true_rect.x, true_rect.y)
1868
+
1869
+ return preview
1870
+
1871
+
1872
+ def DrawButtonBarBackground(self, dc, wnd, rect):
1873
+ """
1874
+ Draw the background for a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar` control.
1875
+
1876
+ :param `dc`: The device context to draw onto;
1877
+ :param `wnd`: The window which is being drawn onto (which will typically be
1878
+ the button bar itself, though this is not guaranteed);
1879
+ :param `rect`: The rectangle within which to draw.
1880
+
1881
+ """
1882
+
1883
+ self.DrawPartialPageBackground(dc, wnd, rect, True)
1884
+
1885
+
1886
+ def DrawPartialPageBackground2(self, dc, wnd, rect, allow_hovered=True):
1887
+
1888
+ # Assume the window is a child of a ribbon page, and also check for a
1889
+ # hovered panel somewhere between the window and the page, as it causes
1890
+ # the background to change.
1891
+ offset = wx.Point(*wnd.GetPosition())
1892
+ page = None
1893
+ parent = wnd.GetParent()
1894
+ hovered = False
1895
+ panel = None
1896
+
1897
+ if isinstance(wnd, PANEL.RibbonPanel):
1898
+ panel = wnd
1899
+ hovered = allow_hovered and panel.IsHovered()
1900
+ if panel.GetExpandedDummy() is not None:
1901
+ offset = panel.GetExpandedDummy().GetPosition()
1902
+ parent = panel.GetExpandedDummy().GetParent()
1903
+
1904
+ while 1:
1905
+
1906
+ if panel is None:
1907
+ panel = parent
1908
+ if isinstance(panel, PANEL.RibbonPanel):
1909
+ hovered = allow_hovered and panel.IsHovered()
1910
+ if panel.GetExpandedDummy() is not None:
1911
+ parent = panel.GetExpandedDummy()
1912
+
1913
+ page = parent
1914
+ if isinstance(page, PAGE.RibbonPage):
1915
+ break
1916
+
1917
+ offset += parent.GetPosition()
1918
+ parent = parent.GetParent()
1919
+ if parent is None:
1920
+ break
1921
+
1922
+ if page is not None:
1923
+ self.DrawPartialPageBackground(dc, wnd, rect, page, offset, hovered)
1924
+ return
1925
+
1926
+ # No page found - fallback to painting with a stock brush
1927
+ dc.SetBrush(wx.WHITE_BRUSH)
1928
+ dc.SetPen(wx.TRANSPARENT_PEN)
1929
+ dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height)
1930
+
1931
+
1932
+ def DrawButtonBarButton(self, dc, wnd, rect, kind, state, label, bitmap_large, bitmap_small):
1933
+ """
1934
+ Draw a single button for a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar` control.
1935
+
1936
+ :param `dc`: The device context to draw onto;
1937
+ :param `wnd`: The window which is being drawn onto;
1938
+ :param `rect`: The rectangle within which to draw. The size of this rectangle
1939
+ will be a size previously returned by :meth:`~RibbonMSWArtProvider.GetButtonBarButtonSize`, and the
1940
+ rectangle will be entirely within a rectangle on the same device context
1941
+ previously painted with :meth:`~RibbonMSWArtProvider.DrawButtonBarBackground`;
1942
+ :param `kind`: The kind of button to draw (normal, dropdown or hybrid);
1943
+ :param `state`: Combination of a size flag and state flags from the
1944
+ `RibbonButtonBarButtonState` enumeration;
1945
+ :param `label`: The label of the button;
1946
+ :param `bitmap_large`: The large bitmap of the button (or the large disabled
1947
+ bitmap when ``RIBBON_BUTTONBAR_BUTTON_DISABLED`` is set in `state`);
1948
+ :param `bitmap_small`: The small bitmap of the button (or the small disabled
1949
+ bitmap when ``RIBBON_BUTTONBAR_BUTTON_DISABLED`` is set in `state`).
1950
+
1951
+ """
1952
+
1953
+ if kind == RIBBON_BUTTON_TOGGLE:
1954
+ kind = RIBBON_BUTTON_NORMAL
1955
+ if state & RIBBON_BUTTONBAR_BUTTON_TOGGLED:
1956
+ state ^= RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK
1957
+
1958
+ if state & (RIBBON_BUTTONBAR_BUTTON_HOVER_MASK | RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK):
1959
+ if state & RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK:
1960
+ dc.SetPen(self._button_bar_active_border_pen)
1961
+ else:
1962
+ dc.SetPen(self._button_bar_hover_border_pen)
1963
+
1964
+ bg_rect = wx.Rect(*rect)
1965
+ bg_rect.x += 1
1966
+ bg_rect.y += 1
1967
+ bg_rect.width -= 2
1968
+ bg_rect.height -= 2
1969
+
1970
+ bg_rect_top = wx.Rect(*bg_rect)
1971
+ bg_rect_top.height //= 3
1972
+ bg_rect.y += bg_rect_top.height
1973
+ bg_rect.height -= bg_rect_top.height
1974
+
1975
+ if kind == RIBBON_BUTTON_HYBRID:
1976
+
1977
+ result = state & RIBBON_BUTTONBAR_BUTTON_SIZE_MASK
1978
+
1979
+ if result == RIBBON_BUTTONBAR_BUTTON_LARGE:
1980
+ iYBorder = rect.y + bitmap_large.GetHeight() + 4
1981
+ partial_bg = wx.Rect(*rect)
1982
+
1983
+ if state & RIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED:
1984
+ partial_bg.SetBottom(iYBorder - 1)
1985
+ else:
1986
+ partial_bg.height -= (iYBorder - partial_bg.y + 1)
1987
+ partial_bg.y = iYBorder + 1
1988
+
1989
+ dc.DrawLine(rect.x, iYBorder, rect.x + rect.width, iYBorder)
1990
+ bg_rect.Intersect(partial_bg)
1991
+ bg_rect_top.Intersect(partial_bg)
1992
+
1993
+ elif result == RIBBON_BUTTONBAR_BUTTON_MEDIUM:
1994
+ iArrowWidth = 9
1995
+
1996
+ if state & RIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED:
1997
+ bg_rect.width -= iArrowWidth
1998
+ bg_rect_top.width -= iArrowWidth
1999
+ dc.DrawLine(bg_rect_top.x + bg_rect_top.width, rect.y, bg_rect_top.x + bg_rect_top.width,
2000
+ rect.y + rect.height)
2001
+ else:
2002
+ iArrowWidth -= 1
2003
+ bg_rect.x += bg_rect.width - iArrowWidth
2004
+ bg_rect_top.x += bg_rect_top.width - iArrowWidth
2005
+ bg_rect.width = iArrowWidth
2006
+ bg_rect_top.width = iArrowWidth
2007
+ dc.DrawLine(bg_rect_top.x - 1, rect.y, bg_rect_top.x - 1, rect.y + rect.height)
2008
+
2009
+ if state & RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK:
2010
+
2011
+ dc.GradientFillLinear(bg_rect_top, self._button_bar_active_background_top_colour,
2012
+ self._button_bar_active_background_top_gradient_colour, wx.SOUTH)
2013
+ dc.GradientFillLinear(bg_rect, self._button_bar_active_background_colour,
2014
+ self._button_bar_active_background_gradient_colour, wx.SOUTH)
2015
+
2016
+ else:
2017
+ dc.GradientFillLinear(bg_rect_top, self._button_bar_hover_background_top_colour,
2018
+ self._button_bar_hover_background_top_gradient_colour, wx.SOUTH)
2019
+ dc.GradientFillLinear(bg_rect, self._button_bar_hover_background_colour,
2020
+ self._button_bar_hover_background_gradient_colour, wx.SOUTH)
2021
+
2022
+ border_points = [wx.Point() for i in range(9)]
2023
+ border_points[0] = wx.Point(2, 0)
2024
+ border_points[1] = wx.Point(rect.width - 3, 0)
2025
+ border_points[2] = wx.Point(rect.width - 1, 2)
2026
+ border_points[3] = wx.Point(rect.width - 1, rect.height - 3)
2027
+ border_points[4] = wx.Point(rect.width - 3, rect.height - 1)
2028
+ border_points[5] = wx.Point(2, rect.height - 1)
2029
+ border_points[6] = wx.Point(0, rect.height - 3)
2030
+ border_points[7] = wx.Point(0, 2)
2031
+ border_points[8] = border_points[0]
2032
+
2033
+ dc.DrawLines(border_points, rect.x, rect.y)
2034
+
2035
+ dc.SetFont(self._button_bar_label_font)
2036
+ dc.SetTextForeground(self._button_bar_label_colour)
2037
+ self.DrawButtonBarButtonForeground(dc, rect, kind, state, label, bitmap_large, bitmap_small)
2038
+
2039
+
2040
+ def DrawButtonBarButtonForeground(self, dc, rect, kind, state, label, bitmap_large, bitmap_small):
2041
+
2042
+ result = state & RIBBON_BUTTONBAR_BUTTON_SIZE_MASK
2043
+
2044
+ if result == RIBBON_BUTTONBAR_BUTTON_LARGE:
2045
+
2046
+ padding = 2
2047
+ dc.DrawBitmap(bitmap_large, rect.x + (rect.width - bitmap_large.GetWidth()) // 2,
2048
+ rect.y + padding, True)
2049
+ ypos = rect.y + padding + bitmap_large.GetHeight() + padding
2050
+ arrow_width = (kind == RIBBON_BUTTON_NORMAL and [0] or [8])[0]
2051
+
2052
+ label_w, label_h = dc.GetTextExtent(label)
2053
+
2054
+ if label_w + 2 * padding <= rect.width:
2055
+
2056
+ dc.DrawText(label, rect.x + (rect.width - label_w) // 2, ypos)
2057
+ if arrow_width != 0:
2058
+ self.DrawDropdownArrow(dc, rect.x + rect.width // 2,
2059
+ ypos + (label_h * 3) // 2,
2060
+ self._button_bar_label_colour)
2061
+ else:
2062
+ breaki = len(label)
2063
+
2064
+ while breaki > 0:
2065
+ breaki -= 1
2066
+ if RibbonCanLabelBreakAtPosition(label, breaki):
2067
+ label_top = label[0:breaki]
2068
+ label_w, label_h = dc.GetTextExtent(label_top)
2069
+
2070
+ if label_w + 2 * padding <= rect.width:
2071
+ dc.DrawText(label_top, rect.x + (rect.width - label_w) // 2, ypos)
2072
+ ypos += label_h
2073
+ label_bottom = label[breaki:]
2074
+ label_w, label_h = dc.GetTextExtent(label_bottom)
2075
+ label_w += arrow_width
2076
+ iX = rect.x + (rect.width - label_w) // 2
2077
+ dc.DrawText(label_bottom, iX, ypos)
2078
+
2079
+ if arrow_width != 0:
2080
+ self.DrawDropdownArrow(dc, iX + 2 +label_w - arrow_width,
2081
+ ypos + label_h // 2 + 1,
2082
+ self._button_bar_label_colour)
2083
+
2084
+ break
2085
+
2086
+ elif result == RIBBON_BUTTONBAR_BUTTON_MEDIUM:
2087
+
2088
+ x_cursor = rect.x + 2
2089
+ dc.DrawBitmap(bitmap_small, x_cursor, rect.y + (rect.height - bitmap_small.GetHeight())//2, True)
2090
+ x_cursor += bitmap_small.GetWidth() + 2
2091
+ label_w, label_h = dc.GetTextExtent(label)
2092
+ dc.DrawText(label, x_cursor, rect.y + (rect.height - label_h) // 2)
2093
+ x_cursor += label_w + 3
2094
+
2095
+ if kind != RIBBON_BUTTON_NORMAL:
2096
+ self.DrawDropdownArrow(dc, x_cursor, rect.y + rect.height // 2,
2097
+ self._button_bar_label_colour)
2098
+
2099
+ else:
2100
+ # TODO
2101
+ pass
2102
+
2103
+
2104
+ def DrawToolBarBackground(self, dc, wnd, rect):
2105
+ """
2106
+ Draw the background for a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control.
2107
+
2108
+
2109
+ :param `dc`: The device context to draw onto;
2110
+ :param `wnd`: The which is being drawn onto. In most cases this will be a
2111
+ :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`, but it doesn't have to be;
2112
+ :param `rect`: The rectangle within which to draw. Some of this rectangle
2113
+ will later be drawn over using :meth:`~RibbonMSWArtProvider.DrawToolGroupBackground` and :meth:`~RibbonMSWArtProvider.DrawTool`,
2114
+ but not all of it will (unless there is only a single group of tools).
2115
+
2116
+ """
2117
+
2118
+ self.DrawPartialPageBackground(dc, wnd, rect)
2119
+
2120
+
2121
+ def DrawToolGroupBackground(self, dc, wnd, rect):
2122
+ """
2123
+ Draw the background for a group of tools on a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control.
2124
+
2125
+ :param `dc`: The device context to draw onto;
2126
+ :param `wnd`: The window which is being drawn onto. In most cases this will
2127
+ be a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`, but it doesn't have to be;
2128
+ :param `rect`: The rectangle within which to draw. This rectangle is a union
2129
+ of the individual tools' rectangles. As there are no gaps between tools,
2130
+ this rectangle will be painted over exactly once by calls to :meth:`~RibbonMSWArtProvider.DrawTool`.
2131
+ The group background could therefore be painted by :meth:`~RibbonMSWArtProvider.DrawTool`, though it
2132
+ can be conceptually easier and more efficient to draw it all at once here.
2133
+ The rectangle will be entirely within a rectangle on the same device context
2134
+ previously painted with :meth:`~RibbonMSWArtProvider.DrawToolBarBackground`.
2135
+
2136
+ """
2137
+
2138
+ dc.SetPen(self._toolbar_border_pen)
2139
+ outline = [wx.Point() for i in range(9)]
2140
+ outline[0] = wx.Point(2, 0)
2141
+ outline[1] = wx.Point(rect.width - 3, 0)
2142
+ outline[2] = wx.Point(rect.width - 1, 2)
2143
+ outline[3] = wx.Point(rect.width - 1, rect.height - 3)
2144
+ outline[4] = wx.Point(rect.width - 3, rect.height - 1)
2145
+ outline[5] = wx.Point(2, rect.height - 1)
2146
+ outline[6] = wx.Point(0, rect.height - 3)
2147
+ outline[7] = wx.Point(0, 2)
2148
+ outline[8] = outline[0]
2149
+
2150
+ dc.DrawLines(outline, rect.x, rect.y)
2151
+
2152
+
2153
+ def DrawTool(self, dc, wnd, rect, bitmap, kind, state):
2154
+ """
2155
+ Draw a single tool (for a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control).
2156
+
2157
+ :param `dc`: The device context to draw onto;
2158
+ :param `wnd`: The window which is being drawn onto. In most cases this will
2159
+ be a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`, but it doesn't have to be;
2160
+ :param `rect`: The rectangle within which to draw. The size of this rectangle
2161
+ will at least the size returned by :meth:`~RibbonMSWArtProvider.GetToolSize`, and the height of it will
2162
+ be equal for all tools within the same group. The rectangle will be entirely
2163
+ within a rectangle on the same device context previously painted with
2164
+ :meth:`~RibbonMSWArtProvider.DrawToolGroupBackground`;
2165
+ :param `bitmap`: The bitmap to use as the tool's foreground. If the tool is a
2166
+ hybrid or dropdown tool, then the foreground should also contain a standard
2167
+ dropdown button;
2168
+ :param `kind`: The kind of tool to draw (normal, dropdown, or hybrid);
2169
+ :param `state`: A combination of `RibbonToolBarToolState` flags giving the
2170
+ state of the tool and it's relative position within a tool group.
2171
+
2172
+ """
2173
+
2174
+ if kind == RIBBON_BUTTON_TOGGLE:
2175
+ if state & RIBBON_TOOLBAR_TOOL_TOGGLED:
2176
+ state ^= RIBBON_TOOLBAR_TOOL_ACTIVE_MASK
2177
+
2178
+ bg_rect = wx.Rect(*rect)
2179
+ bg_rect.Deflate(1, 1)
2180
+
2181
+ if state & RIBBON_TOOLBAR_TOOL_LAST == 0:
2182
+ bg_rect.width += 1
2183
+
2184
+ is_split_hybrid = (kind == RIBBON_BUTTON_HYBRID and (state & (RIBBON_TOOLBAR_TOOL_HOVER_MASK | RIBBON_TOOLBAR_TOOL_ACTIVE_MASK)))
2185
+
2186
+ # Background
2187
+ bg_rect_top = wx.Rect(*bg_rect)
2188
+ bg_rect_top.height = (bg_rect_top.height * 2) // 5
2189
+ bg_rect_btm = wx.Rect(*bg_rect)
2190
+ bg_rect_btm.y += bg_rect_top.height
2191
+ bg_rect_btm.height -= bg_rect_top.height
2192
+
2193
+ bg_top_colour = self._tool_background_top_colour
2194
+ bg_top_grad_colour = self._tool_background_top_gradient_colour
2195
+ bg_colour = self._tool_background_colour
2196
+ bg_grad_colour = self._tool_background_gradient_colour
2197
+
2198
+ if state & RIBBON_TOOLBAR_TOOL_ACTIVE_MASK:
2199
+ bg_top_colour = self._tool_active_background_top_colour
2200
+ bg_top_grad_colour = self._tool_active_background_top_gradient_colour
2201
+ bg_colour = self._tool_active_background_colour
2202
+ bg_grad_colour = self._tool_active_background_gradient_colour
2203
+
2204
+ elif state & RIBBON_TOOLBAR_TOOL_HOVER_MASK:
2205
+ bg_top_colour = self._tool_hover_background_top_colour
2206
+ bg_top_grad_colour = self._tool_hover_background_top_gradient_colour
2207
+ bg_colour = self._tool_hover_background_colour
2208
+ bg_grad_colour = self._tool_hover_background_gradient_colour
2209
+
2210
+ dc.GradientFillLinear(bg_rect_top, bg_top_colour, bg_top_grad_colour, wx.SOUTH)
2211
+ dc.GradientFillLinear(bg_rect_btm, bg_colour, bg_grad_colour, wx.SOUTH)
2212
+
2213
+ if is_split_hybrid:
2214
+ nonrect = wx.Rect(*bg_rect)
2215
+ if state & (RIBBON_TOOLBAR_TOOL_DROPDOWN_HOVERED | RIBBON_TOOLBAR_TOOL_DROPDOWN_ACTIVE):
2216
+ nonrect.width -= 8
2217
+ else:
2218
+ nonrect.x += nonrect.width - 8
2219
+ nonrect.width = 8
2220
+
2221
+ B = wx.Brush(self._tool_hover_background_top_colour)
2222
+ dc.SetPen(wx.TRANSPARENT_PEN)
2223
+ dc.SetBrush(B)
2224
+ dc.DrawRectangle(nonrect.x, nonrect.y, nonrect.width, nonrect.height)
2225
+
2226
+ # Border
2227
+ dc.SetPen(self._toolbar_border_pen)
2228
+
2229
+ if state & RIBBON_TOOLBAR_TOOL_FIRST:
2230
+ dc.DrawPoint(rect.x + 1, rect.y + 1)
2231
+ dc.DrawPoint(rect.x + 1, rect.y + rect.height - 2)
2232
+ else:
2233
+ dc.DrawLine(rect.x, rect.y + 1, rect.x, rect.y + rect.height - 1)
2234
+
2235
+ if state & RIBBON_TOOLBAR_TOOL_LAST:
2236
+ dc.DrawPoint(rect.x + rect.width - 2, rect.y + 1)
2237
+ dc.DrawPoint(rect.x + rect.width - 2, rect.y + rect.height - 2)
2238
+
2239
+ # Foreground
2240
+ avail_width = bg_rect.GetWidth()
2241
+
2242
+ if kind & RIBBON_BUTTON_DROPDOWN:
2243
+ avail_width -= 8
2244
+ if is_split_hybrid:
2245
+ dc.DrawLine(rect.x + avail_width + 1, rect.y, rect.x + avail_width + 1, rect.y + rect.height)
2246
+
2247
+ dc.DrawBitmap(self._toolbar_drop_bitmap, bg_rect.x + avail_width + 2,
2248
+ bg_rect.y + (bg_rect.height // 2) - 2, True)
2249
+
2250
+ dc.DrawBitmap(bitmap, bg_rect.x + (avail_width - bitmap.GetWidth()) // 2,
2251
+ bg_rect.y + (bg_rect.height - bitmap.GetHeight()) // 2, True)
2252
+
2253
+
2254
+ def GetBarTabWidth(self, dc, wnd, label, bitmap, ideal=None, small_begin_need_separator=None,
2255
+ small_must_have_separator=None, minimum=None):
2256
+
2257
+ """
2258
+ Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar.
2259
+
2260
+ :param `dc`: A device context to use when one is required for size calculations;
2261
+ :param `wnd`: The window onto which the tab will eventually be drawn;
2262
+ :param `label`: The tab's label (or "" if it has none);
2263
+ :param `bitmap`: The tab's icon (or :class:`NullBitmap` if it has none);
2264
+ :param `ideal`: The ideal width (in pixels) of the tab;
2265
+ :param `small_begin_need_separator`: A size less than the size, at which a
2266
+ tab separator should begin to be drawn (i.e. drawn, but still fairly transparent);
2267
+ :param `small_must_have_separator`: A size less than the size, at which a
2268
+ tab separator must be drawn (i.e. drawn at full opacity);
2269
+ :param `minimum`: A size less than the size, and greater than or equal to
2270
+ zero, which is the minimum pixel width for the tab.
2271
+
2272
+ """
2273
+
2274
+ width = 0
2275
+ mini = 0
2276
+
2277
+ if (self._flags & RIBBON_BAR_SHOW_PAGE_LABELS) and label.strip():
2278
+ dc.SetFont(self._tab_label_font)
2279
+ width += dc.GetTextExtent(label)[0]
2280
+ mini += min(25, width) # enough for a few chars
2281
+
2282
+ if bitmap.IsOk():
2283
+ # gap between label and bitmap
2284
+ width += 4
2285
+ mini += 2
2286
+
2287
+ if (self._flags & RIBBON_BAR_SHOW_PAGE_ICONS) and bitmap.IsOk():
2288
+ width += bitmap.GetWidth()
2289
+ mini += bitmap.GetWidth()
2290
+
2291
+ ideal = width + 30
2292
+ small_begin_need_separator = width + 20
2293
+ small_must_have_separator = width + 10
2294
+ minimum = mini
2295
+
2296
+ return ideal, small_begin_need_separator, small_must_have_separator, minimum
2297
+
2298
+
2299
+ def GetTabCtrlHeight(self, dc, wnd, pages):
2300
+ """
2301
+ Calculate the height (in pixels) of the tab region of a ribbon bar.
2302
+
2303
+ Note that as the tab region can contain scroll buttons, the height should be
2304
+ greater than or equal to the minimum height for a tab scroll button.
2305
+
2306
+ :param `dc`: A device context to use when one is required for size calculations;
2307
+ :param `wnd`: The window onto which the tabs will eventually be drawn;
2308
+ :param `pages`: The tabs which will acquire the returned height.
2309
+
2310
+ """
2311
+
2312
+ text_height = 0
2313
+ icon_height = 0
2314
+
2315
+ if len(pages) <= 1 and (self._flags & RIBBON_BAR_ALWAYS_SHOW_TABS) == 0:
2316
+ # To preserve space, a single tab need not be displayed. We still need
2317
+ # two pixels of border / padding though.
2318
+ return 2
2319
+
2320
+ if self._flags & RIBBON_BAR_SHOW_PAGE_LABELS:
2321
+ dc.SetFont(self._tab_label_font)
2322
+ text_height = dc.GetTextExtent("ABCDEFXj")[1] + 10
2323
+
2324
+ if self._flags & RIBBON_BAR_SHOW_PAGE_ICONS:
2325
+ for info in pages:
2326
+ if info.page.GetIcon().IsOk():
2327
+ icon_height = max(icon_height, info.page.GetIcon().GetHeight() + 4)
2328
+
2329
+ return max(text_height, icon_height)
2330
+
2331
+
2332
+ def GetScrollButtonMinimumSize(self, dc, wnd, style):
2333
+ """
2334
+ Calculate the minimum size (in pixels) of a scroll button.
2335
+
2336
+ :param `dc`: A device context to use when one is required for size calculations;
2337
+ :param `wnd`: The window onto which the scroll button will eventually be drawn;
2338
+ :param `style`: A combination of flags from `RibbonScrollButtonStyle`, including
2339
+ a direction, and a for flag (state flags may be given too, but should be ignored,
2340
+ as a button should retain a constant size, regardless of its state).
2341
+
2342
+ """
2343
+
2344
+ return wx.Size(12, 12)
2345
+
2346
+
2347
+ def GetPanelSize(self, dc, wnd, client_size, client_offset=None):
2348
+ """
2349
+ Calculate the size of a panel for a given client size.
2350
+
2351
+ This should increment the given size by enough to fit the panel label and other
2352
+ chrome.
2353
+
2354
+ :param `dc`: A device context to use if one is required for size calculations;
2355
+ :param `wnd`: The ribbon panel in question;
2356
+ :param `client_size`: The client size;
2357
+ :param `client_offset`: The offset where the client rectangle begins within the
2358
+ panel (may be ``None``).
2359
+
2360
+ :see: :meth:`~RibbonMSWArtProvider.GetPanelClientSize`
2361
+ """
2362
+
2363
+ dc.SetFont(self._panel_label_font)
2364
+ label_size = wx.Size(*dc.GetTextExtent(wnd.GetLabel()))
2365
+
2366
+ client_size.IncBy(0, label_size.GetHeight())
2367
+
2368
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2369
+ client_size.IncBy(4, 8)
2370
+ else:
2371
+ client_size.IncBy(6, 6)
2372
+
2373
+ if client_offset is not None:
2374
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2375
+ client_offset = wx.Point(2, 3)
2376
+ else:
2377
+ client_offset = wx.Point(3, 2)
2378
+
2379
+ return client_size
2380
+
2381
+
2382
+ def GetPanelClientSize(self, dc, wnd, size, client_offset=None):
2383
+ """
2384
+ Calculate the client size of a panel for a given overall size.
2385
+
2386
+ This should act as the inverse to :meth:`~RibbonMSWArtProvider.GetPanelSize`, and decrement the given size
2387
+ by enough to fit the panel label and other chrome.
2388
+
2389
+ :param `dc`: A device context to use if one is required for size calculations;
2390
+ :param `wnd`: The ribbon panel in question;
2391
+ :param `size`: The overall size to calculate client size for;
2392
+ :param `client_offset`: The offset where the returned client size begins within
2393
+ the given (may be ``None``).
2394
+
2395
+ :see: :meth:`~RibbonMSWArtProvider.GetPanelSize`
2396
+ """
2397
+
2398
+ dc.SetFont(self._panel_label_font)
2399
+ label_size = wx.Size(*dc.GetTextExtent(wnd.GetLabel()))
2400
+
2401
+ size.DecBy(0, label_size.GetHeight())
2402
+
2403
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2404
+ size.DecBy(4, 8)
2405
+ else:
2406
+ size.DecBy(6, 6)
2407
+
2408
+ if client_offset is not None:
2409
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2410
+ client_offset = wx.Point(2, 3)
2411
+ else:
2412
+ client_offset = wx.Point(3, 2)
2413
+
2414
+ if size.x < 0:
2415
+ size.x = 0
2416
+ if size.y < 0:
2417
+ size.y = 0
2418
+
2419
+ return size, client_offset
2420
+
2421
+
2422
+ def GetGallerySize(self, dc, wnd, client_size):
2423
+ """
2424
+ Calculate the size of a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control for a given client size.
2425
+
2426
+ This should increment the given size by enough to fit the gallery border,
2427
+ buttons, and any other chrome.
2428
+
2429
+ :param `dc`: A device context to use if one is required for size calculations;
2430
+ :param `wnd`: The gallery in question;
2431
+ :param `client_size`: The client size.
2432
+
2433
+ :see: :meth:`~RibbonMSWArtProvider.GetGalleryClientSize`
2434
+ """
2435
+
2436
+ client_size.IncBy(2, 1) # Left / top padding
2437
+
2438
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2439
+ client_size.IncBy(1, 16) # Right / bottom padding
2440
+ else:
2441
+ client_size.IncBy(16, 1) # Right / bottom padding
2442
+
2443
+ return client_size
2444
+
2445
+
2446
+ def GetGalleryClientSize(self, dc, wnd, size, client_offset=None, scroll_up_button=None,
2447
+ scroll_down_button=None, extension_button=None):
2448
+
2449
+ """
2450
+ Calculate the client size of a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control for a given size.
2451
+
2452
+ This should act as the inverse to :meth:`~RibbonMSWArtProvider.GetGallerySize`, and decrement the given
2453
+ size by enough to fir the gallery border, buttons, and other chrome.
2454
+
2455
+ :param `dc`: A device context to use if one is required for size calculations;
2456
+ :param `wnd`: The gallery in question;
2457
+ :param `size`: The overall size to calculate the client size for;
2458
+ :param `client_offset`: The position within the given size at which the
2459
+ returned client size begins;
2460
+ :param `scroll_up_button`: The rectangle within the given size which the
2461
+ scroll up button occupies;
2462
+ :param `scroll_down_button`: The rectangle within the given size which the
2463
+ scroll down button occupies;
2464
+ :param `extension_button`: The rectangle within the given size which the
2465
+ extension button occupies.
2466
+
2467
+ """
2468
+
2469
+ scroll_up = wx.Rect()
2470
+ scroll_down = wx.Rect()
2471
+ extension = wx.Rect()
2472
+
2473
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2474
+ # Flow is vertical - put buttons on bottom
2475
+ scroll_up.y = size.GetHeight() - 15
2476
+ scroll_up.height = 15
2477
+ scroll_up.x = 0
2478
+ scroll_up.width = (size.GetWidth() + 2) // 3
2479
+ scroll_down.y = scroll_up.y
2480
+ scroll_down.height = scroll_up.height
2481
+ scroll_down.x = scroll_up.x + scroll_up.width
2482
+ scroll_down.width = scroll_up.width
2483
+ extension.y = scroll_down.y
2484
+ extension.height = scroll_down.height
2485
+ extension.x = scroll_down.x + scroll_down.width
2486
+ extension.width = size.GetWidth() - scroll_up.width - scroll_down.width
2487
+ size.DecBy(1, 16)
2488
+ size.DecBy(2, 1)
2489
+
2490
+ else:
2491
+ # Flow is horizontal - put buttons on right
2492
+ scroll_up.x = size.GetWidth() - 15
2493
+ scroll_up.width = 15
2494
+ scroll_up.y = 0
2495
+ scroll_up.height = (size.GetHeight() + 2) // 3
2496
+ scroll_down.x = scroll_up.x
2497
+ scroll_down.width = scroll_up.width
2498
+ scroll_down.y = scroll_up.y + scroll_up.height
2499
+ scroll_down.height = scroll_up.height
2500
+ extension.x = scroll_down.x
2501
+ extension.width = scroll_down.width
2502
+ extension.y = scroll_down.y + scroll_down.height
2503
+ extension.height = size.GetHeight() - scroll_up.height - scroll_down.height
2504
+ size.DecBy(16, 1)
2505
+ size.DecBy( 2, 1)
2506
+
2507
+ client_offset = wx.Point(2, 1)
2508
+ scroll_up_button = scroll_up
2509
+ scroll_down_button = scroll_down
2510
+ extension_button = extension
2511
+
2512
+ return size, client_offset, scroll_up_button, scroll_down_button, extension_button
2513
+
2514
+
2515
+ def GetPageBackgroundRedrawArea(self, dc, wnd, page_old_size, page_new_size):
2516
+ """
2517
+ Calculate the portion of a page background which needs to be redrawn when a page
2518
+ is resized.
2519
+
2520
+ To optimise the drawing of page backgrounds, as small an area as possible should
2521
+ be returned. Of couse, if the way in which a background is drawn means that the
2522
+ entire background needs to be repainted on resize, then the entire new size
2523
+ should be returned.
2524
+
2525
+ :param `dc`: A device context to use when one is required for size calculations;
2526
+ :param `wnd`: The page which is being resized;
2527
+ :param `page_old_size`: The size of the page prior to the resize (which has
2528
+ already been painted);
2529
+ :param `page_new_size`: The size of the page after the resize.
2530
+
2531
+ """
2532
+
2533
+ if page_new_size.GetWidth() != page_old_size.GetWidth():
2534
+ if page_new_size.GetHeight() != page_old_size.GetHeight():
2535
+ # Width and height both changed - redraw everything
2536
+ return wx.Rect(0, 0, *page_new_size)
2537
+ else:
2538
+ # Only width changed - redraw right hand side
2539
+ right_edge_width = 4
2540
+ new_rect = wx.Rect(page_new_size.GetWidth() - right_edge_width, 0, right_edge_width, page_new_size.GetHeight())
2541
+ old_rect = wx.Rect(page_old_size.GetWidth() - right_edge_width, 0, right_edge_width, page_old_size.GetHeight())
2542
+
2543
+ else:
2544
+ if page_new_size.GetHeight() == page_old_size.GetHeight():
2545
+ # Nothing changed (should never happen) - redraw nothing
2546
+ return wx.Rect(0, 0, 0, 0)
2547
+ else:
2548
+ # Height changed - need to redraw everything (as the background
2549
+ # gradient is done vertically).
2550
+ return wx.Rect(0, 0, *page_new_size)
2551
+
2552
+ new_rect.Union(old_rect)
2553
+ new_rect.Intersect(wx.Rect(0, 0, *page_new_size))
2554
+ return new_rect
2555
+
2556
+
2557
+ def GetButtonBarButtonSize(self, dc, wnd, kind, size, label, bitmap_size_large, bitmap_size_small,
2558
+ button_size=None, normal_region=None, dropdown_region=None):
2559
+ """
2560
+ Calculate the size of a button within a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar`.
2561
+
2562
+ :param `dc`: A device context to use when one is required for size calculations;
2563
+ :param `wnd`: The window onto which the button will eventually be drawn
2564
+ (which is normally a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar`, though this is not guaranteed);
2565
+ :param `kind`: The kind of button;
2566
+ :param `size`: The size-class to calculate the size for. Buttons on a button
2567
+ bar can have three distinct sizes: ``RIBBON_BUTTONBAR_BUTTON_SMALL``,
2568
+ ``RIBBON_BUTTONBAR_BUTTON_MEDIUM``, and ``RIBBON_BUTTONBAR_BUTTON_LARGE``.
2569
+ If the requested size-class is not applicable, then ``False`` should be returned;
2570
+ :param `label`: The label of the button;
2571
+ :param `bitmap_size_large`: The size of all "large" bitmaps on the button bar;
2572
+ :param `bitmap_size_small`: The size of all "small" bitmaps on the button bar;
2573
+ :param `button_size`: The size, in pixels, of the button;
2574
+ :param `normal_region`: The region of the button which constitutes the normal button;
2575
+ :param `dropdown_region`: The region of the button which constitutes the dropdown button.
2576
+
2577
+ :returns: ``True`` if a size exists for the button, ``False`` otherwise.
2578
+ """
2579
+
2580
+ drop_button_width = 8
2581
+
2582
+ normal_region = wx.Rect()
2583
+ dropdown_region = wx.Rect()
2584
+
2585
+ dc.SetFont(self._button_bar_label_font)
2586
+ result = size & RIBBON_BUTTONBAR_BUTTON_SIZE_MASK
2587
+
2588
+ if result == RIBBON_BUTTONBAR_BUTTON_SMALL:
2589
+ # Small bitmap, no label
2590
+ button_size = wx.Size(bitmap_size_small + wx.Size(6, 4))
2591
+
2592
+ if kind in [RIBBON_BUTTON_NORMAL, RIBBON_BUTTON_TOGGLE]:
2593
+ normal_region = wx.Rect(0, 0, *button_size)
2594
+ dropdown_region = wx.Rect(0, 0, 0, 0)
2595
+
2596
+ elif kind == RIBBON_BUTTON_DROPDOWN:
2597
+ button_size += wx.Size(drop_button_width, 0)
2598
+ dropdown_region = wx.Rect(0, 0, *button_size)
2599
+ normal_region = wx.Rect(0, 0, 0, 0)
2600
+
2601
+ elif kind == RIBBON_BUTTON_HYBRID:
2602
+ normal_region = wx.Rect(0, 0, *button_size)
2603
+ dropdown_region = wx.Rect(button_size.GetWidth(), 0, drop_button_width, button_size.GetHeight())
2604
+ button_size += wx.Size(drop_button_width, 0)
2605
+
2606
+ elif result == RIBBON_BUTTONBAR_BUTTON_MEDIUM:
2607
+ # Small bitmap, with label to the right
2608
+ is_supported, button_size, normal_region, dropdown_region = self.GetButtonBarButtonSize(dc, wnd, kind,
2609
+ RIBBON_BUTTONBAR_BUTTON_SMALL,
2610
+ label, bitmap_size_large,
2611
+ bitmap_size_small)
2612
+ text_size = dc.GetTextExtent(label)[0]
2613
+ button_size.SetWidth(button_size.GetWidth() + text_size)
2614
+
2615
+ if kind == RIBBON_BUTTON_DROPDOWN:
2616
+ dropdown_region.SetWidth(dropdown_region.GetWidth() + text_size)
2617
+
2618
+ elif kind == RIBBON_BUTTON_HYBRID:
2619
+ dropdown_region.SetX(dropdown_region.GetX() + text_size)
2620
+ normal_region.SetWidth(normal_region.GetWidth() + text_size)
2621
+ # no break
2622
+ elif kind in [RIBBON_BUTTON_NORMAL, RIBBON_BUTTON_TOGGLE]:
2623
+ normal_region.SetWidth(normal_region.GetWidth() + text_size)
2624
+
2625
+ elif result == RIBBON_BUTTONBAR_BUTTON_LARGE:
2626
+ # Large bitmap, with label below (possibly split over 2 lines)
2627
+
2628
+ icon_size = wx.Size(*bitmap_size_large)
2629
+ icon_size += wx.Size(4, 4)
2630
+ best_width, label_height = dc.GetTextExtent(label)
2631
+ last_line_extra_width = 0
2632
+
2633
+ if kind not in [RIBBON_BUTTON_NORMAL, RIBBON_BUTTON_TOGGLE]:
2634
+ last_line_extra_width += 8
2635
+
2636
+ for i in range(0, len(label)):
2637
+ if RibbonCanLabelBreakAtPosition(label, i):
2638
+
2639
+ width = max(dc.GetTextExtent(label[0:i])[0],
2640
+ dc.GetTextExtent(label[i+1:])[0] + last_line_extra_width)
2641
+ if width < best_width:
2642
+ best_width = width
2643
+
2644
+ label_height *= 2 # Assume two lines even when only one is used
2645
+ # (to give all buttons a consistent height)
2646
+ icon_size.SetWidth(max(icon_size.GetWidth(), best_width) + 6)
2647
+ icon_size.SetHeight(icon_size.GetHeight() + label_height)
2648
+ button_size = wx.Size(*icon_size)
2649
+
2650
+ if kind == RIBBON_BUTTON_DROPDOWN:
2651
+ dropdown_region = wx.Rect(0, 0, *icon_size)
2652
+ elif kind == RIBBON_BUTTON_HYBRID:
2653
+ normal_region = wx.Rect(0, 0, *icon_size)
2654
+ normal_region.height -= 2 + label_height
2655
+ dropdown_region.x = 0
2656
+ dropdown_region.y = normal_region.height
2657
+ dropdown_region.width = icon_size.GetWidth()
2658
+ dropdown_region.height = icon_size.GetHeight() - normal_region.height
2659
+ elif kind in [RIBBON_BUTTON_NORMAL, RIBBON_BUTTON_TOGGLE]:
2660
+ normal_region = wx.Rect(0, 0, *icon_size)
2661
+
2662
+ return True, button_size, normal_region, dropdown_region
2663
+
2664
+
2665
+ def GetMinimisedPanelMinimumSize(self, dc, wnd, desired_bitmap_size=None, expanded_panel_direction=None):
2666
+ """
2667
+ Calculate the size of a minimised ribbon panel.
2668
+
2669
+ :param `dc`: A device context to use when one is required for size calculations;
2670
+ :param `wnd`: The ribbon panel in question. Attributes like the panel label can
2671
+ be queried from this;
2672
+ :param `desired_bitmap_size`: MISSING DESCRIPTION;
2673
+ :param `expanded_panel_direction`: MISSING DESCRIPTION.
2674
+
2675
+ """
2676
+
2677
+ if desired_bitmap_size is not None:
2678
+ desired_bitmap_size = wx.Size(16, 16)
2679
+
2680
+ if expanded_panel_direction is not None:
2681
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2682
+ expanded_panel_direction = wx.EAST
2683
+ else:
2684
+ expanded_panel_direction = wx.SOUTH
2685
+
2686
+ base_size = wx.Size(42, 42)
2687
+
2688
+ dc.SetFont(self._panel_label_font)
2689
+ label_size = wx.Size(*dc.GetTextExtent(wnd.GetLabel()))
2690
+ label_size.IncBy(2, 2) # Allow for differences between this DC and a paint DC
2691
+ label_size.IncBy(6, 0) # Padding
2692
+ label_size.y *= 2 # Second line for dropdown button
2693
+
2694
+ if self._flags & RIBBON_BAR_FLOW_VERTICAL:
2695
+ # Label alongside icon
2696
+ return wx.Size(base_size.x + label_size.x, max(base_size.y, label_size.y)), \
2697
+ desired_bitmap_size, expanded_panel_direction
2698
+ else:
2699
+ # Label beneath icon
2700
+ return wx.Size(max(base_size.x, label_size.x), base_size.y + label_size.y), \
2701
+ desired_bitmap_size, expanded_panel_direction
2702
+
2703
+
2704
+ def GetToolSize(self, dc, wnd, bitmap_size, kind, is_first, is_last, dropdown_region=None):
2705
+ """
2706
+ Calculate the size of a tool within a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`.
2707
+
2708
+ :param `dc`: A device context to use when one is required for size calculations;
2709
+ :param `wnd`: The window onto which the tool will eventually be drawn;
2710
+ :param `bitmap_size`: The size of the tool's foreground bitmap;
2711
+ :param `kind`: The kind of tool (normal, dropdown, or hybrid);
2712
+ :param `is_first`: ``True`` if the tool is the first within its group. ``False``
2713
+ otherwise;
2714
+ :param `is_last`: ``True`` if the tool is the last within its group. ``False``
2715
+ otherwise;
2716
+ :param `dropdown_region`: For dropdown and hybrid tools, the region within the
2717
+ returned size which counts as the dropdown part.
2718
+ """
2719
+
2720
+ size = wx.Size(*bitmap_size)
2721
+ size.IncBy(7, 6)
2722
+
2723
+ if is_last:
2724
+ size.IncBy(1, 0)
2725
+
2726
+ if kind & RIBBON_BUTTON_DROPDOWN:
2727
+ size.IncBy(8, 0)
2728
+ if kind == RIBBON_BUTTON_DROPDOWN:
2729
+ dropdown_region = wx.Rect(0, 0, *size)
2730
+ else:
2731
+ dropdown_region = wx.Rect(size.GetWidth() - 8, 0, 8, size.GetHeight())
2732
+ else:
2733
+ dropdown_region = wx.Rect(0, 0, 0, 0)
2734
+
2735
+ return size, dropdown_region
2736
+