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/rulerctrl.py
ADDED
|
@@ -0,0 +1,1887 @@
|
|
|
1
|
+
# --------------------------------------------------------------------------------- #
|
|
2
|
+
# RULERCTRL wxPython IMPLEMENTATION
|
|
3
|
+
#
|
|
4
|
+
# Andrea Gavana, @ 03 Nov 2006
|
|
5
|
+
# Latest Revision: 19 Dec 2012, 21.00 GMT
|
|
6
|
+
#
|
|
7
|
+
#
|
|
8
|
+
# TODO List
|
|
9
|
+
#
|
|
10
|
+
# 1. Any idea?
|
|
11
|
+
#
|
|
12
|
+
# For All Kind Of Problems, Requests Of Enhancements And Bug Reports, Please
|
|
13
|
+
# Write To Me At:
|
|
14
|
+
#
|
|
15
|
+
# andrea.gavana@maerskoil.com
|
|
16
|
+
# andrea.gavana@gmail.com
|
|
17
|
+
#
|
|
18
|
+
# Or, Obviously, To The wxPython Mailing List!!!
|
|
19
|
+
#
|
|
20
|
+
# Tags: phoenix-port, unittest, documented, py3-port
|
|
21
|
+
#
|
|
22
|
+
# End Of Comments
|
|
23
|
+
# --------------------------------------------------------------------------------- #
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
:class:`~wx.lib.agw.rulerctrl.RulerCtrl` implements a ruler window that can be placed on top, bottom, left or right
|
|
27
|
+
to any wxPython widget.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Description
|
|
31
|
+
===========
|
|
32
|
+
|
|
33
|
+
:class:`RulerCtrl` implements a ruler window that can be placed on top, bottom, left or right
|
|
34
|
+
to any wxPython widget. It is somewhat similar to the rulers you can find in text
|
|
35
|
+
editors software, though not so powerful.
|
|
36
|
+
|
|
37
|
+
:class:`RulerCtrl` has the following characteristics:
|
|
38
|
+
|
|
39
|
+
- Can be horizontal or vertical;
|
|
40
|
+
- 4 built-in formats: integer, real, time and linearDB formats;
|
|
41
|
+
- Units (as ``cm``, ``dB``, ``inches``) can be displayed together with the label values;
|
|
42
|
+
- Possibility to add a number of "paragraph indicators", small arrows that point at
|
|
43
|
+
the current indicator position;
|
|
44
|
+
- Customizable background colour, tick colour, label colour;
|
|
45
|
+
- Possibility to flip the ruler (i.e. changing the tick alignment);
|
|
46
|
+
- Changing individually the indicator colour (requires PIL at the moment);
|
|
47
|
+
- Different window borders are supported (``wx.STATIC_BORDER``, ``wx.SUNKEN_BORDER``,
|
|
48
|
+
``wx.DOUBLE_BORDER``, ``wx.NO_BORDER``, ``wx.RAISED_BORDER``, ``wx.SIMPLE_BORDER``);
|
|
49
|
+
- Logarithmic scale available;
|
|
50
|
+
- Possibility to draw a thin line over a selected window when moving an indicator,
|
|
51
|
+
which emulates the text editors software.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
And a lot more. See the demo for a review of the functionalities.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
Usage
|
|
58
|
+
=====
|
|
59
|
+
|
|
60
|
+
Usage example::
|
|
61
|
+
|
|
62
|
+
import wx
|
|
63
|
+
import wx.lib.agw.rulerctrl as RC
|
|
64
|
+
|
|
65
|
+
class MyFrame(wx.Frame):
|
|
66
|
+
|
|
67
|
+
def __init__(self, parent):
|
|
68
|
+
|
|
69
|
+
wx.Frame.__init__(self, parent, -1, "RulerCtrl Demo")
|
|
70
|
+
|
|
71
|
+
panel = wx.Panel(self)
|
|
72
|
+
|
|
73
|
+
text = wx.TextCtrl(panel, -1, "Hello World! wxPython rules", style=wx.TE_MULTILINE)
|
|
74
|
+
|
|
75
|
+
ruler1 = RC.RulerCtrl(panel, -1, orient=wx.HORIZONTAL, style=wx.SUNKEN_BORDER)
|
|
76
|
+
ruler2 = RC.RulerCtrl(panel, -1, orient=wx.VERTICAL, style=wx.SUNKEN_BORDER)
|
|
77
|
+
|
|
78
|
+
mainsizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
79
|
+
leftsizer = wx.BoxSizer(wx.VERTICAL)
|
|
80
|
+
bottomleftsizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
81
|
+
topsizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
82
|
+
|
|
83
|
+
leftsizer.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0)
|
|
84
|
+
topsizer.Add((39, 0), 0, wx.ADJUST_MINSIZE, 0)
|
|
85
|
+
topsizer.Add(ruler1, 1, wx.EXPAND, 0)
|
|
86
|
+
leftsizer.Add(topsizer, 0, wx.EXPAND, 0)
|
|
87
|
+
|
|
88
|
+
bottomleftsizer.Add((10, 0))
|
|
89
|
+
bottomleftsizer.Add(ruler2, 0, wx.EXPAND, 0)
|
|
90
|
+
bottomleftsizer.Add(text, 1, wx.EXPAND, 0)
|
|
91
|
+
leftsizer.Add(bottomleftsizer, 1, wx.EXPAND, 0)
|
|
92
|
+
mainsizer.Add(leftsizer, 3, wx.EXPAND, 0)
|
|
93
|
+
|
|
94
|
+
panel.SetSizer(mainsizer)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# our normal wxApp-derived class, as usual
|
|
98
|
+
|
|
99
|
+
app = wx.App(0)
|
|
100
|
+
|
|
101
|
+
frame = MyFrame(None)
|
|
102
|
+
app.SetTopWindow(frame)
|
|
103
|
+
frame.Show()
|
|
104
|
+
|
|
105
|
+
app.MainLoop()
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
Events
|
|
110
|
+
======
|
|
111
|
+
|
|
112
|
+
:class:`RulerCtrl` implements the following events related to indicators:
|
|
113
|
+
|
|
114
|
+
- ``EVT_INDICATOR_CHANGING``: the user is about to change the position of one indicator;
|
|
115
|
+
- ``EVT_INDICATOR_CHANGED``: the user has changed the position of one indicator.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
Supported Platforms
|
|
119
|
+
===================
|
|
120
|
+
|
|
121
|
+
:class:`RulerCtrl` has been tested on the following platforms:
|
|
122
|
+
* Windows (Windows XP);
|
|
123
|
+
* Linux Ubuntu (Dapper 6.06)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
Window Styles
|
|
127
|
+
=============
|
|
128
|
+
|
|
129
|
+
`No particular window styles are available for this class.`
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
Events Processing
|
|
133
|
+
=================
|
|
134
|
+
|
|
135
|
+
This class processes the following events:
|
|
136
|
+
|
|
137
|
+
========================== ==================================================
|
|
138
|
+
Event Name Description
|
|
139
|
+
========================== ==================================================
|
|
140
|
+
``EVT_INDICATOR_CHANGED`` The user has changed the indicator value.
|
|
141
|
+
``EVT_INDICATOR_CHANGING`` The user is about to change the indicator value.
|
|
142
|
+
========================== ==================================================
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
License And Version
|
|
146
|
+
===================
|
|
147
|
+
|
|
148
|
+
:class:`RulerCtrl` is distributed under the wxPython license.
|
|
149
|
+
|
|
150
|
+
Latest Revision: Andrea Gavana @ 19 Dec 2012, 21.00 GMT
|
|
151
|
+
|
|
152
|
+
Version 0.4
|
|
153
|
+
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
import wx
|
|
157
|
+
import math
|
|
158
|
+
import zlib
|
|
159
|
+
|
|
160
|
+
# Try to import PIL, if possible.
|
|
161
|
+
# This is used only to change the colour for an indicator arrow.
|
|
162
|
+
_hasPIL = False
|
|
163
|
+
try:
|
|
164
|
+
import Image
|
|
165
|
+
_hasPIL = True
|
|
166
|
+
except:
|
|
167
|
+
pass
|
|
168
|
+
|
|
169
|
+
# Python 2/3 compatibility helper
|
|
170
|
+
import six
|
|
171
|
+
|
|
172
|
+
# Built-in formats
|
|
173
|
+
IntFormat = 1
|
|
174
|
+
""" Integer format. """
|
|
175
|
+
RealFormat = 2
|
|
176
|
+
""" Real format. """
|
|
177
|
+
TimeFormat = 3
|
|
178
|
+
""" Time format. """
|
|
179
|
+
LinearDBFormat = 4
|
|
180
|
+
""" Linear DB format. """
|
|
181
|
+
HHMMSS_Format = 5
|
|
182
|
+
""" HHMMSS format. """
|
|
183
|
+
|
|
184
|
+
# Events
|
|
185
|
+
wxEVT_INDICATOR_CHANGING = wx.NewEventType()
|
|
186
|
+
wxEVT_INDICATOR_CHANGED = wx.NewEventType()
|
|
187
|
+
|
|
188
|
+
EVT_INDICATOR_CHANGING = wx.PyEventBinder(wxEVT_INDICATOR_CHANGING, 2)
|
|
189
|
+
""" The user is about to change the indicator value. """
|
|
190
|
+
EVT_INDICATOR_CHANGED = wx.PyEventBinder(wxEVT_INDICATOR_CHANGED, 2)
|
|
191
|
+
""" The user has changed the indicator value. """
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
# Some accessor functions
|
|
195
|
+
#----------------------------------------------------------------------
|
|
196
|
+
|
|
197
|
+
def GetIndicatorData():
|
|
198
|
+
""" Returns the image indicator as a decompressed stream of characters. """
|
|
199
|
+
|
|
200
|
+
return zlib.decompress(
|
|
201
|
+
b'x\xda\x01x\x01\x87\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\n\x00\
|
|
202
|
+
\x00\x00\n\x08\x06\x00\x00\x00\x8d2\xcf\xbd\x00\x00\x00\x04sBIT\x08\x08\x08\
|
|
203
|
+
\x08|\x08d\x88\x00\x00\x01/IDAT\x18\x95m\xceO(\x83q\x1c\xc7\xf1\xf7\xef\xf9\
|
|
204
|
+
\xcd\xf6D6\xca\x1c\xc8\x9f\x14\'J-\xc4A9(9(-\xe5 \xed\xe4\xe2\xe2\xb2\x928\
|
|
205
|
+
\xb9\xec\xc2\x01\x17.\x0e\xe4\xe6B\xed\xb2\x1c\xdc$5\x97\xf9S\xb3\x14+\x0eO\
|
|
206
|
+
\xdb\xccZ\x9e\xfd\xf9\xba\x98E{\x1d\xbf\xbd\xfb\xf4U\x00\x18\x9d\xc3\xad\x1d\
|
|
207
|
+
\xa1+\xa7S\x15\xf8\xa1\xb5i\xbc\xc4\xd7\x0f\xca\xc5\xd82U3[\x97\xb1\x82\xc4S\
|
|
208
|
+
"\x89\xb4\xc8SZ\xc4\xb2E\xfa\x06CR)\x1c\x00\xb8\x8cb"-|\x94@\x01\x0e\r\xee&\
|
|
209
|
+
\xf8\x12\xc5\xdf\xd0\xd4\xf2\xf6i\x90/\x82\xe9\x82\xdb\xe72\xa7\xe7%\x92\x99\
|
|
210
|
+
\xdfA\xb4j\x9b]\xa5\xaek\xbag|\xaa\xdd\xca)\xceb\x10\xbe\x87\xacm VT\xd0N\
|
|
211
|
+
\x0f\xf9\xd7\x94\xd6\xde\xb1\xdd\xf9\xcdm_\x83\xdb\x81\x95W\x88\x02\xad\x159\
|
|
212
|
+
\x01\xcc!U2}\xa3$\x0f\x1dZR\xd1\xfd\xbb\x9b\xc7\x89\xc99\x7f\xb7\xb7\xd1\x00\
|
|
213
|
+
\xc0.B\xbe\xac\xc8\xbe?P\x8e\x8c\x1ccg\x02\xd5\x1f\x9a\x07\xf6\x82a[6.D\xfc\
|
|
214
|
+
\'"\x9e\xc0\xb5\xa0\xeb\xd7\xa8\xc9\xdd\xbf\xb3pdI\xefRD\xc0\x08\xd6\x8e*\\-\
|
|
215
|
+
+\xa0\x17\xff\x9f\xbf\x01{\xb5t\x9e\x99]a\x97\x00\x00\x00\x00IEND\xaeB`\x82G\
|
|
216
|
+
\xbf\xa8>' )
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def GetIndicatorBitmap():
|
|
220
|
+
""" Returns the image indicator as a :class:`wx.Bitmap`. """
|
|
221
|
+
|
|
222
|
+
return wx.Bitmap(GetIndicatorImage())
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def GetIndicatorImage():
|
|
226
|
+
""" Returns the image indicator as a :class:`wx.Image`. """
|
|
227
|
+
|
|
228
|
+
stream = six.BytesIO(GetIndicatorData())
|
|
229
|
+
return wx.Image(stream)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def MakePalette(tr, tg, tb):
|
|
233
|
+
"""
|
|
234
|
+
Creates a palette to be applied on an image based on input colour.
|
|
235
|
+
|
|
236
|
+
:param `tr`: the red intensity of the input colour;
|
|
237
|
+
:param `tg`: the green intensity of the input colour;
|
|
238
|
+
:param `tb`: the blue intensity of the input colour.
|
|
239
|
+
"""
|
|
240
|
+
|
|
241
|
+
l = []
|
|
242
|
+
for i in range(255):
|
|
243
|
+
l.extend([tr*i // 255, tg*i // 255, tb*i // 255])
|
|
244
|
+
|
|
245
|
+
return l
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def ConvertWXToPIL(bmp):
|
|
249
|
+
"""
|
|
250
|
+
Converts a :class:`wx.Image` into a PIL image.
|
|
251
|
+
|
|
252
|
+
:param `bmp`: an instance of :class:`wx.Image`.
|
|
253
|
+
|
|
254
|
+
:note: Requires PIL (Python Imaging Library), which can be downloaded from
|
|
255
|
+
http://www.pythonware.com/products/pil/
|
|
256
|
+
"""
|
|
257
|
+
|
|
258
|
+
width = bmp.GetWidth()
|
|
259
|
+
height = bmp.GetHeight()
|
|
260
|
+
img = Image.frombytes("RGBA", (width, height), bmp.GetData())
|
|
261
|
+
|
|
262
|
+
return img
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def ConvertPILToWX(pil, alpha=True):
|
|
266
|
+
"""
|
|
267
|
+
Converts a PIL image into a :class:`wx.Image`.
|
|
268
|
+
|
|
269
|
+
:param `pil`: a PIL image;
|
|
270
|
+
:param `alpha`: ``True`` if the image contains alpha transparency, ``False``
|
|
271
|
+
otherwise.
|
|
272
|
+
|
|
273
|
+
:note: Requires PIL (Python Imaging Library), which can be downloaded from
|
|
274
|
+
http://www.pythonware.com/products/pil/
|
|
275
|
+
"""
|
|
276
|
+
|
|
277
|
+
if alpha:
|
|
278
|
+
image = wx.Image(*pil.size)
|
|
279
|
+
image.SetData(pil.convert("RGB").tobytes())
|
|
280
|
+
image.SetAlpha(pil.convert("RGBA").tobytes()[3::4])
|
|
281
|
+
else:
|
|
282
|
+
image = wx.Image(pil.size[0], pil.size[1])
|
|
283
|
+
new_image = pil.convert('RGB')
|
|
284
|
+
data = new_image.tobytes()
|
|
285
|
+
image.SetData(data)
|
|
286
|
+
|
|
287
|
+
return image
|
|
288
|
+
|
|
289
|
+
# ---------------------------------------------------------------------------- #
|
|
290
|
+
# Class RulerCtrlEvent
|
|
291
|
+
# ---------------------------------------------------------------------------- #
|
|
292
|
+
|
|
293
|
+
class RulerCtrlEvent(wx.CommandEvent):
|
|
294
|
+
"""
|
|
295
|
+
Represent details of the events that the :class:`RulerCtrl` object sends.
|
|
296
|
+
"""
|
|
297
|
+
|
|
298
|
+
def __init__(self, eventType, eventId=1):
|
|
299
|
+
"""
|
|
300
|
+
Default class constructor.
|
|
301
|
+
|
|
302
|
+
:param `eventType`: the event type;
|
|
303
|
+
:param `eventId`: the event identifier.
|
|
304
|
+
"""
|
|
305
|
+
|
|
306
|
+
wx.CommandEvent.__init__(self, eventType, eventId)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def SetValue(self, value):
|
|
310
|
+
"""
|
|
311
|
+
Sets the event value.
|
|
312
|
+
|
|
313
|
+
:param `value`: the new indicator position.
|
|
314
|
+
"""
|
|
315
|
+
|
|
316
|
+
self._value = value
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def GetValue(self):
|
|
320
|
+
""" Returns the event value. """
|
|
321
|
+
|
|
322
|
+
return self._value
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def SetOldValue(self, oldValue):
|
|
326
|
+
"""
|
|
327
|
+
Sets the event old value.
|
|
328
|
+
|
|
329
|
+
:param `value`: the old indicator position.
|
|
330
|
+
"""
|
|
331
|
+
|
|
332
|
+
self._oldValue = oldValue
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def GetOldValue(self):
|
|
336
|
+
""" Returns the event old value. """
|
|
337
|
+
|
|
338
|
+
return self._oldValue
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
# ---------------------------------------------------------------------------- #
|
|
342
|
+
# Class Label
|
|
343
|
+
# ---------------------------------------------------------------------------- #
|
|
344
|
+
|
|
345
|
+
class Label(object):
|
|
346
|
+
"""
|
|
347
|
+
Auxilary class. Just holds information about a label in :class:`RulerCtrl`.
|
|
348
|
+
"""
|
|
349
|
+
|
|
350
|
+
def __init__(self, pos=-1, lx=-1, ly=-1, text=""):
|
|
351
|
+
"""
|
|
352
|
+
Default class constructor.
|
|
353
|
+
|
|
354
|
+
:param `pos`: the indicator position;
|
|
355
|
+
:param `lx`: the indicator `x` coordinate;
|
|
356
|
+
:param `ly`: the indicator `y` coordinate;
|
|
357
|
+
:param `text`: the label text.
|
|
358
|
+
"""
|
|
359
|
+
|
|
360
|
+
self.pos = pos
|
|
361
|
+
self.lx = lx
|
|
362
|
+
self.ly = ly
|
|
363
|
+
self.text = text
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
# ---------------------------------------------------------------------------- #
|
|
367
|
+
# Class Indicator
|
|
368
|
+
# ---------------------------------------------------------------------------- #
|
|
369
|
+
|
|
370
|
+
class Indicator(object):
|
|
371
|
+
"""
|
|
372
|
+
This class holds all the information about a single indicator inside :class:`RulerCtrl`.
|
|
373
|
+
|
|
374
|
+
You should not call this class directly. Use::
|
|
375
|
+
|
|
376
|
+
ruler.AddIndicator(id, value)
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
to add an indicator to your :class:`RulerCtrl`.
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
def __init__(self, parent, id=wx.ID_ANY, value=0):
|
|
383
|
+
"""
|
|
384
|
+
Default class constructor.
|
|
385
|
+
|
|
386
|
+
:param `parent`: the parent window, an instance of :class:`RulerCtrl`;
|
|
387
|
+
:param `id`: the indicator identifier;
|
|
388
|
+
:param `value`: the initial value of the indicator.
|
|
389
|
+
"""
|
|
390
|
+
|
|
391
|
+
self._parent = parent
|
|
392
|
+
if id == wx.ID_ANY:
|
|
393
|
+
id = wx.NewIdRef()
|
|
394
|
+
|
|
395
|
+
self._id = id
|
|
396
|
+
self._colour = None
|
|
397
|
+
|
|
398
|
+
self.RotateImage(GetIndicatorImage())
|
|
399
|
+
self.SetValue(value)
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def GetPosition(self):
|
|
403
|
+
""" Returns the position at which we should draw the indicator bitmap. """
|
|
404
|
+
|
|
405
|
+
orient = self._parent._orientation
|
|
406
|
+
flip = self._parent._flip
|
|
407
|
+
left, top, right, bottom = self._parent.GetBounds()
|
|
408
|
+
minval = self._parent._min
|
|
409
|
+
maxval = self._parent._max
|
|
410
|
+
|
|
411
|
+
value = self._value
|
|
412
|
+
|
|
413
|
+
if self._parent._log:
|
|
414
|
+
value = math.log10(value)
|
|
415
|
+
maxval = math.log10(maxval)
|
|
416
|
+
minval = math.log10(minval)
|
|
417
|
+
|
|
418
|
+
pos = float(value-minval)/abs(maxval - minval)
|
|
419
|
+
|
|
420
|
+
if orient == wx.HORIZONTAL:
|
|
421
|
+
xpos = int(pos*right) - self._img.GetWidth()//2
|
|
422
|
+
if flip:
|
|
423
|
+
ypos = top
|
|
424
|
+
else:
|
|
425
|
+
ypos = bottom - self._img.GetHeight()
|
|
426
|
+
else:
|
|
427
|
+
ypos = int(pos*bottom) - self._img.GetHeight()//2
|
|
428
|
+
if flip:
|
|
429
|
+
xpos = left
|
|
430
|
+
else:
|
|
431
|
+
xpos = right - self._img.GetWidth()
|
|
432
|
+
|
|
433
|
+
return xpos, ypos
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def GetImageSize(self):
|
|
437
|
+
""" Returns the indicator bitmap size. """
|
|
438
|
+
|
|
439
|
+
return self._img.GetWidth(), self._img.GetHeight()
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
def GetRect(self):
|
|
443
|
+
""" Returns the indicator client rectangle. """
|
|
444
|
+
|
|
445
|
+
return self._rect
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
def RotateImage(self, img=None):
|
|
449
|
+
"""
|
|
450
|
+
Rotates the default indicator bitmap.
|
|
451
|
+
|
|
452
|
+
:param `img`: if not ``None``, the indicator image.
|
|
453
|
+
"""
|
|
454
|
+
|
|
455
|
+
if img is None:
|
|
456
|
+
img = GetIndicatorImage()
|
|
457
|
+
|
|
458
|
+
orient = self._parent._orientation
|
|
459
|
+
flip = self._parent._flip
|
|
460
|
+
left, top, right, bottom = self._parent.GetBounds()
|
|
461
|
+
|
|
462
|
+
if orient == wx.HORIZONTAL:
|
|
463
|
+
if flip:
|
|
464
|
+
img = img.Rotate(math.pi, (5, 5), True)
|
|
465
|
+
else:
|
|
466
|
+
if flip:
|
|
467
|
+
img = img.Rotate(-math.pi/2.0, (5, 5), True)
|
|
468
|
+
else:
|
|
469
|
+
img = img.Rotate(math.pi/2.0, (5, 5), True)
|
|
470
|
+
|
|
471
|
+
self._img = img
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
def SetValue(self, value):
|
|
475
|
+
"""
|
|
476
|
+
Sets the indicator value.
|
|
477
|
+
|
|
478
|
+
:param `value`: the new indicator value.
|
|
479
|
+
"""
|
|
480
|
+
|
|
481
|
+
if value < self._parent._min:
|
|
482
|
+
value = self._parent._min
|
|
483
|
+
if value > self._parent._max:
|
|
484
|
+
value = self._parent._max
|
|
485
|
+
|
|
486
|
+
self._value = value
|
|
487
|
+
self._rect = wx.Rect()
|
|
488
|
+
|
|
489
|
+
self._parent.Refresh()
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
def GetValue(self):
|
|
493
|
+
""" Returns the indicator value. """
|
|
494
|
+
|
|
495
|
+
return self._value
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
def Draw(self, dc):
|
|
499
|
+
"""
|
|
500
|
+
Actually draws the indicator.
|
|
501
|
+
|
|
502
|
+
:param `dc`: an instance of :class:`wx.DC`.
|
|
503
|
+
"""
|
|
504
|
+
|
|
505
|
+
xpos, ypos = self.GetPosition()
|
|
506
|
+
bmp = wx.Bitmap(self._img)
|
|
507
|
+
dc.DrawBitmap(bmp, xpos, ypos, True)
|
|
508
|
+
self._rect = wx.Rect(xpos, ypos, self._img.GetWidth(), self._img.GetHeight())
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
def GetId(self):
|
|
512
|
+
""" Returns the indicator id. """
|
|
513
|
+
|
|
514
|
+
return self._id
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
def SetColour(self, colour):
|
|
518
|
+
"""
|
|
519
|
+
Sets the indicator colour.
|
|
520
|
+
|
|
521
|
+
:param `colour`: the new indicator colour, an instance of :class:`wx.Colour`.
|
|
522
|
+
|
|
523
|
+
:note: Requires PIL (Python Imaging Library), which can be downloaded from
|
|
524
|
+
http://www.pythonware.com/products/pil/
|
|
525
|
+
"""
|
|
526
|
+
|
|
527
|
+
if not _hasPIL:
|
|
528
|
+
return
|
|
529
|
+
|
|
530
|
+
palette = colour.Red(), colour.Green(), colour.Blue()
|
|
531
|
+
|
|
532
|
+
img = ConvertWXToPIL(GetIndicatorBitmap())
|
|
533
|
+
l = MakePalette(*palette)
|
|
534
|
+
# The Palette Can Be Applied Only To "L" And "P" Images, Not "RGBA"
|
|
535
|
+
img = img.convert("L")
|
|
536
|
+
# Apply The New Palette
|
|
537
|
+
img.putpalette(l)
|
|
538
|
+
# Convert The Image Back To RGBA
|
|
539
|
+
img = img.convert("RGBA")
|
|
540
|
+
img = ConvertPILToWX(img)
|
|
541
|
+
self.RotateImage(img)
|
|
542
|
+
|
|
543
|
+
self._parent.Refresh()
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
# ---------------------------------------------------------------------------- #
|
|
547
|
+
# Class RulerCtrl
|
|
548
|
+
# ---------------------------------------------------------------------------- #
|
|
549
|
+
|
|
550
|
+
class RulerCtrl(wx.Panel):
|
|
551
|
+
"""
|
|
552
|
+
:class:`RulerCtrl` implements a ruler window that can be placed on top, bottom, left or right
|
|
553
|
+
to any wxPython widget. It is somewhat similar to the rulers you can find in text
|
|
554
|
+
editors software, though not so powerful.
|
|
555
|
+
"""
|
|
556
|
+
|
|
557
|
+
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize,
|
|
558
|
+
style=wx.STATIC_BORDER, orient=wx.HORIZONTAL):
|
|
559
|
+
"""
|
|
560
|
+
Default class constructor.
|
|
561
|
+
|
|
562
|
+
:param `parent`: parent window. Must not be ``None``;
|
|
563
|
+
:param `id`: window identifier. A value of -1 indicates a default value;
|
|
564
|
+
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
|
|
565
|
+
chosen by either the windowing system or wxPython, depending on platform;
|
|
566
|
+
:param `size`: the control size. A value of (-1, -1) indicates a default size,
|
|
567
|
+
chosen by either the windowing system or wxPython, depending on platform;
|
|
568
|
+
:param `style`: the window style;
|
|
569
|
+
:param `orient`: sets the orientation of the :class:`RulerCtrl`, and can be either
|
|
570
|
+
``wx.HORIZONTAL`` of ``wx.VERTICAL``.
|
|
571
|
+
"""
|
|
572
|
+
|
|
573
|
+
wx.Panel.__init__(self, parent, id, pos, size, style)
|
|
574
|
+
|
|
575
|
+
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
|
|
576
|
+
width, height = size
|
|
577
|
+
|
|
578
|
+
self._min = 0.0
|
|
579
|
+
self._max = 10.0
|
|
580
|
+
self._orientation = orient
|
|
581
|
+
self._spacing = 5
|
|
582
|
+
self._hassetspacing = False
|
|
583
|
+
self._format = RealFormat
|
|
584
|
+
self._flip = False
|
|
585
|
+
self._log = False
|
|
586
|
+
self._labeledges = False
|
|
587
|
+
self._units = ""
|
|
588
|
+
|
|
589
|
+
self._drawingparent = None
|
|
590
|
+
self._drawingpen = wx.Pen(wx.BLACK, 2)
|
|
591
|
+
|
|
592
|
+
self._left = -1
|
|
593
|
+
self._top = -1
|
|
594
|
+
self._right = -1
|
|
595
|
+
self._bottom = -1
|
|
596
|
+
|
|
597
|
+
self._major = 1
|
|
598
|
+
self._minor = 1
|
|
599
|
+
|
|
600
|
+
self._indicators = []
|
|
601
|
+
self._currentIndicator = None
|
|
602
|
+
|
|
603
|
+
fontsize = 10
|
|
604
|
+
if wx.Platform == "__WXMSW__":
|
|
605
|
+
fontsize = 8
|
|
606
|
+
|
|
607
|
+
self._minorfont = wx.Font(fontsize, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
|
|
608
|
+
self._majorfont = wx.Font(fontsize, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
|
|
609
|
+
|
|
610
|
+
self._bits = []
|
|
611
|
+
self._userbits = []
|
|
612
|
+
self._userbitlen = 0
|
|
613
|
+
self._tickmajor = True
|
|
614
|
+
self._tickminor = True
|
|
615
|
+
self._timeformat = IntFormat
|
|
616
|
+
self._labelmajor = True
|
|
617
|
+
self._labelminor = True
|
|
618
|
+
self._tickpen = wx.Pen(wx.BLACK)
|
|
619
|
+
self._textcolour = wx.BLACK
|
|
620
|
+
self._background = wx.WHITE
|
|
621
|
+
|
|
622
|
+
self._valid = False
|
|
623
|
+
self._state = 0
|
|
624
|
+
|
|
625
|
+
self._style = style
|
|
626
|
+
self._orientation = orient
|
|
627
|
+
wbound, hbound = self.CheckStyle()
|
|
628
|
+
|
|
629
|
+
if orient & wx.VERTICAL:
|
|
630
|
+
self.SetInitialSize((28, height))
|
|
631
|
+
else:
|
|
632
|
+
self.SetInitialSize((width, 28))
|
|
633
|
+
|
|
634
|
+
self.SetBounds(0, 0, wbound, hbound)
|
|
635
|
+
|
|
636
|
+
self.Bind(wx.EVT_SIZE, self.OnSize)
|
|
637
|
+
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
|
638
|
+
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
|
639
|
+
self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvents)
|
|
640
|
+
self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, lambda evt: True)
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
def OnMouseEvents(self, event):
|
|
644
|
+
"""
|
|
645
|
+
Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`RulerCtrl`.
|
|
646
|
+
|
|
647
|
+
:param `event`: a :class:`MouseEvent` event to be processed.
|
|
648
|
+
"""
|
|
649
|
+
|
|
650
|
+
if not self._indicators:
|
|
651
|
+
event.Skip()
|
|
652
|
+
return
|
|
653
|
+
|
|
654
|
+
mousePos = event.GetPosition()
|
|
655
|
+
|
|
656
|
+
if event.LeftDown():
|
|
657
|
+
self.CaptureMouse()
|
|
658
|
+
self.GetIndicator(mousePos)
|
|
659
|
+
self._mousePosition = mousePos
|
|
660
|
+
self.SetIndicatorValue(sendEvent=False)
|
|
661
|
+
elif event.Dragging() and self._currentIndicator:
|
|
662
|
+
self._mousePosition = mousePos
|
|
663
|
+
self.SetIndicatorValue()
|
|
664
|
+
elif event.LeftUp():
|
|
665
|
+
if self.HasCapture():
|
|
666
|
+
self.ReleaseMouse()
|
|
667
|
+
self.SetIndicatorValue(sendEvent=False)
|
|
668
|
+
if self._drawingparent:
|
|
669
|
+
self._drawingparent.Refresh()
|
|
670
|
+
self._currentIndicator = None
|
|
671
|
+
#else:
|
|
672
|
+
# self._currentIndicator = None
|
|
673
|
+
|
|
674
|
+
event.Skip()
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def OnPaint(self, event):
|
|
678
|
+
"""
|
|
679
|
+
Handles the ``wx.EVT_PAINT`` event for :class:`RulerCtrl`.
|
|
680
|
+
|
|
681
|
+
:param `event`: a :class:`PaintEvent` event to be processed.
|
|
682
|
+
"""
|
|
683
|
+
|
|
684
|
+
dc = wx.BufferedPaintDC(self)
|
|
685
|
+
dc.SetBackground(wx.Brush(self._background))
|
|
686
|
+
dc.Clear()
|
|
687
|
+
self.Draw(dc)
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
def OnSize(self, event):
|
|
691
|
+
"""
|
|
692
|
+
Handles the ``wx.EVT_SIZE`` event for :class:`RulerCtrl`.
|
|
693
|
+
|
|
694
|
+
:param `event`: a :class:`wx.SizeEvent` event to be processed.
|
|
695
|
+
"""
|
|
696
|
+
|
|
697
|
+
width, height = event.GetSize()
|
|
698
|
+
self.SetBounds(0, 0, width, height)
|
|
699
|
+
|
|
700
|
+
self.Invalidate()
|
|
701
|
+
event.Skip()
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
def OnEraseBackground(self, event):
|
|
705
|
+
"""
|
|
706
|
+
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RulerCtrl`.
|
|
707
|
+
|
|
708
|
+
:param `event`: a :class:`EraseEvent` event to be processed.
|
|
709
|
+
|
|
710
|
+
:note: This method is intentionally empty to reduce flicker.
|
|
711
|
+
"""
|
|
712
|
+
|
|
713
|
+
pass
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
def SetIndicatorValue(self, sendEvent=True):
|
|
717
|
+
"""
|
|
718
|
+
Sets the indicator value.
|
|
719
|
+
|
|
720
|
+
:param `sendEvent`: ``True`` to send a :class:`RulerCtrlEvent`, ``False`` otherwise.
|
|
721
|
+
"""
|
|
722
|
+
|
|
723
|
+
if self._currentIndicator is None:
|
|
724
|
+
return
|
|
725
|
+
|
|
726
|
+
left, top, right, bottom = self.GetBounds()
|
|
727
|
+
|
|
728
|
+
x = self._mousePosition.x
|
|
729
|
+
y = self._mousePosition.y
|
|
730
|
+
|
|
731
|
+
maxvalue = self._max
|
|
732
|
+
minvalue = self._min
|
|
733
|
+
|
|
734
|
+
if self._log:
|
|
735
|
+
minvalue = math.log10(minvalue)
|
|
736
|
+
maxvalue = math.log10(maxvalue)
|
|
737
|
+
|
|
738
|
+
deltarange = abs(self._max - self._min)
|
|
739
|
+
|
|
740
|
+
if self._orientation == wx.HORIZONTAL: # only x moves
|
|
741
|
+
value = deltarange*float(x)/(right - left)
|
|
742
|
+
else:
|
|
743
|
+
value = deltarange*float(y)/(bottom - top)
|
|
744
|
+
|
|
745
|
+
value += minvalue
|
|
746
|
+
|
|
747
|
+
if self._log:
|
|
748
|
+
value = 10**value
|
|
749
|
+
|
|
750
|
+
if value < self._min or value > self._max:
|
|
751
|
+
return
|
|
752
|
+
|
|
753
|
+
self.DrawOnParent(self._currentIndicator)
|
|
754
|
+
|
|
755
|
+
if sendEvent:
|
|
756
|
+
event = RulerCtrlEvent(wxEVT_INDICATOR_CHANGING, self._currentIndicator.GetId())
|
|
757
|
+
event.SetOldValue(self._currentIndicator.GetValue())
|
|
758
|
+
|
|
759
|
+
event.SetValue(value)
|
|
760
|
+
event.SetEventObject(self)
|
|
761
|
+
|
|
762
|
+
if self.GetEventHandler().ProcessEvent(event):
|
|
763
|
+
self.DrawOnParent(self._currentIndicator)
|
|
764
|
+
return
|
|
765
|
+
|
|
766
|
+
self._currentIndicator.SetValue(value)
|
|
767
|
+
|
|
768
|
+
if sendEvent:
|
|
769
|
+
event.SetEventType(wxEVT_INDICATOR_CHANGED)
|
|
770
|
+
event.SetOldValue(value)
|
|
771
|
+
self.GetEventHandler().ProcessEvent(event)
|
|
772
|
+
self.DrawOnParent(self._currentIndicator)
|
|
773
|
+
|
|
774
|
+
self.Refresh()
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
def GetIndicator(self, mousePos):
|
|
778
|
+
"""
|
|
779
|
+
Returns the indicator located at the mouse position `mousePos` (if any).
|
|
780
|
+
|
|
781
|
+
:param `mousePos`: the mouse position, an instance of :class:`wx.Point`.
|
|
782
|
+
"""
|
|
783
|
+
|
|
784
|
+
for indicator in self._indicators:
|
|
785
|
+
if indicator.GetRect().Contains(mousePos):
|
|
786
|
+
self._currentIndicator = indicator
|
|
787
|
+
break
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
def CheckStyle(self):
|
|
791
|
+
""" Adjust the :class:`RulerCtrl` style accordingly to borders, units, etc..."""
|
|
792
|
+
|
|
793
|
+
width, height = self.GetSize()
|
|
794
|
+
|
|
795
|
+
if self._orientation & wx.HORIZONTAL:
|
|
796
|
+
if self._style & wx.NO_BORDER:
|
|
797
|
+
hbound = 28
|
|
798
|
+
wbound = width-1
|
|
799
|
+
elif self._style & wx.SIMPLE_BORDER:
|
|
800
|
+
hbound = 27
|
|
801
|
+
wbound = width-1
|
|
802
|
+
elif self._style & wx.STATIC_BORDER:
|
|
803
|
+
hbound = 26
|
|
804
|
+
wbound = width-3
|
|
805
|
+
elif self._style & wx.SUNKEN_BORDER:
|
|
806
|
+
hbound = 24
|
|
807
|
+
wbound = width-5
|
|
808
|
+
elif self._style & wx.RAISED_BORDER:
|
|
809
|
+
hbound = 22
|
|
810
|
+
wbound = width-7
|
|
811
|
+
elif self._style & wx.DOUBLE_BORDER:
|
|
812
|
+
hbound = 22
|
|
813
|
+
wbound = width-7
|
|
814
|
+
else:
|
|
815
|
+
if self._style & wx.NO_BORDER:
|
|
816
|
+
wbound = 28
|
|
817
|
+
hbound = height-1
|
|
818
|
+
elif self._style & wx.SIMPLE_BORDER:
|
|
819
|
+
wbound = 27
|
|
820
|
+
hbound = height-1
|
|
821
|
+
elif self._style & wx.STATIC_BORDER:
|
|
822
|
+
wbound = 26
|
|
823
|
+
hbound = height-3
|
|
824
|
+
elif self._style & wx.SUNKEN_BORDER:
|
|
825
|
+
wbound = 24
|
|
826
|
+
hbound = height-5
|
|
827
|
+
elif self._style & wx.RAISED_BORDER:
|
|
828
|
+
wbound = 22
|
|
829
|
+
hbound = height-7
|
|
830
|
+
elif self._style & wx.DOUBLE_BORDER:
|
|
831
|
+
wbound = 22
|
|
832
|
+
hbound = height-7
|
|
833
|
+
|
|
834
|
+
minText = self.LabelString(self._min, major=True)
|
|
835
|
+
maxText = self.LabelString(self._max, major=True)
|
|
836
|
+
|
|
837
|
+
dc = wx.ClientDC(self)
|
|
838
|
+
minWidth, minHeight = dc.GetTextExtent(minText)
|
|
839
|
+
maxWidth, maxHeight = dc.GetTextExtent(maxText)
|
|
840
|
+
|
|
841
|
+
maxWidth = max(maxWidth, minWidth)
|
|
842
|
+
maxHeight = max(maxHeight, minHeight)
|
|
843
|
+
|
|
844
|
+
if self._orientation == wx.HORIZONTAL:
|
|
845
|
+
if maxHeight + 4 > hbound:
|
|
846
|
+
hbound = maxHeight
|
|
847
|
+
self.SetInitialSize((-1, maxHeight + 4))
|
|
848
|
+
if self.GetContainingSizer():
|
|
849
|
+
self.GetContainingSizer().Layout()
|
|
850
|
+
else:
|
|
851
|
+
if maxWidth + 4 > wbound:
|
|
852
|
+
wbound = maxWidth
|
|
853
|
+
self.SetInitialSize((maxWidth + 4, -1))
|
|
854
|
+
if self.GetContainingSizer():
|
|
855
|
+
self.GetContainingSizer().Layout()
|
|
856
|
+
|
|
857
|
+
return wbound, hbound
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
def TickMajor(self, tick=True):
|
|
861
|
+
"""
|
|
862
|
+
Sets whether the major ticks should be ticked or not.
|
|
863
|
+
|
|
864
|
+
:param `tick`: ``True`` to show major ticks, ``False`` otherwise.
|
|
865
|
+
"""
|
|
866
|
+
|
|
867
|
+
if self._tickmajor != tick:
|
|
868
|
+
self._tickmajor = tick
|
|
869
|
+
self.Invalidate()
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
def TickMinor(self, tick=True):
|
|
873
|
+
"""
|
|
874
|
+
Sets whether the minor ticks should be ticked or not.
|
|
875
|
+
|
|
876
|
+
:param `tick`: ``True`` to show minor ticks, ``False`` otherwise.
|
|
877
|
+
"""
|
|
878
|
+
|
|
879
|
+
if self._tickminor != tick:
|
|
880
|
+
self._tickminor = tick
|
|
881
|
+
self.Invalidate()
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
def LabelMinor(self, label=True):
|
|
885
|
+
"""
|
|
886
|
+
Sets whether the minor ticks should be labeled or not.
|
|
887
|
+
|
|
888
|
+
:param `label`: ``True`` to label minor ticks, ``False`` otherwise.
|
|
889
|
+
"""
|
|
890
|
+
|
|
891
|
+
if self._labelminor != label:
|
|
892
|
+
self._labelminor = label
|
|
893
|
+
self.Invalidate()
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
def LabelMajor(self, label=True):
|
|
897
|
+
"""
|
|
898
|
+
Sets whether the major ticks should be labeled or not.
|
|
899
|
+
|
|
900
|
+
:param `label`: ``True`` to label major ticks, ``False`` otherwise.
|
|
901
|
+
"""
|
|
902
|
+
|
|
903
|
+
if self._labelmajor != label:
|
|
904
|
+
self._labelmajor = label
|
|
905
|
+
self.Invalidate()
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
def GetTimeFormat(self):
|
|
909
|
+
""" Returns the time format. """
|
|
910
|
+
|
|
911
|
+
return self._timeformat
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
def SetTimeFormat(self, format=TimeFormat):
|
|
915
|
+
"""
|
|
916
|
+
Sets the time format.
|
|
917
|
+
|
|
918
|
+
:param `format`: the format used to display time values.
|
|
919
|
+
"""
|
|
920
|
+
|
|
921
|
+
if self._timeformat != format:
|
|
922
|
+
self._timeformat = format
|
|
923
|
+
self.Invalidate()
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
def SetFormat(self, format):
|
|
927
|
+
"""
|
|
928
|
+
Sets the format for :class:`RulerCtrl`.
|
|
929
|
+
|
|
930
|
+
:param `format`: the format used to display values in :class:`RulerCtrl`. This can be
|
|
931
|
+
one of the following bits:
|
|
932
|
+
|
|
933
|
+
====================== ======= ==============================
|
|
934
|
+
Format Value Description
|
|
935
|
+
====================== ======= ==============================
|
|
936
|
+
``IntFormat`` 1 Integer format
|
|
937
|
+
``RealFormat`` 2 Real format
|
|
938
|
+
``TimeFormat`` 3 Time format
|
|
939
|
+
``LinearDBFormat`` 4 Linear DB format
|
|
940
|
+
``HHMMSS_Format`` 5 HHMMSS format
|
|
941
|
+
====================== ======= ==============================
|
|
942
|
+
"""
|
|
943
|
+
|
|
944
|
+
if self._format != format:
|
|
945
|
+
self._format = format
|
|
946
|
+
self.Invalidate()
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
def GetFormat(self):
|
|
950
|
+
"""
|
|
951
|
+
Returns the format used to display values in :class:`RulerCtrl`.
|
|
952
|
+
|
|
953
|
+
:see: :meth:`RulerCtrl.SetFormat` for a list of possible formats.
|
|
954
|
+
"""
|
|
955
|
+
|
|
956
|
+
return self._format
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
def SetLog(self, log=True):
|
|
960
|
+
"""
|
|
961
|
+
Sets whether :class:`RulerCtrl` should have a logarithmic scale or not.
|
|
962
|
+
|
|
963
|
+
:param `log`: ``True`` to use a logarithmic scale, ``False`` to use a
|
|
964
|
+
linear one.
|
|
965
|
+
"""
|
|
966
|
+
|
|
967
|
+
if self._log != log:
|
|
968
|
+
self._log = log
|
|
969
|
+
self.Invalidate()
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
def SetUnits(self, units):
|
|
973
|
+
"""
|
|
974
|
+
Sets the units that should be displayed beside the labels.
|
|
975
|
+
|
|
976
|
+
:param `units`: the units that should be displayed beside the labels.
|
|
977
|
+
"""
|
|
978
|
+
|
|
979
|
+
# Specify the name of the units (like "dB") if you
|
|
980
|
+
# want numbers like "1.6" formatted as "1.6 dB".
|
|
981
|
+
|
|
982
|
+
if self._units != units:
|
|
983
|
+
self._units = units
|
|
984
|
+
self.Invalidate()
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
def SetBackgroundColour(self, colour):
|
|
988
|
+
"""
|
|
989
|
+
Sets the :class:`RulerCtrl` background colour.
|
|
990
|
+
|
|
991
|
+
:param `colour`: an instance of :class:`wx.Colour`.
|
|
992
|
+
|
|
993
|
+
:note: Overridden from :class:`Panel`.
|
|
994
|
+
"""
|
|
995
|
+
|
|
996
|
+
self._background = colour
|
|
997
|
+
wx.Panel.SetBackgroundColour(self, colour)
|
|
998
|
+
self.Refresh()
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
def SetOrientation(self, orient=None):
|
|
1002
|
+
"""
|
|
1003
|
+
Sets the :class:`RulerCtrl` orientation.
|
|
1004
|
+
|
|
1005
|
+
:param `orient`: can be ``wx.HORIZONTAL`` or ``wx.VERTICAL``.
|
|
1006
|
+
"""
|
|
1007
|
+
|
|
1008
|
+
if orient is None:
|
|
1009
|
+
orient = wx.HORIZONTAL
|
|
1010
|
+
|
|
1011
|
+
if self._orientation != orient:
|
|
1012
|
+
self._orientation = orient
|
|
1013
|
+
|
|
1014
|
+
if self._orientation == wx.VERTICAL and not self._hassetspacing:
|
|
1015
|
+
self._spacing = 2
|
|
1016
|
+
|
|
1017
|
+
self.Invalidate()
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
def SetRange(self, minVal, maxVal):
|
|
1021
|
+
"""
|
|
1022
|
+
Sets the :class:`RulerCtrl` range.
|
|
1023
|
+
|
|
1024
|
+
:param `minVal`: the minimum value of :class:`RulerCtrl`;
|
|
1025
|
+
:param `maxVal`: the maximum value of :class:`RulerCtrl`.
|
|
1026
|
+
"""
|
|
1027
|
+
|
|
1028
|
+
# For a horizontal ruler,
|
|
1029
|
+
# minVal is the value in the center of pixel "left",
|
|
1030
|
+
# maxVal is the value in the center of pixel "right".
|
|
1031
|
+
|
|
1032
|
+
if self._min != minVal or self._max != maxVal:
|
|
1033
|
+
self._min = minVal
|
|
1034
|
+
self._max = maxVal
|
|
1035
|
+
self.Invalidate()
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
def SetSpacing(self, spacing):
|
|
1039
|
+
"""
|
|
1040
|
+
Sets the :class:`RulerCtrl` spacing between labels.
|
|
1041
|
+
|
|
1042
|
+
:param `spacing`: the spacing between labels, in pixels.
|
|
1043
|
+
"""
|
|
1044
|
+
|
|
1045
|
+
self._hassetspacing = True
|
|
1046
|
+
|
|
1047
|
+
if self._spacing != spacing:
|
|
1048
|
+
self._spacing = spacing
|
|
1049
|
+
self.Invalidate()
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
def SetLabelEdges(self, labelEdges=True):
|
|
1053
|
+
"""
|
|
1054
|
+
Sets whether the edge values should always be displayed or not.
|
|
1055
|
+
|
|
1056
|
+
:param `labelEdges`: ``True`` to always display edge labels, ``False`` otherwise/
|
|
1057
|
+
"""
|
|
1058
|
+
|
|
1059
|
+
# If this is True, the edges of the ruler will always
|
|
1060
|
+
# receive a label. If not, the nearest round number is
|
|
1061
|
+
# labeled (which may or may not be the edge).
|
|
1062
|
+
|
|
1063
|
+
if self._labeledges != labelEdges:
|
|
1064
|
+
self._labeledges = labelEdges
|
|
1065
|
+
self.Invalidate()
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
def SetFlip(self, flip=True):
|
|
1069
|
+
"""
|
|
1070
|
+
Sets whether the orientation of the tick marks should be reversed.
|
|
1071
|
+
|
|
1072
|
+
:param `flip`: ``True`` to reverse the orientation of the tick marks, ``False``
|
|
1073
|
+
otherwise.
|
|
1074
|
+
"""
|
|
1075
|
+
|
|
1076
|
+
# If this is True, the orientation of the tick marks
|
|
1077
|
+
# is reversed from the default eg. above the line
|
|
1078
|
+
# instead of below
|
|
1079
|
+
|
|
1080
|
+
if self._flip != flip:
|
|
1081
|
+
self._flip = flip
|
|
1082
|
+
self.Invalidate()
|
|
1083
|
+
for indicator in self._indicators:
|
|
1084
|
+
indicator.RotateImage()
|
|
1085
|
+
|
|
1086
|
+
|
|
1087
|
+
def SetFonts(self, minorFont, majorFont):
|
|
1088
|
+
"""
|
|
1089
|
+
Sets the fonts for minor and major tick labels.
|
|
1090
|
+
|
|
1091
|
+
:param `minorFont`: the font used to draw minor ticks, a valid :class:`wx.Font` object;
|
|
1092
|
+
:param `majorFont`: the font used to draw major ticks, a valid :class:`wx.Font` object.
|
|
1093
|
+
"""
|
|
1094
|
+
|
|
1095
|
+
self._minorfont = minorFont
|
|
1096
|
+
self._majorfont = majorFont
|
|
1097
|
+
|
|
1098
|
+
self.Invalidate()
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
def SetTickPenColour(self, colour=wx.BLACK):
|
|
1102
|
+
"""
|
|
1103
|
+
Sets the pen colour to draw the ticks.
|
|
1104
|
+
|
|
1105
|
+
:param `colour`: a valid :class:`wx.Colour` object.
|
|
1106
|
+
"""
|
|
1107
|
+
|
|
1108
|
+
self._tickpen = wx.Pen(colour)
|
|
1109
|
+
self.Refresh()
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
def SetLabelColour(self, colour=wx.BLACK):
|
|
1113
|
+
"""
|
|
1114
|
+
Sets the labels colour.
|
|
1115
|
+
|
|
1116
|
+
:param `colour`: a valid :class:`wx.Colour` object.
|
|
1117
|
+
"""
|
|
1118
|
+
|
|
1119
|
+
self._textcolour = colour
|
|
1120
|
+
self.Refresh()
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
def OfflimitsPixels(self, start, end):
|
|
1124
|
+
""" Used internally. """
|
|
1125
|
+
|
|
1126
|
+
if not self._userbits:
|
|
1127
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1128
|
+
self._length = self._right-self._left
|
|
1129
|
+
else:
|
|
1130
|
+
self._length = self._bottom-self._top
|
|
1131
|
+
|
|
1132
|
+
self._userbits = [0]*self._length
|
|
1133
|
+
self._userbitlen = self._length+1
|
|
1134
|
+
|
|
1135
|
+
if end < start:
|
|
1136
|
+
i = end
|
|
1137
|
+
end = start
|
|
1138
|
+
start = i
|
|
1139
|
+
|
|
1140
|
+
if start < 0:
|
|
1141
|
+
start = 0
|
|
1142
|
+
if end > self._length:
|
|
1143
|
+
end = self._length
|
|
1144
|
+
|
|
1145
|
+
for ii in range(start, end+1):
|
|
1146
|
+
self._userbits[ii] = 1
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
def SetBounds(self, left, top, right, bottom):
|
|
1150
|
+
"""
|
|
1151
|
+
Sets the bounds for :class:`RulerCtrl` (its client rectangle).
|
|
1152
|
+
|
|
1153
|
+
:param `left`: the left corner of the client rectangle;
|
|
1154
|
+
:param `top`: the top corner of the client rectangle;
|
|
1155
|
+
:param `right`: the right corner of the client rectangle;
|
|
1156
|
+
:param `bottom`: the bottom corner of the client rectangle.
|
|
1157
|
+
"""
|
|
1158
|
+
|
|
1159
|
+
if self._left != left or self._top != top or self._right != right or \
|
|
1160
|
+
self._bottom != bottom:
|
|
1161
|
+
|
|
1162
|
+
self._left = left
|
|
1163
|
+
self._top = top
|
|
1164
|
+
self._right = right
|
|
1165
|
+
self._bottom = bottom
|
|
1166
|
+
|
|
1167
|
+
self.Invalidate()
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
def GetBounds(self):
|
|
1171
|
+
""" Returns the :class:`RulerCtrl` bounds (its client rectangle). """
|
|
1172
|
+
|
|
1173
|
+
return self._left, self._top, self._right, self._bottom
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
def AddIndicator(self, id, value):
|
|
1177
|
+
"""
|
|
1178
|
+
Adds an indicator to :class:`RulerCtrl`. You should pass a unique `id` and a starting
|
|
1179
|
+
`value` for the indicator.
|
|
1180
|
+
|
|
1181
|
+
:param `id`: the indicator identifier;
|
|
1182
|
+
:param `value`: the indicator initial value.
|
|
1183
|
+
"""
|
|
1184
|
+
|
|
1185
|
+
self._indicators.append(Indicator(self, id, value))
|
|
1186
|
+
self.Refresh()
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
def SetIndicatorColour(self, id, colour=None):
|
|
1190
|
+
"""
|
|
1191
|
+
Sets the indicator colour.
|
|
1192
|
+
|
|
1193
|
+
:param `id`: the indicator identifier;
|
|
1194
|
+
:param `colour`: a valid :class:`wx.Colour` object.
|
|
1195
|
+
|
|
1196
|
+
:note: This method requires PIL to change the image palette.
|
|
1197
|
+
"""
|
|
1198
|
+
|
|
1199
|
+
if not _hasPIL:
|
|
1200
|
+
return
|
|
1201
|
+
|
|
1202
|
+
if colour is None:
|
|
1203
|
+
colour = wx.WHITE
|
|
1204
|
+
|
|
1205
|
+
for indicator in self._indicators:
|
|
1206
|
+
if indicator.GetId() == id:
|
|
1207
|
+
indicator.SetColour(colour)
|
|
1208
|
+
break
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
def Invalidate(self):
|
|
1212
|
+
""" Invalidates the ticks calculations. """
|
|
1213
|
+
|
|
1214
|
+
self._valid = False
|
|
1215
|
+
|
|
1216
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1217
|
+
self._length = self._right - self._left
|
|
1218
|
+
else:
|
|
1219
|
+
self._length = self._bottom - self._top
|
|
1220
|
+
|
|
1221
|
+
self._majorlabels = []
|
|
1222
|
+
self._minorlabels = []
|
|
1223
|
+
self._bits = []
|
|
1224
|
+
self._userbits = []
|
|
1225
|
+
self._userbitlen = 0
|
|
1226
|
+
self.Refresh()
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
def FindLinearTickSizes(self, UPP):
|
|
1230
|
+
""" Used internally. """
|
|
1231
|
+
|
|
1232
|
+
# Given the dimensions of the ruler, the range of values it
|
|
1233
|
+
# has to display, and the format (i.e. Int, Real, Time),
|
|
1234
|
+
# figure out how many units are in one Minor tick, and
|
|
1235
|
+
# in one Major tick.
|
|
1236
|
+
#
|
|
1237
|
+
# The goal is to always put tick marks on nice round numbers
|
|
1238
|
+
# that are easy for humans to grok. This is the most tricky
|
|
1239
|
+
# with time.
|
|
1240
|
+
|
|
1241
|
+
# As a heuristic, we want at least 16 pixels
|
|
1242
|
+
# between each minor tick
|
|
1243
|
+
units = 16.0*abs(UPP)
|
|
1244
|
+
|
|
1245
|
+
self._digits = 0
|
|
1246
|
+
|
|
1247
|
+
if self._format == LinearDBFormat:
|
|
1248
|
+
|
|
1249
|
+
if units < 0.1:
|
|
1250
|
+
self._minor = 0.1
|
|
1251
|
+
self._major = 0.5
|
|
1252
|
+
return
|
|
1253
|
+
|
|
1254
|
+
if units < 1.0:
|
|
1255
|
+
self._minor = 1.0
|
|
1256
|
+
self._major = 6.0
|
|
1257
|
+
return
|
|
1258
|
+
|
|
1259
|
+
self._minor = 3.0
|
|
1260
|
+
self._major = 12.0
|
|
1261
|
+
return
|
|
1262
|
+
|
|
1263
|
+
elif self._format == IntFormat:
|
|
1264
|
+
|
|
1265
|
+
d = 1.0
|
|
1266
|
+
while 1:
|
|
1267
|
+
if units < d:
|
|
1268
|
+
self._minor = d
|
|
1269
|
+
self._major = d*5.0
|
|
1270
|
+
return
|
|
1271
|
+
|
|
1272
|
+
d = d*5.0
|
|
1273
|
+
if units < d:
|
|
1274
|
+
self._minor = d
|
|
1275
|
+
self._major = d*2.0
|
|
1276
|
+
return
|
|
1277
|
+
|
|
1278
|
+
d = 2.0*d
|
|
1279
|
+
|
|
1280
|
+
elif self._format == TimeFormat:
|
|
1281
|
+
|
|
1282
|
+
if units > 0.5:
|
|
1283
|
+
if units < 1.0: # 1 sec
|
|
1284
|
+
self._minor = 1.0
|
|
1285
|
+
self._major = 5.0
|
|
1286
|
+
return
|
|
1287
|
+
|
|
1288
|
+
if units < 5.0: # 5 sec
|
|
1289
|
+
self._minor = 5.0
|
|
1290
|
+
self._major = 15.0
|
|
1291
|
+
return
|
|
1292
|
+
|
|
1293
|
+
if units < 10.0:
|
|
1294
|
+
self._minor = 10.0
|
|
1295
|
+
self._major = 30.0
|
|
1296
|
+
return
|
|
1297
|
+
|
|
1298
|
+
if units < 15.0:
|
|
1299
|
+
self._minor = 15.0
|
|
1300
|
+
self._major = 60.0
|
|
1301
|
+
return
|
|
1302
|
+
|
|
1303
|
+
if units < 30.0:
|
|
1304
|
+
self._minor = 30.0
|
|
1305
|
+
self._major = 60.0
|
|
1306
|
+
return
|
|
1307
|
+
|
|
1308
|
+
if units < 60.0: # 1 min
|
|
1309
|
+
self._minor = 60.0
|
|
1310
|
+
self._major = 300.0
|
|
1311
|
+
return
|
|
1312
|
+
|
|
1313
|
+
if units < 300.0: # 5 min
|
|
1314
|
+
self._minor = 300.0
|
|
1315
|
+
self._major = 900.0
|
|
1316
|
+
return
|
|
1317
|
+
|
|
1318
|
+
if units < 600.0: # 10 min
|
|
1319
|
+
self._minor = 600.0
|
|
1320
|
+
self._major = 1800.0
|
|
1321
|
+
return
|
|
1322
|
+
|
|
1323
|
+
if units < 900.0: # 15 min
|
|
1324
|
+
self._minor = 900.0
|
|
1325
|
+
self._major = 3600.0
|
|
1326
|
+
return
|
|
1327
|
+
|
|
1328
|
+
if units < 1800.0: # 30 min
|
|
1329
|
+
self._minor = 1800.0
|
|
1330
|
+
self._major = 3600.0
|
|
1331
|
+
return
|
|
1332
|
+
|
|
1333
|
+
if units < 3600.0: # 1 hr
|
|
1334
|
+
self._minor = 3600.0
|
|
1335
|
+
self._major = 6*3600.0
|
|
1336
|
+
return
|
|
1337
|
+
|
|
1338
|
+
if units < 6*3600.0: # 6 hrs
|
|
1339
|
+
self._minor = 6*3600.0
|
|
1340
|
+
self._major = 24*3600.0
|
|
1341
|
+
return
|
|
1342
|
+
|
|
1343
|
+
if units < 24*3600.0: # 1 day
|
|
1344
|
+
self._minor = 24*3600.0
|
|
1345
|
+
self._major = 7*24*3600.0
|
|
1346
|
+
return
|
|
1347
|
+
|
|
1348
|
+
self._minor = 24.0*7.0*3600.0 # 1 week
|
|
1349
|
+
self._major = 24.0*7.0*3600.0
|
|
1350
|
+
|
|
1351
|
+
# Otherwise fall through to RealFormat
|
|
1352
|
+
# (fractions of a second should be dealt with
|
|
1353
|
+
# the same way as for RealFormat)
|
|
1354
|
+
|
|
1355
|
+
elif self._format == RealFormat:
|
|
1356
|
+
|
|
1357
|
+
d = 0.000001
|
|
1358
|
+
self._digits = 6
|
|
1359
|
+
|
|
1360
|
+
while 1:
|
|
1361
|
+
if units < d:
|
|
1362
|
+
self._minor = d
|
|
1363
|
+
self._major = d*5.0
|
|
1364
|
+
return
|
|
1365
|
+
|
|
1366
|
+
d = d*5.0
|
|
1367
|
+
if units < d:
|
|
1368
|
+
self._minor = d
|
|
1369
|
+
self._major = d*2.0
|
|
1370
|
+
return
|
|
1371
|
+
|
|
1372
|
+
d = d*2.0
|
|
1373
|
+
self._digits = self._digits - 1
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
def LabelString(self, d, major=None):
|
|
1377
|
+
""" Used internally. """
|
|
1378
|
+
|
|
1379
|
+
# Given a value, turn it into a string according
|
|
1380
|
+
# to the current ruler format. The number of digits of
|
|
1381
|
+
# accuracy depends on the resolution of the ruler,
|
|
1382
|
+
# i.e. how far zoomed in or out you are.
|
|
1383
|
+
|
|
1384
|
+
s = ""
|
|
1385
|
+
|
|
1386
|
+
if d < 0.0 and d + self._minor > 0.0:
|
|
1387
|
+
d = 0.0
|
|
1388
|
+
|
|
1389
|
+
if self._format == IntFormat:
|
|
1390
|
+
s = "%d"%int(math.floor(d+0.5))
|
|
1391
|
+
|
|
1392
|
+
elif self._format == LinearDBFormat:
|
|
1393
|
+
if self._minor >= 1.0:
|
|
1394
|
+
s = "%d"%int(math.floor(d+0.5))
|
|
1395
|
+
else:
|
|
1396
|
+
s = "%0.1f"%d
|
|
1397
|
+
|
|
1398
|
+
elif self._format == RealFormat:
|
|
1399
|
+
if self._minor >= 1.0:
|
|
1400
|
+
s = "%d"%int(math.floor(d+0.5))
|
|
1401
|
+
else:
|
|
1402
|
+
s = (("%." + str(self._digits) + "f")%d).strip()
|
|
1403
|
+
|
|
1404
|
+
elif self._format == TimeFormat:
|
|
1405
|
+
if major:
|
|
1406
|
+
if d < 0:
|
|
1407
|
+
s = "-"
|
|
1408
|
+
d = -d
|
|
1409
|
+
|
|
1410
|
+
if self.GetTimeFormat() == HHMMSS_Format:
|
|
1411
|
+
|
|
1412
|
+
secs = int(d + 0.5)
|
|
1413
|
+
if self._minor >= 1.0:
|
|
1414
|
+
s = ("%d:%02d:%02d")%(secs//3600, (secs//60)%60, secs%60)
|
|
1415
|
+
|
|
1416
|
+
else:
|
|
1417
|
+
t1 = ("%d:%02d:")%(secs//3600, (secs//60)%60)
|
|
1418
|
+
format = "%" + "%0d.%dlf"%(self._digits+3, self._digits)
|
|
1419
|
+
t2 = format%(d%60.0)
|
|
1420
|
+
s = s + t1 + t2
|
|
1421
|
+
|
|
1422
|
+
else:
|
|
1423
|
+
|
|
1424
|
+
if self._minor >= 3600.0:
|
|
1425
|
+
hrs = int(d/3600.0 + 0.5)
|
|
1426
|
+
h = "%d:00:00"%hrs
|
|
1427
|
+
s = s + h
|
|
1428
|
+
|
|
1429
|
+
elif self._minor >= 60.0:
|
|
1430
|
+
minutes = int(d/60.0 + 0.5)
|
|
1431
|
+
if minutes >= 60:
|
|
1432
|
+
m = "%d:%02d:00"%(minutes//60, minutes%60)
|
|
1433
|
+
else:
|
|
1434
|
+
m = "%d:00"%minutes
|
|
1435
|
+
|
|
1436
|
+
s = s + m
|
|
1437
|
+
|
|
1438
|
+
elif self._minor >= 1.0:
|
|
1439
|
+
secs = int(d + 0.5)
|
|
1440
|
+
if secs >= 3600:
|
|
1441
|
+
t = "%d:%02d:%02d"%(secs//3600, (secs//60)%60, secs%60)
|
|
1442
|
+
elif secs >= 60:
|
|
1443
|
+
t = "%d:%02d"%(secs//60, secs%60)
|
|
1444
|
+
else:
|
|
1445
|
+
t = "%d"%secs
|
|
1446
|
+
|
|
1447
|
+
s = s + t
|
|
1448
|
+
|
|
1449
|
+
else:
|
|
1450
|
+
secs = int(d)
|
|
1451
|
+
if secs >= 3600:
|
|
1452
|
+
t1 = "%d:%02d:"%(secs//3600, (secs//60)%60)
|
|
1453
|
+
elif secs >= 60:
|
|
1454
|
+
t1 = "%d:"%(secs//60)
|
|
1455
|
+
|
|
1456
|
+
if secs >= 60:
|
|
1457
|
+
format = "%%0%d.%dlf"%(self._digits+3, self._digits)
|
|
1458
|
+
else:
|
|
1459
|
+
format = "%%%d.%dlf"%(self._digits+3, self._digits)
|
|
1460
|
+
|
|
1461
|
+
t2 = format%(d%60.0)
|
|
1462
|
+
|
|
1463
|
+
s = s + t1 + t2
|
|
1464
|
+
|
|
1465
|
+
if self._units != "":
|
|
1466
|
+
s = s + " " + self._units
|
|
1467
|
+
|
|
1468
|
+
return s
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
def Tick(self, dc, pos, d, major):
|
|
1472
|
+
"""
|
|
1473
|
+
Ticks a particular position.
|
|
1474
|
+
|
|
1475
|
+
:param `dc`: an instance of :class:`wx.DC`;
|
|
1476
|
+
:param `pos`: the label position;
|
|
1477
|
+
:param `d`: the current label value;
|
|
1478
|
+
:param `major`: ``True`` if it is a major ticks, ``False`` if it is a minor one.
|
|
1479
|
+
"""
|
|
1480
|
+
|
|
1481
|
+
if major:
|
|
1482
|
+
label = Label()
|
|
1483
|
+
self._majorlabels.append(label)
|
|
1484
|
+
else:
|
|
1485
|
+
label = Label()
|
|
1486
|
+
self._minorlabels.append(label)
|
|
1487
|
+
|
|
1488
|
+
label.pos = pos
|
|
1489
|
+
label.lx = self._left - 2000 # don't display
|
|
1490
|
+
label.ly = self._top - 2000 # don't display
|
|
1491
|
+
label.text = ""
|
|
1492
|
+
|
|
1493
|
+
dc.SetFont((major and [self._majorfont] or [self._minorfont])[0])
|
|
1494
|
+
|
|
1495
|
+
l = self.LabelString(d, major)
|
|
1496
|
+
strw, strh = dc.GetTextExtent(l)
|
|
1497
|
+
|
|
1498
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1499
|
+
strlen = strw
|
|
1500
|
+
strpos = pos - strw//2
|
|
1501
|
+
if strpos < 0:
|
|
1502
|
+
strpos = 0
|
|
1503
|
+
if strpos + strw >= self._length:
|
|
1504
|
+
strpos = self._length - strw
|
|
1505
|
+
strleft = self._left + strpos
|
|
1506
|
+
if self._flip:
|
|
1507
|
+
strtop = self._top + 4
|
|
1508
|
+
self._maxheight = max(self._maxheight, 4 + strh)
|
|
1509
|
+
else:
|
|
1510
|
+
strtop = self._bottom - strh - 6
|
|
1511
|
+
self._maxheight = max(self._maxheight, strh + 6)
|
|
1512
|
+
|
|
1513
|
+
else:
|
|
1514
|
+
strlen = strh
|
|
1515
|
+
strpos = pos - strh//2
|
|
1516
|
+
if strpos < 0:
|
|
1517
|
+
strpos = 0
|
|
1518
|
+
if strpos + strh >= self._length:
|
|
1519
|
+
strpos = self._length - strh
|
|
1520
|
+
strtop = self._top + strpos
|
|
1521
|
+
if self._flip:
|
|
1522
|
+
strleft = self._left + 5
|
|
1523
|
+
self._maxwidth = max(self._maxwidth, 5 + strw)
|
|
1524
|
+
else:
|
|
1525
|
+
strleft = self._right - strw - 6
|
|
1526
|
+
self._maxwidth = max(self._maxwidth, strw + 6)
|
|
1527
|
+
|
|
1528
|
+
# See if any of the pixels we need to draw this
|
|
1529
|
+
# label is already covered
|
|
1530
|
+
|
|
1531
|
+
if major and self._labelmajor or not major and self._labelminor:
|
|
1532
|
+
for ii in range(strlen):
|
|
1533
|
+
if self._bits[strpos+ii]:
|
|
1534
|
+
return
|
|
1535
|
+
|
|
1536
|
+
# If not, position the label and give it text
|
|
1537
|
+
|
|
1538
|
+
label.lx = strleft
|
|
1539
|
+
label.ly = strtop
|
|
1540
|
+
label.text = l
|
|
1541
|
+
|
|
1542
|
+
if major:
|
|
1543
|
+
if self._tickmajor and not self._labelmajor:
|
|
1544
|
+
label.text = ""
|
|
1545
|
+
self._majorlabels[-1] = label
|
|
1546
|
+
|
|
1547
|
+
else:
|
|
1548
|
+
if self._tickminor and not self._labelminor:
|
|
1549
|
+
label.text = ""
|
|
1550
|
+
label.text = label.text.replace(self._units, "")
|
|
1551
|
+
self._minorlabels[-1] = label
|
|
1552
|
+
|
|
1553
|
+
# And mark these pixels, plus some surrounding
|
|
1554
|
+
# ones (the spacing between labels), as covered
|
|
1555
|
+
|
|
1556
|
+
if (not major and self._labelminor) or (major and self._labelmajor):
|
|
1557
|
+
|
|
1558
|
+
leftmargin = self._spacing
|
|
1559
|
+
|
|
1560
|
+
if strpos < leftmargin:
|
|
1561
|
+
leftmargin = strpos
|
|
1562
|
+
|
|
1563
|
+
strpos = strpos - leftmargin
|
|
1564
|
+
strlen = strlen + leftmargin
|
|
1565
|
+
|
|
1566
|
+
rightmargin = self._spacing
|
|
1567
|
+
|
|
1568
|
+
if strpos + strlen > self._length - self._spacing:
|
|
1569
|
+
rightmargin = self._length - strpos - strlen
|
|
1570
|
+
|
|
1571
|
+
strlen = strlen + rightmargin
|
|
1572
|
+
|
|
1573
|
+
for ii in range(strlen):
|
|
1574
|
+
self._bits[strpos+ii] = 1
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
def Update(self, dc):
|
|
1578
|
+
"""
|
|
1579
|
+
Updates all the ticks calculations.
|
|
1580
|
+
|
|
1581
|
+
:param `dc`: an instance of :class:`wx.DC`.
|
|
1582
|
+
"""
|
|
1583
|
+
|
|
1584
|
+
# This gets called when something has been changed
|
|
1585
|
+
# (i.e. we've been invalidated). Recompute all
|
|
1586
|
+
# tick positions.
|
|
1587
|
+
|
|
1588
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1589
|
+
self._maxwidth = self._length
|
|
1590
|
+
self._maxheight = 0
|
|
1591
|
+
else:
|
|
1592
|
+
self._maxwidth = 0
|
|
1593
|
+
self._maxheight = self._length
|
|
1594
|
+
|
|
1595
|
+
self._bits = [0]*(self._length+1)
|
|
1596
|
+
self._middlepos = []
|
|
1597
|
+
|
|
1598
|
+
if self._userbits:
|
|
1599
|
+
for ii in range(self._length):
|
|
1600
|
+
self._bits[ii] = self._userbits[ii]
|
|
1601
|
+
else:
|
|
1602
|
+
for ii in range(self._length):
|
|
1603
|
+
self._bits[ii] = 0
|
|
1604
|
+
|
|
1605
|
+
if not self._log:
|
|
1606
|
+
|
|
1607
|
+
UPP = (self._max - self._min)/float(self._length) # Units per pixel
|
|
1608
|
+
|
|
1609
|
+
self.FindLinearTickSizes(UPP)
|
|
1610
|
+
|
|
1611
|
+
# Left and Right Edges
|
|
1612
|
+
if self._labeledges:
|
|
1613
|
+
self.Tick(dc, 0, self._min, True)
|
|
1614
|
+
self.Tick(dc, self._length, self._max, True)
|
|
1615
|
+
|
|
1616
|
+
# Zero (if it's in the middle somewhere)
|
|
1617
|
+
if self._min*self._max < 0.0:
|
|
1618
|
+
mid = int(self._length*(self._min/(self._min-self._max)) + 0.5)
|
|
1619
|
+
self.Tick(dc, mid, 0.0, True)
|
|
1620
|
+
|
|
1621
|
+
sg = ((UPP > 0.0) and [1.0] or [-1.0])[0]
|
|
1622
|
+
|
|
1623
|
+
# Major ticks
|
|
1624
|
+
d = self._min - UPP/2.0
|
|
1625
|
+
lastd = d
|
|
1626
|
+
majorint = int(math.floor(sg*d/self._major))
|
|
1627
|
+
ii = -1
|
|
1628
|
+
|
|
1629
|
+
while ii <= self._length:
|
|
1630
|
+
ii = ii + 1
|
|
1631
|
+
lastd = d
|
|
1632
|
+
d = d + UPP
|
|
1633
|
+
|
|
1634
|
+
if int(math.floor(sg*d/self._major)) > majorint:
|
|
1635
|
+
majorint = int(math.floor(sg*d/self._major))
|
|
1636
|
+
self.Tick(dc, ii, sg*majorint*self._major, True)
|
|
1637
|
+
|
|
1638
|
+
# Minor ticks
|
|
1639
|
+
d = self._min - UPP/2.0
|
|
1640
|
+
lastd = d
|
|
1641
|
+
minorint = int(math.floor(sg*d/self._minor))
|
|
1642
|
+
ii = -1
|
|
1643
|
+
|
|
1644
|
+
while ii <= self._length:
|
|
1645
|
+
ii = ii + 1
|
|
1646
|
+
lastd = d
|
|
1647
|
+
d = d + UPP
|
|
1648
|
+
|
|
1649
|
+
if int(math.floor(sg*d/self._minor)) > minorint:
|
|
1650
|
+
minorint = int(math.floor(sg*d/self._minor))
|
|
1651
|
+
self.Tick(dc, ii, sg*minorint*self._minor, False)
|
|
1652
|
+
|
|
1653
|
+
# Left and Right Edges
|
|
1654
|
+
if self._labeledges:
|
|
1655
|
+
self.Tick(dc, 0, self._min, True)
|
|
1656
|
+
self.Tick(dc, self._length, self._max, True)
|
|
1657
|
+
|
|
1658
|
+
else:
|
|
1659
|
+
# log case
|
|
1660
|
+
|
|
1661
|
+
lolog = math.log10(self._min)
|
|
1662
|
+
hilog = math.log10(self._max)
|
|
1663
|
+
scale = self._length/(hilog - lolog)
|
|
1664
|
+
lodecade = int(math.floor(lolog))
|
|
1665
|
+
hidecade = int(math.ceil(hilog))
|
|
1666
|
+
|
|
1667
|
+
# Left and Right Edges
|
|
1668
|
+
if self._labeledges:
|
|
1669
|
+
self.Tick(dc, 0, self._min, True)
|
|
1670
|
+
self.Tick(dc, self._length, self._max, True)
|
|
1671
|
+
|
|
1672
|
+
startdecade = 10.0**lodecade
|
|
1673
|
+
|
|
1674
|
+
# Major ticks are the decades
|
|
1675
|
+
decade = startdecade
|
|
1676
|
+
for ii in range(lodecade, hidecade):
|
|
1677
|
+
if ii != lodecade:
|
|
1678
|
+
val = decade
|
|
1679
|
+
if val > self._min and val < self._max:
|
|
1680
|
+
pos = int(((math.log10(val) - lolog)*scale)+0.5)
|
|
1681
|
+
self.Tick(dc, pos, val, True)
|
|
1682
|
+
|
|
1683
|
+
decade = decade*10.0
|
|
1684
|
+
|
|
1685
|
+
# Minor ticks are multiples of decades
|
|
1686
|
+
decade = startdecade
|
|
1687
|
+
|
|
1688
|
+
for ii in range(lodecade, hidecade):
|
|
1689
|
+
for jj in range(2, 10):
|
|
1690
|
+
val = decade*jj
|
|
1691
|
+
if val >= self._min and val < self._max:
|
|
1692
|
+
pos = int(((math.log10(val) - lolog)*scale)+0.5)
|
|
1693
|
+
self.Tick(dc, pos, val, False)
|
|
1694
|
+
|
|
1695
|
+
decade = decade*10.0
|
|
1696
|
+
|
|
1697
|
+
self._valid = True
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
def Draw(self, dc):
|
|
1701
|
+
"""
|
|
1702
|
+
Actually draws the whole :class:`RulerCtrl`.
|
|
1703
|
+
|
|
1704
|
+
:param `dc`: an instance of :class:`wx.DC`.
|
|
1705
|
+
"""
|
|
1706
|
+
|
|
1707
|
+
if not self._valid:
|
|
1708
|
+
self.Update(dc)
|
|
1709
|
+
|
|
1710
|
+
dc.SetBrush(wx.Brush(self._background))
|
|
1711
|
+
dc.SetPen(self._tickpen)
|
|
1712
|
+
dc.SetTextForeground(self._textcolour)
|
|
1713
|
+
|
|
1714
|
+
dc.DrawRectangle(self.GetClientRect())
|
|
1715
|
+
|
|
1716
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1717
|
+
if self._flip:
|
|
1718
|
+
dc.DrawLine(self._left, self._top, self._right+1, self._top)
|
|
1719
|
+
else:
|
|
1720
|
+
dc.DrawLine(self._left, self._bottom-1, self._right+1, self._bottom-1)
|
|
1721
|
+
|
|
1722
|
+
else:
|
|
1723
|
+
if self._flip:
|
|
1724
|
+
dc.DrawLine(self._left, self._top, self._left, self._bottom+1)
|
|
1725
|
+
else:
|
|
1726
|
+
dc.DrawLine(self._right-1, self._top, self._right-1, self._bottom+1)
|
|
1727
|
+
|
|
1728
|
+
dc.SetFont(self._majorfont)
|
|
1729
|
+
|
|
1730
|
+
for label in self._majorlabels:
|
|
1731
|
+
pos = label.pos
|
|
1732
|
+
|
|
1733
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1734
|
+
if self._flip:
|
|
1735
|
+
dc.DrawLine(self._left + pos, self._top,
|
|
1736
|
+
self._left + pos, self._top + 5)
|
|
1737
|
+
else:
|
|
1738
|
+
dc.DrawLine(self._left + pos, self._bottom - 5,
|
|
1739
|
+
self._left + pos, self._bottom)
|
|
1740
|
+
|
|
1741
|
+
else:
|
|
1742
|
+
if self._flip:
|
|
1743
|
+
dc.DrawLine(self._left, self._top + pos,
|
|
1744
|
+
self._left + 5, self._top + pos)
|
|
1745
|
+
else:
|
|
1746
|
+
dc.DrawLine(self._right - 5, self._top + pos,
|
|
1747
|
+
self._right, self._top + pos)
|
|
1748
|
+
|
|
1749
|
+
if label.text != "":
|
|
1750
|
+
dc.DrawText(label.text, label.lx, label.ly)
|
|
1751
|
+
|
|
1752
|
+
dc.SetFont(self._minorfont)
|
|
1753
|
+
|
|
1754
|
+
for label in self._minorlabels:
|
|
1755
|
+
pos = label.pos
|
|
1756
|
+
|
|
1757
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1758
|
+
if self._flip:
|
|
1759
|
+
dc.DrawLine(self._left + pos, self._top,
|
|
1760
|
+
self._left + pos, self._top + 3)
|
|
1761
|
+
else:
|
|
1762
|
+
dc.DrawLine(self._left + pos, self._bottom - 3,
|
|
1763
|
+
self._left + pos, self._bottom)
|
|
1764
|
+
|
|
1765
|
+
else:
|
|
1766
|
+
if self._flip:
|
|
1767
|
+
dc.DrawLine(self._left, self._top + pos,
|
|
1768
|
+
self._left + 3, self._top + pos)
|
|
1769
|
+
else:
|
|
1770
|
+
dc.DrawLine(self._right - 3, self._top + pos,
|
|
1771
|
+
self._right, self._top + pos)
|
|
1772
|
+
|
|
1773
|
+
if label.text != "":
|
|
1774
|
+
dc.DrawText(label.text, label.lx, label.ly)
|
|
1775
|
+
|
|
1776
|
+
for indicator in self._indicators:
|
|
1777
|
+
indicator.Draw(dc)
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
def SetDrawingParent(self, dparent):
|
|
1781
|
+
"""
|
|
1782
|
+
Sets the window to which :class:`RulerCtrl` draws a thin line over.
|
|
1783
|
+
|
|
1784
|
+
:param `dparent`: an instance of :class:`wx.Window`, representing the window to
|
|
1785
|
+
which :class:`RulerCtrl` draws a thin line over.
|
|
1786
|
+
"""
|
|
1787
|
+
|
|
1788
|
+
self._drawingparent = dparent
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
def GetDrawingParent(self):
|
|
1792
|
+
""" Returns the window to which :class:`RulerCtrl` draws a thin line over. """
|
|
1793
|
+
|
|
1794
|
+
return self._drawingparent
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
def DrawOnParent(self, indicator):
|
|
1798
|
+
"""
|
|
1799
|
+
Actually draws the thin line over the drawing parent window.
|
|
1800
|
+
|
|
1801
|
+
:param `indicator`: the current indicator, an instance of :class:`Indicator`.
|
|
1802
|
+
|
|
1803
|
+
:note: This method is currently not available on wxMac as it uses :class:`ScreenDC`.
|
|
1804
|
+
"""
|
|
1805
|
+
|
|
1806
|
+
if not self._drawingparent:
|
|
1807
|
+
return
|
|
1808
|
+
|
|
1809
|
+
xpos, ypos = indicator.GetPosition()
|
|
1810
|
+
parentrect = self._drawingparent.GetClientRect()
|
|
1811
|
+
|
|
1812
|
+
dc = wx.ScreenDC()
|
|
1813
|
+
dc.SetLogicalFunction(wx.INVERT)
|
|
1814
|
+
dc.SetPen(self._drawingpen)
|
|
1815
|
+
dc.SetBrush(wx.TRANSPARENT_BRUSH)
|
|
1816
|
+
|
|
1817
|
+
imgx, imgy = indicator.GetImageSize()
|
|
1818
|
+
|
|
1819
|
+
if self._orientation == wx.HORIZONTAL:
|
|
1820
|
+
|
|
1821
|
+
x1 = xpos+ imgx//2
|
|
1822
|
+
y1 = parentrect.y
|
|
1823
|
+
x2 = x1
|
|
1824
|
+
y2 = parentrect.height
|
|
1825
|
+
x1, y1 = self._drawingparent.ClientToScreen((x1, y1))
|
|
1826
|
+
x2, y2 = self._drawingparent.ClientToScreen((x2, y2))
|
|
1827
|
+
|
|
1828
|
+
elif self._orientation == wx.VERTICAL:
|
|
1829
|
+
|
|
1830
|
+
x1 = parentrect.x
|
|
1831
|
+
y1 = ypos + imgy//2
|
|
1832
|
+
x2 = parentrect.width
|
|
1833
|
+
y2 = y1
|
|
1834
|
+
|
|
1835
|
+
x1, y1 = self._drawingparent.ClientToScreen((x1, y1))
|
|
1836
|
+
x2, y2 = self._drawingparent.ClientToScreen((x2, y2))
|
|
1837
|
+
|
|
1838
|
+
dc.DrawLine(x1, y1, x2, y2)
|
|
1839
|
+
dc.SetLogicalFunction(wx.COPY)
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
if __name__ == '__main__':
|
|
1843
|
+
|
|
1844
|
+
import wx
|
|
1845
|
+
|
|
1846
|
+
class MyFrame(wx.Frame):
|
|
1847
|
+
|
|
1848
|
+
def __init__(self, parent):
|
|
1849
|
+
|
|
1850
|
+
wx.Frame.__init__(self, parent, -1, "RulerCtrl Demo")
|
|
1851
|
+
|
|
1852
|
+
panel = wx.Panel(self)
|
|
1853
|
+
|
|
1854
|
+
text = wx.TextCtrl(panel, -1, "Hello World! wxPython rules", style=wx.TE_MULTILINE)
|
|
1855
|
+
|
|
1856
|
+
ruler1 = RulerCtrl(panel, -1, orient=wx.HORIZONTAL, style=wx.SUNKEN_BORDER)
|
|
1857
|
+
ruler2 = RulerCtrl(panel, -1, orient=wx.VERTICAL, style=wx.SUNKEN_BORDER)
|
|
1858
|
+
|
|
1859
|
+
mainsizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
1860
|
+
leftsizer = wx.BoxSizer(wx.VERTICAL)
|
|
1861
|
+
bottomleftsizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
1862
|
+
topsizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
1863
|
+
|
|
1864
|
+
leftsizer.Add((20, 20))
|
|
1865
|
+
topsizer.Add((39, 0))
|
|
1866
|
+
topsizer.Add(ruler1, 1, wx.EXPAND, 0)
|
|
1867
|
+
leftsizer.Add(topsizer, 0, wx.EXPAND, 0)
|
|
1868
|
+
|
|
1869
|
+
bottomleftsizer.Add(10, 0)
|
|
1870
|
+
bottomleftsizer.Add(ruler2, 0, wx.EXPAND, 0)
|
|
1871
|
+
bottomleftsizer.Add(text, 1, wx.EXPAND, 0)
|
|
1872
|
+
leftsizer.Add(bottomleftsizer, 1, wx.EXPAND, 0)
|
|
1873
|
+
mainsizer.Add(leftsizer, 3, wx.EXPAND, 0)
|
|
1874
|
+
|
|
1875
|
+
panel.SetSizer(mainsizer)
|
|
1876
|
+
|
|
1877
|
+
|
|
1878
|
+
# our normal wxApp-derived class, as usual
|
|
1879
|
+
|
|
1880
|
+
app = wx.App(0)
|
|
1881
|
+
|
|
1882
|
+
frame = MyFrame(None)
|
|
1883
|
+
app.SetTopWindow(frame)
|
|
1884
|
+
frame.Show()
|
|
1885
|
+
|
|
1886
|
+
app.MainLoop()
|
|
1887
|
+
|