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.
- wx/__init__.py +22 -0
- wx/__version__.py +9 -0
- wx/_adv.cp313-win_amd64.pyd +0 -0
- wx/_aui.cp313-win_amd64.pyd +0 -0
- wx/_core.cp313-win_amd64.pyd +0 -0
- wx/_dataview.cp313-win_amd64.pyd +0 -0
- wx/_glcanvas.cp313-win_amd64.pyd +0 -0
- wx/_grid.cp313-win_amd64.pyd +0 -0
- wx/_html.cp313-win_amd64.pyd +0 -0
- wx/_html2.cp313-win_amd64.pyd +0 -0
- wx/_media.cp313-win_amd64.pyd +0 -0
- wx/_msw.cp313-win_amd64.pyd +0 -0
- wx/_propgrid.cp313-win_amd64.pyd +0 -0
- wx/_ribbon.cp313-win_amd64.pyd +0 -0
- wx/_richtext.cp313-win_amd64.pyd +0 -0
- wx/_stc.cp313-win_amd64.pyd +0 -0
- wx/_xml.cp313-win_amd64.pyd +0 -0
- wx/_xrc.cp313-win_amd64.pyd +0 -0
- wx/adv.py +124 -0
- wx/adv.pyi +5182 -0
- wx/aui.py +77 -0
- wx/aui.pyi +3655 -0
- wx/core.py +3540 -0
- wx/core.pyi +50592 -0
- wx/dataview.py +173 -0
- wx/dataview.pyi +3491 -0
- wx/demo/AUI_DockingWindowMgr.py +1154 -0
- wx/demo/AUI_MDI.py +117 -0
- wx/demo/AUI_Notebook.py +58 -0
- wx/demo/About.py +75 -0
- wx/demo/AboutBox.py +75 -0
- wx/demo/ActiveXWrapper_Acrobat.py +132 -0
- wx/demo/ActiveXWrapper_IE.py +187 -0
- wx/demo/ActiveX_FlashWindow.py +107 -0
- wx/demo/ActiveX_IEHtmlWindow.py +242 -0
- wx/demo/ActiveX_PDFWindow.py +204 -0
- wx/demo/ActivityIndicator.py +80 -0
- wx/demo/AddPrivateFont.py +116 -0
- wx/demo/AdjustChannels.py +178 -0
- wx/demo/AlphaDrawing.py +77 -0
- wx/demo/AnalogClock.py +144 -0
- wx/demo/AnimationCtrl.py +104 -0
- wx/demo/ArtProvider.py +893 -0
- wx/demo/BannerWindow.py +1 -0
- wx/demo/BitmapButton.py +87 -0
- wx/demo/BitmapComboBox.py +63 -0
- wx/demo/BitmapFromBuffer.py +140 -0
- wx/demo/Button.py +77 -0
- wx/demo/Cairo.py +197 -0
- wx/demo/Cairo_Snippets.py +135 -0
- wx/demo/Calendar.py +660 -0
- wx/demo/CalendarCtrl.py +122 -0
- wx/demo/CheckBox.py +74 -0
- wx/demo/CheckListBox.py +79 -0
- wx/demo/CheckListCtrl.py +99 -0
- wx/demo/Choice.py +55 -0
- wx/demo/Choicebook.py +80 -0
- wx/demo/CollapsibleHeaderCtrl.py +85 -0
- wx/demo/CollapsiblePane.py +126 -0
- wx/demo/ColorPanel.py +19 -0
- wx/demo/ColourDB.py +203 -0
- wx/demo/ColourDialog.py +76 -0
- wx/demo/ColourSelect.py +119 -0
- wx/demo/ComboBox.py +111 -0
- wx/demo/ComboCtrl.py +153 -0
- wx/demo/ComboTreeBox.py +71 -0
- wx/demo/CommandLinkButton.py +50 -0
- wx/demo/ContextHelp.py +112 -0
- wx/demo/Cursor.py +336 -0
- wx/demo/CustomDragAndDrop.py +353 -0
- wx/demo/DVC_CustomRenderer.py +204 -0
- wx/demo/DVC_DataViewModel.py +365 -0
- wx/demo/DVC_IndexListModel.py +257 -0
- wx/demo/DVC_ListCtrl.py +69 -0
- wx/demo/DVC_TreeCtrl.py +76 -0
- wx/demo/DatePickerCtrl.py +68 -0
- wx/demo/DelayedResult.py +239 -0
- wx/demo/Dialog.py +169 -0
- wx/demo/DialogUnits.py +128 -0
- wx/demo/DirDialog.py +58 -0
- wx/demo/DragAndDrop.py +265 -0
- wx/demo/DragImage.py +316 -0
- wx/demo/DragScroller.py +59 -0
- wx/demo/DrawXXXList.py +436 -0
- wx/demo/DynamicSashWindow.py +177 -0
- wx/demo/EditableListBox.py +101 -0
- wx/demo/Editor.py +70 -0
- wx/demo/EventManager.py +291 -0
- wx/demo/ExpandoTextCtrl.py +164 -0
- wx/demo/FancyText.py +83 -0
- wx/demo/FileBrowseButton.py +100 -0
- wx/demo/FileCtrl.py +97 -0
- wx/demo/FileDialog.py +144 -0
- wx/demo/FileHistory.py +140 -0
- wx/demo/FindReplaceDialog.py +123 -0
- wx/demo/FloatCanvas.py +1959 -0
- wx/demo/FontDialog.py +142 -0
- wx/demo/FontEnumerator.py +82 -0
- wx/demo/Frame.py +85 -0
- wx/demo/GLCanvas.py +371 -0
- wx/demo/Gauge.py +66 -0
- wx/demo/GenericButtons.py +185 -0
- wx/demo/GenericCheckBox.py +65 -0
- wx/demo/GenericDirCtrl.py +74 -0
- wx/demo/GetMouseState.py +159 -0
- wx/demo/GraphicsContext.py +236 -0
- wx/demo/GraphicsGradient.py +281 -0
- wx/demo/Grid.py +95 -0
- wx/demo/GridBagSizer.py +170 -0
- wx/demo/GridCustEditor.py +247 -0
- wx/demo/GridCustTable.py +170 -0
- wx/demo/GridDragAndDrop.py +102 -0
- wx/demo/GridDragable.py +206 -0
- wx/demo/GridEnterHandler.py +66 -0
- wx/demo/GridHugeTable.py +89 -0
- wx/demo/GridLabelRenderer.py +114 -0
- wx/demo/GridSimple.py +270 -0
- wx/demo/GridStdEdRend.py +186 -0
- wx/demo/Grid_MegaExample.py +490 -0
- wx/demo/HTML2_WebView.py +183 -0
- wx/demo/HtmlWindow.py +232 -0
- wx/demo/I18N.py +237 -0
- wx/demo/Image.py +338 -0
- wx/demo/ImageAlpha.py +87 -0
- wx/demo/ImageBrowser.py +70 -0
- wx/demo/ImageFromStream.py +49 -0
- wx/demo/Img2PyArtProvider.py +99 -0
- wx/demo/InfoBar.py +127 -0
- wx/demo/IntCtrl.py +343 -0
- wx/demo/ItemsPicker.py +108 -0
- wx/demo/Joystick.py +1083 -0
- wx/demo/KeyEvents.py +428 -0
- wx/demo/LEDNumberCtrl.py +121 -0
- wx/demo/LayoutAnchors.py +258 -0
- wx/demo/LayoutConstraints.py +149 -0
- wx/demo/Layoutf.py +69 -0
- wx/demo/ListBox.py +164 -0
- wx/demo/ListCtrl.py +538 -0
- wx/demo/ListCtrl_edit.py +155 -0
- wx/demo/ListCtrl_virtual.py +145 -0
- wx/demo/Listbook.py +104 -0
- wx/demo/MDIDemo.py +86 -0
- wx/demo/MDISashDemo.py +152 -0
- wx/demo/MDIWindows.py +66 -0
- wx/demo/Main.py +2768 -0
- wx/demo/Mask.py +137 -0
- wx/demo/MaskedEditControls.py +648 -0
- wx/demo/MaskedNumCtrl.py +359 -0
- wx/demo/MediaCtrl.py +190 -0
- wx/demo/Menu.py +322 -0
- wx/demo/MessageDialog.py +54 -0
- wx/demo/MimeTypesManager.py +354 -0
- wx/demo/MiniFrame.py +67 -0
- wx/demo/MouseGestures.py +198 -0
- wx/demo/MultiChoiceDialog.py +59 -0
- wx/demo/MultiSash.py +95 -0
- wx/demo/MultiSplitterWindow.py +168 -0
- wx/demo/MultipleChoiceDialog.py +101 -0
- wx/demo/Notebook.py +134 -0
- wx/demo/NotificationMessage.py +61 -0
- wx/demo/OGL.py +433 -0
- wx/demo/Overlay.py +209 -0
- wx/demo/OwnerDrawnComboBox.py +152 -0
- wx/demo/PDFViewer.py +109 -0
- wx/demo/PageSetupDialog.py +70 -0
- wx/demo/PenAndBrushStyles.py +208 -0
- wx/demo/Pickers.py +120 -0
- wx/demo/PlateButton.py +430 -0
- wx/demo/PopupControl.py +99 -0
- wx/demo/PopupMenu.py +156 -0
- wx/demo/PopupWindow.py +227 -0
- wx/demo/PrintDialog.py +60 -0
- wx/demo/PrintFramework.py +227 -0
- wx/demo/Process.py +168 -0
- wx/demo/ProgressDialog.py +87 -0
- wx/demo/PropertyGrid.py +1045 -0
- wx/demo/PropertySheetDialog.py +231 -0
- wx/demo/PseudoDC.py +350 -0
- wx/demo/PyColourChooser.py +60 -0
- wx/demo/PyCrust.py +21 -0
- wx/demo/PyPlot.py +83 -0
- wx/demo/PyShell.py +22 -0
- wx/demo/PythonEvents.py +109 -0
- wx/demo/README.txt +7 -0
- wx/demo/RadioBox.py +67 -0
- wx/demo/RadioButton.py +127 -0
- wx/demo/RawBitmapAccess.py +208 -0
- wx/demo/RearrangeDialog.py +160 -0
- wx/demo/RendererNative.py +170 -0
- wx/demo/ResizeWidget.py +76 -0
- wx/demo/RichMessageDialog.py +85 -0
- wx/demo/RichTextCtrl.py +732 -0
- wx/demo/RichToolTip.py +145 -0
- wx/demo/SVGImage_Bitmap.py +130 -0
- wx/demo/SVGImage_Render.py +138 -0
- wx/demo/SashWindow.py +151 -0
- wx/demo/ScrolledMessageDialog.py +52 -0
- wx/demo/ScrolledPanel.py +124 -0
- wx/demo/ScrolledWindow.py +260 -0
- wx/demo/SearchCtrl.py +115 -0
- wx/demo/ShapedWindow.py +145 -0
- wx/demo/Simplebook.py +202 -0
- wx/demo/SingleChoiceDialog.py +56 -0
- wx/demo/SizedControls.py +433 -0
- wx/demo/Sizers.py +609 -0
- wx/demo/Slider.py +52 -0
- wx/demo/Sound.py +95 -0
- wx/demo/SpinButton.py +63 -0
- wx/demo/SpinCtrl.py +56 -0
- wx/demo/SpinCtrlDouble.py +42 -0
- wx/demo/SplitTree.py +146 -0
- wx/demo/SplitterWindow.py +62 -0
- wx/demo/StandardPaths.py +113 -0
- wx/demo/StaticBitmap.py +55 -0
- wx/demo/StaticBox.py +62 -0
- wx/demo/StaticText.py +69 -0
- wx/demo/StatusBar.py +144 -0
- wx/demo/StockButtons.py +113 -0
- wx/demo/StyledTextCtrl_1.py +303 -0
- wx/demo/StyledTextCtrl_2.py +410 -0
- wx/demo/SystemSettings.py +333 -0
- wx/demo/TablePrint.py +215 -0
- wx/demo/TestTable.txt +38 -0
- wx/demo/TextCtrl.py +187 -0
- wx/demo/TextEntryDialog.py +57 -0
- wx/demo/Threads.py +258 -0
- wx/demo/Throbber.py +250 -0
- wx/demo/Ticker.py +147 -0
- wx/demo/TimeCtrl.py +240 -0
- wx/demo/TimePickerCtrl.py +60 -0
- wx/demo/Timer.py +275 -0
- wx/demo/ToggleButton.py +54 -0
- wx/demo/ToolBar.py +249 -0
- wx/demo/ToolTip.py +71 -0
- wx/demo/Toolbook.py +111 -0
- wx/demo/TreeCtrl.py +199 -0
- wx/demo/TreeListCtrl.py +121 -0
- wx/demo/TreeMixin.py +269 -0
- wx/demo/Treebook.py +117 -0
- wx/demo/UIActionSimulator.py +151 -0
- wx/demo/URLDragAndDrop.py +130 -0
- wx/demo/Unicode.py +146 -0
- wx/demo/VListBox.py +176 -0
- wx/demo/Validator.py +237 -0
- wx/demo/Wizard.py +248 -0
- wx/demo/WrapSizer.py +115 -0
- wx/demo/XmlResource.py +80 -0
- wx/demo/XmlResourceHandler.py +199 -0
- wx/demo/XmlResourceSubclass.py +119 -0
- wx/demo/__init__.py +9 -0
- wx/demo/agw/AGWInfoBar.py +175 -0
- wx/demo/agw/AUI.py +3058 -0
- wx/demo/agw/AdvancedSplash.py +59 -0
- wx/demo/agw/AquaButton.py +146 -0
- wx/demo/agw/BalloonTip.py +378 -0
- wx/demo/agw/ButtonPanel.py +890 -0
- wx/demo/agw/CubeColourDialog.py +83 -0
- wx/demo/agw/CustomTreeCtrl.py +2167 -0
- wx/demo/agw/Example1 +67 -0
- wx/demo/agw/Example2 +49 -0
- wx/demo/agw/FlatMenu.py +876 -0
- wx/demo/agw/FlatNotebook.py +994 -0
- wx/demo/agw/FloatSpin.py +475 -0
- wx/demo/agw/FoldPanelBar.py +953 -0
- wx/demo/agw/FourWaySplitter.py +300 -0
- wx/demo/agw/GenericMessageDialog.py +207 -0
- wx/demo/agw/GradientButton.py +156 -0
- wx/demo/agw/HyperLinkCtrl.py +144 -0
- wx/demo/agw/HyperTreeList.py +2660 -0
- wx/demo/agw/KnobCtrl.py +186 -0
- wx/demo/agw/LabelBook.py +567 -0
- wx/demo/agw/MacLargeDemo.py +360 -0
- wx/demo/agw/MultiDirDialog.py +117 -0
- wx/demo/agw/PeakMeter.py +194 -0
- wx/demo/agw/PersistentControls.py +589 -0
- wx/demo/agw/PieCtrl.py +206 -0
- wx/demo/agw/PyBusyInfo.py +64 -0
- wx/demo/agw/PyCollapsiblePane.py +308 -0
- wx/demo/agw/PyGauge.py +162 -0
- wx/demo/agw/PyProgress.py +155 -0
- wx/demo/agw/RibbonBar.py +925 -0
- wx/demo/agw/RulerCtrl.py +454 -0
- wx/demo/agw/ScrolledThumbnail.py +128 -0
- wx/demo/agw/ShapedButton.py +603 -0
- wx/demo/agw/ShortcutEditor.py +397 -0
- wx/demo/agw/SpeedMeter.py +668 -0
- wx/demo/agw/SuperToolTip.py +396 -0
- wx/demo/agw/ThumbDemoConfig.py +603 -0
- wx/demo/agw/ThumbnailCtrl.py +149 -0
- wx/demo/agw/ToasterBox.py +410 -0
- wx/demo/agw/UltimateListCtrl.py +80 -0
- wx/demo/agw/UltimateListIconDemo.py +908 -0
- wx/demo/agw/UltimateListListDemo.py +124 -0
- wx/demo/agw/UltimateReportDemo.py +1146 -0
- wx/demo/agw/UltimateVirtualDemo.py +207 -0
- wx/demo/agw/Windows7Explorer_Contents.py +368 -0
- wx/demo/agw/XLSGrid.py +238 -0
- wx/demo/agw/ZoomBar.py +230 -0
- wx/demo/agw/__demo__.py +183 -0
- wx/demo/agw/bitmaps/Explorer96.png +0 -0
- wx/demo/agw/bitmaps/Explorer96Flip40.png +0 -0
- wx/demo/agw/bitmaps/Folder96.png +0 -0
- wx/demo/agw/bitmaps/Folder96Flip40.png +0 -0
- wx/demo/agw/bitmaps/Monitor96.png +0 -0
- wx/demo/agw/bitmaps/Monitor96Flip40.png +0 -0
- wx/demo/agw/bitmaps/Music96.png +0 -0
- wx/demo/agw/bitmaps/Music96Flip40.png +0 -0
- wx/demo/agw/bitmaps/Photo96.png +0 -0
- wx/demo/agw/bitmaps/Photo96Flip40.png +0 -0
- wx/demo/agw/bitmaps/Search96.png +0 -0
- wx/demo/agw/bitmaps/Search96Flip40.png +0 -0
- wx/demo/agw/bitmaps/Wizard96.png +0 -0
- wx/demo/agw/bitmaps/Wizard96Flip40.png +0 -0
- wx/demo/agw/bitmaps/advancedsplash.png +0 -0
- wx/demo/agw/bitmaps/aquabutton.png +0 -0
- wx/demo/agw/bitmaps/aquachecked.ico +0 -0
- wx/demo/agw/bitmaps/aquaflagged.ico +0 -0
- wx/demo/agw/bitmaps/aquanotchecked.ico +0 -0
- wx/demo/agw/bitmaps/aquanotflagged.ico +0 -0
- wx/demo/agw/bitmaps/canada.gif +0 -0
- wx/demo/agw/bitmaps/checked.ico +0 -0
- wx/demo/agw/bitmaps/columns.png +0 -0
- wx/demo/agw/bitmaps/contexthelp-16.png +0 -0
- wx/demo/agw/bitmaps/contexthelp.png +0 -0
- wx/demo/agw/bitmaps/copy.png +0 -0
- wx/demo/agw/bitmaps/cut.png +0 -0
- wx/demo/agw/bitmaps/editcopy.png +0 -0
- wx/demo/agw/bitmaps/editcut.png +0 -0
- wx/demo/agw/bitmaps/editpaste.png +0 -0
- wx/demo/agw/bitmaps/empty_icon.png +0 -0
- wx/demo/agw/bitmaps/exit-16.png +0 -0
- wx/demo/agw/bitmaps/exit.ico +0 -0
- wx/demo/agw/bitmaps/ffwd.png +0 -0
- wx/demo/agw/bitmaps/ffwddisabled.png +0 -0
- wx/demo/agw/bitmaps/field-16.png +0 -0
- wx/demo/agw/bitmaps/filenew.png +0 -0
- wx/demo/agw/bitmaps/fileopen.png +0 -0
- wx/demo/agw/bitmaps/filesave.png +0 -0
- wx/demo/agw/bitmaps/flagged.ico +0 -0
- wx/demo/agw/bitmaps/folder.png +0 -0
- wx/demo/agw/bitmaps/folder_new.png +0 -0
- wx/demo/agw/bitmaps/ghost.png +0 -0
- wx/demo/agw/bitmaps/gradientbutton.png +0 -0
- wx/demo/agw/bitmaps/help-16.png +0 -0
- wx/demo/agw/bitmaps/help.ico +0 -0
- wx/demo/agw/bitmaps/italy.gif +0 -0
- wx/demo/agw/bitmaps/lbadd.png +0 -0
- wx/demo/agw/bitmaps/lbcharge.png +0 -0
- wx/demo/agw/bitmaps/lbdecrypted.png +0 -0
- wx/demo/agw/bitmaps/lbnews.png +0 -0
- wx/demo/agw/bitmaps/lbroll.png +0 -0
- wx/demo/agw/bitmaps/minus1.ico +0 -0
- wx/demo/agw/bitmaps/minus2.ico +0 -0
- wx/demo/agw/bitmaps/minus3.ico +0 -0
- wx/demo/agw/bitmaps/minus4.ico +0 -0
- wx/demo/agw/bitmaps/minus5.ico +0 -0
- wx/demo/agw/bitmaps/month-16.png +0 -0
- wx/demo/agw/bitmaps/new_file.png +0 -0
- wx/demo/agw/bitmaps/new_folder.png +0 -0
- wx/demo/agw/bitmaps/notchecked.ico +0 -0
- wx/demo/agw/bitmaps/notflagged.ico +0 -0
- wx/demo/agw/bitmaps/ok-16.png +0 -0
- wx/demo/agw/bitmaps/open_folder.png +0 -0
- wx/demo/agw/bitmaps/paste.png +0 -0
- wx/demo/agw/bitmaps/pause.png +0 -0
- wx/demo/agw/bitmaps/pausedisabled.png +0 -0
- wx/demo/agw/bitmaps/play.png +0 -0
- wx/demo/agw/bitmaps/playdisabled.png +0 -0
- wx/demo/agw/bitmaps/plus1.ico +0 -0
- wx/demo/agw/bitmaps/plus2.ico +0 -0
- wx/demo/agw/bitmaps/plus3.ico +0 -0
- wx/demo/agw/bitmaps/plus4.ico +0 -0
- wx/demo/agw/bitmaps/plus5.ico +0 -0
- wx/demo/agw/bitmaps/record.png +0 -0
- wx/demo/agw/bitmaps/recorddisabled.png +0 -0
- wx/demo/agw/bitmaps/recording.gif +0 -0
- wx/demo/agw/bitmaps/rewind.png +0 -0
- wx/demo/agw/bitmaps/rewinddisabled.png +0 -0
- wx/demo/agw/bitmaps/round.png +0 -0
- wx/demo/agw/bitmaps/save.png +0 -0
- wx/demo/agw/bitmaps/separator.gif +0 -0
- wx/demo/agw/bitmaps/separatorflip.png +0 -0
- wx/demo/agw/bitmaps/smfuel.ico +0 -0
- wx/demo/agw/bitmaps/smpi.ico +0 -0
- wx/demo/agw/bitmaps/smtemp.ico +0 -0
- wx/demo/agw/bitmaps/stop.png +0 -0
- wx/demo/agw/bitmaps/stopdisabled.png +0 -0
- wx/demo/agw/bitmaps/sttbutton.png +0 -0
- wx/demo/agw/bitmaps/sttfont.png +0 -0
- wx/demo/agw/bitmaps/sttheader.png +0 -0
- wx/demo/agw/bitmaps/stthelp.png +0 -0
- wx/demo/agw/bitmaps/view1.png +0 -0
- wx/demo/agw/bitmaps/view2.png +0 -0
- wx/demo/agw/bitmaps/view_choose.png +0 -0
- wx/demo/agw/bitmaps/view_detailed.png +0 -0
- wx/demo/agw/bitmaps/view_icon.png +0 -0
- wx/demo/agw/bitmaps/view_multicolumn.png +0 -0
- wx/demo/agw/bitmaps/viewmag-16.png +0 -0
- wx/demo/agw/bitmaps/viewmag-m-16.png +0 -0
- wx/demo/agw/bitmaps/viewmag-p-16.png +0 -0
- wx/demo/agw/bitmaps/viewmagfit-16.png +0 -0
- wx/demo/agw/data/Example_1.xls +0 -0
- wx/demo/agw/images.py +6714 -0
- wx/demo/bitmaps/AG00028_.gif +0 -0
- wx/demo/bitmaps/AG00039_.gif +0 -0
- wx/demo/bitmaps/AG00178_.gif +0 -0
- wx/demo/bitmaps/AG00183_.gif +0 -0
- wx/demo/bitmaps/AG00185_.gif +0 -0
- wx/demo/bitmaps/BD13656_.gif +0 -0
- wx/demo/bitmaps/advancedsplash.png +0 -0
- wx/demo/bitmaps/aquabutton.png +0 -0
- wx/demo/bitmaps/aquachecked.ico +0 -0
- wx/demo/bitmaps/aquaflagged.ico +0 -0
- wx/demo/bitmaps/aquanotchecked.ico +0 -0
- wx/demo/bitmaps/aquanotflagged.ico +0 -0
- wx/demo/bitmaps/canada.gif +0 -0
- wx/demo/bitmaps/checked.ico +0 -0
- wx/demo/bitmaps/columns.png +0 -0
- wx/demo/bitmaps/contexthelp-16.png +0 -0
- wx/demo/bitmaps/contexthelp.png +0 -0
- wx/demo/bitmaps/copy.png +0 -0
- wx/demo/bitmaps/cropshot24x20.png +0 -0
- wx/demo/bitmaps/cut.png +0 -0
- wx/demo/bitmaps/editcopy.png +0 -0
- wx/demo/bitmaps/editcut.png +0 -0
- wx/demo/bitmaps/editpaste.png +0 -0
- wx/demo/bitmaps/exit-16.png +0 -0
- wx/demo/bitmaps/exit.ico +0 -0
- wx/demo/bitmaps/ffwd.png +0 -0
- wx/demo/bitmaps/ffwddisabled.png +0 -0
- wx/demo/bitmaps/field-16.png +0 -0
- wx/demo/bitmaps/filenew.png +0 -0
- wx/demo/bitmaps/fileopen.png +0 -0
- wx/demo/bitmaps/filesave.png +0 -0
- wx/demo/bitmaps/flagged.ico +0 -0
- wx/demo/bitmaps/folder_new.png +0 -0
- wx/demo/bitmaps/ghost.png +0 -0
- wx/demo/bitmaps/gradientbutton.png +0 -0
- wx/demo/bitmaps/help-16.png +0 -0
- wx/demo/bitmaps/help.ico +0 -0
- wx/demo/bitmaps/honeycomb300.png +0 -0
- wx/demo/bitmaps/image.bmp +0 -0
- wx/demo/bitmaps/image.gif +0 -0
- wx/demo/bitmaps/image.ico +0 -0
- wx/demo/bitmaps/image.jpg +0 -0
- wx/demo/bitmaps/image.png +0 -0
- wx/demo/bitmaps/image.tif +0 -0
- wx/demo/bitmaps/italy.gif +0 -0
- wx/demo/bitmaps/lbadd.png +0 -0
- wx/demo/bitmaps/lbcharge.png +0 -0
- wx/demo/bitmaps/lbdecrypted.png +0 -0
- wx/demo/bitmaps/lbnews.png +0 -0
- wx/demo/bitmaps/lbroll.png +0 -0
- wx/demo/bitmaps/minus1.ico +0 -0
- wx/demo/bitmaps/minus2.ico +0 -0
- wx/demo/bitmaps/minus3.ico +0 -0
- wx/demo/bitmaps/minus4.ico +0 -0
- wx/demo/bitmaps/minus5.ico +0 -0
- wx/demo/bitmaps/month-16.png +0 -0
- wx/demo/bitmaps/new_file.png +0 -0
- wx/demo/bitmaps/new_folder.png +0 -0
- wx/demo/bitmaps/notchecked.ico +0 -0
- wx/demo/bitmaps/notflagged.ico +0 -0
- wx/demo/bitmaps/ok-16.png +0 -0
- wx/demo/bitmaps/open_folder.png +0 -0
- wx/demo/bitmaps/paste.png +0 -0
- wx/demo/bitmaps/pause.png +0 -0
- wx/demo/bitmaps/pausedisabled.png +0 -0
- wx/demo/bitmaps/phoenix_title.png +0 -0
- wx/demo/bitmaps/phoenix_top.png +0 -0
- wx/demo/bitmaps/play.png +0 -0
- wx/demo/bitmaps/playdisabled.png +0 -0
- wx/demo/bitmaps/plus1.ico +0 -0
- wx/demo/bitmaps/plus2.ico +0 -0
- wx/demo/bitmaps/plus3.ico +0 -0
- wx/demo/bitmaps/plus4.ico +0 -0
- wx/demo/bitmaps/plus5.ico +0 -0
- wx/demo/bitmaps/record.png +0 -0
- wx/demo/bitmaps/recorddisabled.png +0 -0
- wx/demo/bitmaps/rewind.png +0 -0
- wx/demo/bitmaps/rewinddisabled.png +0 -0
- wx/demo/bitmaps/round.png +0 -0
- wx/demo/bitmaps/save.png +0 -0
- wx/demo/bitmaps/smfuel.ico +0 -0
- wx/demo/bitmaps/smpi.ico +0 -0
- wx/demo/bitmaps/smtemp.ico +0 -0
- wx/demo/bitmaps/snakey_render.png +0 -0
- wx/demo/bitmaps/splash.png +0 -0
- wx/demo/bitmaps/stop.png +0 -0
- wx/demo/bitmaps/stopdisabled.png +0 -0
- wx/demo/bitmaps/sttbutton.png +0 -0
- wx/demo/bitmaps/sttfont.png +0 -0
- wx/demo/bitmaps/sttheader.png +0 -0
- wx/demo/bitmaps/stthelp.png +0 -0
- wx/demo/bitmaps/toucan.png +0 -0
- wx/demo/bitmaps/view1.png +0 -0
- wx/demo/bitmaps/view2.png +0 -0
- wx/demo/bitmaps/view_choose.png +0 -0
- wx/demo/bitmaps/view_detailed.png +0 -0
- wx/demo/bitmaps/view_icon.png +0 -0
- wx/demo/bitmaps/view_multicolumn.png +0 -0
- wx/demo/bitmaps/viewmag-16.png +0 -0
- wx/demo/bitmaps/viewmag-m-16.png +0 -0
- wx/demo/bitmaps/viewmag-p-16.png +0 -0
- wx/demo/bitmaps/viewmagfit-16.png +0 -0
- wx/demo/bmp_source/001.png +0 -0
- wx/demo/bmp_source/002.png +0 -0
- wx/demo/bmp_source/003.png +0 -0
- wx/demo/bmp_source/004.png +0 -0
- wx/demo/bmp_source/005.png +0 -0
- wx/demo/bmp_source/006.png +0 -0
- wx/demo/bmp_source/007.png +0 -0
- wx/demo/bmp_source/008.png +0 -0
- wx/demo/bmp_source/009.png +0 -0
- wx/demo/bmp_source/010.png +0 -0
- wx/demo/bmp_source/011.png +0 -0
- wx/demo/bmp_source/012.png +0 -0
- wx/demo/bmp_source/013.png +0 -0
- wx/demo/bmp_source/014.png +0 -0
- wx/demo/bmp_source/015.png +0 -0
- wx/demo/bmp_source/016.png +0 -0
- wx/demo/bmp_source/017.png +0 -0
- wx/demo/bmp_source/018.png +0 -0
- wx/demo/bmp_source/019.png +0 -0
- wx/demo/bmp_source/020.png +0 -0
- wx/demo/bmp_source/021.png +0 -0
- wx/demo/bmp_source/022.png +0 -0
- wx/demo/bmp_source/023.png +0 -0
- wx/demo/bmp_source/024.png +0 -0
- wx/demo/bmp_source/025.png +0 -0
- wx/demo/bmp_source/026.png +0 -0
- wx/demo/bmp_source/027.png +0 -0
- wx/demo/bmp_source/028.png +0 -0
- wx/demo/bmp_source/029.png +0 -0
- wx/demo/bmp_source/030.png +0 -0
- wx/demo/bmp_source/DbDec.bmp +0 -0
- wx/demo/bmp_source/DbInc.bmp +0 -0
- wx/demo/bmp_source/Dec.bmp +0 -0
- wx/demo/bmp_source/FRM_0.png +0 -0
- wx/demo/bmp_source/FRM_1.png +0 -0
- wx/demo/bmp_source/FRM_2.png +0 -0
- wx/demo/bmp_source/FRM_3.png +0 -0
- wx/demo/bmp_source/FRM_4.png +0 -0
- wx/demo/bmp_source/FRM_5.png +0 -0
- wx/demo/bmp_source/FRM_6.png +0 -0
- wx/demo/bmp_source/FRM_7.png +0 -0
- wx/demo/bmp_source/FRM_8.png +0 -0
- wx/demo/bmp_source/GridBG.gif +0 -0
- wx/demo/bmp_source/Inc.bmp +0 -0
- wx/demo/bmp_source/LB01.png +0 -0
- wx/demo/bmp_source/LB02.png +0 -0
- wx/demo/bmp_source/LB03.png +0 -0
- wx/demo/bmp_source/LB04.png +0 -0
- wx/demo/bmp_source/LB05.png +0 -0
- wx/demo/bmp_source/LB06.png +0 -0
- wx/demo/bmp_source/LB07.png +0 -0
- wx/demo/bmp_source/LB08.png +0 -0
- wx/demo/bmp_source/LB09.png +0 -0
- wx/demo/bmp_source/LB10.png +0 -0
- wx/demo/bmp_source/LB11.png +0 -0
- wx/demo/bmp_source/LB12.png +0 -0
- wx/demo/bmp_source/Pt.bmp +0 -0
- wx/demo/bmp_source/Vippi.png +0 -0
- wx/demo/bmp_source/backgrnd.png +0 -0
- wx/demo/bmp_source/book.png +0 -0
- wx/demo/bmp_source/book_blue.png +0 -0
- wx/demo/bmp_source/book_green.png +0 -0
- wx/demo/bmp_source/book_red.png +0 -0
- wx/demo/bmp_source/bp_btn1.png +0 -0
- wx/demo/bmp_source/bp_btn2.png +0 -0
- wx/demo/bmp_source/bp_btn3.png +0 -0
- wx/demo/bmp_source/bp_btn4.png +0 -0
- wx/demo/bmp_source/bulb1.bmp +0 -0
- wx/demo/bmp_source/bulb2.bmp +0 -0
- wx/demo/bmp_source/carrot.png +0 -0
- wx/demo/bmp_source/clipboard.png +0 -0
- wx/demo/bmp_source/code.png +0 -0
- wx/demo/bmp_source/core.png +0 -0
- wx/demo/bmp_source/custom.png +0 -0
- wx/demo/bmp_source/customcontrol.png +0 -0
- wx/demo/bmp_source/deletedocs.png +0 -0
- wx/demo/bmp_source/deleteperspective.png +0 -0
- wx/demo/bmp_source/demo.png +0 -0
- wx/demo/bmp_source/dialog.png +0 -0
- wx/demo/bmp_source/exit.png +0 -0
- wx/demo/bmp_source/expansion.png +0 -0
- wx/demo/bmp_source/find.png +0 -0
- wx/demo/bmp_source/findnext.png +0 -0
- wx/demo/bmp_source/floatcanvas.png +0 -0
- wx/demo/bmp_source/frame.png +0 -0
- wx/demo/bmp_source/images.png +0 -0
- wx/demo/bmp_source/inspect.png +0 -0
- wx/demo/bmp_source/layout.png +0 -0
- wx/demo/bmp_source/logo.png +0 -0
- wx/demo/bmp_source/miscellaneous.png +0 -0
- wx/demo/bmp_source/modifiedexists.png +0 -0
- wx/demo/bmp_source/mondrian.ico +0 -0
- wx/demo/bmp_source/morecontrols.png +0 -0
- wx/demo/bmp_source/moredialog.png +0 -0
- wx/demo/bmp_source/noicon.png +0 -0
- wx/demo/bmp_source/overview.png +0 -0
- wx/demo/bmp_source/pencil.png +0 -0
- wx/demo/bmp_source/pointy.png +0 -0
- wx/demo/bmp_source/process.png +0 -0
- wx/demo/bmp_source/pyshell.png +0 -0
- wx/demo/bmp_source/recent.png +0 -0
- wx/demo/bmp_source/rest.png +0 -0
- wx/demo/bmp_source/robin.jpg +0 -0
- wx/demo/bmp_source/rt_alignleft.xpm +24 -0
- wx/demo/bmp_source/rt_alignright.xpm +24 -0
- wx/demo/bmp_source/rt_bold.xpm +24 -0
- wx/demo/bmp_source/rt_centre.xpm +24 -0
- wx/demo/bmp_source/rt_colour.xpm +59 -0
- wx/demo/bmp_source/rt_copy.xpm +44 -0
- wx/demo/bmp_source/rt_cut.xpm +46 -0
- wx/demo/bmp_source/rt_font.xpm +25 -0
- wx/demo/bmp_source/rt_idea.xpm +47 -0
- wx/demo/bmp_source/rt_indentless.xpm +25 -0
- wx/demo/bmp_source/rt_indentmore.xpm +25 -0
- wx/demo/bmp_source/rt_italic.xpm +25 -0
- wx/demo/bmp_source/rt_open.xpm +57 -0
- wx/demo/bmp_source/rt_paste.xpm +46 -0
- wx/demo/bmp_source/rt_redo.xpm +58 -0
- wx/demo/bmp_source/rt_sample.xpm +44 -0
- wx/demo/bmp_source/rt_save.xpm +42 -0
- wx/demo/bmp_source/rt_smiley.xpm +42 -0
- wx/demo/bmp_source/rt_underline.xpm +25 -0
- wx/demo/bmp_source/rt_undo.xpm +58 -0
- wx/demo/bmp_source/rt_zebra.xpm +409 -0
- wx/demo/bmp_source/saveperspective.png +0 -0
- wx/demo/bmp_source/sm_down.bmp +0 -0
- wx/demo/bmp_source/sm_up.bmp +0 -0
- wx/demo/bmp_source/smiles2.bmp +0 -0
- wx/demo/bmp_source/test2.bmp +0 -0
- wx/demo/bmp_source/testmask.bmp +0 -0
- wx/demo/bmp_source/teststar.png +0 -0
- wx/demo/bmp_source/thekid.png +0 -0
- wx/demo/bmp_source/tog1.bmp +0 -0
- wx/demo/bmp_source/tog2.bmp +0 -0
- wx/demo/bmp_source/wiztest1.bmp +0 -0
- wx/demo/bmp_source/wiztest2.bmp +0 -0
- wx/demo/bmp_source/wxpdemo.ico +0 -0
- wx/demo/cursors/paperairplane_arrow_blue.cur +0 -0
- wx/demo/cursors/paperairplane_arrow_blue_fadeout80.cur +0 -0
- wx/demo/cursors/paperairplane_arrow_colorshift.ani +0 -0
- wx/demo/cursors/paperairplane_arrow_dark.cur +0 -0
- wx/demo/cursors/paperairplane_arrow_grey.cur +0 -0
- wx/demo/cursors/paperairplane_arrow_red.cur +0 -0
- wx/demo/cursors/paperairplane_arrow_white.cur +0 -0
- wx/demo/cursors/paperairplane_arrow_white24.png +0 -0
- wx/demo/data/0-tiger.svg +725 -0
- wx/demo/data/Asteroid_blaster.swf +0 -0
- wx/demo/data/SIL_OPEN_FONT_LICENSE.txt +97 -0
- wx/demo/data/SourceCodePro-Regular.ttf +0 -0
- wx/demo/data/accessories-calculator.svg +636 -0
- wx/demo/data/accessories-text-editor.svg +554 -0
- wx/demo/data/anykey.wav +0 -0
- wx/demo/data/applications-internet.svg +623 -0
- wx/demo/data/desktop-accessibility.svg +245 -0
- wx/demo/data/desktop-keyboard-shortcuts.svg +839 -0
- wx/demo/data/desktop-locale.svg +878 -0
- wx/demo/data/desktop-remote-desktop.svg +1479 -0
- wx/demo/data/desktop-theme.svg +882 -0
- wx/demo/data/desktop-wallpaper.svg +747 -0
- wx/demo/data/echo.py +25 -0
- wx/demo/data/imagemap.htm +20 -0
- wx/demo/data/imagemap.png +0 -0
- wx/demo/data/internet-group-chat.svg +312 -0
- wx/demo/data/internet-mail.svg +440 -0
- wx/demo/data/locale/af/LC_MESSAGES/wxpydemo.mo +0 -0
- wx/demo/data/locale/de/LC_MESSAGES/wxpydemo.mo +0 -0
- wx/demo/data/locale/es/LC_MESSAGES/wxpydemo.mo +0 -0
- wx/demo/data/locale/fr/LC_MESSAGES/wxpydemo.mo +0 -0
- wx/demo/data/locale/it/LC_MESSAGES/wxpydemo.mo +0 -0
- wx/demo/data/locale-src/af.po +23 -0
- wx/demo/data/locale-src/de.po +23 -0
- wx/demo/data/locale-src/es.po +22 -0
- wx/demo/data/locale-src/fr.po +22 -0
- wx/demo/data/locale-src/install +15 -0
- wx/demo/data/locale-src/it.po +23 -0
- wx/demo/data/locale-src/wxpydemo.po +21 -0
- wx/demo/data/office-calendar.svg +316 -0
- wx/demo/data/pic.png +0 -0
- wx/demo/data/pic2.bmp +0 -0
- wx/demo/data/plan.wav +0 -0
- wx/demo/data/proclamation.txt +115 -0
- wx/demo/data/resource.wdr +0 -0
- wx/demo/data/resource_wdr.xrc +146 -0
- wx/demo/data/romedalen.png +0 -0
- wx/demo/data/stc.h.html +3544 -0
- wx/demo/data/system-session.svg +510 -0
- wx/demo/data/system-users.svg +539 -0
- wx/demo/data/tables.htm +116 -0
- wx/demo/data/test-gradient-pen.svg +14 -0
- wx/demo/data/test-opacity.svg +7 -0
- wx/demo/data/test.htm +253 -0
- wx/demo/data/testmovie.mpg +0 -0
- wx/demo/data/testtable.txt +38 -0
- wx/demo/data/tips.txt +73 -0
- wx/demo/data/utilities-system-monitor.svg +435 -0
- wx/demo/data/utilities-terminal.svg +500 -0
- wx/demo/data/widgetTest.htm +70 -0
- wx/demo/data/world.dat +24055 -0
- wx/demo/demo.py +4 -0
- wx/demo/demo.pyw +4 -0
- wx/demo/demodata.py +310 -0
- wx/demo/encode_bitmaps.py +181 -0
- wx/demo/images.py +6812 -0
- wx/demo/infoframe.py +149 -0
- wx/demo/run.py +171 -0
- wx/demo/snippets/__init__.py +13 -0
- wx/demo/snippets/arc.py +21 -0
- wx/demo/snippets/arc_negative.py +21 -0
- wx/demo/snippets/clip.py +13 -0
- wx/demo/snippets/clip_image.py +13 -0
- wx/demo/snippets/curve_rectangle.py +53 -0
- wx/demo/snippets/curve_to.py +17 -0
- wx/demo/snippets/dash.py +18 -0
- wx/demo/snippets/ellipse.py +33 -0
- wx/demo/snippets/fill_and_stroke.py +12 -0
- wx/demo/snippets/fill_and_stroke2.py +18 -0
- wx/demo/snippets/fill_style.py +31 -0
- wx/demo/snippets/glyph_path.py +21 -0
- wx/demo/snippets/gradient.py +16 -0
- wx/demo/snippets/gradient_mask.py +12 -0
- wx/demo/snippets/group.py +16 -0
- wx/demo/snippets/image.py +14 -0
- wx/demo/snippets/imagepattern.py +23 -0
- wx/demo/snippets/path.py +7 -0
- wx/demo/snippets/set_line_cap.py +19 -0
- wx/demo/snippets/set_line_join.py +21 -0
- wx/demo/snippets/show_glyphs.py +15 -0
- wx/demo/snippets/text.py +22 -0
- wx/demo/snippets/text_align_center.py +26 -0
- wx/demo/snippets/text_extents.py +27 -0
- wx/demo/template.py +36 -0
- wx/demo/throbImages.py +1277 -0
- wx/demo/version.py +3 -0
- wx/demo/widgetTest.py +72 -0
- wx/demo/wxpdemo.ico +0 -0
- wx/glcanvas.py +10 -0
- wx/glcanvas.pyi +458 -0
- wx/grid.py +229 -0
- wx/grid.pyi +4959 -0
- wx/html.py +35 -0
- wx/html.pyi +2965 -0
- wx/html2.py +40 -0
- wx/html2.pyi +772 -0
- wx/lib/CDate.py +202 -0
- wx/lib/ClickableHtmlWindow.py +57 -0
- wx/lib/__init__.py +0 -0
- wx/lib/activex.py +178 -0
- wx/lib/activexwrapper.py +153 -0
- wx/lib/agw/__init__.py +128 -0
- wx/lib/agw/advancedsplash.py +564 -0
- wx/lib/agw/aquabutton.py +1127 -0
- wx/lib/agw/artmanager.py +2110 -0
- wx/lib/agw/aui/__init__.py +295 -0
- wx/lib/agw/aui/aui_constants.py +2628 -0
- wx/lib/agw/aui/aui_switcherdialog.py +1227 -0
- wx/lib/agw/aui/aui_utilities.py +672 -0
- wx/lib/agw/aui/auibar.py +4031 -0
- wx/lib/agw/aui/auibook.py +6289 -0
- wx/lib/agw/aui/dockart.py +1198 -0
- wx/lib/agw/aui/framemanager.py +10409 -0
- wx/lib/agw/aui/tabart.py +2771 -0
- wx/lib/agw/aui/tabmdi.py +679 -0
- wx/lib/agw/balloontip.py +1158 -0
- wx/lib/agw/buttonpanel.py +2823 -0
- wx/lib/agw/cubecolourdialog.py +3529 -0
- wx/lib/agw/customtreectrl.py +8963 -0
- wx/lib/agw/data/ShortcutEditor_1.png +0 -0
- wx/lib/agw/data/ShortcutEditor_1_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_2.png +0 -0
- wx/lib/agw/data/ShortcutEditor_2_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_3.png +0 -0
- wx/lib/agw/data/ShortcutEditor_3_thumb.png +0 -0
- wx/lib/agw/data/ShortcutEditor_4.png +0 -0
- wx/lib/agw/data/ShortcutEditor_4_thumb.png +0 -0
- wx/lib/agw/data/default_help_text.html +105 -0
- wx/lib/agw/flatmenu.py +7333 -0
- wx/lib/agw/flatnotebook.py +6672 -0
- wx/lib/agw/floatspin.py +1823 -0
- wx/lib/agw/fmcustomizedlg.py +540 -0
- wx/lib/agw/fmresources.py +407 -0
- wx/lib/agw/foldpanelbar.py +2282 -0
- wx/lib/agw/fourwaysplitter.py +1130 -0
- wx/lib/agw/genericmessagedialog.py +1549 -0
- wx/lib/agw/gradientbutton.py +732 -0
- wx/lib/agw/hyperlink.py +664 -0
- wx/lib/agw/hypertreelist.py +5374 -0
- wx/lib/agw/infobar.py +885 -0
- wx/lib/agw/knobctrl.py +945 -0
- wx/lib/agw/labelbook.py +3029 -0
- wx/lib/agw/multidirdialog.py +615 -0
- wx/lib/agw/peakmeter.py +1029 -0
- wx/lib/agw/persist/__init__.py +188 -0
- wx/lib/agw/persist/persist_constants.py +284 -0
- wx/lib/agw/persist/persist_handlers.py +2614 -0
- wx/lib/agw/persist/persistencemanager.py +864 -0
- wx/lib/agw/piectrl.py +1082 -0
- wx/lib/agw/pybusyinfo.py +399 -0
- wx/lib/agw/pycollapsiblepane.py +940 -0
- wx/lib/agw/pygauge.py +570 -0
- wx/lib/agw/pyprogress.py +917 -0
- wx/lib/agw/ribbon/__init__.py +198 -0
- wx/lib/agw/ribbon/art.py +219 -0
- wx/lib/agw/ribbon/art_aui.py +1284 -0
- wx/lib/agw/ribbon/art_default.py +81 -0
- wx/lib/agw/ribbon/art_internal.py +244 -0
- wx/lib/agw/ribbon/art_msw.py +2736 -0
- wx/lib/agw/ribbon/art_osx.py +52 -0
- wx/lib/agw/ribbon/bar.py +1261 -0
- wx/lib/agw/ribbon/buttonbar.py +1320 -0
- wx/lib/agw/ribbon/control.py +205 -0
- wx/lib/agw/ribbon/gallery.py +974 -0
- wx/lib/agw/ribbon/page.py +946 -0
- wx/lib/agw/ribbon/panel.py +1170 -0
- wx/lib/agw/ribbon/toolbar.py +1442 -0
- wx/lib/agw/rulerctrl.py +1887 -0
- wx/lib/agw/scrolledthumbnail.py +2119 -0
- wx/lib/agw/shapedbutton.py +1809 -0
- wx/lib/agw/shortcuteditor.py +2634 -0
- wx/lib/agw/speedmeter.py +1801 -0
- wx/lib/agw/supertooltip.py +1444 -0
- wx/lib/agw/thumbnailctrl.py +529 -0
- wx/lib/agw/toasterbox.py +1327 -0
- wx/lib/agw/ultimatelistctrl.py +13666 -0
- wx/lib/agw/xlsgrid.py +2113 -0
- wx/lib/agw/zoombar.py +1339 -0
- wx/lib/analogclock/__init__.py +140 -0
- wx/lib/analogclock/analogclock.py +631 -0
- wx/lib/analogclock/helpers.py +991 -0
- wx/lib/analogclock/lib_setup/__init__.py +0 -0
- wx/lib/analogclock/lib_setup/buttontreectrlpanel.py +297 -0
- wx/lib/analogclock/lib_setup/fontselect.py +57 -0
- wx/lib/analogclock/setup.py +490 -0
- wx/lib/analogclock/styles.py +47 -0
- wx/lib/anchors.py +103 -0
- wx/lib/art/__init__.py +4 -0
- wx/lib/art/flagart.py +1583 -0
- wx/lib/art/img2pyartprov.py +56 -0
- wx/lib/busy.py +146 -0
- wx/lib/buttons.py +1141 -0
- wx/lib/calendar.py +1597 -0
- wx/lib/checkbox.py +837 -0
- wx/lib/colourchooser/__init__.py +38 -0
- wx/lib/colourchooser/canvas.py +145 -0
- wx/lib/colourchooser/intl.py +24 -0
- wx/lib/colourchooser/pycolourbox.py +89 -0
- wx/lib/colourchooser/pycolourchooser.py +629 -0
- wx/lib/colourchooser/pycolourslider.py +100 -0
- wx/lib/colourchooser/pypalette.py +211 -0
- wx/lib/colourdb.py +740 -0
- wx/lib/colourselect.py +385 -0
- wx/lib/colourutils.py +118 -0
- wx/lib/combotreebox.py +944 -0
- wx/lib/delayedresult.py +420 -0
- wx/lib/dialogs.py +510 -0
- wx/lib/docview.py +3210 -0
- wx/lib/dragscroller.py +79 -0
- wx/lib/editor/README.txt +77 -0
- wx/lib/editor/__init__.py +24 -0
- wx/lib/editor/editor.py +974 -0
- wx/lib/editor/images.py +15 -0
- wx/lib/editor/selection.py +44 -0
- wx/lib/embeddedimage.py +76 -0
- wx/lib/eventStack.py +136 -0
- wx/lib/eventwatcher.py +440 -0
- wx/lib/evtmgr.py +521 -0
- wx/lib/expando.py +393 -0
- wx/lib/fancytext.py +505 -0
- wx/lib/filebrowsebutton.py +459 -0
- wx/lib/flashwin.py +262 -0
- wx/lib/flashwin_old.py +651 -0
- wx/lib/floatcanvas/FCEvents.py +53 -0
- wx/lib/floatcanvas/FCObjects.py +2923 -0
- wx/lib/floatcanvas/FloatCanvas.py +1027 -0
- wx/lib/floatcanvas/GUIMode.py +396 -0
- wx/lib/floatcanvas/NavCanvas.py +161 -0
- wx/lib/floatcanvas/Resources.py +319 -0
- wx/lib/floatcanvas/ScreenShot.py +1788 -0
- wx/lib/floatcanvas/Utilities/BBox.py +314 -0
- wx/lib/floatcanvas/Utilities/Colors.py +137 -0
- wx/lib/floatcanvas/Utilities/GUI.py +91 -0
- wx/lib/floatcanvas/Utilities/__init__.py +7 -0
- wx/lib/floatcanvas/__init__.py +124 -0
- wx/lib/foldmenu.py +89 -0
- wx/lib/gestures.py +310 -0
- wx/lib/gizmos/__init__.py +18 -0
- wx/lib/gizmos/dynamicsash.py +1202 -0
- wx/lib/gizmos/ledctrl.py +300 -0
- wx/lib/gizmos/treelistctrl.py +87 -0
- wx/lib/graphics.py +1939 -0
- wx/lib/gridmovers.py +511 -0
- wx/lib/iewin.py +249 -0
- wx/lib/iewin_old.py +894 -0
- wx/lib/imagebrowser.py +856 -0
- wx/lib/imageutils.py +163 -0
- wx/lib/infoframe.py +490 -0
- wx/lib/inspection.py +1255 -0
- wx/lib/intctrl.py +1001 -0
- wx/lib/itemspicker.py +256 -0
- wx/lib/langlistctrl.py +480 -0
- wx/lib/layoutf.py +271 -0
- wx/lib/masked/__init__.py +27 -0
- wx/lib/masked/combobox.py +839 -0
- wx/lib/masked/ctrl.py +108 -0
- wx/lib/masked/ipaddrctrl.py +242 -0
- wx/lib/masked/maskededit.py +7279 -0
- wx/lib/masked/numctrl.py +2001 -0
- wx/lib/masked/textctrl.py +465 -0
- wx/lib/masked/timectrl.py +1466 -0
- wx/lib/mixins/__init__.py +17 -0
- wx/lib/mixins/grid.py +47 -0
- wx/lib/mixins/gridlabelrenderer.py +251 -0
- wx/lib/mixins/imagelist.py +77 -0
- wx/lib/mixins/inspection.py +184 -0
- wx/lib/mixins/listctrl.py +894 -0
- wx/lib/mixins/rubberband.py +404 -0
- wx/lib/mixins/treemixin.py +678 -0
- wx/lib/msgpanel.py +95 -0
- wx/lib/multisash.py +747 -0
- wx/lib/myole4ax.idl +178 -0
- wx/lib/myole4ax.tlb +0 -0
- wx/lib/newevent.py +229 -0
- wx/lib/nvdlg.py +156 -0
- wx/lib/ogl/__init__.py +13 -0
- wx/lib/ogl/basic.py +3991 -0
- wx/lib/ogl/bmpshape.py +87 -0
- wx/lib/ogl/canvas.py +467 -0
- wx/lib/ogl/composit.py +1577 -0
- wx/lib/ogl/diagram.py +230 -0
- wx/lib/ogl/divided.py +483 -0
- wx/lib/ogl/drawn.py +900 -0
- wx/lib/ogl/lines.py +1811 -0
- wx/lib/ogl/oglmisc.py +608 -0
- wx/lib/pdfviewer/__init__.py +113 -0
- wx/lib/pdfviewer/bitmaps/ArrowLeft.png +0 -0
- wx/lib/pdfviewer/bitmaps/ArrowRight.png +0 -0
- wx/lib/pdfviewer/bitmaps/DirectionH.png +0 -0
- wx/lib/pdfviewer/bitmaps/DirectionV.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerFirst.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerLast.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerNext.png +0 -0
- wx/lib/pdfviewer/bitmaps/PlayerPrev.png +0 -0
- wx/lib/pdfviewer/bitmaps/Printer.png +0 -0
- wx/lib/pdfviewer/bitmaps/ReadMe.txt +28 -0
- wx/lib/pdfviewer/bitmaps/Save.png +0 -0
- wx/lib/pdfviewer/bitmaps/ZoomIn.png +0 -0
- wx/lib/pdfviewer/bitmaps/ZoomOut.png +0 -0
- wx/lib/pdfviewer/bitmaps/encode_bitmaps.py +37 -0
- wx/lib/pdfviewer/buttonpanel.py +279 -0
- wx/lib/pdfviewer/images.py +240 -0
- wx/lib/pdfviewer/viewer.py +1077 -0
- wx/lib/pdfwin.py +295 -0
- wx/lib/pdfwin_old.py +789 -0
- wx/lib/platebtn.py +789 -0
- wx/lib/plot/CHANGELOG.md +150 -0
- wx/lib/plot/README.md +16 -0
- wx/lib/plot/__init__.py +46 -0
- wx/lib/plot/__main__.py +5 -0
- wx/lib/plot/examples/__init__.py +0 -0
- wx/lib/plot/examples/demo.py +1009 -0
- wx/lib/plot/examples/simple_example.py +54 -0
- wx/lib/plot/plotcanvas.py +2981 -0
- wx/lib/plot/polyobjects.py +1525 -0
- wx/lib/plot/utils.py +327 -0
- wx/lib/popupctl.py +250 -0
- wx/lib/printout.py +1157 -0
- wx/lib/progressindicator.py +151 -0
- wx/lib/pubsub/LICENSE_BSD_Simple.txt +23 -0
- wx/lib/pubsub/README_WxPython.txt +22 -0
- wx/lib/pubsub/RELEASE_NOTES.txt +71 -0
- wx/lib/pubsub/__init__.py +25 -0
- wx/lib/pubsub/core/__init__.py +92 -0
- wx/lib/pubsub/core/arg1/__init__.py +16 -0
- wx/lib/pubsub/core/arg1/listenerimpl.py +97 -0
- wx/lib/pubsub/core/arg1/publisher.py +40 -0
- wx/lib/pubsub/core/arg1/publishermixin.py +34 -0
- wx/lib/pubsub/core/arg1/topicargspecimpl.py +66 -0
- wx/lib/pubsub/core/arg1/topicmgrimpl.py +19 -0
- wx/lib/pubsub/core/callables.py +191 -0
- wx/lib/pubsub/core/imp2.py +63 -0
- wx/lib/pubsub/core/itopicdefnprovider.py +0 -0
- wx/lib/pubsub/core/kwargs/__init__.py +16 -0
- wx/lib/pubsub/core/kwargs/datamsg.py +27 -0
- wx/lib/pubsub/core/kwargs/listenerimpl.py +93 -0
- wx/lib/pubsub/core/kwargs/publisher.py +77 -0
- wx/lib/pubsub/core/kwargs/publishermixin.py +65 -0
- wx/lib/pubsub/core/kwargs/topicargspecimpl.py +217 -0
- wx/lib/pubsub/core/kwargs/topicmgrimpl.py +13 -0
- wx/lib/pubsub/core/listener.py +40 -0
- wx/lib/pubsub/core/listenerbase.py +185 -0
- wx/lib/pubsub/core/notificationmgr.py +185 -0
- wx/lib/pubsub/core/publisherbase.py +191 -0
- wx/lib/pubsub/core/topicargspec.py +77 -0
- wx/lib/pubsub/core/topicdefnprovider.py +632 -0
- wx/lib/pubsub/core/topicexc.py +72 -0
- wx/lib/pubsub/core/topicmgr.py +456 -0
- wx/lib/pubsub/core/topicobj.py +472 -0
- wx/lib/pubsub/core/topictreetraverser.py +143 -0
- wx/lib/pubsub/core/topicutils.py +118 -0
- wx/lib/pubsub/core/treeconfig.py +21 -0
- wx/lib/pubsub/core/validatedefnargs.py +29 -0
- wx/lib/pubsub/core/weakmethod.py +102 -0
- wx/lib/pubsub/policies.py +24 -0
- wx/lib/pubsub/pub.py +199 -0
- wx/lib/pubsub/py2and3.py +608 -0
- wx/lib/pubsub/setuparg1.py +47 -0
- wx/lib/pubsub/setupkwargs.py +29 -0
- wx/lib/pubsub/utils/__init__.py +27 -0
- wx/lib/pubsub/utils/exchandling.py +100 -0
- wx/lib/pubsub/utils/misc.py +100 -0
- wx/lib/pubsub/utils/notification.py +331 -0
- wx/lib/pubsub/utils/topictreeprinter.py +195 -0
- wx/lib/pubsub/utils/xmltopicdefnprovider.py +287 -0
- wx/lib/pydocview.py +3300 -0
- wx/lib/rcsizer.py +229 -0
- wx/lib/resizewidget.py +357 -0
- wx/lib/scrolledpanel.py +225 -0
- wx/lib/sheet.py +350 -0
- wx/lib/sized_controls.py +691 -0
- wx/lib/softwareupdate.py +361 -0
- wx/lib/splitter.py +925 -0
- wx/lib/statbmp.py +199 -0
- wx/lib/stattext.py +322 -0
- wx/lib/throbber.py +425 -0
- wx/lib/ticker.py +295 -0
- wx/lib/ticker_xrc.py +48 -0
- wx/lib/utils.py +89 -0
- wx/lib/wordwrap.py +97 -0
- wx/lib/wxcairo/__init__.py +124 -0
- wx/lib/wxcairo/wx_cairocffi.py +200 -0
- wx/lib/wxcairo/wx_pycairo.py +463 -0
- wx/lib/wxpTag.py +274 -0
- wx/locale/af/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/an/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ar/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ca/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ca@valencia/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/cs/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/da/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/de/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/el/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/es/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/eu/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fa_IR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/fr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/gl_ES/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/hu/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/id/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/it/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ja/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ka/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ko_KR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/lt/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/lv/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ms/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/nb/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ne/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/nl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pt/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/pt_BR/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ro/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ru/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sk/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sl/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sq/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/sv/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/ta/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/tr/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/uk/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/vi/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/zh_CN/LC_MESSAGES/wxstd.mo +0 -0
- wx/locale/zh_TW/LC_MESSAGES/wxstd.mo +0 -0
- wx/media.py +27 -0
- wx/media.pyi +223 -0
- wx/msw.py +13 -0
- wx/msw.pyi +65 -0
- wx/propgrid.py +1451 -0
- wx/propgrid.pyi +7914 -0
- wx/py/CHANGES.txt +796 -0
- wx/py/Py.ico +0 -0
- wx/py/PyAlaCarte.py +34 -0
- wx/py/PyAlaMode.py +34 -0
- wx/py/PyAlaModeTest.py +33 -0
- wx/py/PyCrust.ico +0 -0
- wx/py/PyCrust.py +78 -0
- wx/py/PyCrust_16.png +0 -0
- wx/py/PyCrust_32.png +0 -0
- wx/py/PyFilling.py +35 -0
- wx/py/PyShell.py +78 -0
- wx/py/PySlices.ico +0 -0
- wx/py/PySlices.py +98 -0
- wx/py/PySlicesShell.py +94 -0
- wx/py/PySlices_16.png +0 -0
- wx/py/PySlices_32.png +0 -0
- wx/py/PyWrap.py +52 -0
- wx/py/README.txt +77 -0
- wx/py/__init__.py +20 -0
- wx/py/buffer.py +136 -0
- wx/py/crust.py +403 -0
- wx/py/crustslices.py +403 -0
- wx/py/dispatcher.py +259 -0
- wx/py/document.py +37 -0
- wx/py/editor.py +844 -0
- wx/py/editwindow.py +299 -0
- wx/py/filling.py +357 -0
- wx/py/frame.py +978 -0
- wx/py/images.py +212 -0
- wx/py/interpreter.py +170 -0
- wx/py/introspect.py +393 -0
- wx/py/magic.py +98 -0
- wx/py/parse.py +134 -0
- wx/py/path.py +36 -0
- wx/py/pseudo.py +99 -0
- wx/py/shell.py +1588 -0
- wx/py/sliceshell.py +3814 -0
- wx/py/tests/test_interpreter.py +71 -0
- wx/py/tests/test_introspect.py +862 -0
- wx/py/tests/test_pseudo.py +70 -0
- wx/py/tests/test_version.py +36 -0
- wx/py/tests/testall.py +22 -0
- wx/py/version.py +7 -0
- wx/ribbon.py +45 -0
- wx/ribbon.pyi +2494 -0
- wx/richtext.py +142 -0
- wx/richtext.pyi +12113 -0
- wx/siplib.cp313-win_amd64.pyd +0 -0
- wx/stc.py +58 -0
- wx/stc.pyi +8463 -0
- wx/svg/__init__.py +364 -0
- wx/svg/_nanosvg.cp313-win_amd64.pyd +0 -0
- wx/tools/__init__.py +18 -0
- wx/tools/dbg.py +268 -0
- wx/tools/genaxmodule.py +50 -0
- wx/tools/helpviewer.py +92 -0
- wx/tools/img2img.py +85 -0
- wx/tools/img2png.py +54 -0
- wx/tools/img2py.py +309 -0
- wx/tools/img2xpm.py +54 -0
- wx/tools/pywxrc.py +949 -0
- wx/tools/wxget.py +254 -0
- wx/tools/wxget_docs_demo.py +186 -0
- wx/wxbase315u_net_vc140_x64.dll +0 -0
- wx/wxbase315u_vc140_x64.dll +0 -0
- wx/wxbase315u_xml_vc140_x64.dll +0 -0
- wx/wxmsw315u_adv_vc140_x64.dll +0 -0
- wx/wxmsw315u_aui_vc140_x64.dll +0 -0
- wx/wxmsw315u_core_vc140_x64.dll +0 -0
- wx/wxmsw315u_gl_vc140_x64.dll +0 -0
- wx/wxmsw315u_html_vc140_x64.dll +0 -0
- wx/wxmsw315u_media_vc140_x64.dll +0 -0
- wx/wxmsw315u_propgrid_vc140_x64.dll +0 -0
- wx/wxmsw315u_qa_vc140_x64.dll +0 -0
- wx/wxmsw315u_ribbon_vc140_x64.dll +0 -0
- wx/wxmsw315u_richtext_vc140_x64.dll +0 -0
- wx/wxmsw315u_stc_vc140_x64.dll +0 -0
- wx/wxmsw315u_webview_vc140_x64.dll +0 -0
- wx/wxmsw315u_xrc_vc140_x64.dll +0 -0
- wx/xml.py +15 -0
- wx/xml.pyi +575 -0
- wx/xrc.py +65 -0
- wx/xrc.pyi +742 -0
- wxPython_zombie-3.1.5.8.dist-info/LICENSE.txt +950 -0
- wxPython_zombie-3.1.5.8.dist-info/METADATA +107 -0
- wxPython_zombie-3.1.5.8.dist-info/RECORD +1175 -0
- wxPython_zombie-3.1.5.8.dist-info/WHEEL +5 -0
- wxPython_zombie-3.1.5.8.dist-info/entry_points.txt +2 -0
- wxPython_zombie-3.1.5.8.dist-info/top_level.txt +1 -0
wx/lib/agw/artmanager.py
ADDED
|
@@ -0,0 +1,2110 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module contains drawing routines and customizations for the AGW widgets
|
|
3
|
+
:class:`~wx.lib.agw.labelbook.LabelBook` and :class:`~wx.lib.agw.flatmenu.FlatMenu`.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import wx
|
|
7
|
+
import random
|
|
8
|
+
|
|
9
|
+
from six import BytesIO
|
|
10
|
+
|
|
11
|
+
from .fmresources import *
|
|
12
|
+
|
|
13
|
+
# ---------------------------------------------------------------------------- #
|
|
14
|
+
# Class DCSaver
|
|
15
|
+
# ---------------------------------------------------------------------------- #
|
|
16
|
+
|
|
17
|
+
_ = wx.GetTranslation
|
|
18
|
+
|
|
19
|
+
_libimported = None
|
|
20
|
+
|
|
21
|
+
if wx.Platform == "__WXMSW__":
|
|
22
|
+
osVersion = wx.GetOsVersion()
|
|
23
|
+
# Shadows behind menus are supported only in XP
|
|
24
|
+
if osVersion[1] == 5 and osVersion[2] == 1:
|
|
25
|
+
try:
|
|
26
|
+
import win32api
|
|
27
|
+
import win32con
|
|
28
|
+
import winxpgui
|
|
29
|
+
_libimported = "MH"
|
|
30
|
+
except:
|
|
31
|
+
try:
|
|
32
|
+
import ctypes
|
|
33
|
+
_libimported = "ctypes"
|
|
34
|
+
except:
|
|
35
|
+
pass
|
|
36
|
+
else:
|
|
37
|
+
_libimported = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class DCSaver(object):
|
|
41
|
+
"""
|
|
42
|
+
Construct a DC saver. The dc is copied as-is.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def __init__(self, pdc):
|
|
46
|
+
"""
|
|
47
|
+
Default class constructor.
|
|
48
|
+
|
|
49
|
+
:param `pdc`: an instance of :class:`wx.DC`.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
self._pdc = pdc
|
|
53
|
+
self._pen = pdc.GetPen()
|
|
54
|
+
self._brush = pdc.GetBrush()
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def __del__(self):
|
|
58
|
+
""" While destructing, restores the dc pen and brush. """
|
|
59
|
+
|
|
60
|
+
if self._pdc:
|
|
61
|
+
self._pdc.SetPen(self._pen)
|
|
62
|
+
self._pdc.SetBrush(self._brush)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# ---------------------------------------------------------------------------- #
|
|
66
|
+
# Class RendererBase
|
|
67
|
+
# ---------------------------------------------------------------------------- #
|
|
68
|
+
|
|
69
|
+
class RendererBase(object):
|
|
70
|
+
""" Base class for all theme renderers. """
|
|
71
|
+
|
|
72
|
+
def __init__(self):
|
|
73
|
+
""" Default class constructor. Intentionally empty. """
|
|
74
|
+
|
|
75
|
+
pass
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def DrawButtonBorders(self, dc, rect, penColour, brushColour):
|
|
79
|
+
"""
|
|
80
|
+
Draws borders for buttons.
|
|
81
|
+
|
|
82
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
83
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
84
|
+
:param `penColour`: a valid :class:`wx.Colour` for the pen border;
|
|
85
|
+
:param `brushColour`: a valid :class:`wx.Colour` for the brush.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
# Keep old pen and brush
|
|
89
|
+
dcsaver = DCSaver(dc)
|
|
90
|
+
dc.SetPen(wx.Pen(penColour))
|
|
91
|
+
dc.SetBrush(wx.Brush(brushColour))
|
|
92
|
+
dc.DrawRectangle(rect)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def DrawBitmapArea(self, dc, xpm_name, rect, baseColour, flipSide):
|
|
96
|
+
"""
|
|
97
|
+
Draws the area below a bitmap and the bitmap itself using a gradient shading.
|
|
98
|
+
|
|
99
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
100
|
+
:param string `xpm_name`: a name of a XPM bitmap;
|
|
101
|
+
:param wx.Rect `rect`: the bitmap client rectangle;
|
|
102
|
+
:param `baseColour`: a valid :class:`wx.Colour` for the bitmap background;
|
|
103
|
+
:param bool `flipSide`: ``True`` to flip the gradient direction, ``False`` otherwise.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
# draw the gradient area
|
|
107
|
+
if not flipSide:
|
|
108
|
+
ArtManager.Get().PaintDiagonalGradientBox(dc, rect, wx.WHITE,
|
|
109
|
+
ArtManager.Get().LightColour(baseColour, 20),
|
|
110
|
+
True, False)
|
|
111
|
+
else:
|
|
112
|
+
ArtManager.Get().PaintDiagonalGradientBox(dc, rect, ArtManager.Get().LightColour(baseColour, 20),
|
|
113
|
+
wx.WHITE, True, False)
|
|
114
|
+
|
|
115
|
+
# draw arrow
|
|
116
|
+
arrowDown = wx.Bitmap(xpm_name)
|
|
117
|
+
arrowDown.SetMask(wx.Mask(arrowDown, wx.WHITE))
|
|
118
|
+
dc.DrawBitmap(arrowDown, rect.x + 1 , rect.y + 1, True)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def DrawBitmapBorders(self, dc, rect, penColour, bitmapBorderUpperLeftPen):
|
|
122
|
+
"""
|
|
123
|
+
Draws borders for a bitmap.
|
|
124
|
+
|
|
125
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
126
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
127
|
+
:param `penColour`: a valid :class:`wx.Colour` for the pen border;
|
|
128
|
+
:param `bitmapBorderUpperLeftPen`: a valid :class:`wx.Colour` for the pen upper
|
|
129
|
+
left border.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
# Keep old pen and brush
|
|
133
|
+
dcsaver = DCSaver(dc)
|
|
134
|
+
|
|
135
|
+
# lower right size
|
|
136
|
+
dc.SetPen(wx.Pen(penColour))
|
|
137
|
+
dc.DrawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width, rect.y + rect.height - 1)
|
|
138
|
+
dc.DrawLine(rect.x + rect.width - 1, rect.y, rect.x + rect.width - 1, rect.y + rect.height)
|
|
139
|
+
|
|
140
|
+
# upper left side
|
|
141
|
+
dc.SetPen(wx.Pen(bitmapBorderUpperLeftPen))
|
|
142
|
+
dc.DrawLine(rect.x, rect.y, rect.x + rect.width, rect.y)
|
|
143
|
+
dc.DrawLine(rect.x, rect.y, rect.x, rect.y + rect.height)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def GetMenuFaceColour(self):
|
|
147
|
+
"""
|
|
148
|
+
Returns the foreground colour for the menu.
|
|
149
|
+
|
|
150
|
+
:return: An instance of :class:`wx.Colour`.
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
return ArtManager.Get().LightColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE), 80)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def GetTextColourEnable(self):
|
|
157
|
+
"""
|
|
158
|
+
Returns the colour used for text colour when enabled.
|
|
159
|
+
|
|
160
|
+
:return: An instance of :class:`wx.Colour`.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
return wx.BLACK
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def GetTextColourDisable(self):
|
|
167
|
+
"""
|
|
168
|
+
Returns the colour used for text colour when disabled.
|
|
169
|
+
|
|
170
|
+
:return: An instance of :class:`wx.Colour`.
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
return ArtManager.Get().LightColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT), 30)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def GetFont(self):
|
|
177
|
+
"""
|
|
178
|
+
Returns the font used for text.
|
|
179
|
+
|
|
180
|
+
:return: An instance of :class:`wx.Font`.
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
return wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# ---------------------------------------------------------------------------- #
|
|
187
|
+
# Class RendererXP
|
|
188
|
+
# ---------------------------------------------------------------------------- #
|
|
189
|
+
|
|
190
|
+
class RendererXP(RendererBase):
|
|
191
|
+
""" Xp-Style renderer. """
|
|
192
|
+
|
|
193
|
+
def __init__(self):
|
|
194
|
+
""" Default class constructor. """
|
|
195
|
+
|
|
196
|
+
RendererBase.__init__(self)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def DrawButton(self, dc, rect, state, input=None):
|
|
200
|
+
"""
|
|
201
|
+
Draws a button using the XP theme.
|
|
202
|
+
|
|
203
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
204
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
205
|
+
:param integer `state`: the button state;
|
|
206
|
+
:param `input`: a flag used to call the right method.
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
if input is None or type(input) == type(False):
|
|
210
|
+
self.DrawButtonTheme(dc, rect, state, input)
|
|
211
|
+
else:
|
|
212
|
+
self.DrawButtonColour(dc, rect, state, input)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def DrawButtonTheme(self, dc, rect, state, useLightColours=None):
|
|
216
|
+
"""
|
|
217
|
+
Draws a button using the XP theme.
|
|
218
|
+
|
|
219
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
220
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
221
|
+
:param integer `state`: the button state;
|
|
222
|
+
:param bool `useLightColours`: ``True`` to use light colours, ``False`` otherwise.
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
# switch according to the status
|
|
226
|
+
if state == ControlFocus:
|
|
227
|
+
penColour = ArtManager.Get().FrameColour()
|
|
228
|
+
brushColour = ArtManager.Get().BackgroundColour()
|
|
229
|
+
elif state == ControlPressed:
|
|
230
|
+
penColour = ArtManager.Get().FrameColour()
|
|
231
|
+
brushColour = ArtManager.Get().HighlightBackgroundColour()
|
|
232
|
+
else:
|
|
233
|
+
penColour = ArtManager.Get().FrameColour()
|
|
234
|
+
brushColour = ArtManager.Get().BackgroundColour()
|
|
235
|
+
|
|
236
|
+
# Draw the button borders
|
|
237
|
+
self.DrawButtonBorders(dc, rect, penColour, brushColour)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def DrawButtonColour(self, dc, rect, state, colour):
|
|
241
|
+
"""
|
|
242
|
+
Draws a button using the XP theme.
|
|
243
|
+
|
|
244
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
245
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
246
|
+
:param integer `state`: the button state;
|
|
247
|
+
:param `colour`: a valid :class:`wx.Colour` instance.
|
|
248
|
+
"""
|
|
249
|
+
|
|
250
|
+
# switch according to the status
|
|
251
|
+
if statet == ControlFocus:
|
|
252
|
+
penColour = colour
|
|
253
|
+
brushColour = ArtManager.Get().LightColour(colour, 75)
|
|
254
|
+
elif state == ControlPressed:
|
|
255
|
+
penColour = colour
|
|
256
|
+
brushColour = ArtManager.Get().LightColour(colour, 60)
|
|
257
|
+
else:
|
|
258
|
+
penColour = colour
|
|
259
|
+
brushColour = ArtManager.Get().LightColour(colour, 75)
|
|
260
|
+
|
|
261
|
+
# Draw the button borders
|
|
262
|
+
self.DrawButtonBorders(dc, rect, penColour, brushColour)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def DrawMenuBarBg(self, dc, rect):
|
|
266
|
+
"""
|
|
267
|
+
Draws the menu bar background according to the active theme.
|
|
268
|
+
|
|
269
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
270
|
+
:param wx.Rect `rect`: the menu bar's client rectangle.
|
|
271
|
+
"""
|
|
272
|
+
|
|
273
|
+
# For office style, we simple draw a rectangle with a gradient colouring
|
|
274
|
+
artMgr = ArtManager.Get()
|
|
275
|
+
vertical = artMgr.GetMBVerticalGradient()
|
|
276
|
+
|
|
277
|
+
dcsaver = DCSaver(dc)
|
|
278
|
+
|
|
279
|
+
# fill with gradient
|
|
280
|
+
startColour = artMgr.GetMenuBarFaceColour()
|
|
281
|
+
if artMgr.IsDark(startColour):
|
|
282
|
+
startColour = artMgr.LightColour(startColour, 50)
|
|
283
|
+
|
|
284
|
+
endColour = artMgr.LightColour(startColour, 90)
|
|
285
|
+
artMgr.PaintStraightGradientBox(dc, rect, startColour, endColour, vertical)
|
|
286
|
+
|
|
287
|
+
# Draw the border
|
|
288
|
+
if artMgr.GetMenuBarBorder():
|
|
289
|
+
|
|
290
|
+
dc.SetPen(wx.Pen(startColour))
|
|
291
|
+
dc.SetBrush(wx.TRANSPARENT_BRUSH)
|
|
292
|
+
dc.DrawRectangle(rect)
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def DrawToolBarBg(self, dc, rect):
|
|
296
|
+
"""
|
|
297
|
+
Draws the toolbar background according to the active theme.
|
|
298
|
+
|
|
299
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
300
|
+
:param wx.Rect `rect`: the toolbar's client rectangle.
|
|
301
|
+
"""
|
|
302
|
+
|
|
303
|
+
artMgr = ArtManager.Get()
|
|
304
|
+
|
|
305
|
+
if not artMgr.GetRaiseToolbar():
|
|
306
|
+
return
|
|
307
|
+
|
|
308
|
+
# For office style, we simple draw a rectangle with a gradient colouring
|
|
309
|
+
vertical = artMgr.GetMBVerticalGradient()
|
|
310
|
+
|
|
311
|
+
dcsaver = DCSaver(dc)
|
|
312
|
+
|
|
313
|
+
# fill with gradient
|
|
314
|
+
startColour = artMgr.GetMenuBarFaceColour()
|
|
315
|
+
if artMgr.IsDark(startColour):
|
|
316
|
+
startColour = artMgr.LightColour(startColour, 50)
|
|
317
|
+
|
|
318
|
+
startColour = artMgr.LightColour(startColour, 20)
|
|
319
|
+
|
|
320
|
+
endColour = artMgr.LightColour(startColour, 90)
|
|
321
|
+
artMgr.PaintStraightGradientBox(dc, rect, startColour, endColour, vertical)
|
|
322
|
+
artMgr.DrawBitmapShadow(dc, rect)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def GetTextColourEnable(self):
|
|
326
|
+
"""
|
|
327
|
+
Returns the colour used for text colour when enabled.
|
|
328
|
+
|
|
329
|
+
:return: An instance of :class:`wx.Colour`.
|
|
330
|
+
"""
|
|
331
|
+
|
|
332
|
+
return wx.BLACK
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
# ---------------------------------------------------------------------------- #
|
|
336
|
+
# Class RendererMSOffice2007
|
|
337
|
+
# ---------------------------------------------------------------------------- #
|
|
338
|
+
|
|
339
|
+
class RendererMSOffice2007(RendererBase):
|
|
340
|
+
""" Windows MS Office 2007 style. """
|
|
341
|
+
|
|
342
|
+
def __init__(self):
|
|
343
|
+
""" Default class constructor. """
|
|
344
|
+
|
|
345
|
+
RendererBase.__init__(self)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def GetColoursAccordingToState(self, state):
|
|
349
|
+
"""
|
|
350
|
+
Returns a :class:`wx.Colour` according to the menu item state.
|
|
351
|
+
|
|
352
|
+
:param integer `state`: one of the following bits:
|
|
353
|
+
|
|
354
|
+
==================== ======= ==========================
|
|
355
|
+
Item State Value Description
|
|
356
|
+
==================== ======= ==========================
|
|
357
|
+
``ControlPressed`` 0 The item is pressed
|
|
358
|
+
``ControlFocus`` 1 The item is focused
|
|
359
|
+
``ControlDisabled`` 2 The item is disabled
|
|
360
|
+
``ControlNormal`` 3 Normal state
|
|
361
|
+
==================== ======= ==========================
|
|
362
|
+
|
|
363
|
+
:return: An instance of :class:`wx.Colour`.
|
|
364
|
+
"""
|
|
365
|
+
|
|
366
|
+
# switch according to the status
|
|
367
|
+
if state == ControlFocus:
|
|
368
|
+
upperBoxTopPercent = 95
|
|
369
|
+
upperBoxBottomPercent = 50
|
|
370
|
+
lowerBoxTopPercent = 40
|
|
371
|
+
lowerBoxBottomPercent = 90
|
|
372
|
+
concaveUpperBox = True
|
|
373
|
+
concaveLowerBox = True
|
|
374
|
+
|
|
375
|
+
elif state == ControlPressed:
|
|
376
|
+
upperBoxTopPercent = 75
|
|
377
|
+
upperBoxBottomPercent = 90
|
|
378
|
+
lowerBoxTopPercent = 90
|
|
379
|
+
lowerBoxBottomPercent = 40
|
|
380
|
+
concaveUpperBox = True
|
|
381
|
+
concaveLowerBox = True
|
|
382
|
+
|
|
383
|
+
elif state == ControlDisabled:
|
|
384
|
+
upperBoxTopPercent = 100
|
|
385
|
+
upperBoxBottomPercent = 100
|
|
386
|
+
lowerBoxTopPercent = 70
|
|
387
|
+
lowerBoxBottomPercent = 70
|
|
388
|
+
concaveUpperBox = True
|
|
389
|
+
concaveLowerBox = True
|
|
390
|
+
|
|
391
|
+
else:
|
|
392
|
+
upperBoxTopPercent = 90
|
|
393
|
+
upperBoxBottomPercent = 50
|
|
394
|
+
lowerBoxTopPercent = 30
|
|
395
|
+
lowerBoxBottomPercent = 75
|
|
396
|
+
concaveUpperBox = True
|
|
397
|
+
concaveLowerBox = True
|
|
398
|
+
|
|
399
|
+
return upperBoxTopPercent, upperBoxBottomPercent, lowerBoxTopPercent, lowerBoxBottomPercent, \
|
|
400
|
+
concaveUpperBox, concaveLowerBox
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
def DrawButton(self, dc, rect, state, useLightColours):
|
|
404
|
+
"""
|
|
405
|
+
Draws a button using the MS Office 2007 theme.
|
|
406
|
+
|
|
407
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
408
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
409
|
+
:param integer `state`: the button state;
|
|
410
|
+
:param bool `useLightColours`: ``True`` to use light colours, ``False`` otherwise.
|
|
411
|
+
"""
|
|
412
|
+
|
|
413
|
+
self.DrawButtonColour(dc, rect, state, ArtManager.Get().GetThemeBaseColour(useLightColours))
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
def DrawButtonColour(self, dc, rect, state, colour):
|
|
417
|
+
"""
|
|
418
|
+
Draws a button using the MS Office 2007 theme.
|
|
419
|
+
|
|
420
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
421
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
422
|
+
:param integer `state`: the button state;
|
|
423
|
+
:param `colour`: a valid :class:`wx.Colour` instance.
|
|
424
|
+
"""
|
|
425
|
+
|
|
426
|
+
artMgr = ArtManager.Get()
|
|
427
|
+
|
|
428
|
+
# Keep old pen and brush
|
|
429
|
+
dcsaver = DCSaver(dc)
|
|
430
|
+
|
|
431
|
+
# Define the rounded rectangle base on the given rect
|
|
432
|
+
# we need an array of 9 points for it
|
|
433
|
+
baseColour = colour
|
|
434
|
+
|
|
435
|
+
# Define the middle points
|
|
436
|
+
leftPt = wx.Point(rect.x, rect.y + (rect.height / 2))
|
|
437
|
+
rightPt = wx.Point(rect.x + rect.width-1, rect.y + (rect.height / 2))
|
|
438
|
+
|
|
439
|
+
# Define the top region
|
|
440
|
+
top = wx.Rect((rect.GetLeft(), rect.GetTop()), rightPt)
|
|
441
|
+
bottom = wx.Rect(leftPt, (rect.GetRight(), rect.GetBottom()))
|
|
442
|
+
|
|
443
|
+
upperBoxTopPercent, upperBoxBottomPercent, lowerBoxTopPercent, lowerBoxBottomPercent, \
|
|
444
|
+
concaveUpperBox, concaveLowerBox = self.GetColoursAccordingToState(state)
|
|
445
|
+
|
|
446
|
+
topStartColour = artMgr.LightColour(baseColour, upperBoxTopPercent)
|
|
447
|
+
topEndColour = artMgr.LightColour(baseColour, upperBoxBottomPercent)
|
|
448
|
+
bottomStartColour = artMgr.LightColour(baseColour, lowerBoxTopPercent)
|
|
449
|
+
bottomEndColour = artMgr.LightColour(baseColour, lowerBoxBottomPercent)
|
|
450
|
+
|
|
451
|
+
artMgr.PaintStraightGradientBox(dc, top, topStartColour, topEndColour)
|
|
452
|
+
artMgr.PaintStraightGradientBox(dc, bottom, bottomStartColour, bottomEndColour)
|
|
453
|
+
|
|
454
|
+
rr = wx.Rect(rect.x, rect.y, rect.width, rect.height)
|
|
455
|
+
dc.SetBrush(wx.TRANSPARENT_BRUSH)
|
|
456
|
+
|
|
457
|
+
frameColour = artMgr.LightColour(baseColour, 60)
|
|
458
|
+
dc.SetPen(wx.Pen(frameColour))
|
|
459
|
+
dc.DrawRectangle(rr)
|
|
460
|
+
|
|
461
|
+
wc = artMgr.LightColour(baseColour, 80)
|
|
462
|
+
dc.SetPen(wx.Pen(wc))
|
|
463
|
+
rr.Deflate(1, 1)
|
|
464
|
+
dc.DrawRectangle(rr)
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def DrawMenuBarBg(self, dc, rect):
|
|
468
|
+
"""
|
|
469
|
+
Draws the menu bar background according to the active theme.
|
|
470
|
+
|
|
471
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
472
|
+
:param wx.Rect `rect`: the menu bar's client rectangle.
|
|
473
|
+
"""
|
|
474
|
+
|
|
475
|
+
# Keep old pen and brush
|
|
476
|
+
dcsaver = DCSaver(dc)
|
|
477
|
+
artMgr = ArtManager.Get()
|
|
478
|
+
baseColour = artMgr.GetMenuBarFaceColour()
|
|
479
|
+
|
|
480
|
+
dc.SetBrush(wx.Brush(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)))
|
|
481
|
+
dc.SetPen(wx.Pen(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)))
|
|
482
|
+
dc.DrawRectangle(rect)
|
|
483
|
+
|
|
484
|
+
# Define the rounded rectangle base on the given rect
|
|
485
|
+
# we need an array of 9 points for it
|
|
486
|
+
regPts = [wx.Point() for ii in range(9)]
|
|
487
|
+
radius = 2
|
|
488
|
+
|
|
489
|
+
regPts[0] = wx.Point(rect.x, rect.y + radius)
|
|
490
|
+
regPts[1] = wx.Point(rect.x+radius, rect.y)
|
|
491
|
+
regPts[2] = wx.Point(rect.x+rect.width-radius-1, rect.y)
|
|
492
|
+
regPts[3] = wx.Point(rect.x+rect.width-1, rect.y + radius)
|
|
493
|
+
regPts[4] = wx.Point(rect.x+rect.width-1, rect.y + rect.height - radius - 1)
|
|
494
|
+
regPts[5] = wx.Point(rect.x+rect.width-radius-1, rect.y + rect.height-1)
|
|
495
|
+
regPts[6] = wx.Point(rect.x+radius, rect.y + rect.height-1)
|
|
496
|
+
regPts[7] = wx.Point(rect.x, rect.y + rect.height - radius - 1)
|
|
497
|
+
regPts[8] = regPts[0]
|
|
498
|
+
|
|
499
|
+
# Define the middle points
|
|
500
|
+
|
|
501
|
+
factor = artMgr.GetMenuBgFactor()
|
|
502
|
+
|
|
503
|
+
leftPt1 = wx.Point(rect.x, rect.y + (rect.height / factor))
|
|
504
|
+
leftPt2 = wx.Point(rect.x, rect.y + (rect.height / factor)*(factor-1))
|
|
505
|
+
|
|
506
|
+
rightPt1 = wx.Point(rect.x + rect.width, rect.y + (rect.height / factor))
|
|
507
|
+
rightPt2 = wx.Point(rect.x + rect.width, rect.y + (rect.height / factor)*(factor-1))
|
|
508
|
+
|
|
509
|
+
# Define the top region
|
|
510
|
+
topReg = [wx.Point() for ii in range(7)]
|
|
511
|
+
topReg[0] = regPts[0]
|
|
512
|
+
topReg[1] = regPts[1]
|
|
513
|
+
topReg[2] = wx.Point(regPts[2].x+1, regPts[2].y)
|
|
514
|
+
topReg[3] = wx.Point(regPts[3].x + 1, regPts[3].y)
|
|
515
|
+
topReg[4] = wx.Point(rightPt1.x, rightPt1.y+1)
|
|
516
|
+
topReg[5] = wx.Point(leftPt1.x, leftPt1.y+1)
|
|
517
|
+
topReg[6] = topReg[0]
|
|
518
|
+
|
|
519
|
+
# Define the middle region
|
|
520
|
+
middle = wx.Rect(leftPt1, wx.Point(rightPt2.x - 2, rightPt2.y))
|
|
521
|
+
|
|
522
|
+
# Define the bottom region
|
|
523
|
+
bottom = wx.Rect(leftPt2, wx.Point(rect.GetRight() - 1, rect.GetBottom()))
|
|
524
|
+
|
|
525
|
+
topStartColour = artMgr.LightColour(baseColour, 90)
|
|
526
|
+
topEndColour = artMgr.LightColour(baseColour, 60)
|
|
527
|
+
bottomStartColour = artMgr.LightColour(baseColour, 40)
|
|
528
|
+
bottomEndColour = artMgr.LightColour(baseColour, 20)
|
|
529
|
+
|
|
530
|
+
topRegion = wx.Region(topReg)
|
|
531
|
+
|
|
532
|
+
artMgr.PaintGradientRegion(dc, topRegion, topStartColour, topEndColour)
|
|
533
|
+
artMgr.PaintStraightGradientBox(dc, bottom, bottomStartColour, bottomEndColour)
|
|
534
|
+
artMgr.PaintStraightGradientBox(dc, middle, topEndColour, bottomStartColour)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
def DrawToolBarBg(self, dc, rect):
|
|
538
|
+
"""
|
|
539
|
+
Draws the toolbar background according to the active theme.
|
|
540
|
+
|
|
541
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
542
|
+
:param wx.Rect `rect`: the toolbar's client rectangle.
|
|
543
|
+
"""
|
|
544
|
+
|
|
545
|
+
artMgr = ArtManager.Get()
|
|
546
|
+
|
|
547
|
+
if not artMgr.GetRaiseToolbar():
|
|
548
|
+
return
|
|
549
|
+
|
|
550
|
+
# Keep old pen and brush
|
|
551
|
+
dcsaver = DCSaver(dc)
|
|
552
|
+
|
|
553
|
+
baseColour = artMgr.GetMenuBarFaceColour()
|
|
554
|
+
baseColour = artMgr.LightColour(baseColour, 20)
|
|
555
|
+
|
|
556
|
+
dc.SetBrush(wx.Brush(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)))
|
|
557
|
+
dc.SetPen(wx.Pen(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)))
|
|
558
|
+
dc.DrawRectangle(rect)
|
|
559
|
+
|
|
560
|
+
radius = 2
|
|
561
|
+
|
|
562
|
+
# Define the rounded rectangle base on the given rect
|
|
563
|
+
# we need an array of 9 points for it
|
|
564
|
+
regPts = [None]*9
|
|
565
|
+
|
|
566
|
+
regPts[0] = wx.Point(rect.x, rect.y + radius)
|
|
567
|
+
regPts[1] = wx.Point(rect.x+radius, rect.y)
|
|
568
|
+
regPts[2] = wx.Point(rect.x+rect.width-radius-1, rect.y)
|
|
569
|
+
regPts[3] = wx.Point(rect.x+rect.width-1, rect.y + radius)
|
|
570
|
+
regPts[4] = wx.Point(rect.x+rect.width-1, rect.y + rect.height - radius - 1)
|
|
571
|
+
regPts[5] = wx.Point(rect.x+rect.width-radius-1, rect.y + rect.height-1)
|
|
572
|
+
regPts[6] = wx.Point(rect.x+radius, rect.y + rect.height-1)
|
|
573
|
+
regPts[7] = wx.Point(rect.x, rect.y + rect.height - radius - 1)
|
|
574
|
+
regPts[8] = regPts[0]
|
|
575
|
+
|
|
576
|
+
# Define the middle points
|
|
577
|
+
factor = artMgr.GetMenuBgFactor()
|
|
578
|
+
|
|
579
|
+
leftPt1 = wx.Point(rect.x, rect.y + (rect.height / factor))
|
|
580
|
+
rightPt1 = wx.Point(rect.x + rect.width, rect.y + (rect.height / factor))
|
|
581
|
+
|
|
582
|
+
leftPt2 = wx.Point(rect.x, rect.y + (rect.height / factor)*(factor-1))
|
|
583
|
+
rightPt2 = wx.Point(rect.x + rect.width, rect.y + (rect.height / factor)*(factor-1))
|
|
584
|
+
|
|
585
|
+
# Define the top region
|
|
586
|
+
topReg = [None]*7
|
|
587
|
+
topReg[0] = regPts[0]
|
|
588
|
+
topReg[1] = regPts[1]
|
|
589
|
+
topReg[2] = wx.Point(regPts[2].x+1, regPts[2].y)
|
|
590
|
+
topReg[3] = wx.Point(regPts[3].x + 1, regPts[3].y)
|
|
591
|
+
topReg[4] = wx.Point(rightPt1.x, rightPt1.y+1)
|
|
592
|
+
topReg[5] = wx.Point(leftPt1.x, leftPt1.y+1)
|
|
593
|
+
topReg[6] = topReg[0]
|
|
594
|
+
|
|
595
|
+
# Define the middle region
|
|
596
|
+
middle = wx.Rect(leftPt1, wx.Point(rightPt2.x - 2, rightPt2.y))
|
|
597
|
+
|
|
598
|
+
# Define the bottom region
|
|
599
|
+
bottom = wx.Rect(leftPt2, wx.Point(rect.GetRight() - 1, rect.GetBottom()))
|
|
600
|
+
|
|
601
|
+
topStartColour = artMgr.LightColour(baseColour, 90)
|
|
602
|
+
topEndColour = artMgr.LightColour(baseColour, 60)
|
|
603
|
+
bottomStartColour = artMgr.LightColour(baseColour, 40)
|
|
604
|
+
bottomEndColour = artMgr.LightColour(baseColour, 20)
|
|
605
|
+
|
|
606
|
+
topRegion = wx.Region(topReg)
|
|
607
|
+
|
|
608
|
+
artMgr.PaintGradientRegion(dc, topRegion, topStartColour, topEndColour)
|
|
609
|
+
artMgr.PaintStraightGradientBox(dc, bottom, bottomStartColour, bottomEndColour)
|
|
610
|
+
artMgr.PaintStraightGradientBox(dc, middle, topEndColour, bottomStartColour)
|
|
611
|
+
|
|
612
|
+
artMgr.DrawBitmapShadow(dc, rect)
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
def GetTextColourEnable(self):
|
|
616
|
+
"""
|
|
617
|
+
Returns the colour used for text colour when enabled.
|
|
618
|
+
|
|
619
|
+
:return: An instance of :class:`wx.Colour`.
|
|
620
|
+
"""
|
|
621
|
+
|
|
622
|
+
return wx.Colour("MIDNIGHT BLUE")
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
# ---------------------------------------------------------------------------- #
|
|
626
|
+
# Class ArtManager
|
|
627
|
+
# ---------------------------------------------------------------------------- #
|
|
628
|
+
|
|
629
|
+
class ArtManager(wx.EvtHandler):
|
|
630
|
+
|
|
631
|
+
"""
|
|
632
|
+
This class provides various art utilities, such as creating shadow, providing
|
|
633
|
+
lighter / darker colours for a given colour, etc...
|
|
634
|
+
"""
|
|
635
|
+
|
|
636
|
+
_alignmentBuffer = 7
|
|
637
|
+
_menuTheme = StyleXP
|
|
638
|
+
_verticalGradient = False
|
|
639
|
+
_renderers = {StyleXP: None, Style2007: None}
|
|
640
|
+
_bmpShadowEnabled = False
|
|
641
|
+
_ms2007sunken = False
|
|
642
|
+
_drowMBBorder = True
|
|
643
|
+
_menuBgFactor = 5
|
|
644
|
+
_menuBarColourScheme = _("Default")
|
|
645
|
+
_raiseTB = True
|
|
646
|
+
_bitmaps = {}
|
|
647
|
+
_transparency = 255
|
|
648
|
+
|
|
649
|
+
def __init__(self):
|
|
650
|
+
""" Default class constructor. """
|
|
651
|
+
|
|
652
|
+
wx.EvtHandler.__init__(self)
|
|
653
|
+
self._menuBarBgColour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)
|
|
654
|
+
|
|
655
|
+
# connect an event handler to the system colour change event
|
|
656
|
+
self.Bind(wx.EVT_SYS_COLOUR_CHANGED, self.OnSysColourChange)
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
def SetTransparency(self, amount):
|
|
660
|
+
"""
|
|
661
|
+
Sets the alpha channel value for transparent windows.
|
|
662
|
+
|
|
663
|
+
:param integer `amount`: the actual transparency value (between 0 and 255).
|
|
664
|
+
|
|
665
|
+
:raise: `Exception` if the `amount` parameter is lower than ``0`` or greater than ``255``.
|
|
666
|
+
"""
|
|
667
|
+
|
|
668
|
+
if self._transparency == amount:
|
|
669
|
+
return
|
|
670
|
+
|
|
671
|
+
if amount < 0 or amount > 255:
|
|
672
|
+
raise Exception("Invalid transparency value")
|
|
673
|
+
|
|
674
|
+
self._transparency = amount
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def GetTransparency(self):
|
|
678
|
+
"""
|
|
679
|
+
Returns the alpha channel value for transparent windows.
|
|
680
|
+
|
|
681
|
+
:return: An integer representing the alpha channel value.
|
|
682
|
+
"""
|
|
683
|
+
|
|
684
|
+
return self._transparency
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
def ConvertToBitmap(self, xpm, alpha=None):
|
|
688
|
+
"""
|
|
689
|
+
Convert the given image to a bitmap, optionally overlaying an alpha
|
|
690
|
+
channel to it.
|
|
691
|
+
|
|
692
|
+
:param `xpm`: a list of strings formatted as XPM;
|
|
693
|
+
:type `xpm`: list of strings
|
|
694
|
+
:param `alpha`: a list of alpha values, the same size as the xpm bitmap.
|
|
695
|
+
:type `alpha`: list of integers
|
|
696
|
+
|
|
697
|
+
:return: An instance of :class:`wx.Bitmap`.
|
|
698
|
+
"""
|
|
699
|
+
|
|
700
|
+
if alpha is not None:
|
|
701
|
+
|
|
702
|
+
img = wx.Bitmap(xpm)
|
|
703
|
+
img = img.ConvertToImage()
|
|
704
|
+
x, y = img.GetWidth(), img.GetHeight()
|
|
705
|
+
img.InitAlpha()
|
|
706
|
+
for jj in range(y):
|
|
707
|
+
for ii in range(x):
|
|
708
|
+
img.SetAlpha(ii, jj, alpha[jj*x+ii])
|
|
709
|
+
|
|
710
|
+
else:
|
|
711
|
+
|
|
712
|
+
stream = BytesIO(xpm)
|
|
713
|
+
img = wx.Image(stream)
|
|
714
|
+
|
|
715
|
+
return wx.Bitmap(img)
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
def Initialize(self):
|
|
719
|
+
""" Initializes the bitmaps and colours. """
|
|
720
|
+
|
|
721
|
+
# create wxBitmaps from the xpm's
|
|
722
|
+
self._rightBottomCorner = self.ConvertToBitmap(shadow_center_xpm, shadow_center_alpha)
|
|
723
|
+
self._bottom = self.ConvertToBitmap(shadow_bottom_xpm, shadow_bottom_alpha)
|
|
724
|
+
self._bottomLeft = self.ConvertToBitmap(shadow_bottom_left_xpm, shadow_bottom_left_alpha)
|
|
725
|
+
self._rightTop = self.ConvertToBitmap(shadow_right_top_xpm, shadow_right_top_alpha)
|
|
726
|
+
self._right = self.ConvertToBitmap(shadow_right_xpm, shadow_right_alpha)
|
|
727
|
+
|
|
728
|
+
# initialise the colour map
|
|
729
|
+
self.InitColours()
|
|
730
|
+
self.SetMenuBarColour(self._menuBarColourScheme)
|
|
731
|
+
|
|
732
|
+
# Create common bitmaps
|
|
733
|
+
self.FillStockBitmaps()
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
def FillStockBitmaps(self):
|
|
737
|
+
""" Initializes few standard bitmaps. """
|
|
738
|
+
|
|
739
|
+
bmp = self.ConvertToBitmap(arrow_down, alpha=None)
|
|
740
|
+
bmp.SetMask(wx.Mask(bmp, wx.Colour(0, 128, 128)))
|
|
741
|
+
self._bitmaps.update({"arrow_down": bmp})
|
|
742
|
+
|
|
743
|
+
bmp = self.ConvertToBitmap(arrow_up, alpha=None)
|
|
744
|
+
bmp.SetMask(wx.Mask(bmp, wx.Colour(0, 128, 128)))
|
|
745
|
+
self._bitmaps.update({"arrow_up": bmp})
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
def GetStockBitmap(self, name):
|
|
749
|
+
"""
|
|
750
|
+
Returns a bitmap from a stock.
|
|
751
|
+
|
|
752
|
+
:param string `name`: the bitmap name.
|
|
753
|
+
|
|
754
|
+
:return: The stock bitmap, if `name` was found in the stock bitmap dictionary.
|
|
755
|
+
Othewise, :class:`NullBitmap` is returned.
|
|
756
|
+
"""
|
|
757
|
+
|
|
758
|
+
return self._bitmaps.get(name, wx.NullBitmap)
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
def Get(self):
|
|
762
|
+
"""
|
|
763
|
+
Accessor to the unique art manager object.
|
|
764
|
+
|
|
765
|
+
:return: A unique instance of :class:`ArtManager`.
|
|
766
|
+
"""
|
|
767
|
+
|
|
768
|
+
if not hasattr(self, "_instance"):
|
|
769
|
+
|
|
770
|
+
self._instance = ArtManager()
|
|
771
|
+
self._instance.Initialize()
|
|
772
|
+
|
|
773
|
+
# Initialize the renderers map
|
|
774
|
+
self._renderers[StyleXP] = RendererXP()
|
|
775
|
+
self._renderers[Style2007] = RendererMSOffice2007()
|
|
776
|
+
|
|
777
|
+
return self._instance
|
|
778
|
+
|
|
779
|
+
Get = classmethod(Get)
|
|
780
|
+
|
|
781
|
+
def Free(self):
|
|
782
|
+
""" Destructor for the unique art manager object. """
|
|
783
|
+
|
|
784
|
+
if hasattr(self, "_instance"):
|
|
785
|
+
|
|
786
|
+
del self._instance
|
|
787
|
+
|
|
788
|
+
Free = classmethod(Free)
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
def OnSysColourChange(self, event):
|
|
792
|
+
"""
|
|
793
|
+
Handles the ``wx.EVT_SYS_COLOUR_CHANGED`` event for :class:`ArtManager`.
|
|
794
|
+
|
|
795
|
+
:param `event`: a :class:`SysColourChangedEvent` event to be processed.
|
|
796
|
+
"""
|
|
797
|
+
|
|
798
|
+
# reinitialise the colour map
|
|
799
|
+
self.InitColours()
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
def LightColour(self, colour, percent):
|
|
803
|
+
"""
|
|
804
|
+
Return light contrast of `colour`. The colour returned is from the scale of
|
|
805
|
+
`colour` ==> white.
|
|
806
|
+
|
|
807
|
+
:param `colour`: the input colour to be brightened, an instance of :class:`wx.Colour`;
|
|
808
|
+
:param integer `percent`: determines how light the colour will be. `percent` = ``100``
|
|
809
|
+
returns white, `percent` = ``0`` returns `colour`.
|
|
810
|
+
|
|
811
|
+
:return: A light contrast of the input `colour`, an instance of :class:`wx.Colour`.
|
|
812
|
+
"""
|
|
813
|
+
|
|
814
|
+
end_colour = wx.WHITE
|
|
815
|
+
rd = end_colour.Red() - colour.Red()
|
|
816
|
+
gd = end_colour.Green() - colour.Green()
|
|
817
|
+
bd = end_colour.Blue() - colour.Blue()
|
|
818
|
+
high = 100
|
|
819
|
+
|
|
820
|
+
# We take the percent way of the colour from colour -. white
|
|
821
|
+
i = percent
|
|
822
|
+
r = colour.Red() + ((i*rd*100)/high)/100
|
|
823
|
+
g = colour.Green() + ((i*gd*100)/high)/100
|
|
824
|
+
b = colour.Blue() + ((i*bd*100)/high)/100
|
|
825
|
+
a = colour.Alpha()
|
|
826
|
+
|
|
827
|
+
return wx.Colour(int(r), int(g), int(b), int(a))
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
def DarkColour(self, colour, percent):
|
|
831
|
+
"""
|
|
832
|
+
Like the :meth:`~ArtManager.LightColour` function, but create the colour darker by `percent`.
|
|
833
|
+
|
|
834
|
+
:param `colour`: the input colour to be darkened, an instance of :class:`wx.Colour`;
|
|
835
|
+
:param integer `percent`: determines how dark the colour will be. `percent` = ``100``
|
|
836
|
+
returns black, `percent` = ``0`` returns `colour`.
|
|
837
|
+
|
|
838
|
+
:return: A dark contrast of the input `colour`, an instance of :class:`wx.Colour`.
|
|
839
|
+
"""
|
|
840
|
+
|
|
841
|
+
end_colour = wx.BLACK
|
|
842
|
+
rd = end_colour.Red() - colour.Red()
|
|
843
|
+
gd = end_colour.Green() - colour.Green()
|
|
844
|
+
bd = end_colour.Blue() - colour.Blue()
|
|
845
|
+
high = 100
|
|
846
|
+
|
|
847
|
+
# We take the percent way of the colour from colour -. white
|
|
848
|
+
i = percent
|
|
849
|
+
r = colour.Red() + ((i*rd*100)/high)/100
|
|
850
|
+
g = colour.Green() + ((i*gd*100)/high)/100
|
|
851
|
+
b = colour.Blue() + ((i*bd*100)/high)/100
|
|
852
|
+
|
|
853
|
+
return wx.Colour(int(r), int(g), int(b))
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
def PaintStraightGradientBox(self, dc, rect, startColour, endColour, vertical=True):
|
|
857
|
+
"""
|
|
858
|
+
Paint the rectangle with gradient colouring; the gradient lines are either
|
|
859
|
+
horizontal or vertical.
|
|
860
|
+
|
|
861
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
862
|
+
:param wx.Rect `rect`: the rectangle to be filled with gradient shading;
|
|
863
|
+
:param wx.Colour `startColour`: the first colour of the gradient shading;
|
|
864
|
+
:param wx.Colour `endColour`: the second colour of the gradient shading;
|
|
865
|
+
:param bool `vertical`: ``True`` for gradient colouring in the vertical direction,
|
|
866
|
+
``False`` for horizontal shading.
|
|
867
|
+
"""
|
|
868
|
+
|
|
869
|
+
dcsaver = DCSaver(dc)
|
|
870
|
+
|
|
871
|
+
if vertical:
|
|
872
|
+
high = rect.GetHeight()-1
|
|
873
|
+
direction = wx.SOUTH
|
|
874
|
+
else:
|
|
875
|
+
high = rect.GetWidth()-1
|
|
876
|
+
direction = wx.EAST
|
|
877
|
+
|
|
878
|
+
if high < 1:
|
|
879
|
+
return
|
|
880
|
+
|
|
881
|
+
dc.GradientFillLinear(rect, startColour, endColour, direction)
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
def PaintGradientRegion(self, dc, region, startColour, endColour, vertical=True):
|
|
885
|
+
"""
|
|
886
|
+
Paint a region with gradient colouring.
|
|
887
|
+
|
|
888
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
889
|
+
:param `region`: a region to be filled with gradient shading (an instance of
|
|
890
|
+
:class:`Region`);
|
|
891
|
+
:param wx.Colour `startColour`: the first colour of the gradient shading;
|
|
892
|
+
:param wx.Colour `endColour`: the second colour of the gradient shading;
|
|
893
|
+
:param bool `vertical`: ``True`` for gradient colouring in the vertical direction,
|
|
894
|
+
``False`` for horizontal shading.
|
|
895
|
+
|
|
896
|
+
"""
|
|
897
|
+
|
|
898
|
+
# The way to achieve non-rectangle
|
|
899
|
+
memDC = wx.MemoryDC()
|
|
900
|
+
rect = region.GetBox()
|
|
901
|
+
bitmap = wx.Bitmap(rect.width, rect.height)
|
|
902
|
+
memDC.SelectObject(bitmap)
|
|
903
|
+
|
|
904
|
+
# Colour the whole rectangle with gradient
|
|
905
|
+
rr = wx.Rect(0, 0, rect.width, rect.height)
|
|
906
|
+
self.PaintStraightGradientBox(memDC, rr, startColour, endColour, vertical)
|
|
907
|
+
|
|
908
|
+
# Convert the region to a black and white bitmap with the white pixels being inside the region
|
|
909
|
+
# we draw the bitmap over the gradient coloured rectangle, with mask set to white,
|
|
910
|
+
# this will cause our region to be coloured with the gradient, while area outside the
|
|
911
|
+
# region will be painted with black. then we simply draw the bitmap to the dc with mask set to
|
|
912
|
+
# black
|
|
913
|
+
tmpRegion = wx.Region(rect.x, rect.y, rect.width, rect.height)
|
|
914
|
+
tmpRegion.Offset(-rect.x, -rect.y)
|
|
915
|
+
regionBmp = tmpRegion.ConvertToBitmap()
|
|
916
|
+
regionBmp.SetMask(wx.Mask(regionBmp, wx.WHITE))
|
|
917
|
+
|
|
918
|
+
# The function ConvertToBitmap() return a rectangle bitmap
|
|
919
|
+
# which is shorter by 1 pixl on the height and width (this is correct behavior, since
|
|
920
|
+
# DrawLine does not include the second point as part of the line)
|
|
921
|
+
# we fix this issue by drawing our own line at the bottom and left side of the rectangle
|
|
922
|
+
memDC.SetPen(wx.BLACK_PEN)
|
|
923
|
+
memDC.DrawBitmap(regionBmp, 0, 0, True)
|
|
924
|
+
memDC.DrawLine(0, rr.height - 1, rr.width, rr.height - 1)
|
|
925
|
+
memDC.DrawLine(rr.width - 1, 0, rr.width - 1, rr.height)
|
|
926
|
+
|
|
927
|
+
memDC.SelectObject(wx.NullBitmap)
|
|
928
|
+
bitmap.SetMask(wx.Mask(bitmap, wx.BLACK))
|
|
929
|
+
dc.DrawBitmap(bitmap, rect.x, rect.y, True)
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
def PaintDiagonalGradientBox(self, dc, rect, startColour, endColour,
|
|
933
|
+
startAtUpperLeft=True, trimToSquare=True):
|
|
934
|
+
"""
|
|
935
|
+
Paint rectangle with gradient colouring; the gradient lines are diagonal
|
|
936
|
+
and may start from the upper left corner or from the upper right corner.
|
|
937
|
+
|
|
938
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
939
|
+
:param wx.Rect `rect`: the rectangle to be filled with gradient shading;
|
|
940
|
+
:param wx.Colour `startColour`: the first colour of the gradient shading;
|
|
941
|
+
:param wx.Colour `endColour`: the second colour of the gradient shading;
|
|
942
|
+
:param bool `startAtUpperLeft`: ``True`` to start the gradient lines at the upper
|
|
943
|
+
left corner of the rectangle, ``False`` to start at the upper right corner;
|
|
944
|
+
:param bool `trimToSquare`: ``True`` to trim the gradient lines in a square.
|
|
945
|
+
"""
|
|
946
|
+
|
|
947
|
+
# Save the current pen and brush
|
|
948
|
+
savedPen = dc.GetPen()
|
|
949
|
+
savedBrush = dc.GetBrush()
|
|
950
|
+
|
|
951
|
+
# gradient fill from colour 1 to colour 2 with top to bottom
|
|
952
|
+
if rect.height < 1 or rect.width < 1:
|
|
953
|
+
return
|
|
954
|
+
|
|
955
|
+
# calculate some basic numbers
|
|
956
|
+
size = rect.width
|
|
957
|
+
sizeX = sizeY = 0
|
|
958
|
+
proportion = 1
|
|
959
|
+
|
|
960
|
+
if rect.width > rect.height:
|
|
961
|
+
|
|
962
|
+
if trimToSquare:
|
|
963
|
+
|
|
964
|
+
size = rect.height
|
|
965
|
+
sizeX = sizeY = rect.height - 1
|
|
966
|
+
|
|
967
|
+
else:
|
|
968
|
+
|
|
969
|
+
proportion = float(rect.height)/float(rect.width)
|
|
970
|
+
size = rect.width
|
|
971
|
+
sizeX = rect.width - 1
|
|
972
|
+
sizeY = rect.height -1
|
|
973
|
+
|
|
974
|
+
else:
|
|
975
|
+
|
|
976
|
+
if trimToSquare:
|
|
977
|
+
|
|
978
|
+
size = rect.width
|
|
979
|
+
sizeX = sizeY = rect.width - 1
|
|
980
|
+
|
|
981
|
+
else:
|
|
982
|
+
|
|
983
|
+
sizeX = rect.width - 1
|
|
984
|
+
size = rect.height
|
|
985
|
+
sizeY = rect.height - 1
|
|
986
|
+
proportion = float(rect.width)/float(rect.height)
|
|
987
|
+
|
|
988
|
+
# calculate gradient coefficients
|
|
989
|
+
col2 = endColour
|
|
990
|
+
col1 = startColour
|
|
991
|
+
|
|
992
|
+
rf, gf, bf = 0, 0, 0
|
|
993
|
+
rstep = float(col2.Red() - col1.Red())/float(size)
|
|
994
|
+
gstep = float(col2.Green() - col1.Green())/float(size)
|
|
995
|
+
bstep = float(col2.Blue() - col1.Blue())/float(size)
|
|
996
|
+
|
|
997
|
+
# draw the upper triangle
|
|
998
|
+
for i in range(size):
|
|
999
|
+
|
|
1000
|
+
currCol = wx.Colour(col1.Red() + rf, col1.Green() + gf, col1.Blue() + bf)
|
|
1001
|
+
dc.SetBrush(wx.Brush(currCol, wx.BRUSHSTYLE_SOLID))
|
|
1002
|
+
dc.SetPen(wx.Pen(currCol))
|
|
1003
|
+
|
|
1004
|
+
if startAtUpperLeft:
|
|
1005
|
+
|
|
1006
|
+
if rect.width > rect.height:
|
|
1007
|
+
|
|
1008
|
+
dc.DrawLine(rect.x + i, rect.y, rect.x, int(rect.y + proportion*i))
|
|
1009
|
+
dc.DrawPoint(rect.x, int(rect.y + proportion*i))
|
|
1010
|
+
|
|
1011
|
+
else:
|
|
1012
|
+
|
|
1013
|
+
dc.DrawLine(int(rect.x + proportion*i), rect.y, rect.x, rect.y + i)
|
|
1014
|
+
dc.DrawPoint(rect.x, rect.y + i)
|
|
1015
|
+
|
|
1016
|
+
else:
|
|
1017
|
+
|
|
1018
|
+
if rect.width > rect.height:
|
|
1019
|
+
|
|
1020
|
+
dc.DrawLine(rect.x + sizeX - i, rect.y, rect.x + sizeX, int(rect.y + proportion*i))
|
|
1021
|
+
dc.DrawPoint(rect.x + sizeX, int(rect.y + proportion*i))
|
|
1022
|
+
|
|
1023
|
+
else:
|
|
1024
|
+
|
|
1025
|
+
xTo = (int(rect.x + sizeX - proportion * i) > rect.x and [int(rect.x + sizeX - proportion*i)] or [rect.x])[0]
|
|
1026
|
+
dc.DrawLine(xTo, rect.y, rect.x + sizeX, rect.y + i)
|
|
1027
|
+
dc.DrawPoint(rect.x + sizeX, rect.y + i)
|
|
1028
|
+
|
|
1029
|
+
rf += rstep/2
|
|
1030
|
+
gf += gstep/2
|
|
1031
|
+
bf += bstep/2
|
|
1032
|
+
|
|
1033
|
+
# draw the lower triangle
|
|
1034
|
+
for i in range(size):
|
|
1035
|
+
|
|
1036
|
+
currCol = wx.Colour(col1.Red() + rf, col1.Green() + gf, col1.Blue() + bf)
|
|
1037
|
+
dc.SetBrush(wx.Brush(currCol, wx.BRUSHSTYLE_SOLID))
|
|
1038
|
+
dc.SetPen(wx.Pen(currCol))
|
|
1039
|
+
|
|
1040
|
+
if startAtUpperLeft:
|
|
1041
|
+
|
|
1042
|
+
if rect.width > rect.height:
|
|
1043
|
+
|
|
1044
|
+
dc.DrawLine(rect.x + i, rect.y + sizeY, rect.x + sizeX, int(rect.y + proportion * i))
|
|
1045
|
+
dc.DrawPoint(rect.x + sizeX, int(rect.y + proportion * i))
|
|
1046
|
+
|
|
1047
|
+
else:
|
|
1048
|
+
|
|
1049
|
+
dc.DrawLine(int(rect.x + proportion * i), rect.y + sizeY, rect.x + sizeX, rect.y + i)
|
|
1050
|
+
dc.DrawPoint(rect.x + sizeX, rect.y + i)
|
|
1051
|
+
|
|
1052
|
+
else:
|
|
1053
|
+
|
|
1054
|
+
if rect.width > rect.height:
|
|
1055
|
+
|
|
1056
|
+
dc.DrawLine(rect.x, (int)(rect.y + proportion * i), rect.x + sizeX - i, rect.y + sizeY)
|
|
1057
|
+
dc.DrawPoint(rect.x + sizeX - i, rect.y + sizeY)
|
|
1058
|
+
|
|
1059
|
+
else:
|
|
1060
|
+
|
|
1061
|
+
xTo = (int(rect.x + sizeX - proportion*i) > rect.x and [int(rect.x + sizeX - proportion*i)] or [rect.x])[0]
|
|
1062
|
+
dc.DrawLine(rect.x, rect.y + i, xTo, rect.y + sizeY)
|
|
1063
|
+
dc.DrawPoint(xTo, rect.y + sizeY)
|
|
1064
|
+
|
|
1065
|
+
rf += rstep/2
|
|
1066
|
+
gf += gstep/2
|
|
1067
|
+
bf += bstep/2
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
# Restore the pen and brush
|
|
1071
|
+
dc.SetPen( savedPen )
|
|
1072
|
+
dc.SetBrush( savedBrush )
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
def PaintCrescentGradientBox(self, dc, rect, startColour, endColour, concave=True):
|
|
1076
|
+
"""
|
|
1077
|
+
Paint a region with gradient colouring. The gradient is in crescent shape
|
|
1078
|
+
which fits the 2007 style.
|
|
1079
|
+
|
|
1080
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1081
|
+
:param wx.Rect `rect`: the rectangle to be filled with gradient shading;
|
|
1082
|
+
:param wx.Colour `startColour`: the first colour of the gradient shading;
|
|
1083
|
+
:param wx.Colour `endColour`: the second colour of the gradient shading;
|
|
1084
|
+
:param bool `concave`: ``True`` for a concave effect, ``False`` for a convex one.
|
|
1085
|
+
"""
|
|
1086
|
+
|
|
1087
|
+
diagonalRectWidth = rect.GetWidth()/4
|
|
1088
|
+
spare = rect.width - 4*diagonalRectWidth
|
|
1089
|
+
leftRect = wx.Rect(rect.x, rect.y, diagonalRectWidth, rect.GetHeight())
|
|
1090
|
+
rightRect = wx.Rect(rect.x + 3 * diagonalRectWidth + spare, rect.y, diagonalRectWidth, rect.GetHeight())
|
|
1091
|
+
|
|
1092
|
+
if concave:
|
|
1093
|
+
|
|
1094
|
+
self.PaintStraightGradientBox(dc, rect, self.MixColours(startColour, endColour, 50), endColour)
|
|
1095
|
+
self.PaintDiagonalGradientBox(dc, leftRect, startColour, endColour, True, False)
|
|
1096
|
+
self.PaintDiagonalGradientBox(dc, rightRect, startColour, endColour, False, False)
|
|
1097
|
+
|
|
1098
|
+
else:
|
|
1099
|
+
|
|
1100
|
+
self.PaintStraightGradientBox(dc, rect, endColour, self.MixColours(endColour, startColour, 50))
|
|
1101
|
+
self.PaintDiagonalGradientBox(dc, leftRect, endColour, startColour, False, False)
|
|
1102
|
+
self.PaintDiagonalGradientBox(dc, rightRect, endColour, startColour, True, False)
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
def FrameColour(self):
|
|
1106
|
+
"""
|
|
1107
|
+
Return the surrounding colour for a control.
|
|
1108
|
+
|
|
1109
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1110
|
+
"""
|
|
1111
|
+
|
|
1112
|
+
return wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION)
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
def BackgroundColour(self):
|
|
1116
|
+
"""
|
|
1117
|
+
Returns the background colour of a control when not in focus.
|
|
1118
|
+
|
|
1119
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1120
|
+
"""
|
|
1121
|
+
|
|
1122
|
+
return self.LightColour(self.FrameColour(), 75)
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
def HighlightBackgroundColour(self):
|
|
1126
|
+
"""
|
|
1127
|
+
Returns the background colour of a control when it is in focus.
|
|
1128
|
+
|
|
1129
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1130
|
+
"""
|
|
1131
|
+
|
|
1132
|
+
return self.LightColour(self.FrameColour(), 60)
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
def MixColours(self, firstColour, secondColour, percent):
|
|
1136
|
+
"""
|
|
1137
|
+
Return mix of input colours.
|
|
1138
|
+
|
|
1139
|
+
:param `firstColour`: the first colour to be mixed, an instance of :class:`wx.Colour`;
|
|
1140
|
+
:param `secondColour`: the second colour to be mixed, an instance of :class:`wx.Colour`;
|
|
1141
|
+
:param integer `percent`: the relative percentage of `firstColour` with respect to
|
|
1142
|
+
`secondColour`.
|
|
1143
|
+
|
|
1144
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1145
|
+
"""
|
|
1146
|
+
|
|
1147
|
+
# calculate gradient coefficients
|
|
1148
|
+
redOffset = float((secondColour.Red() * (100 - percent) / 100) - (firstColour.Red() * percent / 100))
|
|
1149
|
+
greenOffset = float((secondColour.Green() * (100 - percent) / 100) - (firstColour.Green() * percent / 100))
|
|
1150
|
+
blueOffset = float((secondColour.Blue() * (100 - percent) / 100) - (firstColour.Blue() * percent / 100))
|
|
1151
|
+
|
|
1152
|
+
return wx.Colour(firstColour.Red() + redOffset, firstColour.Green() + greenOffset,
|
|
1153
|
+
firstColour.Blue() + blueOffset)
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
def RandomColour(self):
|
|
1157
|
+
"""
|
|
1158
|
+
Creates a random colour.
|
|
1159
|
+
|
|
1160
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1161
|
+
"""
|
|
1162
|
+
|
|
1163
|
+
r = random.randint(0, 255) # Random value betweem 0-255
|
|
1164
|
+
g = random.randint(0, 255) # Random value betweem 0-255
|
|
1165
|
+
b = random.randint(0, 255) # Random value betweem 0-255
|
|
1166
|
+
|
|
1167
|
+
return wx.Colour(r, g, b)
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
def IsDark(self, colour):
|
|
1171
|
+
"""
|
|
1172
|
+
Returns whether a colour is dark or light.
|
|
1173
|
+
|
|
1174
|
+
:param `colour`: an instance of :class:`wx.Colour`.
|
|
1175
|
+
|
|
1176
|
+
:return: ``True`` if the average RGB values are dark, ``False`` otherwise.
|
|
1177
|
+
"""
|
|
1178
|
+
|
|
1179
|
+
evg = (colour.Red() + colour.Green() + colour.Blue())/3
|
|
1180
|
+
|
|
1181
|
+
if evg < 127:
|
|
1182
|
+
return True
|
|
1183
|
+
|
|
1184
|
+
return False
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
def TruncateText(self, dc, text, maxWidth):
|
|
1188
|
+
"""
|
|
1189
|
+
Truncates a given string to fit given width size. if the text does not fit
|
|
1190
|
+
into the given width it is truncated to fit. The format of the fixed text
|
|
1191
|
+
is ``truncate text ...``.
|
|
1192
|
+
|
|
1193
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1194
|
+
:param string `text`: the text to be (eventually) truncated;
|
|
1195
|
+
:param integer `maxWidth`: the maximum width allowed for the text.
|
|
1196
|
+
|
|
1197
|
+
:return: A new string containining the (possibly) truncated text.
|
|
1198
|
+
"""
|
|
1199
|
+
|
|
1200
|
+
textLen = len(text)
|
|
1201
|
+
tempText = text
|
|
1202
|
+
rectSize = maxWidth
|
|
1203
|
+
|
|
1204
|
+
fixedText = ""
|
|
1205
|
+
|
|
1206
|
+
textW, textH = dc.GetTextExtent(text)
|
|
1207
|
+
|
|
1208
|
+
if rectSize >= textW:
|
|
1209
|
+
return text
|
|
1210
|
+
|
|
1211
|
+
# The text does not fit in the designated area,
|
|
1212
|
+
# so we need to truncate it a bit
|
|
1213
|
+
suffix = ".."
|
|
1214
|
+
w, h = dc.GetTextExtent(suffix)
|
|
1215
|
+
rectSize -= w
|
|
1216
|
+
|
|
1217
|
+
for i in range(textLen, -1, -1):
|
|
1218
|
+
|
|
1219
|
+
textW, textH = dc.GetTextExtent(tempText)
|
|
1220
|
+
if rectSize >= textW:
|
|
1221
|
+
fixedText = tempText
|
|
1222
|
+
fixedText += ".."
|
|
1223
|
+
return fixedText
|
|
1224
|
+
|
|
1225
|
+
tempText = tempText[:-1]
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
def DrawButton(self, dc, rect, theme, state, input=None):
|
|
1229
|
+
"""
|
|
1230
|
+
Colour rectangle according to the theme.
|
|
1231
|
+
|
|
1232
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1233
|
+
:param wx.Rect `rect`: the rectangle to be filled with gradient shading;
|
|
1234
|
+
:param string `theme`: the theme to use to draw the button;
|
|
1235
|
+
:param integer `state`: the button state;
|
|
1236
|
+
:param `input`: a flag used to call the right method.
|
|
1237
|
+
"""
|
|
1238
|
+
|
|
1239
|
+
if input is None or type(input) == type(False):
|
|
1240
|
+
self.DrawButtonTheme(dc, rect, theme, state, input)
|
|
1241
|
+
else:
|
|
1242
|
+
self.DrawButtonColour(dc, rect, theme, state, input)
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
def DrawButtonTheme(self, dc, rect, theme, state, useLightColours=True):
|
|
1246
|
+
"""
|
|
1247
|
+
Draws a button using the appropriate theme.
|
|
1248
|
+
|
|
1249
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1250
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
1251
|
+
:param string `theme`: the theme to use to draw the button;
|
|
1252
|
+
:param integer `state`: the button state;
|
|
1253
|
+
:param bool `useLightColours`: ``True`` to use light colours, ``False`` otherwise.
|
|
1254
|
+
"""
|
|
1255
|
+
|
|
1256
|
+
renderer = self._renderers[theme]
|
|
1257
|
+
|
|
1258
|
+
# Set background colour if non given by caller
|
|
1259
|
+
renderer.DrawButton(dc, rect, state, useLightColours)
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
def DrawButtonColour(self, dc, rect, theme, state, colour):
|
|
1263
|
+
"""
|
|
1264
|
+
Draws a button using the appropriate theme.
|
|
1265
|
+
|
|
1266
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1267
|
+
:param wx.Rect `rect`: the button's client rectangle;
|
|
1268
|
+
:param string `theme`: the theme to use to draw the button;
|
|
1269
|
+
:param integer `state`: the button state;
|
|
1270
|
+
:param `colour`: a valid :class:`wx.Colour` instance.
|
|
1271
|
+
"""
|
|
1272
|
+
|
|
1273
|
+
renderer = self._renderers[theme]
|
|
1274
|
+
renderer.DrawButton(dc, rect, state, colour)
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
def CanMakeWindowsTransparent(self):
|
|
1278
|
+
"""
|
|
1279
|
+
Used internally.
|
|
1280
|
+
|
|
1281
|
+
:return: ``True`` if the system supports transparency of toplevel windows,
|
|
1282
|
+
otherwise returns ``False``.
|
|
1283
|
+
"""
|
|
1284
|
+
|
|
1285
|
+
if wx.Platform == "__WXMSW__":
|
|
1286
|
+
|
|
1287
|
+
version = wx.GetOsDescription()
|
|
1288
|
+
found = version.find("XP") >= 0 or version.find("2000") >= 0 or version.find("NT") >= 0
|
|
1289
|
+
return found
|
|
1290
|
+
|
|
1291
|
+
elif wx.Platform == "__WXMAC__":
|
|
1292
|
+
return True
|
|
1293
|
+
else:
|
|
1294
|
+
return False
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
# on supported windows systems (Win2000 and greater), this function
|
|
1298
|
+
# will make a frame window transparent by a certain amount
|
|
1299
|
+
def MakeWindowTransparent(self, wnd, amount):
|
|
1300
|
+
"""
|
|
1301
|
+
Used internally. Makes a toplevel window transparent if the system supports it.
|
|
1302
|
+
|
|
1303
|
+
:param `wnd`: the toplevel window to make transparent, an instance of :class:`TopLevelWindow`;
|
|
1304
|
+
:param integer `amount`: the window transparency to apply.
|
|
1305
|
+
"""
|
|
1306
|
+
|
|
1307
|
+
if wnd.GetSize() == (0, 0):
|
|
1308
|
+
return
|
|
1309
|
+
|
|
1310
|
+
# this API call is not in all SDKs, only the newer ones, so
|
|
1311
|
+
# we will runtime bind this
|
|
1312
|
+
if wx.Platform == "__WXMSW__":
|
|
1313
|
+
hwnd = wnd.GetHandle()
|
|
1314
|
+
|
|
1315
|
+
if not hasattr(self, "_winlib"):
|
|
1316
|
+
if _libimported == "MH":
|
|
1317
|
+
self._winlib = win32api.LoadLibrary("user32")
|
|
1318
|
+
elif _libimported == "ctypes":
|
|
1319
|
+
self._winlib = ctypes.windll.user32
|
|
1320
|
+
|
|
1321
|
+
if _libimported == "MH":
|
|
1322
|
+
pSetLayeredWindowAttributes = win32api.GetProcAddress(self._winlib,
|
|
1323
|
+
"SetLayeredWindowAttributes")
|
|
1324
|
+
|
|
1325
|
+
if pSetLayeredWindowAttributes is None:
|
|
1326
|
+
return
|
|
1327
|
+
|
|
1328
|
+
exstyle = win32api.GetWindowLong(hwnd, win32con.GWL_EXSTYLE)
|
|
1329
|
+
if 0 == (exstyle & 0x80000):
|
|
1330
|
+
win32api.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, exstyle | 0x80000)
|
|
1331
|
+
|
|
1332
|
+
winxpgui.SetLayeredWindowAttributes(hwnd, 0, amount, 2)
|
|
1333
|
+
|
|
1334
|
+
elif _libimported == "ctypes":
|
|
1335
|
+
style = self._winlib.GetWindowLongA(hwnd, 0xffffffec)
|
|
1336
|
+
style |= 0x00080000
|
|
1337
|
+
self._winlib.SetWindowLongA(hwnd, 0xffffffec, style)
|
|
1338
|
+
self._winlib.SetLayeredWindowAttributes(hwnd, 0, amount, 2)
|
|
1339
|
+
else:
|
|
1340
|
+
if not wnd.CanSetTransparent():
|
|
1341
|
+
return
|
|
1342
|
+
wnd.SetTransparent(amount)
|
|
1343
|
+
return
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
# assumption: the background was already drawn on the dc
|
|
1347
|
+
def DrawBitmapShadow(self, dc, rect, where=BottomShadow|RightShadow):
|
|
1348
|
+
"""
|
|
1349
|
+
Draws a shadow using background bitmap.
|
|
1350
|
+
|
|
1351
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1352
|
+
:param wx.Rect `rect`: the bitmap's client rectangle;
|
|
1353
|
+
:param integer `where`: where to draw the shadow. This can be any combination of the
|
|
1354
|
+
following bits:
|
|
1355
|
+
|
|
1356
|
+
========================== ======= ================================
|
|
1357
|
+
Shadow Settings Value Description
|
|
1358
|
+
========================== ======= ================================
|
|
1359
|
+
``RightShadow`` 1 Right side shadow
|
|
1360
|
+
``BottomShadow`` 2 Not full bottom shadow
|
|
1361
|
+
``BottomShadowFull`` 4 Full bottom shadow
|
|
1362
|
+
========================== ======= ================================
|
|
1363
|
+
|
|
1364
|
+
"""
|
|
1365
|
+
|
|
1366
|
+
shadowSize = 5
|
|
1367
|
+
|
|
1368
|
+
# the rect must be at least 5x5 pixles
|
|
1369
|
+
if rect.height < 2*shadowSize or rect.width < 2*shadowSize:
|
|
1370
|
+
return
|
|
1371
|
+
|
|
1372
|
+
# Start by drawing the right bottom corner
|
|
1373
|
+
if where & BottomShadow or where & BottomShadowFull:
|
|
1374
|
+
dc.DrawBitmap(self._rightBottomCorner, rect.x+rect.width, rect.y+rect.height, True)
|
|
1375
|
+
|
|
1376
|
+
# Draw right side shadow
|
|
1377
|
+
xx = rect.x + rect.width
|
|
1378
|
+
yy = rect.y + rect.height - shadowSize
|
|
1379
|
+
|
|
1380
|
+
if where & RightShadow:
|
|
1381
|
+
while yy - rect.y > 2*shadowSize:
|
|
1382
|
+
dc.DrawBitmap(self._right, xx, yy, True)
|
|
1383
|
+
yy -= shadowSize
|
|
1384
|
+
|
|
1385
|
+
dc.DrawBitmap(self._rightTop, xx, yy - shadowSize, True)
|
|
1386
|
+
|
|
1387
|
+
if where & BottomShadow:
|
|
1388
|
+
xx = rect.x + rect.width - shadowSize
|
|
1389
|
+
yy = rect.height + rect.y
|
|
1390
|
+
while xx - rect.x > 2*shadowSize:
|
|
1391
|
+
dc.DrawBitmap(self._bottom, xx, yy, True)
|
|
1392
|
+
xx -= shadowSize
|
|
1393
|
+
|
|
1394
|
+
dc.DrawBitmap(self._bottomLeft, xx - shadowSize, yy, True)
|
|
1395
|
+
|
|
1396
|
+
if where & BottomShadowFull:
|
|
1397
|
+
xx = rect.x + rect.width - shadowSize
|
|
1398
|
+
yy = rect.height + rect.y
|
|
1399
|
+
while xx - rect.x >= 0:
|
|
1400
|
+
dc.DrawBitmap(self._bottom, xx, yy, True)
|
|
1401
|
+
xx -= shadowSize
|
|
1402
|
+
|
|
1403
|
+
dc.DrawBitmap(self._bottom, xx, yy, True)
|
|
1404
|
+
|
|
1405
|
+
|
|
1406
|
+
def DropShadow(self, wnd, drop=True):
|
|
1407
|
+
"""
|
|
1408
|
+
Adds a shadow under the window (Windows only).
|
|
1409
|
+
|
|
1410
|
+
:param `wnd`: the window for which we are dropping a shadow, an instance of :class:`TopLevelWindow`;
|
|
1411
|
+
:param bool `drop`: ``True`` to drop a shadow, ``False`` to remove it.
|
|
1412
|
+
"""
|
|
1413
|
+
|
|
1414
|
+
if not self.CanMakeWindowsTransparent() or not _libimported:
|
|
1415
|
+
return
|
|
1416
|
+
|
|
1417
|
+
if "__WXMSW__" in wx.Platform:
|
|
1418
|
+
|
|
1419
|
+
hwnd = wnd.GetHandle()
|
|
1420
|
+
|
|
1421
|
+
if not hasattr(self, "_winlib"):
|
|
1422
|
+
if _libimported == "MH":
|
|
1423
|
+
self._winlib = win32api.LoadLibrary("user32")
|
|
1424
|
+
elif _libimported == "ctypes":
|
|
1425
|
+
self._winlib = ctypes.windll.user32
|
|
1426
|
+
|
|
1427
|
+
if _libimported == "MH":
|
|
1428
|
+
csstyle = win32api.GetWindowLong(hwnd, win32con.GCL_STYLE)
|
|
1429
|
+
else:
|
|
1430
|
+
csstyle = self._winlib.GetWindowLongA(hwnd, win32con.GCL_STYLE)
|
|
1431
|
+
|
|
1432
|
+
if drop:
|
|
1433
|
+
if csstyle & CS_DROPSHADOW:
|
|
1434
|
+
return
|
|
1435
|
+
else:
|
|
1436
|
+
csstyle |= CS_DROPSHADOW #Nothing to be done
|
|
1437
|
+
|
|
1438
|
+
else:
|
|
1439
|
+
|
|
1440
|
+
if csstyle & CS_DROPSHADOW:
|
|
1441
|
+
csstyle &= ~(CS_DROPSHADOW)
|
|
1442
|
+
else:
|
|
1443
|
+
return #Nothing to be done
|
|
1444
|
+
|
|
1445
|
+
win32api.SetWindowLong(hwnd, win32con.GCL_STYLE, csstyle)
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
def GetBitmapStartLocation(self, dc, rect, bitmap, text="", style=0):
|
|
1449
|
+
"""
|
|
1450
|
+
Returns the top left `x` and `y` cordinates of the bitmap drawing.
|
|
1451
|
+
|
|
1452
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1453
|
+
:param wx.Rect `rect`: the bitmap's client rectangle;
|
|
1454
|
+
:param wx.Bitmap `bitmap`: the bitmap associated with the button;
|
|
1455
|
+
:param string `text`: the button label;
|
|
1456
|
+
:param integer `style`: the button style. This can be one of the following bits:
|
|
1457
|
+
|
|
1458
|
+
============================== ======= ================================
|
|
1459
|
+
Button style Value Description
|
|
1460
|
+
============================== ======= ================================
|
|
1461
|
+
``BU_EXT_XP_STYLE`` 1 A button with a XP style
|
|
1462
|
+
``BU_EXT_2007_STYLE`` 2 A button with a MS Office 2007 style
|
|
1463
|
+
``BU_EXT_LEFT_ALIGN_STYLE`` 4 A left-aligned button
|
|
1464
|
+
``BU_EXT_CENTER_ALIGN_STYLE`` 8 A center-aligned button
|
|
1465
|
+
``BU_EXT_RIGHT_ALIGN_STYLE`` 16 A right-aligned button
|
|
1466
|
+
``BU_EXT_RIGHT_TO_LEFT_STYLE`` 32 A button suitable for right-to-left languages
|
|
1467
|
+
============================== ======= ================================
|
|
1468
|
+
|
|
1469
|
+
:return: A tuple containining the top left `x` and `y` cordinates of the bitmap drawing.
|
|
1470
|
+
"""
|
|
1471
|
+
|
|
1472
|
+
alignmentBuffer = self.GetAlignBuffer()
|
|
1473
|
+
|
|
1474
|
+
# get the startLocationY
|
|
1475
|
+
fixedTextWidth = fixedTextHeight = 0
|
|
1476
|
+
|
|
1477
|
+
if not text:
|
|
1478
|
+
fixedTextHeight = bitmap.GetHeight()
|
|
1479
|
+
else:
|
|
1480
|
+
fixedTextWidth, fixedTextHeight = dc.GetTextExtent(text)
|
|
1481
|
+
|
|
1482
|
+
startLocationY = rect.y + (rect.height - fixedTextHeight)/2
|
|
1483
|
+
|
|
1484
|
+
# get the startLocationX
|
|
1485
|
+
if style & BU_EXT_RIGHT_TO_LEFT_STYLE:
|
|
1486
|
+
|
|
1487
|
+
startLocationX = rect.x + rect.width - alignmentBuffer - bitmap.GetWidth()
|
|
1488
|
+
|
|
1489
|
+
else:
|
|
1490
|
+
|
|
1491
|
+
if style & BU_EXT_RIGHT_ALIGN_STYLE:
|
|
1492
|
+
|
|
1493
|
+
maxWidth = rect.x + rect.width - (2 * alignmentBuffer) - bitmap.GetWidth() # the alignment is for both sides
|
|
1494
|
+
|
|
1495
|
+
# get the truncated text. The text may stay as is, it is not a must that is will be trancated
|
|
1496
|
+
fixedText = self.TruncateText(dc, text, maxWidth)
|
|
1497
|
+
|
|
1498
|
+
# get the fixed text dimentions
|
|
1499
|
+
fixedTextWidth, fixedTextHeight = dc.GetTextExtent(fixedText)
|
|
1500
|
+
|
|
1501
|
+
# calculate the start location
|
|
1502
|
+
startLocationX = maxWidth - fixedTextWidth
|
|
1503
|
+
|
|
1504
|
+
elif style & BU_EXT_LEFT_ALIGN_STYLE:
|
|
1505
|
+
|
|
1506
|
+
# calculate the start location
|
|
1507
|
+
startLocationX = alignmentBuffer
|
|
1508
|
+
|
|
1509
|
+
else: # meaning BU_EXT_CENTER_ALIGN_STYLE
|
|
1510
|
+
|
|
1511
|
+
maxWidth = rect.x + rect.width - (2 * alignmentBuffer) - bitmap.GetWidth() # the alignment is for both sides
|
|
1512
|
+
|
|
1513
|
+
# get the truncated text. The text may stay as is, it is not a must that is will be trancated
|
|
1514
|
+
fixedText = self.TruncateText(dc, text, maxWidth)
|
|
1515
|
+
|
|
1516
|
+
# get the fixed text dimentions
|
|
1517
|
+
fixedTextWidth, fixedTextHeight = dc.GetTextExtent(fixedText)
|
|
1518
|
+
|
|
1519
|
+
if maxWidth > fixedTextWidth:
|
|
1520
|
+
|
|
1521
|
+
# calculate the start location
|
|
1522
|
+
startLocationX = (maxWidth - fixedTextWidth) / 2
|
|
1523
|
+
|
|
1524
|
+
else:
|
|
1525
|
+
|
|
1526
|
+
# calculate the start location
|
|
1527
|
+
startLocationX = maxWidth - fixedTextWidth
|
|
1528
|
+
|
|
1529
|
+
# it is very important to validate that the start location is not less than the alignment buffer
|
|
1530
|
+
if startLocationX < alignmentBuffer:
|
|
1531
|
+
startLocationX = alignmentBuffer
|
|
1532
|
+
|
|
1533
|
+
return startLocationX, startLocationY
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
def GetTextStartLocation(self, dc, rect, bitmap, text, style=0):
|
|
1537
|
+
"""
|
|
1538
|
+
Returns the top left `x` and `y` cordinates of the text drawing.
|
|
1539
|
+
In case the text is too long, the text is being fixed (the text is cut and
|
|
1540
|
+
a '...' mark is added in the end).
|
|
1541
|
+
|
|
1542
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1543
|
+
:param wx.Rect `rect`: the text's client rectangle;
|
|
1544
|
+
:param wx.Bitmap `bitmap`: the bitmap associated with the button;
|
|
1545
|
+
:param string `text`: the button label;
|
|
1546
|
+
:param integer `style`: the button style.
|
|
1547
|
+
|
|
1548
|
+
:return: A tuple containining the top left `x` and `y` cordinates of the text drawing, plus
|
|
1549
|
+
the truncated version of the input `text`.
|
|
1550
|
+
|
|
1551
|
+
:see: :meth:`~ArtManager.GetBitmapStartLocation` for a list of valid button styles.
|
|
1552
|
+
"""
|
|
1553
|
+
|
|
1554
|
+
alignmentBuffer = self.GetAlignBuffer()
|
|
1555
|
+
|
|
1556
|
+
# get the bitmap offset
|
|
1557
|
+
bitmapOffset = 0
|
|
1558
|
+
if bitmap != wx.NullBitmap:
|
|
1559
|
+
bitmapOffset = bitmap.GetWidth()
|
|
1560
|
+
|
|
1561
|
+
# get the truncated text. The text may stay as is, it is not a must that is will be trancated
|
|
1562
|
+
maxWidth = rect.x + rect.width - (2 * alignmentBuffer) - bitmapOffset # the alignment is for both sides
|
|
1563
|
+
|
|
1564
|
+
fixedText = self.TruncateText(dc, text, maxWidth)
|
|
1565
|
+
|
|
1566
|
+
# get the fixed text dimentions
|
|
1567
|
+
fixedTextWidth, fixedTextHeight = dc.GetTextExtent(fixedText)
|
|
1568
|
+
startLocationY = (rect.height - fixedTextHeight) / 2 + rect.y
|
|
1569
|
+
|
|
1570
|
+
# get the startLocationX
|
|
1571
|
+
if style & BU_EXT_RIGHT_TO_LEFT_STYLE:
|
|
1572
|
+
|
|
1573
|
+
startLocationX = maxWidth - fixedTextWidth + alignmentBuffer
|
|
1574
|
+
|
|
1575
|
+
else:
|
|
1576
|
+
|
|
1577
|
+
if style & BU_EXT_LEFT_ALIGN_STYLE:
|
|
1578
|
+
|
|
1579
|
+
# calculate the start location
|
|
1580
|
+
startLocationX = bitmapOffset + alignmentBuffer
|
|
1581
|
+
|
|
1582
|
+
elif style & BU_EXT_RIGHT_ALIGN_STYLE:
|
|
1583
|
+
|
|
1584
|
+
# calculate the start location
|
|
1585
|
+
startLocationX = maxWidth - fixedTextWidth + bitmapOffset + alignmentBuffer
|
|
1586
|
+
|
|
1587
|
+
else: # meaning wxBU_EXT_CENTER_ALIGN_STYLE
|
|
1588
|
+
|
|
1589
|
+
# calculate the start location
|
|
1590
|
+
startLocationX = (maxWidth - fixedTextWidth) / 2 + bitmapOffset + alignmentBuffer
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
# it is very important to validate that the start location is not less than the alignment buffer
|
|
1594
|
+
if startLocationX < alignmentBuffer:
|
|
1595
|
+
startLocationX = alignmentBuffer
|
|
1596
|
+
|
|
1597
|
+
return startLocationX, startLocationY, fixedText
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
def DrawTextAndBitmap(self, dc, rect, text, enable=True, font=wx.NullFont,
|
|
1601
|
+
fontColour=wx.BLACK, bitmap=wx.NullBitmap,
|
|
1602
|
+
grayBitmap=wx.NullBitmap, style=0):
|
|
1603
|
+
"""
|
|
1604
|
+
Draws the text & bitmap on the input dc.
|
|
1605
|
+
|
|
1606
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1607
|
+
:param wx.Rect `rect`: the text and bitmap client rectangle;
|
|
1608
|
+
:param string `text`: the button label;
|
|
1609
|
+
:param bool `enable`: ``True`` if the button is enabled, ``False`` otherwise;
|
|
1610
|
+
:param `font`: the font to use to draw the text, an instance of :class:`wx.Font`;
|
|
1611
|
+
:param `fontColour`: the colour to use to draw the text, an instance of
|
|
1612
|
+
:class:`wx.Colour`;
|
|
1613
|
+
:param `bitmap`: the bitmap associated with the button, an instance of :class:`wx.Bitmap`;
|
|
1614
|
+
:param `grayBitmap`: a greyed-out version of the input `bitmap` representing
|
|
1615
|
+
a disabled bitmap, an instance of :class:`wx.Bitmap`;
|
|
1616
|
+
:param integer `style`: the button style.
|
|
1617
|
+
|
|
1618
|
+
:see: :meth:`~ArtManager.GetBitmapStartLocation` for a list of valid button styles.
|
|
1619
|
+
"""
|
|
1620
|
+
|
|
1621
|
+
# enable colours
|
|
1622
|
+
if enable:
|
|
1623
|
+
dc.SetTextForeground(fontColour)
|
|
1624
|
+
else:
|
|
1625
|
+
dc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))
|
|
1626
|
+
|
|
1627
|
+
# set the font
|
|
1628
|
+
|
|
1629
|
+
if font == wx.NullFont:
|
|
1630
|
+
font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
|
|
1631
|
+
|
|
1632
|
+
dc.SetFont(font)
|
|
1633
|
+
|
|
1634
|
+
startLocationX = startLocationY = 0
|
|
1635
|
+
|
|
1636
|
+
if bitmap != wx.NullBitmap:
|
|
1637
|
+
|
|
1638
|
+
# calculate the bitmap start location
|
|
1639
|
+
startLocationX, startLocationY = self.GetBitmapStartLocation(dc, rect, bitmap, text, style)
|
|
1640
|
+
|
|
1641
|
+
# draw the bitmap
|
|
1642
|
+
if enable:
|
|
1643
|
+
dc.DrawBitmap(bitmap, startLocationX, startLocationY, True)
|
|
1644
|
+
else:
|
|
1645
|
+
dc.DrawBitmap(grayBitmap, startLocationX, startLocationY, True)
|
|
1646
|
+
|
|
1647
|
+
# calculate the text start location
|
|
1648
|
+
location, labelOnly = self.GetAccelIndex(text)
|
|
1649
|
+
startLocationX, startLocationY, fixedText = self.GetTextStartLocation(dc, rect, bitmap, labelOnly, style)
|
|
1650
|
+
|
|
1651
|
+
# after all the caculations are finished, it is time to draw the text
|
|
1652
|
+
# underline the first letter that is marked with a '&'
|
|
1653
|
+
if location == -1 or font.GetUnderlined() or location >= len(fixedText):
|
|
1654
|
+
# draw the text
|
|
1655
|
+
dc.DrawText(fixedText, startLocationX, startLocationY)
|
|
1656
|
+
|
|
1657
|
+
else:
|
|
1658
|
+
|
|
1659
|
+
# underline the first '&'
|
|
1660
|
+
before = fixedText[0:location]
|
|
1661
|
+
underlineLetter = fixedText[location]
|
|
1662
|
+
after = fixedText[location+1:]
|
|
1663
|
+
|
|
1664
|
+
# before
|
|
1665
|
+
dc.DrawText(before, startLocationX, startLocationY)
|
|
1666
|
+
|
|
1667
|
+
# underlineLetter
|
|
1668
|
+
if "__WXGTK__" not in wx.Platform:
|
|
1669
|
+
w1, h = dc.GetTextExtent(before)
|
|
1670
|
+
font.SetUnderlined(True)
|
|
1671
|
+
dc.SetFont(font)
|
|
1672
|
+
dc.DrawText(underlineLetter, startLocationX + w1, startLocationY)
|
|
1673
|
+
else:
|
|
1674
|
+
w1, h = dc.GetTextExtent(before)
|
|
1675
|
+
dc.DrawText(underlineLetter, startLocationX + w1, startLocationY)
|
|
1676
|
+
|
|
1677
|
+
# Draw the underline ourselves since using the Underline in GTK,
|
|
1678
|
+
# causes the line to be too close to the letter
|
|
1679
|
+
uderlineLetterW, uderlineLetterH = dc.GetTextExtent(underlineLetter)
|
|
1680
|
+
|
|
1681
|
+
curPen = dc.GetPen()
|
|
1682
|
+
dc.SetPen(wx.BLACK_PEN)
|
|
1683
|
+
|
|
1684
|
+
dc.DrawLine(startLocationX + w1, startLocationY + uderlineLetterH - 2,
|
|
1685
|
+
startLocationX + w1 + uderlineLetterW, startLocationY + uderlineLetterH - 2)
|
|
1686
|
+
dc.SetPen(curPen)
|
|
1687
|
+
|
|
1688
|
+
# after
|
|
1689
|
+
w2, h = dc.GetTextExtent(underlineLetter)
|
|
1690
|
+
font.SetUnderlined(False)
|
|
1691
|
+
dc.SetFont(font)
|
|
1692
|
+
dc.DrawText(after, startLocationX + w1 + w2, startLocationY)
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
def CalcButtonBestSize(self, label, bmp):
|
|
1696
|
+
"""
|
|
1697
|
+
Returns the best fit size for the supplied label & bitmap.
|
|
1698
|
+
|
|
1699
|
+
:param string `label`: the button label;
|
|
1700
|
+
:param `bmp`: the bitmap associated with the button, an instance of :class:`wx.Bitmap`.
|
|
1701
|
+
|
|
1702
|
+
:return: An instance of :class:`wx.Size`, representing the best fit size for the supplied label & bitmap.
|
|
1703
|
+
"""
|
|
1704
|
+
|
|
1705
|
+
if "__WXMSW__" in wx.Platform:
|
|
1706
|
+
HEIGHT = 22
|
|
1707
|
+
else:
|
|
1708
|
+
HEIGHT = 26
|
|
1709
|
+
|
|
1710
|
+
dc = wx.MemoryDC()
|
|
1711
|
+
dc.SelectBitmap(wx.Bitmap(1, 1))
|
|
1712
|
+
|
|
1713
|
+
dc.SetFont(wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT))
|
|
1714
|
+
width, height, dummy = dc.GetFullMultiLineTextExtent(label)
|
|
1715
|
+
|
|
1716
|
+
width += 2*self.GetAlignBuffer()
|
|
1717
|
+
|
|
1718
|
+
if bmp.IsOk():
|
|
1719
|
+
|
|
1720
|
+
# allocate extra space for the bitmap
|
|
1721
|
+
heightBmp = bmp.GetHeight() + 2
|
|
1722
|
+
if height < heightBmp:
|
|
1723
|
+
height = heightBmp
|
|
1724
|
+
|
|
1725
|
+
width += bmp.GetWidth() + 2
|
|
1726
|
+
|
|
1727
|
+
if height < HEIGHT:
|
|
1728
|
+
height = HEIGHT
|
|
1729
|
+
|
|
1730
|
+
dc.SelectBitmap(wx.NullBitmap)
|
|
1731
|
+
|
|
1732
|
+
return wx.Size(width, height)
|
|
1733
|
+
|
|
1734
|
+
|
|
1735
|
+
def GetMenuFaceColour(self):
|
|
1736
|
+
"""
|
|
1737
|
+
Returns the colour used for the menu foreground.
|
|
1738
|
+
|
|
1739
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1740
|
+
"""
|
|
1741
|
+
|
|
1742
|
+
renderer = self._renderers[self.GetMenuTheme()]
|
|
1743
|
+
return renderer.GetMenuFaceColour()
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
def GetTextColourEnable(self):
|
|
1747
|
+
"""
|
|
1748
|
+
Returns the colour used for enabled menu items.
|
|
1749
|
+
|
|
1750
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1751
|
+
"""
|
|
1752
|
+
|
|
1753
|
+
renderer = self._renderers[self.GetMenuTheme()]
|
|
1754
|
+
return renderer.GetTextColourEnable()
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
def GetTextColourDisable(self):
|
|
1758
|
+
"""
|
|
1759
|
+
Returns the colour used for disabled menu items.
|
|
1760
|
+
|
|
1761
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1762
|
+
"""
|
|
1763
|
+
|
|
1764
|
+
renderer = self._renderers[self.GetMenuTheme()]
|
|
1765
|
+
return renderer.GetTextColourDisable()
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
def GetFont(self):
|
|
1769
|
+
"""
|
|
1770
|
+
Returns the font used by this theme.
|
|
1771
|
+
|
|
1772
|
+
:return: An instance of :class:`wx.Font`.
|
|
1773
|
+
"""
|
|
1774
|
+
|
|
1775
|
+
renderer = self._renderers[self.GetMenuTheme()]
|
|
1776
|
+
return renderer.GetFont()
|
|
1777
|
+
|
|
1778
|
+
|
|
1779
|
+
def GetAccelIndex(self, label):
|
|
1780
|
+
"""
|
|
1781
|
+
Returns the mnemonic index of the label and the label stripped of the ampersand mnemonic
|
|
1782
|
+
(e.g. 'lab&el' ==> will result in 3 and labelOnly = label).
|
|
1783
|
+
|
|
1784
|
+
:param string `label`: a string containining an ampersand.
|
|
1785
|
+
|
|
1786
|
+
:return: A tuple containining the mnemonic index of the label and the label
|
|
1787
|
+
stripped of the ampersand mnemonic.
|
|
1788
|
+
"""
|
|
1789
|
+
|
|
1790
|
+
indexAccel = 0
|
|
1791
|
+
while True:
|
|
1792
|
+
indexAccel = label.find("&", indexAccel)
|
|
1793
|
+
if indexAccel == -1:
|
|
1794
|
+
return indexAccel, label
|
|
1795
|
+
if label[indexAccel:indexAccel+2] == "&&":
|
|
1796
|
+
label = label[0:indexAccel] + label[indexAccel+1:]
|
|
1797
|
+
indexAccel += 1
|
|
1798
|
+
else:
|
|
1799
|
+
break
|
|
1800
|
+
|
|
1801
|
+
labelOnly = label[0:indexAccel] + label[indexAccel+1:]
|
|
1802
|
+
|
|
1803
|
+
return indexAccel, labelOnly
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
def GetThemeBaseColour(self, useLightColours=True):
|
|
1807
|
+
"""
|
|
1808
|
+
Returns the theme (Blue, Silver, Green etc.) base colour, if no theme is active
|
|
1809
|
+
it return the active caption colour, lighter in 30%.
|
|
1810
|
+
|
|
1811
|
+
:param bool `useLightColours`: ``True`` to use light colours, ``False`` otherwise.
|
|
1812
|
+
|
|
1813
|
+
:return: An instance of :class:`wx.Colour`.
|
|
1814
|
+
"""
|
|
1815
|
+
|
|
1816
|
+
if not useLightColours and not self.IsDark(self.FrameColour()):
|
|
1817
|
+
return wx.Colour("GOLD")
|
|
1818
|
+
else:
|
|
1819
|
+
return self.LightColour(self.FrameColour(), 30)
|
|
1820
|
+
|
|
1821
|
+
|
|
1822
|
+
def GetAlignBuffer(self):
|
|
1823
|
+
"""
|
|
1824
|
+
Return the padding buffer for a text or bitmap.
|
|
1825
|
+
|
|
1826
|
+
:return: An integer representing the padding buffer.
|
|
1827
|
+
"""
|
|
1828
|
+
|
|
1829
|
+
return self._alignmentBuffer
|
|
1830
|
+
|
|
1831
|
+
|
|
1832
|
+
def SetMenuTheme(self, theme):
|
|
1833
|
+
"""
|
|
1834
|
+
Set the menu theme, possible values (Style2007, StyleXP, StyleVista).
|
|
1835
|
+
|
|
1836
|
+
:param string `theme`: a rendering theme class, either `StyleXP`, `Style2007` or `StyleVista`.
|
|
1837
|
+
"""
|
|
1838
|
+
|
|
1839
|
+
self._menuTheme = theme
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
def GetMenuTheme(self):
|
|
1843
|
+
"""
|
|
1844
|
+
Returns the currently used menu theme.
|
|
1845
|
+
|
|
1846
|
+
:return: A string containining the currently used theme for the menu.
|
|
1847
|
+
"""
|
|
1848
|
+
|
|
1849
|
+
return self._menuTheme
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
def AddMenuTheme(self, render):
|
|
1853
|
+
"""
|
|
1854
|
+
Adds a new theme to the stock.
|
|
1855
|
+
|
|
1856
|
+
:param `render`: a rendering theme class, which must be derived from
|
|
1857
|
+
:class:`RendererBase`.
|
|
1858
|
+
|
|
1859
|
+
:return: An integer representing the size of the renderers dictionary.
|
|
1860
|
+
"""
|
|
1861
|
+
|
|
1862
|
+
# Add new theme
|
|
1863
|
+
lastRenderer = len(self._renderers)
|
|
1864
|
+
self._renderers[lastRenderer] = render
|
|
1865
|
+
|
|
1866
|
+
return lastRenderer
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
def SetMS2007ButtonSunken(self, sunken):
|
|
1870
|
+
"""
|
|
1871
|
+
Sets MS 2007 button style sunken or not.
|
|
1872
|
+
|
|
1873
|
+
:param bool `sunken`: ``True`` to have a sunken border effect, ``False`` otherwise.
|
|
1874
|
+
"""
|
|
1875
|
+
|
|
1876
|
+
self._ms2007sunken = sunken
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
def GetMS2007ButtonSunken(self):
|
|
1880
|
+
"""
|
|
1881
|
+
Returns the sunken flag for MS 2007 buttons.
|
|
1882
|
+
|
|
1883
|
+
:return: ``True`` if the MS 2007 buttons are sunken, ``False`` otherwise.
|
|
1884
|
+
"""
|
|
1885
|
+
|
|
1886
|
+
return self._ms2007sunken
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
def GetMBVerticalGradient(self):
|
|
1890
|
+
""" Returns ``True`` if the menu bar should be painted with vertical gradient. """
|
|
1891
|
+
|
|
1892
|
+
return self._verticalGradient
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
def SetMBVerticalGradient(self, v):
|
|
1896
|
+
"""
|
|
1897
|
+
Sets the menu bar gradient style.
|
|
1898
|
+
|
|
1899
|
+
:param bool `v`: ``True`` for a vertical shaded gradient, ``False`` otherwise.
|
|
1900
|
+
"""
|
|
1901
|
+
|
|
1902
|
+
self._verticalGradient = v
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
def DrawMenuBarBorder(self, border):
|
|
1906
|
+
"""
|
|
1907
|
+
Enables menu border drawing (XP style only).
|
|
1908
|
+
|
|
1909
|
+
:param bool `border`: ``True`` to draw the menubar border, ``False`` otherwise.
|
|
1910
|
+
"""
|
|
1911
|
+
|
|
1912
|
+
self._drowMBBorder = border
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
def GetMenuBarBorder(self):
|
|
1916
|
+
"""
|
|
1917
|
+
Returns menu bar border drawing flag.
|
|
1918
|
+
|
|
1919
|
+
:return: ``True`` if the menu bar border is to be drawn, ``False`` otherwise.
|
|
1920
|
+
"""
|
|
1921
|
+
|
|
1922
|
+
return self._drowMBBorder
|
|
1923
|
+
|
|
1924
|
+
|
|
1925
|
+
def GetMenuBgFactor(self):
|
|
1926
|
+
"""
|
|
1927
|
+
Gets the visibility depth of the menu in Metallic style.
|
|
1928
|
+
The higher the value, the menu bar will look more raised
|
|
1929
|
+
"""
|
|
1930
|
+
|
|
1931
|
+
return self._menuBgFactor
|
|
1932
|
+
|
|
1933
|
+
|
|
1934
|
+
def DrawDragSash(self, rect):
|
|
1935
|
+
"""
|
|
1936
|
+
Draws resize sash.
|
|
1937
|
+
|
|
1938
|
+
:param wx.Rect `rect`: the sash client rectangle.
|
|
1939
|
+
"""
|
|
1940
|
+
|
|
1941
|
+
dc = wx.ScreenDC()
|
|
1942
|
+
mem_dc = wx.MemoryDC()
|
|
1943
|
+
|
|
1944
|
+
bmp = wx.Bitmap(rect.width, rect.height)
|
|
1945
|
+
mem_dc.SelectObject(bmp)
|
|
1946
|
+
mem_dc.SetBrush(wx.WHITE_BRUSH)
|
|
1947
|
+
mem_dc.SetPen(wx.Pen(wx.WHITE, 1))
|
|
1948
|
+
mem_dc.DrawRectangle(0, 0, rect.width, rect.height)
|
|
1949
|
+
|
|
1950
|
+
dc.Blit(rect.x, rect.y, rect.width, rect.height, mem_dc, 0, 0, wx.XOR)
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
def TakeScreenShot(self, rect, bmp):
|
|
1954
|
+
"""
|
|
1955
|
+
Takes a screenshot of the screen at given position & size (rect).
|
|
1956
|
+
|
|
1957
|
+
:param wx.Rect `rect`: the screen rectangle we wish to capture;
|
|
1958
|
+
:param wx.Bitmap `bmp`: currently unused.
|
|
1959
|
+
"""
|
|
1960
|
+
|
|
1961
|
+
# Create a DC for the whole screen area
|
|
1962
|
+
dcScreen = wx.ScreenDC()
|
|
1963
|
+
|
|
1964
|
+
# Create a Bitmap that will later on hold the screenshot image
|
|
1965
|
+
# Note that the Bitmap must have a size big enough to hold the screenshot
|
|
1966
|
+
# -1 means using the current default colour depth
|
|
1967
|
+
bmp = wx.Bitmap(rect.width, rect.height)
|
|
1968
|
+
|
|
1969
|
+
# Create a memory DC that will be used for actually taking the screenshot
|
|
1970
|
+
memDC = wx.MemoryDC()
|
|
1971
|
+
|
|
1972
|
+
# Tell the memory DC to use our Bitmap
|
|
1973
|
+
# all drawing action on the memory DC will go to the Bitmap now
|
|
1974
|
+
memDC.SelectObject(bmp)
|
|
1975
|
+
|
|
1976
|
+
# Blit (in this case copy) the actual screen on the memory DC
|
|
1977
|
+
# and thus the Bitmap
|
|
1978
|
+
memDC.Blit( 0, # Copy to this X coordinate
|
|
1979
|
+
0, # Copy to this Y coordinate
|
|
1980
|
+
rect.width, # Copy this width
|
|
1981
|
+
rect.height, # Copy this height
|
|
1982
|
+
dcScreen, # From where do we copy?
|
|
1983
|
+
rect.x, # What's the X offset in the original DC?
|
|
1984
|
+
rect.y # What's the Y offset in the original DC?
|
|
1985
|
+
)
|
|
1986
|
+
|
|
1987
|
+
# Select the Bitmap out of the memory DC by selecting a new
|
|
1988
|
+
# uninitialized Bitmap
|
|
1989
|
+
memDC.SelectObject(wx.NullBitmap)
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
def DrawToolBarBg(self, dc, rect):
|
|
1993
|
+
"""
|
|
1994
|
+
Draws the toolbar background according to the active theme.
|
|
1995
|
+
|
|
1996
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1997
|
+
:param wx.Rect `rect`: the toolbar's client rectangle.
|
|
1998
|
+
"""
|
|
1999
|
+
|
|
2000
|
+
renderer = self._renderers[self.GetMenuTheme()]
|
|
2001
|
+
|
|
2002
|
+
# Set background colour if non given by caller
|
|
2003
|
+
renderer.DrawToolBarBg(dc, rect)
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
def DrawMenuBarBg(self, dc, rect):
|
|
2007
|
+
"""
|
|
2008
|
+
Draws the menu bar background according to the active theme.
|
|
2009
|
+
|
|
2010
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
2011
|
+
:param wx.Rect `rect`: the menubar's client rectangle.
|
|
2012
|
+
"""
|
|
2013
|
+
|
|
2014
|
+
renderer = self._renderers[self.GetMenuTheme()]
|
|
2015
|
+
# Set background colour if non given by caller
|
|
2016
|
+
renderer.DrawMenuBarBg(dc, rect)
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
def SetMenuBarColour(self, scheme):
|
|
2020
|
+
"""
|
|
2021
|
+
Sets the menu bar colour scheme to use.
|
|
2022
|
+
|
|
2023
|
+
:param string `scheme`: a string representing a colour scheme (i.e., 'Default',
|
|
2024
|
+
'Dark', 'Dark Olive Green', 'Generic').
|
|
2025
|
+
"""
|
|
2026
|
+
|
|
2027
|
+
self._menuBarColourScheme = scheme
|
|
2028
|
+
# set default colour
|
|
2029
|
+
if scheme in self._colourSchemeMap:
|
|
2030
|
+
self._menuBarBgColour = self._colourSchemeMap[scheme]
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
def GetMenuBarColourScheme(self):
|
|
2034
|
+
"""
|
|
2035
|
+
Returns the current colour scheme.
|
|
2036
|
+
|
|
2037
|
+
:return: A string representing the current colour scheme.
|
|
2038
|
+
"""
|
|
2039
|
+
|
|
2040
|
+
return self._menuBarColourScheme
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
def GetMenuBarFaceColour(self):
|
|
2044
|
+
"""
|
|
2045
|
+
Returns the menu bar face colour.
|
|
2046
|
+
|
|
2047
|
+
:return: An instance of :class:`wx.Colour`.
|
|
2048
|
+
"""
|
|
2049
|
+
|
|
2050
|
+
return self._menuBarBgColour
|
|
2051
|
+
|
|
2052
|
+
|
|
2053
|
+
def GetMenuBarSelectionColour(self):
|
|
2054
|
+
"""
|
|
2055
|
+
Returns the menu bar selection colour.
|
|
2056
|
+
|
|
2057
|
+
:return: An instance of :class:`wx.Colour`.
|
|
2058
|
+
"""
|
|
2059
|
+
|
|
2060
|
+
return self._menuBarSelColour
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
def InitColours(self):
|
|
2064
|
+
""" Initialise the colour map. """
|
|
2065
|
+
|
|
2066
|
+
self._colourSchemeMap = {_("Default"): wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE),
|
|
2067
|
+
_("Dark"): wx.BLACK,
|
|
2068
|
+
_("Dark Olive Green"): wx.Colour("DARK OLIVE GREEN"),
|
|
2069
|
+
_("Generic"): wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION)}
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
def GetColourSchemes(self):
|
|
2073
|
+
"""
|
|
2074
|
+
Returns the available colour schemes.
|
|
2075
|
+
|
|
2076
|
+
:return: A list of strings representing the available colour schemes.
|
|
2077
|
+
"""
|
|
2078
|
+
|
|
2079
|
+
return list(self._colourSchemeMap)
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
def CreateGreyBitmap(self, bmp):
|
|
2083
|
+
"""
|
|
2084
|
+
Creates a grey bitmap image from the input bitmap.
|
|
2085
|
+
|
|
2086
|
+
:param `bmp`: a valid :class:`wx.Bitmap` object to be greyed out.
|
|
2087
|
+
|
|
2088
|
+
:return: A greyed-out representation of the input bitmap, an instance of :class:`wx.Bitmap`.
|
|
2089
|
+
"""
|
|
2090
|
+
|
|
2091
|
+
img = bmp.ConvertToImage()
|
|
2092
|
+
return wx.Bitmap(img.ConvertToGreyscale())
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
def GetRaiseToolbar(self):
|
|
2096
|
+
""" Returns ``True`` if we are dropping a shadow under a toolbar. """
|
|
2097
|
+
|
|
2098
|
+
return self._raiseTB
|
|
2099
|
+
|
|
2100
|
+
|
|
2101
|
+
def SetRaiseToolbar(self, rais):
|
|
2102
|
+
"""
|
|
2103
|
+
Enables/disables toobar shadow drop.
|
|
2104
|
+
|
|
2105
|
+
:param bool `rais`: ``True`` to drop a shadow below a toolbar, ``False`` otherwise.
|
|
2106
|
+
"""
|
|
2107
|
+
|
|
2108
|
+
self._raiseTB = rais
|
|
2109
|
+
|
|
2110
|
+
|