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
|
@@ -0,0 +1,2614 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# --------------------------------------------------------------------------- #
|
|
3
|
+
#
|
|
4
|
+
# Tags: phoenix-port, unittest, documented, py3-port
|
|
5
|
+
#
|
|
6
|
+
# End Of Comments
|
|
7
|
+
# --------------------------------------------------------------------------- #
|
|
8
|
+
"""
|
|
9
|
+
This module contains different classes which handle different kind of saving/restoring
|
|
10
|
+
actions depending on the widget kind.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import wx
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
16
|
+
import wx.adv
|
|
17
|
+
import wx.html
|
|
18
|
+
|
|
19
|
+
# use this instead of wx.gizmos.TreeListCtrl
|
|
20
|
+
import wx.dataview as dv
|
|
21
|
+
|
|
22
|
+
# Will likely not be wrapped
|
|
23
|
+
# import wx.aui
|
|
24
|
+
|
|
25
|
+
# Not wrapped, unmaintained
|
|
26
|
+
# import wx.gizmos
|
|
27
|
+
|
|
28
|
+
# Not wrapped yet, coming soon
|
|
29
|
+
# import wx.media
|
|
30
|
+
|
|
31
|
+
import wx.lib.scrolledpanel as scrolled
|
|
32
|
+
import wx.lib.expando as expando
|
|
33
|
+
import wx.lib.buttons as buttons
|
|
34
|
+
import wx.lib.masked as masked
|
|
35
|
+
import wx.lib.colourselect as csel
|
|
36
|
+
|
|
37
|
+
import wx.lib.agw.aui as AUI
|
|
38
|
+
import wx.lib.agw.cubecolourdialog as CCD
|
|
39
|
+
import wx.lib.agw.customtreectrl as CT
|
|
40
|
+
import wx.lib.agw.flatmenu as FM
|
|
41
|
+
import wx.lib.agw.flatnotebook as FNB
|
|
42
|
+
import wx.lib.agw.floatspin as FS
|
|
43
|
+
import wx.lib.agw.foldpanelbar as FPB
|
|
44
|
+
import wx.lib.agw.hypertreelist as HTL
|
|
45
|
+
import wx.lib.agw.knobctrl as KC
|
|
46
|
+
import wx.lib.agw.labelbook as LBK
|
|
47
|
+
import wx.lib.agw.pycollapsiblepane as PCP
|
|
48
|
+
|
|
49
|
+
try:
|
|
50
|
+
import wx.lib.agw.shapedbutton as SB
|
|
51
|
+
hasSB = True
|
|
52
|
+
except:
|
|
53
|
+
hasSB = False
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
import wx.lib.agw.ultimatelistctrl as ULC
|
|
57
|
+
|
|
58
|
+
from .persist_constants import *
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def PyDate2wxDate(date):
|
|
62
|
+
"""
|
|
63
|
+
Transforms a datetime.date object into a :class:`DateTime` one.
|
|
64
|
+
|
|
65
|
+
:param `date`: a `datetime.date` object.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
tt = date.timetuple()
|
|
69
|
+
dmy = (tt[2], tt[1]-1, tt[0])
|
|
70
|
+
return wx.DateTime.FromDMY(*dmy)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def wxDate2PyDate(date):
|
|
74
|
+
"""
|
|
75
|
+
Transforms a :class:`DateTime` object into a `datetime.date` one.
|
|
76
|
+
|
|
77
|
+
:param date: a :class:`DateTime` object.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
if date.IsValid():
|
|
81
|
+
ymd = list(map(int, date.FormatISODate().split('-')))
|
|
82
|
+
return datetime.date(*ymd)
|
|
83
|
+
else:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def CreateFont(font):
|
|
88
|
+
"""
|
|
89
|
+
Creates a tuple of 7 :class:`wx.Font` attributes from the `font` input parameter.
|
|
90
|
+
|
|
91
|
+
:param `font`: a :class:`wx.Font` instance.
|
|
92
|
+
|
|
93
|
+
:returns: A tuple of 7 :class:`wx.Font` attributes from the `font` input parameter.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
return font.GetPointSize(), font.GetFamily(), font.GetStyle(), font.GetWeight(), \
|
|
97
|
+
font.GetUnderlined(), font.GetFaceName(), font.GetEncoding()
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# ----------------------------------------------------------------------------------- #
|
|
101
|
+
|
|
102
|
+
class AbstractHandler(object):
|
|
103
|
+
"""
|
|
104
|
+
Base class for persistent windows, uses the window name as persistent name by
|
|
105
|
+
default and automatically reacts to the window destruction.
|
|
106
|
+
|
|
107
|
+
.. note::
|
|
108
|
+
|
|
109
|
+
This is an abstract class. If you wish to add another (custom) handler
|
|
110
|
+
for your widgets, you should derive from :class:`AbstractHandler` and override
|
|
111
|
+
the :meth:`Save() <AbstractHandler.Save>`,
|
|
112
|
+
:meth:`Restore() <AbstractHandler.Restore>` and
|
|
113
|
+
:meth:`GetKind() <AbstractHandler.GetKind>` methods.
|
|
114
|
+
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
def __init__(self, pObject):
|
|
118
|
+
"""
|
|
119
|
+
Default class constructor.
|
|
120
|
+
|
|
121
|
+
:param `pObject`: a :class:`~wx.lib.agw.persist.persistencemanager.PersistentObject` containing information about the
|
|
122
|
+
persistent widget.
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
object.__init__(self)
|
|
126
|
+
self._pObject = pObject
|
|
127
|
+
self._window = pObject.GetWindow()
|
|
128
|
+
if not hasattr(self._window, 'persistValue'):
|
|
129
|
+
self._window.persistValue = None
|
|
130
|
+
|
|
131
|
+
# need to move the import to here, otherwise we error in Python 3
|
|
132
|
+
from . import persistencemanager as PM
|
|
133
|
+
self._manager = PM.PersistenceManager.Get()
|
|
134
|
+
|
|
135
|
+
def Save(self):
|
|
136
|
+
"""
|
|
137
|
+
Saves the widget's settings by calling :meth:`PersistentObject.SaveValue() <lib.agw.persist.persistencemanager.PersistentObject.SaveValue>`, which in
|
|
138
|
+
turns calls :meth:`PersistenceManager.SaveValue() <lib.agw.persist.persistencemanager.PersistenceManager.SaveValue>`.
|
|
139
|
+
|
|
140
|
+
:note: This method must be overridden in derived classes.
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
pass
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def Restore(self):
|
|
147
|
+
"""
|
|
148
|
+
Restores the widget's settings by calling :meth:`PersistentObject.RestoreValue() <lib.agw.persist.persistencemanager.PersistentObject.RestoreValue>`, which in
|
|
149
|
+
turns calls :meth:`PersistenceManager.RestoreValue() <lib.agw.persist.persistencemanager.PersistenceManager.RestoreValue>`.
|
|
150
|
+
|
|
151
|
+
:note: This method must be overridden in derived classes.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
pass
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def GetKind(self):
|
|
158
|
+
"""
|
|
159
|
+
Returns a short and meaningful *string* description of your widget.
|
|
160
|
+
|
|
161
|
+
:note: This method must be overridden in derived classes.
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
pass
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
# ----------------------------------------------------------------------------------- #
|
|
168
|
+
|
|
169
|
+
class BookHandler(AbstractHandler):
|
|
170
|
+
"""
|
|
171
|
+
Supports saving/restoring book control selection.
|
|
172
|
+
|
|
173
|
+
This class handles the following wxPython widgets:
|
|
174
|
+
|
|
175
|
+
- :class:`Toolbook`;
|
|
176
|
+
- :class:`Choicebook`;
|
|
177
|
+
- :class:`Listbook`;
|
|
178
|
+
- :class:`Treebook` (except for opened tree branches, see :class:`TreebookHandler` for this);
|
|
179
|
+
- :class:`Notebook`;
|
|
180
|
+
- :class:`lib.agw.aui.auibook.AuiNotebook`;
|
|
181
|
+
- :class:`lib.agw.flatnotebook.FlatNotebook`;
|
|
182
|
+
- :class:`lib.agw.labelbook.LabelBook`;
|
|
183
|
+
- :class:`lib.agw.labelbook.FlatImageBook`.
|
|
184
|
+
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
def __init__(self, pObject):
|
|
188
|
+
|
|
189
|
+
AbstractHandler.__init__(self, pObject)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def Save(self):
|
|
193
|
+
|
|
194
|
+
book, obj = self._window, self._pObject
|
|
195
|
+
obj.SaveValue(PERSIST_BOOK_SELECTION, book.GetSelection())
|
|
196
|
+
|
|
197
|
+
if issubclass(book.__class__, AUI.AuiNotebook):
|
|
198
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_AUI_PERSPECTIVES:
|
|
199
|
+
# Allowed to save and restore perspectives
|
|
200
|
+
perspective = book.SavePerspective()
|
|
201
|
+
obj.SaveValue(PERSIST_BOOK_AGW_AUI_PERSPECTIVE, perspective)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def Restore(self):
|
|
205
|
+
|
|
206
|
+
book, obj = self._window, self._pObject
|
|
207
|
+
sel = obj.RestoreValue(PERSIST_BOOK_SELECTION)
|
|
208
|
+
|
|
209
|
+
retVal = True
|
|
210
|
+
if issubclass(book.__class__, AUI.AuiNotebook):
|
|
211
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_AUI_PERSPECTIVES:
|
|
212
|
+
retVal = False
|
|
213
|
+
# Allowed to save and restore perspectives
|
|
214
|
+
perspective = obj.RestoreValue(PERSIST_BOOK_AGW_AUI_PERSPECTIVE)
|
|
215
|
+
if perspective is not None:
|
|
216
|
+
retVal = book.LoadPerspective(perspective)
|
|
217
|
+
wx.CallAfter(book.Refresh)
|
|
218
|
+
|
|
219
|
+
if sel is not None:
|
|
220
|
+
if sel >= 0 and sel < book.GetPageCount():
|
|
221
|
+
book.SetSelection(sel)
|
|
222
|
+
return True and retVal
|
|
223
|
+
|
|
224
|
+
return False
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def GetKind(self):
|
|
228
|
+
|
|
229
|
+
return PERSIST_BOOK_KIND
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# ----------------------------------------------------------------------------------- #
|
|
233
|
+
|
|
234
|
+
class TreebookHandler(BookHandler):
|
|
235
|
+
"""
|
|
236
|
+
Supports saving/restoring open tree branches.
|
|
237
|
+
|
|
238
|
+
This class handles the following wxPython widgets:
|
|
239
|
+
|
|
240
|
+
- :class:`Treebook` (except for page selection, see :class:`BookHandler` for this).
|
|
241
|
+
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
def __init__(self, pObject):
|
|
245
|
+
|
|
246
|
+
BookHandler.__init__(self, pObject)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def Save(self):
|
|
250
|
+
|
|
251
|
+
book, obj = self._window, self._pObject
|
|
252
|
+
|
|
253
|
+
expanded = ""
|
|
254
|
+
for page in range(book.GetPageCount()):
|
|
255
|
+
if book.IsNodeExpanded(page):
|
|
256
|
+
if expanded:
|
|
257
|
+
expanded += PERSIST_SEP
|
|
258
|
+
|
|
259
|
+
expanded += "%u"%page
|
|
260
|
+
|
|
261
|
+
obj.SaveValue(PERSIST_TREEBOOK_EXPANDED_BRANCHES, expanded)
|
|
262
|
+
|
|
263
|
+
return BookHandler.Save(self)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def Restore(self):
|
|
267
|
+
|
|
268
|
+
book, obj = self._window, self._pObject
|
|
269
|
+
|
|
270
|
+
expanded = obj.RestoreValue(PERSIST_TREEBOOK_EXPANDED_BRANCHES)
|
|
271
|
+
|
|
272
|
+
if expanded:
|
|
273
|
+
indices = expanded.split(PERSIST_SEP)
|
|
274
|
+
pageCount = book.GetPageCount()
|
|
275
|
+
|
|
276
|
+
for indx in indices:
|
|
277
|
+
idx = int(indx)
|
|
278
|
+
if idx >= 0 and idx < pageCount:
|
|
279
|
+
book.ExpandNode(idx)
|
|
280
|
+
|
|
281
|
+
return BookHandler.Restore(self)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def GetKind(self):
|
|
285
|
+
|
|
286
|
+
return PERSIST_TREEBOOK_KIND
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
# ----------------------------------------------------------------------------------- #
|
|
290
|
+
|
|
291
|
+
class AUIHandler(AbstractHandler):
|
|
292
|
+
"""
|
|
293
|
+
Supports saving/restoring :class:`lib.agw.aui.framemanager.AuiManager` perspectives.
|
|
294
|
+
"""
|
|
295
|
+
|
|
296
|
+
def __init__(self, pObject):
|
|
297
|
+
|
|
298
|
+
AbstractHandler.__init__(self, pObject)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
def Save(self):
|
|
302
|
+
|
|
303
|
+
# Save the AUI perspectives if PersistenceManager allows it
|
|
304
|
+
eventHandler = self._window.GetEventHandler()
|
|
305
|
+
|
|
306
|
+
isAGWAui = isinstance(eventHandler, AUI.AuiManager)
|
|
307
|
+
if not isAGWAui:
|
|
308
|
+
return True
|
|
309
|
+
|
|
310
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_AUI_PERSPECTIVES:
|
|
311
|
+
# Allowed to save and restore perspectives
|
|
312
|
+
perspective = eventHandler.SavePerspective()
|
|
313
|
+
if isAGWAui:
|
|
314
|
+
name = PERSIST_AGW_AUI_PERSPECTIVE
|
|
315
|
+
else:
|
|
316
|
+
name = PERSIST_AUI_PERSPECTIVE
|
|
317
|
+
|
|
318
|
+
self._pObject.SaveValue(name, perspective)
|
|
319
|
+
|
|
320
|
+
return True
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def Restore(self):
|
|
324
|
+
|
|
325
|
+
# Restore the AUI perspectives if PersistenceManager allows it
|
|
326
|
+
eventHandler = self._window.GetEventHandler()
|
|
327
|
+
restoreCodeCaption = False
|
|
328
|
+
|
|
329
|
+
isAGWAui = isinstance(eventHandler, AUI.AuiManager)
|
|
330
|
+
if not isAGWAui:
|
|
331
|
+
return True
|
|
332
|
+
|
|
333
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_AUI_PERSPECTIVES:
|
|
334
|
+
# Allowed to save and restore perspectives
|
|
335
|
+
if isAGWAui:
|
|
336
|
+
name = PERSIST_AGW_AUI_PERSPECTIVE
|
|
337
|
+
restoreCodeCaption = self._manager.GetManagerStyle()
|
|
338
|
+
restoreCodeCaption &= ~(PM_RESTORE_CAPTION_FROM_CODE)
|
|
339
|
+
else:
|
|
340
|
+
name = PERSIST_AUI_PERSPECTIVE
|
|
341
|
+
|
|
342
|
+
perspective = self._pObject.RestoreValue(name)
|
|
343
|
+
if perspective is not None:
|
|
344
|
+
if restoreCodeCaption:
|
|
345
|
+
eventHandler.LoadPerspective(perspective,
|
|
346
|
+
restorecaption=True)
|
|
347
|
+
else:
|
|
348
|
+
eventHandler.LoadPerspective(perspective)
|
|
349
|
+
return True
|
|
350
|
+
|
|
351
|
+
return True
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def GetKind(self):
|
|
355
|
+
|
|
356
|
+
return PERSIST_AUIPERSPECTIVE_KIND
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
# ----------------------------------------------------------------------------------- #
|
|
360
|
+
|
|
361
|
+
class TLWHandler(AUIHandler):
|
|
362
|
+
"""
|
|
363
|
+
Supports saving/restoring window position and size as well as
|
|
364
|
+
maximized/iconized/restore state for toplevel windows.
|
|
365
|
+
|
|
366
|
+
This class handles the following wxPython widgets:
|
|
367
|
+
|
|
368
|
+
- All :class:`wx.Frame` derived classes;
|
|
369
|
+
- All :class:`Dialog` derived classes.
|
|
370
|
+
|
|
371
|
+
|
|
|
372
|
+
|
|
373
|
+
In addition, if the toplevel window has an associated AuiManager (whether it is
|
|
374
|
+
:class:`~wx.lib.agw.aui.framemanager.AuiManager`) and
|
|
375
|
+
:class:`~wx.lib.agw.persist.persistencemanager.PersistenceManager`
|
|
376
|
+
has the ``PM_SAVE_RESTORE_AUI_PERSPECTIVES`` style set (the default), this class
|
|
377
|
+
will also save and restore AUI perspectives using the underlying :class:`AUIHandler`
|
|
378
|
+
class.
|
|
379
|
+
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
def __init__(self, pObject):
|
|
383
|
+
|
|
384
|
+
AUIHandler.__init__(self, pObject)
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
def Save(self):
|
|
388
|
+
|
|
389
|
+
tlw, obj = self._window, self._pObject
|
|
390
|
+
|
|
391
|
+
pos = tlw.GetScreenPosition()
|
|
392
|
+
obj.SaveValue(PERSIST_TLW_X, pos.x)
|
|
393
|
+
obj.SaveValue(PERSIST_TLW_Y, pos.y)
|
|
394
|
+
|
|
395
|
+
# Notice that we use GetSize() here and not GetClientSize() because
|
|
396
|
+
# the latter doesn't return correct results for the minimized windows
|
|
397
|
+
# (at least not under Windows)
|
|
398
|
+
#
|
|
399
|
+
# Of course, it shouldn't matter anyhow usually, the client size
|
|
400
|
+
# should be preserved as well unless the size of the decorations
|
|
401
|
+
# changed between the runs
|
|
402
|
+
size = tlw.GetSize()
|
|
403
|
+
obj.SaveValue(PERSIST_TLW_W, size.x)
|
|
404
|
+
obj.SaveValue(PERSIST_TLW_H, size.y)
|
|
405
|
+
|
|
406
|
+
obj.SaveValue(PERSIST_TLW_MAXIMIZED, tlw.IsMaximized())
|
|
407
|
+
obj.SaveValue(PERSIST_TLW_ICONIZED, tlw.IsIconized())
|
|
408
|
+
|
|
409
|
+
return AUIHandler.Save(self)
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
def Restore(self):
|
|
413
|
+
|
|
414
|
+
tlw, obj = self._window, self._pObject
|
|
415
|
+
|
|
416
|
+
x, y = obj.RestoreValue(PERSIST_TLW_X), obj.RestoreValue(PERSIST_TLW_Y)
|
|
417
|
+
w, h = obj.RestoreValue(PERSIST_TLW_W), obj.RestoreValue(PERSIST_TLW_H)
|
|
418
|
+
|
|
419
|
+
hasPos = x is not None and y is not None
|
|
420
|
+
hasSize = w is not None and h is not None
|
|
421
|
+
|
|
422
|
+
if hasPos:
|
|
423
|
+
# To avoid making the window completely invisible if it had been
|
|
424
|
+
# shown on a monitor which was disconnected since the last run
|
|
425
|
+
# (this is pretty common for notebook with external displays)
|
|
426
|
+
#
|
|
427
|
+
# NB: we should allow window position to be (slightly) off screen,
|
|
428
|
+
# it's not uncommon to position the window so that its upper
|
|
429
|
+
# left corner has slightly negative coordinate
|
|
430
|
+
if wx.Display.GetFromPoint(wx.Point(x, y)) != wx.NOT_FOUND or \
|
|
431
|
+
(hasSize and wx.Display.GetFromPoint(wx.Point(x+w, y+h)) != wx.NOT_FOUND):
|
|
432
|
+
tlw.Move(wx.Point(x, y), wx.SIZE_ALLOW_MINUS_ONE)
|
|
433
|
+
|
|
434
|
+
# else: should we try to adjust position/size somehow?
|
|
435
|
+
|
|
436
|
+
if hasSize:
|
|
437
|
+
tlw.SetSize((w, h))
|
|
438
|
+
|
|
439
|
+
# Note that the window can be both maximized and iconized
|
|
440
|
+
maximized = obj.RestoreValue(PERSIST_TLW_MAXIMIZED)
|
|
441
|
+
if maximized:
|
|
442
|
+
tlw.Maximize()
|
|
443
|
+
|
|
444
|
+
iconized = obj.RestoreValue(PERSIST_TLW_ICONIZED)
|
|
445
|
+
if iconized:
|
|
446
|
+
tlw.Iconize()
|
|
447
|
+
|
|
448
|
+
# The most important property of the window that we restore is its
|
|
449
|
+
# size, so disregard the value of hasPos here
|
|
450
|
+
return (hasSize and AUIHandler.Restore(self))
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def GetKind(self):
|
|
454
|
+
|
|
455
|
+
return PERSIST_TLW_KIND
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
# ----------------------------------------------------------------------------------- #
|
|
459
|
+
|
|
460
|
+
class CheckBoxHandler(AbstractHandler):
|
|
461
|
+
"""
|
|
462
|
+
Supports saving/restoring a :class:`CheckBox` state.
|
|
463
|
+
|
|
464
|
+
This class handles the following wxPython widgets:
|
|
465
|
+
|
|
466
|
+
- :class:`CheckBox`.
|
|
467
|
+
|
|
468
|
+
"""
|
|
469
|
+
|
|
470
|
+
def __init__(self, pObject):
|
|
471
|
+
|
|
472
|
+
AbstractHandler.__init__(self, pObject)
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
def Save(self):
|
|
476
|
+
|
|
477
|
+
check, obj = self._window, self._pObject
|
|
478
|
+
|
|
479
|
+
if check.Is3State():
|
|
480
|
+
obj.SaveCtrlValue(PERSIST_CHECKBOX_3STATE, check.Get3StateValue())
|
|
481
|
+
else:
|
|
482
|
+
obj.SaveCtrlValue(PERSIST_CHECKBOX, check.GetValue())
|
|
483
|
+
|
|
484
|
+
return True
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
def Restore(self):
|
|
488
|
+
|
|
489
|
+
check, obj = self._window, self._pObject
|
|
490
|
+
|
|
491
|
+
if check.Is3State():
|
|
492
|
+
value = obj.RestoreCtrlValue(PERSIST_CHECKBOX_3STATE)
|
|
493
|
+
if value is not None:
|
|
494
|
+
check.Set3StateValue(value)
|
|
495
|
+
return True
|
|
496
|
+
else:
|
|
497
|
+
value = obj.RestoreCtrlValue(PERSIST_CHECKBOX)
|
|
498
|
+
if value is not None:
|
|
499
|
+
check.SetValue(value)
|
|
500
|
+
return True
|
|
501
|
+
|
|
502
|
+
return False
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def GetKind(self):
|
|
506
|
+
|
|
507
|
+
return PERSIST_CHECKBOX_KIND
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
# ----------------------------------------------------------------------------------- #
|
|
511
|
+
|
|
512
|
+
class ListBoxHandler(AbstractHandler):
|
|
513
|
+
"""
|
|
514
|
+
Supports saving/restoring selected items in :class:`ListBox`, :class:`ListCtrl`, :class:`ListView`,
|
|
515
|
+
:class:`VListBox`, :class:`html.HtmlListBox`, :class:`html.SimpleHtmlListBox`, :class:`adv.EditableListBox`.
|
|
516
|
+
|
|
517
|
+
This class handles the following wxPython widgets:
|
|
518
|
+
|
|
519
|
+
- :class:`ListBox`;
|
|
520
|
+
- :class:`ListCtrl` (only for selected items. For column sizes see :class:`ListCtrlHandler`);
|
|
521
|
+
- :class:`ListView` (only for selected items. For column sizes see :class:`ListCtrlHandler`);
|
|
522
|
+
- :class:`VListBox`;
|
|
523
|
+
- :class:`html.HtmlListBox`;
|
|
524
|
+
- :class:`html.SimpleHtmlListBox`;
|
|
525
|
+
- :class:`adv.EditableListBox`.
|
|
526
|
+
|
|
527
|
+
"""
|
|
528
|
+
|
|
529
|
+
def __init__(self, pObject):
|
|
530
|
+
|
|
531
|
+
AbstractHandler.__init__(self, pObject)
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
def GetSelections(self, listBox):
|
|
535
|
+
"""
|
|
536
|
+
Returns a list of selected items for :class:`ListBox`, :class:`ListCtrl`, :class:`ListView`,
|
|
537
|
+
:class:`VListBox`, :class:`html.HtmlListBox`, :class:`html.SimpleHtmlListBox`, :class:`adv.EditableListBox`.
|
|
538
|
+
|
|
539
|
+
:param `listBox`: an instance of :class:`ListBox`, :class:`ListCtrl`, :class:`ListView`,
|
|
540
|
+
:class:`VListBox`, :class:`html.HtmlListBox`, :class:`html.SimpleHtmlListBox`, :class:`adv.EditableListBox`..
|
|
541
|
+
"""
|
|
542
|
+
|
|
543
|
+
indices = []
|
|
544
|
+
|
|
545
|
+
if isinstance(listBox, (wx.html.HtmlListBox, wx.html.SimpleHtmlListBox)):
|
|
546
|
+
if listBox.GetSelectedCount() == 0:
|
|
547
|
+
return indices
|
|
548
|
+
else:
|
|
549
|
+
if listBox.GetSelectedItemCount() == 0:
|
|
550
|
+
return indices
|
|
551
|
+
|
|
552
|
+
isVirtual = issubclass(listBox.__class__, wx.VListBox)
|
|
553
|
+
|
|
554
|
+
if isVirtual:
|
|
555
|
+
# This includes wx.SimpleHtmlListBox and wx.HtmlListBox
|
|
556
|
+
if listBox.GetWindowStyleFlag() & wx.LB_SINGLE:
|
|
557
|
+
selection = listBox.GetSelection()
|
|
558
|
+
return (selection >= 0 and [selection] or [indices])[0]
|
|
559
|
+
else:
|
|
560
|
+
# wx.ListCtrl
|
|
561
|
+
if listBox.GetWindowStyleFlag() & wx.LC_SINGLE_SEL:
|
|
562
|
+
selection = listBox.GetSelection()
|
|
563
|
+
return (selection >= 0 and [selection] or [indices])[0]
|
|
564
|
+
|
|
565
|
+
if isVirtual:
|
|
566
|
+
item, cookie = listBox.GetFirstSelected()
|
|
567
|
+
while item != wx.NOT_FOUND:
|
|
568
|
+
indices.append(item)
|
|
569
|
+
item, cookie = listBox.GetNextSelected(cookie)
|
|
570
|
+
|
|
571
|
+
return indices
|
|
572
|
+
|
|
573
|
+
lastFound = -1
|
|
574
|
+
# Loop until told to stop
|
|
575
|
+
while 1:
|
|
576
|
+
index = listBox.GetNextItem(lastFound, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
|
|
577
|
+
if index == wx.NOT_FOUND:
|
|
578
|
+
# No item selected
|
|
579
|
+
break
|
|
580
|
+
else:
|
|
581
|
+
# Found one item, append to the list of condemned
|
|
582
|
+
lastFound = index
|
|
583
|
+
indices.append(index)
|
|
584
|
+
|
|
585
|
+
return indices
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
def Save(self):
|
|
589
|
+
|
|
590
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_TREE_LIST_SELECTIONS == 0:
|
|
591
|
+
# We don't want to save selected items
|
|
592
|
+
return True
|
|
593
|
+
|
|
594
|
+
listBox, obj = self._window, self._pObject
|
|
595
|
+
|
|
596
|
+
if issubclass(listBox.__class__, wx.ListBox):
|
|
597
|
+
selections = listBox.GetSelections()
|
|
598
|
+
else:
|
|
599
|
+
selections = self.GetSelections(listBox)
|
|
600
|
+
|
|
601
|
+
obj.SaveValue(PERSIST_LISTBOX_SELECTIONS, selections)
|
|
602
|
+
return True
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
def Restore(self):
|
|
606
|
+
|
|
607
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_TREE_LIST_SELECTIONS == 0:
|
|
608
|
+
# We don't want to save selected items
|
|
609
|
+
return True
|
|
610
|
+
|
|
611
|
+
listBox, obj = self._window, self._pObject
|
|
612
|
+
|
|
613
|
+
isVirtual = issubclass(listBox.__class__, wx.VListBox) or isinstance(listBox, wx.CheckListBox)
|
|
614
|
+
|
|
615
|
+
isHtml = isinstance(listBox, wx.html.HtmlListBox)
|
|
616
|
+
if isVirtual and not isHtml:
|
|
617
|
+
count = listBox.GetCount()
|
|
618
|
+
else:
|
|
619
|
+
count = listBox.GetItemCount()
|
|
620
|
+
|
|
621
|
+
selections = obj.RestoreValue(PERSIST_LISTBOX_SELECTIONS)
|
|
622
|
+
|
|
623
|
+
if selections is not None:
|
|
624
|
+
for index in selections:
|
|
625
|
+
if index < count:
|
|
626
|
+
listBox.Select(index)
|
|
627
|
+
|
|
628
|
+
return True
|
|
629
|
+
|
|
630
|
+
return False
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
def GetKind(self):
|
|
634
|
+
|
|
635
|
+
return PERSIST_LISTBOX_KIND
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
# ----------------------------------------------------------------------------------- #
|
|
639
|
+
|
|
640
|
+
class ListCtrlHandler(ListBoxHandler):
|
|
641
|
+
"""
|
|
642
|
+
Supports saving/restoring selected items and column sizes in :class:`ListCtrl`.
|
|
643
|
+
|
|
644
|
+
This class handles the following wxPython widgets:
|
|
645
|
+
|
|
646
|
+
- :class:`ListCtrl` (only for column sizes. For selected items see :class:`ListBoxHandler`);
|
|
647
|
+
- :class:`ListView` (only for column sizes. For selected items see :class:`ListBoxHandler`).
|
|
648
|
+
"""
|
|
649
|
+
|
|
650
|
+
def __init__(self, pObject):
|
|
651
|
+
|
|
652
|
+
ListBoxHandler.__init__(self, pObject)
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
def Save(self):
|
|
656
|
+
|
|
657
|
+
listCtrl, obj = self._window, self._pObject
|
|
658
|
+
|
|
659
|
+
retVal = ListBoxHandler.Save(self)
|
|
660
|
+
|
|
661
|
+
if not listCtrl.InReportView():
|
|
662
|
+
return retVal
|
|
663
|
+
|
|
664
|
+
colSizes = []
|
|
665
|
+
for col in range(listCtrl.GetColumnCount()):
|
|
666
|
+
colSizes.append(listCtrl.GetColumnWidth(col))
|
|
667
|
+
|
|
668
|
+
obj.SaveValue(PERSIST_LISTCTRL_COLWIDTHS, colSizes)
|
|
669
|
+
|
|
670
|
+
return retVal
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
def Restore(self):
|
|
674
|
+
|
|
675
|
+
listCtrl, obj = self._window, self._pObject
|
|
676
|
+
|
|
677
|
+
retVal = ListBoxHandler.Restore(self)
|
|
678
|
+
|
|
679
|
+
if not listCtrl.InReportView():
|
|
680
|
+
return retVal
|
|
681
|
+
|
|
682
|
+
colSizes = obj.RestoreValue(PERSIST_LISTCTRL_COLWIDTHS)
|
|
683
|
+
if colSizes is None:
|
|
684
|
+
return False
|
|
685
|
+
|
|
686
|
+
count = listCtrl.GetColumnCount()
|
|
687
|
+
for col, size in enumerate(colSizes):
|
|
688
|
+
if col < count:
|
|
689
|
+
listCtrl.SetColumnWidth(col, size)
|
|
690
|
+
|
|
691
|
+
return retVal
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
def GetKind(self):
|
|
695
|
+
|
|
696
|
+
return PERSIST_LISTCTRL_KIND
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
# ----------------------------------------------------------------------------------- #
|
|
700
|
+
|
|
701
|
+
class CheckListBoxHandler(ListBoxHandler):
|
|
702
|
+
"""
|
|
703
|
+
Supports saving/restoring checked and selected items in :class:`CheckListBox`.
|
|
704
|
+
|
|
705
|
+
This class handles the following wxPython widgets:
|
|
706
|
+
|
|
707
|
+
- :class:`CheckListBox` (only for checked items. For selected items see :class:`ListBoxHandler`).
|
|
708
|
+
|
|
709
|
+
"""
|
|
710
|
+
|
|
711
|
+
def __init__(self, pObject):
|
|
712
|
+
|
|
713
|
+
ListBoxHandler.__init__(self, pObject)
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
def Save(self):
|
|
717
|
+
|
|
718
|
+
checkList, obj = self._window, self._pObject
|
|
719
|
+
|
|
720
|
+
checked = []
|
|
721
|
+
for index in range(checkList.GetCount()):
|
|
722
|
+
if checkList.IsChecked(index):
|
|
723
|
+
checked.append(index)
|
|
724
|
+
|
|
725
|
+
obj.SaveValue(PERSIST_CHECKLIST_CHECKED, checked)
|
|
726
|
+
|
|
727
|
+
return ListBoxHandler.Save(self)
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
def Restore(self):
|
|
731
|
+
|
|
732
|
+
checkList, obj = self._window, self._pObject
|
|
733
|
+
|
|
734
|
+
checked = obj.RestoreValue(PERSIST_CHECKLIST_CHECKED)
|
|
735
|
+
count = checkList.GetCount()
|
|
736
|
+
if checked is not None:
|
|
737
|
+
for index in checked:
|
|
738
|
+
if index < count:
|
|
739
|
+
checkList.Check(index)
|
|
740
|
+
|
|
741
|
+
return ListBoxHandler.Restore(self)
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
def GetKind(self):
|
|
745
|
+
|
|
746
|
+
return PERSIST_CHECKLISTBOX_KIND
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
# ----------------------------------------------------------------------------------- #
|
|
750
|
+
|
|
751
|
+
class ChoiceComboHandler(AbstractHandler):
|
|
752
|
+
"""
|
|
753
|
+
Supports saving/restoring :class:`Choice`, :class:`ComboBox` and :class:`adv.OwnerDrawnComboBox`
|
|
754
|
+
selection.
|
|
755
|
+
|
|
756
|
+
This class handles the following wxPython widgets:
|
|
757
|
+
|
|
758
|
+
- :class:`Choice`;
|
|
759
|
+
- :class:`ComboBox`;
|
|
760
|
+
- :class:`adv.OwnerDrawnComboBox`.
|
|
761
|
+
|
|
762
|
+
"""
|
|
763
|
+
|
|
764
|
+
def __init__(self, pObject):
|
|
765
|
+
|
|
766
|
+
AbstractHandler.__init__(self, pObject)
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
def Save(self):
|
|
770
|
+
|
|
771
|
+
combo, obj = self._window, self._pObject
|
|
772
|
+
|
|
773
|
+
value = combo.GetStringSelection()
|
|
774
|
+
obj.SaveCtrlValue(PERSIST_CHOICECOMBO_SELECTION, value)
|
|
775
|
+
return True
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
def Restore(self):
|
|
779
|
+
|
|
780
|
+
combo, obj = self._window, self._pObject
|
|
781
|
+
|
|
782
|
+
value = obj.RestoreCtrlValue(PERSIST_CHOICECOMBO_SELECTION)
|
|
783
|
+
if value is not None:
|
|
784
|
+
if value in combo.GetStrings():
|
|
785
|
+
combo.SetStringSelection(value)
|
|
786
|
+
|
|
787
|
+
return True
|
|
788
|
+
|
|
789
|
+
return False
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
def GetKind(self):
|
|
793
|
+
|
|
794
|
+
return PERSIST_CHOICECOMBO_KIND
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
# ----------------------------------------------------------------------------------- #
|
|
798
|
+
|
|
799
|
+
class FoldPanelBarHandler(AbstractHandler):
|
|
800
|
+
"""
|
|
801
|
+
Supports saving/restoring of :class:`lib.agw.foldpanelbar.FoldPanelBar`.
|
|
802
|
+
|
|
803
|
+
This class handles the following wxPython widgets
|
|
804
|
+
|
|
805
|
+
- :class:`lib.agw.foldpanelbar.FoldPanelBar`
|
|
806
|
+
"""
|
|
807
|
+
|
|
808
|
+
def __init__(self, pObject):
|
|
809
|
+
|
|
810
|
+
AbstractHandler.__init__(self, pObject)
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
def Save(self):
|
|
814
|
+
|
|
815
|
+
fpb, obj = self._window, self._pObject
|
|
816
|
+
expanded = [fpb.GetFoldPanel(i).IsExpanded() for i in range(fpb.GetCount())]
|
|
817
|
+
obj.SaveValue(PERSIST_FOLDPANELBAR_EXPANDED, expanded)
|
|
818
|
+
|
|
819
|
+
return True
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
def Restore(self):
|
|
823
|
+
|
|
824
|
+
fpb, obj = self._window, self._pObject
|
|
825
|
+
expanded = obj.RestoreValue(PERSIST_FOLDPANELBAR_EXPANDED)
|
|
826
|
+
|
|
827
|
+
if expanded is None:
|
|
828
|
+
return False
|
|
829
|
+
else:
|
|
830
|
+
for idx, expand in enumerate(expanded):
|
|
831
|
+
panel = fpb.GetFoldPanel(idx)
|
|
832
|
+
if expand:
|
|
833
|
+
fpb.Expand(panel)
|
|
834
|
+
else:
|
|
835
|
+
fpb.Collapse(panel)
|
|
836
|
+
|
|
837
|
+
return True
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
def GetKind(self):
|
|
841
|
+
|
|
842
|
+
return PERSIST_FOLDPANELBAR_KIND
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
# ----------------------------------------------------------------------------------- #
|
|
846
|
+
|
|
847
|
+
class RadioBoxHandler(AbstractHandler):
|
|
848
|
+
"""
|
|
849
|
+
Supports saving/restoring a :class:`RadioBox` state.
|
|
850
|
+
|
|
851
|
+
This class handles the following wxPython widgets:
|
|
852
|
+
|
|
853
|
+
- :class:`RadioBox`.
|
|
854
|
+
|
|
855
|
+
"""
|
|
856
|
+
|
|
857
|
+
def __init__(self, pObject):
|
|
858
|
+
|
|
859
|
+
AbstractHandler.__init__(self, pObject)
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
def Save(self):
|
|
863
|
+
|
|
864
|
+
radio, obj = self._window, self._pObject
|
|
865
|
+
obj.SaveCtrlValue(PERSIST_RADIOBOX_SELECTION, radio.GetSelection())
|
|
866
|
+
return True
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
def Restore(self):
|
|
870
|
+
|
|
871
|
+
radio, obj = self._window, self._pObject
|
|
872
|
+
value = obj.RestoreCtrlValue(PERSIST_RADIOBOX_SELECTION)
|
|
873
|
+
if value is not None:
|
|
874
|
+
if value < radio.GetCount():
|
|
875
|
+
radio.SetSelection(value)
|
|
876
|
+
return True
|
|
877
|
+
|
|
878
|
+
return False
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
def GetKind(self):
|
|
882
|
+
|
|
883
|
+
return PERSIST_RADIOBOX_KIND
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
# ----------------------------------------------------------------------------------- #
|
|
887
|
+
|
|
888
|
+
class RadioButtonHandler(AbstractHandler):
|
|
889
|
+
"""
|
|
890
|
+
Supports saving/restoring a :class:`RadioButton` state.
|
|
891
|
+
|
|
892
|
+
This class handles the following wxPython widgets:
|
|
893
|
+
|
|
894
|
+
- :class:`RadioButton`.
|
|
895
|
+
|
|
896
|
+
"""
|
|
897
|
+
|
|
898
|
+
def __init__(self, pObject):
|
|
899
|
+
|
|
900
|
+
AbstractHandler.__init__(self, pObject)
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
def Save(self):
|
|
904
|
+
|
|
905
|
+
radio, obj = self._window, self._pObject
|
|
906
|
+
obj.SaveCtrlValue(PERSIST_RADIOBUTTON_VALUE, radio.GetValue())
|
|
907
|
+
return True
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
def Restore(self):
|
|
911
|
+
|
|
912
|
+
radio, obj = self._window, self._pObject
|
|
913
|
+
value = obj.RestoreCtrlValue(PERSIST_RADIOBUTTON_VALUE)
|
|
914
|
+
if value is not None:
|
|
915
|
+
radio.SetValue(value)
|
|
916
|
+
return True
|
|
917
|
+
|
|
918
|
+
return False
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
def GetKind(self):
|
|
922
|
+
|
|
923
|
+
return PERSIST_RADIOBUTTON_KIND
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
# ----------------------------------------------------------------------------------- #
|
|
927
|
+
|
|
928
|
+
class ScrolledWindowHandler(AbstractHandler):
|
|
929
|
+
"""
|
|
930
|
+
Supports saving/restoring a :class:`ScrolledWindow` / :class:`lib.scrolledpanel.ScrolledPanel`
|
|
931
|
+
scroll position.
|
|
932
|
+
|
|
933
|
+
This class handles the following wxPython widgets:
|
|
934
|
+
|
|
935
|
+
- :class:`ScrolledWindow`;
|
|
936
|
+
- :class:`lib.scrolledpanel.ScrolledPanel`.
|
|
937
|
+
|
|
938
|
+
"""
|
|
939
|
+
|
|
940
|
+
def __init__(self, pObject):
|
|
941
|
+
|
|
942
|
+
AbstractHandler.__init__(self, pObject)
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
def Save(self):
|
|
946
|
+
|
|
947
|
+
scroll, obj = self._window, self._pObject
|
|
948
|
+
|
|
949
|
+
scrollPos = scroll.GetScrollPos(wx.HORIZONTAL)
|
|
950
|
+
obj.SaveValue(PERSIST_SCROLLEDWINDOW_POS_H, scrollPos)
|
|
951
|
+
scrollPos = scroll.GetScrollPos(wx.VERTICAL)
|
|
952
|
+
obj.SaveValue(PERSIST_SCROLLEDWINDOW_POS_V, scrollPos)
|
|
953
|
+
return True
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
def Restore(self):
|
|
957
|
+
|
|
958
|
+
scroll, obj = self._window, self._pObject
|
|
959
|
+
hpos = obj.RestoreValue(PERSIST_SCROLLEDWINDOW_POS_H)
|
|
960
|
+
vpos = obj.RestoreValue(PERSIST_SCROLLEDWINDOW_POS_V)
|
|
961
|
+
|
|
962
|
+
if hpos:
|
|
963
|
+
scroll.SetScrollPos(wx.HORIZONTAL, hpos)
|
|
964
|
+
if vpos:
|
|
965
|
+
scroll.SetScrollPos(wx.VERTICAL, vpos, True)
|
|
966
|
+
|
|
967
|
+
return True
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
def GetKind(self):
|
|
971
|
+
|
|
972
|
+
return PERSIST_SCROLLEDWINDOW_KIND
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
# ----------------------------------------------------------------------------------- #
|
|
976
|
+
|
|
977
|
+
class SliderHandler(AbstractHandler):
|
|
978
|
+
"""
|
|
979
|
+
Supports saving/restoring a :class:`Slider` / :class:`lib.agw.knobctrl.KnobCtrl` thumb position.
|
|
980
|
+
|
|
981
|
+
This class handles the following wxPython widgets:
|
|
982
|
+
|
|
983
|
+
- :class:`Slider`;
|
|
984
|
+
- :class:`lib.agw.knobctrl.KnobCtrl`.
|
|
985
|
+
|
|
986
|
+
"""
|
|
987
|
+
|
|
988
|
+
def __init__(self, pObject):
|
|
989
|
+
|
|
990
|
+
AbstractHandler.__init__(self, pObject)
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
def Save(self):
|
|
994
|
+
|
|
995
|
+
slider, obj = self._window, self._pObject
|
|
996
|
+
obj.SaveCtrlValue(PERSIST_SLIDER_VALUE, slider.GetValue())
|
|
997
|
+
return True
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
def Restore(self):
|
|
1001
|
+
|
|
1002
|
+
slider, obj = self._window, self._pObject
|
|
1003
|
+
value = obj.RestoreCtrlValue(PERSIST_SLIDER_VALUE)
|
|
1004
|
+
|
|
1005
|
+
if issubclass(slider.__class__, wx.Slider):
|
|
1006
|
+
minVal, maxVal = slider.GetMin(), slider.GetMax()
|
|
1007
|
+
else:
|
|
1008
|
+
# KnobCtrl
|
|
1009
|
+
minVal, maxVal = slider.GetMinValue(), slider.GetMaxValue()
|
|
1010
|
+
|
|
1011
|
+
if value is not None:
|
|
1012
|
+
if value >= minVal and value <= maxVal:
|
|
1013
|
+
slider.SetValue(value)
|
|
1014
|
+
return True
|
|
1015
|
+
|
|
1016
|
+
return False
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
def GetKind(self):
|
|
1020
|
+
|
|
1021
|
+
return PERSIST_SLIDER_KIND
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
# ----------------------------------------------------------------------------------- #
|
|
1025
|
+
|
|
1026
|
+
class SpinHandler(AbstractHandler):
|
|
1027
|
+
"""
|
|
1028
|
+
Supports saving/restoring a :class:`SpinButton` / :class:`SpinCtrl` value.
|
|
1029
|
+
|
|
1030
|
+
This class handles the following wxPython widgets:
|
|
1031
|
+
|
|
1032
|
+
- :class:`SpinCtrl`;
|
|
1033
|
+
- :class:`SpinButton`.
|
|
1034
|
+
"""
|
|
1035
|
+
|
|
1036
|
+
def __init__(self, pObject):
|
|
1037
|
+
|
|
1038
|
+
AbstractHandler.__init__(self, pObject)
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
def Save(self):
|
|
1042
|
+
|
|
1043
|
+
spin, obj = self._window, self._pObject
|
|
1044
|
+
obj.SaveCtrlValue(PERSIST_SPIN_VALUE, spin.GetValue())
|
|
1045
|
+
return True
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
def Restore(self):
|
|
1049
|
+
|
|
1050
|
+
spin, obj = self._window, self._pObject
|
|
1051
|
+
value = obj.RestoreCtrlValue(PERSIST_SPIN_VALUE)
|
|
1052
|
+
|
|
1053
|
+
if value is not None:
|
|
1054
|
+
minVal, maxVal = spin.GetMin(), spin.GetMax()
|
|
1055
|
+
if value >= minVal and value <= maxVal:
|
|
1056
|
+
spin.SetValue(value)
|
|
1057
|
+
return True
|
|
1058
|
+
|
|
1059
|
+
return False
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
def GetKind(self):
|
|
1063
|
+
|
|
1064
|
+
return PERSIST_SPIN_KIND
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
# ----------------------------------------------------------------------------------- #
|
|
1068
|
+
|
|
1069
|
+
class SplitterHandler(AbstractHandler):
|
|
1070
|
+
"""
|
|
1071
|
+
Supports saving/restoring a :class:`SplitterWindow` splitter position.
|
|
1072
|
+
|
|
1073
|
+
This class handles the following wxPython widgets:
|
|
1074
|
+
|
|
1075
|
+
- :class:`SplitterWindow`.
|
|
1076
|
+
|
|
1077
|
+
"""
|
|
1078
|
+
|
|
1079
|
+
def __init__(self, pObject):
|
|
1080
|
+
|
|
1081
|
+
AbstractHandler.__init__(self, pObject)
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
def Save(self):
|
|
1085
|
+
|
|
1086
|
+
splitter, obj = self._window, self._pObject
|
|
1087
|
+
obj.SaveValue(PERSIST_SPLITTER_POSITION, splitter.GetSashPosition())
|
|
1088
|
+
return True
|
|
1089
|
+
|
|
1090
|
+
|
|
1091
|
+
def Restore(self):
|
|
1092
|
+
|
|
1093
|
+
splitter, obj = self._window, self._pObject
|
|
1094
|
+
value = obj.RestoreValue(PERSIST_SPLITTER_POSITION)
|
|
1095
|
+
|
|
1096
|
+
if value is None:
|
|
1097
|
+
return False
|
|
1098
|
+
|
|
1099
|
+
if not splitter.IsSplit():
|
|
1100
|
+
return False
|
|
1101
|
+
|
|
1102
|
+
width, height = splitter.GetClientSize()
|
|
1103
|
+
minPaneSize = splitter.GetMinimumPaneSize()
|
|
1104
|
+
direction = splitter.GetSplitMode()
|
|
1105
|
+
|
|
1106
|
+
if direction == wx.SPLIT_HORIZONTAL:
|
|
1107
|
+
# Top and bottom panes
|
|
1108
|
+
if value > height - minPaneSize:
|
|
1109
|
+
return False
|
|
1110
|
+
else:
|
|
1111
|
+
# Left and right panes
|
|
1112
|
+
if value > width - minPaneSize:
|
|
1113
|
+
return False
|
|
1114
|
+
|
|
1115
|
+
splitter.SetSashPosition(value)
|
|
1116
|
+
return True
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
def GetKind(self):
|
|
1120
|
+
|
|
1121
|
+
return PERSIST_SPLITTER_KIND
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
# ----------------------------------------------------------------------------------- #
|
|
1125
|
+
|
|
1126
|
+
class TextCtrlHandler(AbstractHandler):
|
|
1127
|
+
"""
|
|
1128
|
+
Supports saving/restoring a :class:`TextCtrl` entered string.
|
|
1129
|
+
|
|
1130
|
+
This class handles the following wxPython widgets:
|
|
1131
|
+
|
|
1132
|
+
- :class:`TextCtrl`;
|
|
1133
|
+
- :class:`SearchCtrl`;
|
|
1134
|
+
- :class:`lib.expando.ExpandoTextCtrl`;
|
|
1135
|
+
- :class:`lib.masked.textctrl.TextCtrl`;
|
|
1136
|
+
- :class:`lib.masked.combobox.ComboBox`;
|
|
1137
|
+
- :class:`lib.masked.ipaddrctrl.IpAddrCtrl`;
|
|
1138
|
+
- :class:`lib.masked.timectrl.TimeCtrl`;
|
|
1139
|
+
- :class:`lib.masked.numctrl.NumCtrl`;
|
|
1140
|
+
|
|
1141
|
+
"""
|
|
1142
|
+
|
|
1143
|
+
def __init__(self, pObject):
|
|
1144
|
+
|
|
1145
|
+
AbstractHandler.__init__(self, pObject)
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
def Save(self):
|
|
1149
|
+
|
|
1150
|
+
text, obj = self._window, self._pObject
|
|
1151
|
+
obj.SaveCtrlValue(PERSIST_TEXTCTRL_VALUE, text.GetValue())
|
|
1152
|
+
return True
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
def Restore(self):
|
|
1156
|
+
|
|
1157
|
+
text, obj = self._window, self._pObject
|
|
1158
|
+
value = obj.RestoreCtrlValue(PERSIST_TEXTCTRL_VALUE)
|
|
1159
|
+
|
|
1160
|
+
if value is not None:
|
|
1161
|
+
text.ChangeValue(value)
|
|
1162
|
+
return True
|
|
1163
|
+
|
|
1164
|
+
return False
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
def GetKind(self):
|
|
1168
|
+
|
|
1169
|
+
return PERSIST_TEXTCTRL_KIND
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
# ----------------------------------------------------------------------------------- #
|
|
1173
|
+
|
|
1174
|
+
class ToggleButtonHandler(AbstractHandler):
|
|
1175
|
+
"""
|
|
1176
|
+
Supports saving/restoring a :class:`ToggleButton` and friends state.
|
|
1177
|
+
|
|
1178
|
+
This class handles the following wxPython widgets:
|
|
1179
|
+
|
|
1180
|
+
- :class:`ToggleButton`;
|
|
1181
|
+
- :class:`lib.buttons.GenToggleButton`;
|
|
1182
|
+
- :class:`lib.buttons.GenBitmapToggleButton`;
|
|
1183
|
+
- :class:`lib.buttons.GenBitmapTextToggleButton`;
|
|
1184
|
+
- :class:`lib.agw.shapedbutton.SToggleButton`;
|
|
1185
|
+
- :class:`lib.agw.shapedbutton.SBitmapToggleButton`;
|
|
1186
|
+
- :class:`lib.agw.shapedbutton.SBitmapTextToggleButton`.
|
|
1187
|
+
|
|
1188
|
+
"""
|
|
1189
|
+
|
|
1190
|
+
def __init__(self, pObject):
|
|
1191
|
+
|
|
1192
|
+
AbstractHandler.__init__(self, pObject)
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
def Save(self):
|
|
1196
|
+
|
|
1197
|
+
toggle, obj = self._window, self._pObject
|
|
1198
|
+
obj.SaveValue(PERSIST_TOGGLEBUTTON_TOGGLED, toggle.GetValue())
|
|
1199
|
+
return True
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
def Restore(self):
|
|
1203
|
+
|
|
1204
|
+
toggle, obj = self._window, self._pObject
|
|
1205
|
+
value = obj.RestoreValue(PERSIST_TOGGLEBUTTON_TOGGLED)
|
|
1206
|
+
|
|
1207
|
+
if value is not None:
|
|
1208
|
+
toggle.SetValue(value)
|
|
1209
|
+
return True
|
|
1210
|
+
|
|
1211
|
+
return False
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
def GetKind(self):
|
|
1215
|
+
|
|
1216
|
+
return PERSIST_TOGGLEBUTTON_KIND
|
|
1217
|
+
|
|
1218
|
+
# ----------------------------------------------------------------------------------- #
|
|
1219
|
+
|
|
1220
|
+
class TreeCtrlHandler(AbstractHandler):
|
|
1221
|
+
"""
|
|
1222
|
+
Supports saving/restoring a :class:`TreeCtrl` expansion state, selections and
|
|
1223
|
+
checked items state (meaningful only for :class:`lib.agw.customtreectrl.CustomTreeCtrl`).
|
|
1224
|
+
|
|
1225
|
+
This class handles the following wxPython widgets:
|
|
1226
|
+
|
|
1227
|
+
- :class:`TreeCtrl`;
|
|
1228
|
+
- :class:`GenericDirCtrl`;
|
|
1229
|
+
- :class:`lib.agw.customtreectrl.CustomTreeCtrl`;
|
|
1230
|
+
- :class:`lib.agw.hypertreelist.HyperTreeList`;
|
|
1231
|
+
|
|
1232
|
+
"""
|
|
1233
|
+
|
|
1234
|
+
def __init__(self, pObject):
|
|
1235
|
+
|
|
1236
|
+
AbstractHandler.__init__(self, pObject)
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
def GetItemChildren(self, item=None, recursively=False):
|
|
1240
|
+
"""
|
|
1241
|
+
Return the children of item as a list.
|
|
1242
|
+
|
|
1243
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item;
|
|
1244
|
+
:param `recursively`: whether to recurse into the item hierarchy or not.
|
|
1245
|
+
"""
|
|
1246
|
+
|
|
1247
|
+
if not item:
|
|
1248
|
+
item = self._window.GetRootItem()
|
|
1249
|
+
if not item:
|
|
1250
|
+
return []
|
|
1251
|
+
|
|
1252
|
+
children = []
|
|
1253
|
+
child, cookie = self._window.GetFirstChild(item)
|
|
1254
|
+
|
|
1255
|
+
while child and child.IsOk():
|
|
1256
|
+
children.append(child)
|
|
1257
|
+
if recursively:
|
|
1258
|
+
children.extend(self.GetItemChildren(child, True))
|
|
1259
|
+
child, cookie = self._window.GetNextChild(item, cookie)
|
|
1260
|
+
|
|
1261
|
+
return children
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
def GetIndexOfItem(self, item):
|
|
1265
|
+
"""
|
|
1266
|
+
Return the index of item.
|
|
1267
|
+
|
|
1268
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item;
|
|
1269
|
+
"""
|
|
1270
|
+
|
|
1271
|
+
parent = self._window.GetItemParent(item)
|
|
1272
|
+
if parent:
|
|
1273
|
+
parentIndices = self.GetIndexOfItem(parent)
|
|
1274
|
+
ownIndex = self.GetItemChildren(parent).index(item)
|
|
1275
|
+
return parentIndices + (ownIndex,)
|
|
1276
|
+
else:
|
|
1277
|
+
return ()
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
def GetItemIdentity(self, item):
|
|
1281
|
+
"""
|
|
1282
|
+
Return a hashable object that represents the identity of the
|
|
1283
|
+
item. By default this returns the position of the item in the
|
|
1284
|
+
tree. You may want to override this to return the item label
|
|
1285
|
+
(if you know that labels are unique and don't change), or return
|
|
1286
|
+
something that represents the underlying domain object, e.g.
|
|
1287
|
+
a database key.
|
|
1288
|
+
|
|
1289
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item;
|
|
1290
|
+
"""
|
|
1291
|
+
|
|
1292
|
+
return self.GetIndexOfItem(item)
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
def GetExpansionState(self):
|
|
1296
|
+
"""
|
|
1297
|
+
Returns list of expanded items. Expanded items are coded as determined by
|
|
1298
|
+
the result of :meth:`TreeCtrlHandler.GetItemIdentity() <TreeCtrlHandler.GetItemIdentity>`.
|
|
1299
|
+
"""
|
|
1300
|
+
|
|
1301
|
+
root = self._window.GetRootItem()
|
|
1302
|
+
if not root:
|
|
1303
|
+
return []
|
|
1304
|
+
if self._window.HasFlag(wx.TR_HIDE_ROOT):
|
|
1305
|
+
return self.GetExpansionStateOfChildren(root)
|
|
1306
|
+
else:
|
|
1307
|
+
return self.GetExpansionStateOfItem(root)
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
def SetExpansionState(self, listOfExpandedItems):
|
|
1311
|
+
"""
|
|
1312
|
+
Expands all tree items whose identity, as determined by :meth:`TreeCtrlHandler.GetItemIdentity() <TreeCtrlHandler.GetItemIdentity>`,
|
|
1313
|
+
is present in the list and collapses all other tree items.
|
|
1314
|
+
|
|
1315
|
+
:param `listOfExpandedItems`: a list of expanded :class:`TreeCtrl` or
|
|
1316
|
+
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items.
|
|
1317
|
+
"""
|
|
1318
|
+
|
|
1319
|
+
root = self._window.GetRootItem()
|
|
1320
|
+
if not root:
|
|
1321
|
+
return
|
|
1322
|
+
if self._window.HasFlag(wx.TR_HIDE_ROOT):
|
|
1323
|
+
self.SetExpansionStateOfChildren(listOfExpandedItems, root)
|
|
1324
|
+
else:
|
|
1325
|
+
self.SetExpansionStateOfItem(listOfExpandedItems, root)
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
def GetSelectionState(self):
|
|
1329
|
+
"""
|
|
1330
|
+
Returns a list of selected items. Selected items are coded as determined by
|
|
1331
|
+
the result of :meth:`TreeCtrlHandler.GetItemIdentity() <TreeCtrlHandler.GetItemIdentity>`.
|
|
1332
|
+
"""
|
|
1333
|
+
|
|
1334
|
+
root = self._window.GetRootItem()
|
|
1335
|
+
if not root:
|
|
1336
|
+
return []
|
|
1337
|
+
if self._window.HasFlag(wx.TR_HIDE_ROOT):
|
|
1338
|
+
return self.GeSelectionStateOfChildren(root)
|
|
1339
|
+
else:
|
|
1340
|
+
return self.GetSelectionStateOfItem(root)
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
def SetSelectionState(self, listOfSelectedItems):
|
|
1344
|
+
"""
|
|
1345
|
+
Selects all tree items whose identity, as determined by :meth:`TreeCtrlHandler.GetItemIdentity() <TreeCtrlHandler.GetItemIdentity>`,
|
|
1346
|
+
is present in the list and unselects all other tree items.
|
|
1347
|
+
|
|
1348
|
+
:param `listOfSelectedItems`: a list of selected :class:`TreeCtrl` or
|
|
1349
|
+
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items.
|
|
1350
|
+
"""
|
|
1351
|
+
|
|
1352
|
+
root = self._window.GetRootItem()
|
|
1353
|
+
if not root:
|
|
1354
|
+
return
|
|
1355
|
+
if self._window.HasFlag(wx.TR_HIDE_ROOT):
|
|
1356
|
+
self.SetSelectedStateOfChildren(listOfSelectedItems, root)
|
|
1357
|
+
else:
|
|
1358
|
+
self.SetSelectedStateOfItem(listOfSelectedItems, root)
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
def GetCheckedState(self):
|
|
1362
|
+
"""
|
|
1363
|
+
Returns a list of checked items. Checked items are coded as determined by
|
|
1364
|
+
the result of :meth:`TreeCtrlHandler.GetItemIdentity() <TreeCtrlHandler.GetItemIdentity>`.
|
|
1365
|
+
|
|
1366
|
+
:note:
|
|
1367
|
+
|
|
1368
|
+
This is meaningful only for :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` and
|
|
1369
|
+
:class:`~wx.lib.agw.hypertreelist.HyperTreeList`.
|
|
1370
|
+
"""
|
|
1371
|
+
|
|
1372
|
+
root = self._window.GetRootItem()
|
|
1373
|
+
if not root:
|
|
1374
|
+
return []
|
|
1375
|
+
if self._window.HasFlag(wx.TR_HIDE_ROOT):
|
|
1376
|
+
return self.GetCheckedStateOfChildren(root)
|
|
1377
|
+
else:
|
|
1378
|
+
return self.GetCheckedStateOfItem(root)
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
def SetCheckedState(self, listOfCheckedItems):
|
|
1382
|
+
"""
|
|
1383
|
+
Checks all tree items whose identity, as determined by :meth:`TreeCtrlHandler.GetItemIdentity() <TreeCtrlHandler.GetItemIdentity>`, is present
|
|
1384
|
+
in the list and unchecks all other tree items.
|
|
1385
|
+
|
|
1386
|
+
:param `listOfCheckedItems`: a list of checked :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items.
|
|
1387
|
+
|
|
1388
|
+
:note:
|
|
1389
|
+
|
|
1390
|
+
This is meaningful only for :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` and
|
|
1391
|
+
:class:`~wx.lib.agw.hypertreelist.HyperTreeList`.
|
|
1392
|
+
"""
|
|
1393
|
+
|
|
1394
|
+
root = self._window.GetRootItem()
|
|
1395
|
+
if not root:
|
|
1396
|
+
return
|
|
1397
|
+
if self._window.HasFlag(wx.TR_HIDE_ROOT):
|
|
1398
|
+
self.SetCheckedStateOfChildren(listOfCheckedItems, root)
|
|
1399
|
+
else:
|
|
1400
|
+
self.SetCheckedStateOfItem(listOfCheckedItems, root)
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
def GetExpansionStateOfItem(self, item):
|
|
1404
|
+
"""
|
|
1405
|
+
Returns the expansion state of a tree item.
|
|
1406
|
+
|
|
1407
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1408
|
+
"""
|
|
1409
|
+
|
|
1410
|
+
listOfExpandedItems = []
|
|
1411
|
+
if self._window.IsExpanded(item):
|
|
1412
|
+
listOfExpandedItems.append(self.GetItemIdentity(item))
|
|
1413
|
+
listOfExpandedItems.extend(self.GetExpansionStateOfChildren(item))
|
|
1414
|
+
|
|
1415
|
+
return listOfExpandedItems
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
def GetExpansionStateOfChildren(self, item):
|
|
1419
|
+
"""
|
|
1420
|
+
Returns the expansion state of the children of a tree item.
|
|
1421
|
+
|
|
1422
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1423
|
+
"""
|
|
1424
|
+
|
|
1425
|
+
listOfExpandedItems = []
|
|
1426
|
+
for child in self.GetItemChildren(item):
|
|
1427
|
+
listOfExpandedItems.extend(self.GetExpansionStateOfItem(child))
|
|
1428
|
+
|
|
1429
|
+
return listOfExpandedItems
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
def GetCheckedStateOfItem(self, item):
|
|
1433
|
+
"""
|
|
1434
|
+
Returns the checked/unchecked state of a tree item.
|
|
1435
|
+
|
|
1436
|
+
:param `item`: a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1437
|
+
"""
|
|
1438
|
+
|
|
1439
|
+
listOfCheckedItems = []
|
|
1440
|
+
if self._window.IsItemChecked(item):
|
|
1441
|
+
listOfCheckedItems.append(self.GetItemIdentity(item))
|
|
1442
|
+
|
|
1443
|
+
listOfCheckedItems.extend(self.GetCheckedStateOfChildren(item))
|
|
1444
|
+
|
|
1445
|
+
return listOfCheckedItems
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
def GetCheckedStateOfChildren(self, item):
|
|
1449
|
+
"""
|
|
1450
|
+
Returns the checked/unchecked state of the children of a tree item.
|
|
1451
|
+
|
|
1452
|
+
:param `item`: a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1453
|
+
"""
|
|
1454
|
+
|
|
1455
|
+
listOfCheckedItems = []
|
|
1456
|
+
for child in self.GetItemChildren(item):
|
|
1457
|
+
listOfCheckedItems.extend(self.GetCheckedStateOfItem(child))
|
|
1458
|
+
|
|
1459
|
+
return listOfCheckedItems
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
def GetSelectionStateOfItem(self, item):
|
|
1463
|
+
"""
|
|
1464
|
+
Returns the selection state of a tree item.
|
|
1465
|
+
|
|
1466
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1467
|
+
"""
|
|
1468
|
+
|
|
1469
|
+
listOfSelectedItems = []
|
|
1470
|
+
if self._window.IsSelected(item):
|
|
1471
|
+
listOfSelectedItems.append(self.GetItemIdentity(item))
|
|
1472
|
+
|
|
1473
|
+
listOfSelectedItems.extend(self.GetSelectionStateOfChildren(item))
|
|
1474
|
+
return listOfSelectedItems
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
def GetSelectionStateOfChildren(self, item):
|
|
1478
|
+
"""
|
|
1479
|
+
Returns the selection state of the children of a tree item.
|
|
1480
|
+
|
|
1481
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1482
|
+
"""
|
|
1483
|
+
|
|
1484
|
+
listOfSelectedItems = []
|
|
1485
|
+
for child in self.GetItemChildren(item):
|
|
1486
|
+
listOfSelectedItems.extend(self.GetSelectionStateOfItem(child))
|
|
1487
|
+
|
|
1488
|
+
return listOfSelectedItems
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
def SetExpansionStateOfItem(self, listOfExpandedItems, item):
|
|
1492
|
+
"""
|
|
1493
|
+
Sets the expansion state of a tree item (expanded or collapsed).
|
|
1494
|
+
|
|
1495
|
+
:param `listOfExpandedItems`: a list of expanded :class:`TreeCtrl` or
|
|
1496
|
+
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items;
|
|
1497
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1498
|
+
"""
|
|
1499
|
+
|
|
1500
|
+
if self.GetItemIdentity(item) in listOfExpandedItems:
|
|
1501
|
+
self._window.Expand(item)
|
|
1502
|
+
self.SetExpansionStateOfChildren(listOfExpandedItems, item)
|
|
1503
|
+
else:
|
|
1504
|
+
self._window.Collapse(item)
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
def SetExpansionStateOfChildren(self, listOfExpandedItems, item):
|
|
1508
|
+
"""
|
|
1509
|
+
Sets the expansion state of the children of a tree item (expanded or collapsed).
|
|
1510
|
+
|
|
1511
|
+
:param `listOfExpandedItems`: a list of expanded :class:`TreeCtrl` or
|
|
1512
|
+
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items;
|
|
1513
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1514
|
+
"""
|
|
1515
|
+
|
|
1516
|
+
for child in self.GetItemChildren(item):
|
|
1517
|
+
self.SetExpansionStateOfItem(listOfExpandedItems, child)
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
def SetCheckedStateOfItem(self, listOfCheckedItems, item):
|
|
1521
|
+
"""
|
|
1522
|
+
Sets the checked/unchecked state of a tree item.
|
|
1523
|
+
|
|
1524
|
+
:param `listOfCheckedItems`: a list of checked :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items;
|
|
1525
|
+
:param `item`: a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1526
|
+
"""
|
|
1527
|
+
|
|
1528
|
+
if self.GetItemIdentity(item) in listOfCheckedItems:
|
|
1529
|
+
self._window.CheckItem2(item, True)
|
|
1530
|
+
else:
|
|
1531
|
+
self._window.CheckItem2(item, False)
|
|
1532
|
+
|
|
1533
|
+
self.SetCheckedStateOfChildren(listOfCheckedItems, item)
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
def SetCheckedStateOfChildren(self, listOfCheckedItems, item):
|
|
1537
|
+
"""
|
|
1538
|
+
Sets the checked/unchecked state of the children of a tree item.
|
|
1539
|
+
|
|
1540
|
+
:param `listOfCheckedItems`: a list of checked :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items;
|
|
1541
|
+
:param `item`: a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1542
|
+
"""
|
|
1543
|
+
|
|
1544
|
+
for child in self.GetItemChildren(item):
|
|
1545
|
+
self.SetCheckedStateOfItem(listOfCheckedItems, child)
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
def SetSelectedStateOfItem(self, listOfSelectedItems, item):
|
|
1549
|
+
"""
|
|
1550
|
+
Sets the selection state of a tree item.
|
|
1551
|
+
|
|
1552
|
+
:param `listOfSelectedItems`: a list of selected :class:`TreeCtrl` or
|
|
1553
|
+
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items;
|
|
1554
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1555
|
+
"""
|
|
1556
|
+
|
|
1557
|
+
if self.GetItemIdentity(item) in listOfSelectedItems:
|
|
1558
|
+
self._window.SelectItem(item)
|
|
1559
|
+
|
|
1560
|
+
self.SetSelectedStateOfChildren(listOfSelectedItems, item)
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
def SetSelectedStateOfChildren(self, listOfSelectedItems, item):
|
|
1564
|
+
"""
|
|
1565
|
+
Sets the selection state of the children of a tree item.
|
|
1566
|
+
|
|
1567
|
+
:param `listOfSelectedItems`: a list of selected :class:`TreeCtrl` or
|
|
1568
|
+
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` items;
|
|
1569
|
+
:param `item`: a :class:`TreeCtrl` item or a :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` item.
|
|
1570
|
+
"""
|
|
1571
|
+
|
|
1572
|
+
for child in self.GetItemChildren(item):
|
|
1573
|
+
self.SetSelectedStateOfItem(listOfSelectedItems, child)
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
def Save(self):
|
|
1577
|
+
|
|
1578
|
+
tree, obj = self._window, self._pObject
|
|
1579
|
+
|
|
1580
|
+
obj.SaveCtrlValue(PERSIST_TREECTRL_EXPANSION, self.GetExpansionState())
|
|
1581
|
+
|
|
1582
|
+
if issubclass(tree.__class__, (HTL.HyperTreeList, CT.CustomTreeCtrl)):
|
|
1583
|
+
obj.SaveCtrlValue(PERSIST_TREECTRL_CHECKED_ITEMS, self.GetCheckedState())
|
|
1584
|
+
|
|
1585
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_TREE_LIST_SELECTIONS == 0:
|
|
1586
|
+
# We don't want to save selected items
|
|
1587
|
+
return True
|
|
1588
|
+
|
|
1589
|
+
obj.SaveCtrlValue(PERSIST_TREECTRL_SELECTIONS, self.GetSelectionState())
|
|
1590
|
+
return True
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
def Restore(self):
|
|
1594
|
+
|
|
1595
|
+
tree, obj = self._window, self._pObject
|
|
1596
|
+
expansion = obj.RestoreCtrlValue(PERSIST_TREECTRL_EXPANSION)
|
|
1597
|
+
selections = obj.RestoreCtrlValue(PERSIST_TREECTRL_SELECTIONS)
|
|
1598
|
+
|
|
1599
|
+
if expansion is not None:
|
|
1600
|
+
self.SetExpansionState(expansion)
|
|
1601
|
+
|
|
1602
|
+
if self._manager.GetManagerStyle() & PM_SAVE_RESTORE_TREE_LIST_SELECTIONS:
|
|
1603
|
+
# We want to restore selected items
|
|
1604
|
+
if selections is not None:
|
|
1605
|
+
self.SetSelectionState(selections)
|
|
1606
|
+
|
|
1607
|
+
if not issubclass(tree.__class__, (HTL.HyperTreeList, CT.CustomTreeCtrl)):
|
|
1608
|
+
return (expansion is not None and selections is not None)
|
|
1609
|
+
|
|
1610
|
+
checked = obj.RestoreCtrlValue(PERSIST_TREECTRL_CHECKED_ITEMS)
|
|
1611
|
+
if checked is not None:
|
|
1612
|
+
self.SetCheckedState(checked)
|
|
1613
|
+
|
|
1614
|
+
return (expansion is not None and selections is not None and checked is not None)
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
def GetKind(self):
|
|
1618
|
+
|
|
1619
|
+
return PERSIST_TREECTRL_KIND
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
# ----------------------------------------------------------------------------------- #
|
|
1623
|
+
|
|
1624
|
+
class TreeListCtrlHandler(TreeCtrlHandler):
|
|
1625
|
+
"""
|
|
1626
|
+
Supports saving/restoring a :class:`lib.agw.hypertreelist.HyperTreeList` expansion state,
|
|
1627
|
+
selections, column widths and checked items state (meaningful only for :class:`~wx.lib.agw.hypertreelist.HyperTreeList`).
|
|
1628
|
+
|
|
1629
|
+
This class handles the following wxPython widgets:
|
|
1630
|
+
|
|
1631
|
+
- :class:`lib.agw.hypertreelist.HyperTreeList`.
|
|
1632
|
+
|
|
1633
|
+
"""
|
|
1634
|
+
|
|
1635
|
+
def __init__(self, pObject):
|
|
1636
|
+
|
|
1637
|
+
TreeCtrlHandler.__init__(self, pObject)
|
|
1638
|
+
|
|
1639
|
+
|
|
1640
|
+
def Save(self):
|
|
1641
|
+
|
|
1642
|
+
treeList, obj = self._window, self._pObject
|
|
1643
|
+
|
|
1644
|
+
colSizes = []
|
|
1645
|
+
for col in range(treeList.GetColumnCount()):
|
|
1646
|
+
colSizes.append(treeList.GetColumnWidth(col))
|
|
1647
|
+
|
|
1648
|
+
obj.SaveValue(PERSIST_TREELISTCTRL_COLWIDTHS, colSizes)
|
|
1649
|
+
|
|
1650
|
+
return TreeCtrlHandler.Save(self)
|
|
1651
|
+
|
|
1652
|
+
|
|
1653
|
+
def Restore(self):
|
|
1654
|
+
|
|
1655
|
+
treeList, obj = self._window, self._pObject
|
|
1656
|
+
colSizes = obj.RestoreValue(PERSIST_TREELISTCTRL_COLWIDTHS)
|
|
1657
|
+
retVal = False
|
|
1658
|
+
|
|
1659
|
+
count = treeList.GetColumnCount()
|
|
1660
|
+
if colSizes is not None:
|
|
1661
|
+
retVal = True
|
|
1662
|
+
for col, size in enumerate(colSizes):
|
|
1663
|
+
if col < count:
|
|
1664
|
+
treeList.SetColumnWidth(col, size)
|
|
1665
|
+
|
|
1666
|
+
return (retVal and TreeCtrlHandler.Restore(self))
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
def GetKind(self):
|
|
1670
|
+
|
|
1671
|
+
return PERSIST_TREELISTCTRL_KIND
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
# ----------------------------------------------------------------------------------- #
|
|
1675
|
+
|
|
1676
|
+
class CalendarCtrlHandler(AbstractHandler):
|
|
1677
|
+
"""
|
|
1678
|
+
Supports saving/restoring a :class:`adv.CalendarCtrl` date.
|
|
1679
|
+
|
|
1680
|
+
This class handles the following wxPython widgets:
|
|
1681
|
+
|
|
1682
|
+
- :class:`adv.CalendarCtrl`.
|
|
1683
|
+
|
|
1684
|
+
"""
|
|
1685
|
+
|
|
1686
|
+
def __init__(self, pObject):
|
|
1687
|
+
|
|
1688
|
+
AbstractHandler.__init__(self, pObject)
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
def Save(self):
|
|
1692
|
+
|
|
1693
|
+
calend, obj = self._window, self._pObject
|
|
1694
|
+
obj.SaveCtrlValue(PERSIST_CALENDAR_DATE, wxDate2PyDate(calend.GetDate()))
|
|
1695
|
+
return True
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
def Restore(self):
|
|
1699
|
+
|
|
1700
|
+
calend, obj = self._window, self._pObject
|
|
1701
|
+
value = obj.RestoreCtrlValue(PERSIST_CALENDAR_DATE)
|
|
1702
|
+
|
|
1703
|
+
if value is not None:
|
|
1704
|
+
calend.SetDate(PyDate2wxDate(value))
|
|
1705
|
+
return True
|
|
1706
|
+
|
|
1707
|
+
return False
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
def GetKind(self):
|
|
1711
|
+
|
|
1712
|
+
return PERSIST_CALENDAR_KIND
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
# ----------------------------------------------------------------------------------- #
|
|
1716
|
+
|
|
1717
|
+
class CollapsiblePaneHandler(AbstractHandler):
|
|
1718
|
+
"""
|
|
1719
|
+
Supports saving/restoring a :class:`CollapsiblePane` / :class:`lib.agw.pycollapsiblepane.PyCollapsiblePane` state.
|
|
1720
|
+
|
|
1721
|
+
This class handles the following wxPython widgets:
|
|
1722
|
+
|
|
1723
|
+
- :class:`CollapsiblePane`;
|
|
1724
|
+
- :class:`lib.agw.pycollapsiblepane.PyCollapsiblePane`.
|
|
1725
|
+
"""
|
|
1726
|
+
|
|
1727
|
+
def __init__(self, pObject):
|
|
1728
|
+
|
|
1729
|
+
AbstractHandler.__init__(self, pObject)
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
def Save(self):
|
|
1733
|
+
|
|
1734
|
+
collPane, obj = self._window, self._pObject
|
|
1735
|
+
obj.SaveValue(PERSIST_COLLAPSIBLE_STATE, collPane.IsCollapsed())
|
|
1736
|
+
return True
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
def Restore(self):
|
|
1740
|
+
|
|
1741
|
+
collPane, obj = self._window, self._pObject
|
|
1742
|
+
value = obj.RestoreValue(PERSIST_COLLAPSIBLE_STATE)
|
|
1743
|
+
|
|
1744
|
+
if value is not None:
|
|
1745
|
+
collPane.Collapse(value)
|
|
1746
|
+
return True
|
|
1747
|
+
|
|
1748
|
+
return False
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
def GetKind(self):
|
|
1752
|
+
|
|
1753
|
+
return PERSIST_COLLAPSIBLE_KIND
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
# ----------------------------------------------------------------------------------- #
|
|
1757
|
+
|
|
1758
|
+
class DatePickerHandler(AbstractHandler):
|
|
1759
|
+
"""
|
|
1760
|
+
Supports saving/restoring a :class:`adv.DatePickerCtrl` date.
|
|
1761
|
+
|
|
1762
|
+
This class handles the following wxPython widgets:
|
|
1763
|
+
|
|
1764
|
+
- :class:`~adv.DatePickerCtrl`.
|
|
1765
|
+
|
|
1766
|
+
"""
|
|
1767
|
+
|
|
1768
|
+
def __init__(self, pObject):
|
|
1769
|
+
|
|
1770
|
+
AbstractHandler.__init__(self, pObject)
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
def Save(self):
|
|
1774
|
+
|
|
1775
|
+
datePicker, obj = self._window, self._pObject
|
|
1776
|
+
obj.SaveCtrlValue(PERSIST_DATEPICKER_DATE, wxDate2PyDate(datePicker.GetValue()))
|
|
1777
|
+
return True
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
def Restore(self):
|
|
1781
|
+
|
|
1782
|
+
datePicker, obj = self._window, self._pObject
|
|
1783
|
+
value = obj.RestoreCtrlValue(PERSIST_DATEPICKER_DATE)
|
|
1784
|
+
|
|
1785
|
+
if value is not None:
|
|
1786
|
+
datePicker.SetValue(PyDate2wxDate(value))
|
|
1787
|
+
return True
|
|
1788
|
+
|
|
1789
|
+
return False
|
|
1790
|
+
|
|
1791
|
+
|
|
1792
|
+
def GetKind(self):
|
|
1793
|
+
|
|
1794
|
+
return PERSIST_DATEPICKER_KIND
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
# ----------------------------------------------------------------------------------- #
|
|
1798
|
+
|
|
1799
|
+
class MediaCtrlHandler(AbstractHandler):
|
|
1800
|
+
"""
|
|
1801
|
+
Supports saving/restoring a :class:`media.MediaCtrl` movie position, volume and playback
|
|
1802
|
+
rate.
|
|
1803
|
+
|
|
1804
|
+
This class handles the following wxPython widgets:
|
|
1805
|
+
|
|
1806
|
+
- :class:`media.MediaCtrl`.
|
|
1807
|
+
|
|
1808
|
+
"""
|
|
1809
|
+
|
|
1810
|
+
def __init__(self, pObject):
|
|
1811
|
+
|
|
1812
|
+
AbstractHandler.__init__(self, pObject)
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
def Save(self):
|
|
1816
|
+
|
|
1817
|
+
mediaCtrl, obj = self._window, self._pObject
|
|
1818
|
+
obj.SaveValue(PERSIST_MEDIA_POS, mediaCtrl.Tell())
|
|
1819
|
+
obj.SaveValue(PERSIST_MEDIA_VOLUME, mediaCtrl.GetVolume())
|
|
1820
|
+
obj.SaveValue(PERSIST_MEDIA_RATE, mediaCtrl.GetPlaybackRate())
|
|
1821
|
+
return True
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
def Restore(self):
|
|
1825
|
+
|
|
1826
|
+
mediaCtrl, obj = self._window, self._pObject
|
|
1827
|
+
position = obj.RestoreValue(PERSIST_MEDIA_POS)
|
|
1828
|
+
volume = obj.RestoreValue(PERSIST_MEDIA_VOLUME)
|
|
1829
|
+
rate = obj.RestoreValue(PERSIST_MEDIA_RATE)
|
|
1830
|
+
|
|
1831
|
+
if position is not None:
|
|
1832
|
+
mediaCtrl.Seek(position)
|
|
1833
|
+
|
|
1834
|
+
if volume is not None:
|
|
1835
|
+
mediaCtrl.SetVolume(volume)
|
|
1836
|
+
|
|
1837
|
+
if rate is not None:
|
|
1838
|
+
mediaCtrl.SetPlaybackRate(rate)
|
|
1839
|
+
|
|
1840
|
+
return (osition is not None and volume is not None and rate is not None)
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
def GetKind(self):
|
|
1844
|
+
|
|
1845
|
+
return PERSIST_MEDIA_KIND
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
# ----------------------------------------------------------------------------------- #
|
|
1849
|
+
|
|
1850
|
+
class ColourPickerHandler(AbstractHandler):
|
|
1851
|
+
"""
|
|
1852
|
+
Supports saving/restoring a :class:`wx.ColourPickerCtrl` / :class:`lib.colourselect.ColourSelect` colour.
|
|
1853
|
+
|
|
1854
|
+
This class handles the following wxPython widgets:
|
|
1855
|
+
|
|
1856
|
+
- :class:`wx.ColourPickerCtrl`;
|
|
1857
|
+
- :class:`lib.colourselect.ColourSelect`.
|
|
1858
|
+
|
|
1859
|
+
"""
|
|
1860
|
+
|
|
1861
|
+
def __init__(self, pObject):
|
|
1862
|
+
|
|
1863
|
+
AbstractHandler.__init__(self, pObject)
|
|
1864
|
+
|
|
1865
|
+
|
|
1866
|
+
def Save(self):
|
|
1867
|
+
|
|
1868
|
+
colPicker, obj = self._window, self._pObject
|
|
1869
|
+
obj.SaveValue(PERSIST_COLOURPICKER_COLOUR, colPicker.GetColour().Get(includeAlpha=True))
|
|
1870
|
+
return True
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
def Restore(self):
|
|
1874
|
+
|
|
1875
|
+
colPicker, obj = self._window, self._pObject
|
|
1876
|
+
value = obj.RestoreValue(PERSIST_COLOURPICKER_COLOUR)
|
|
1877
|
+
|
|
1878
|
+
if value is not None:
|
|
1879
|
+
colPicker.SetColour(wx.Colour(*value))
|
|
1880
|
+
return True
|
|
1881
|
+
|
|
1882
|
+
return False
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
def GetKind(self):
|
|
1886
|
+
|
|
1887
|
+
return PERSIST_COLOURPICKER_KIND
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
# ----------------------------------------------------------------------------------- #
|
|
1891
|
+
|
|
1892
|
+
class FileDirPickerHandler(AbstractHandler):
|
|
1893
|
+
"""
|
|
1894
|
+
Supports saving/restoring a :class:`FilePickerCtrl` / :class:`DirPickerCtrl` path.
|
|
1895
|
+
|
|
1896
|
+
This class handles the following wxPython widgets:
|
|
1897
|
+
|
|
1898
|
+
- :class:`FilePickerCtrl`;
|
|
1899
|
+
- :class:`DirPickerCtrl`.
|
|
1900
|
+
|
|
1901
|
+
"""
|
|
1902
|
+
|
|
1903
|
+
def __init__(self, pObject):
|
|
1904
|
+
|
|
1905
|
+
AbstractHandler.__init__(self, pObject)
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
def Save(self):
|
|
1909
|
+
|
|
1910
|
+
picker, obj = self._window, self._pObject
|
|
1911
|
+
|
|
1912
|
+
path = picker.GetPath()
|
|
1913
|
+
if issubclass(picker.__class__, wx.FileDialog):
|
|
1914
|
+
if picker.GetWindowStyleFlag() & wx.FD_MULTIPLE:
|
|
1915
|
+
path = picker.GetPaths()
|
|
1916
|
+
|
|
1917
|
+
obj.SaveValue(PERSIST_FILEDIRPICKER_PATH, path)
|
|
1918
|
+
return True
|
|
1919
|
+
|
|
1920
|
+
|
|
1921
|
+
def Restore(self):
|
|
1922
|
+
|
|
1923
|
+
picker, obj = self._window, self._pObject
|
|
1924
|
+
value = obj.RestoreValue(PERSIST_FILEDIRPICKER_PATH)
|
|
1925
|
+
|
|
1926
|
+
if value is not None:
|
|
1927
|
+
if issubclass(picker.__class__, wx.FileDialog):
|
|
1928
|
+
if type(value) == list:
|
|
1929
|
+
value = value[-1]
|
|
1930
|
+
|
|
1931
|
+
picker.SetPath(value)
|
|
1932
|
+
return True
|
|
1933
|
+
|
|
1934
|
+
return False
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
def GetKind(self):
|
|
1938
|
+
|
|
1939
|
+
return PERSIST_FILEDIRPICKER_KIND
|
|
1940
|
+
|
|
1941
|
+
|
|
1942
|
+
# ----------------------------------------------------------------------------------- #
|
|
1943
|
+
|
|
1944
|
+
class FontPickerHandler(AbstractHandler):
|
|
1945
|
+
"""
|
|
1946
|
+
Supports saving/restoring a :class:`wx.FontPickerCtrl` font.
|
|
1947
|
+
|
|
1948
|
+
This class handles the following wxPython widgets:
|
|
1949
|
+
|
|
1950
|
+
- :class:`wx.FontPickerCtrl`.
|
|
1951
|
+
|
|
1952
|
+
"""
|
|
1953
|
+
|
|
1954
|
+
def __init__(self, pObject):
|
|
1955
|
+
|
|
1956
|
+
AbstractHandler.__init__(self, pObject)
|
|
1957
|
+
|
|
1958
|
+
|
|
1959
|
+
def Save(self):
|
|
1960
|
+
|
|
1961
|
+
picker, obj = self._window, self._pObject
|
|
1962
|
+
|
|
1963
|
+
font = picker.GetSelectedFont()
|
|
1964
|
+
if not font.IsOk():
|
|
1965
|
+
return False
|
|
1966
|
+
|
|
1967
|
+
fontData = CreateFont(font)
|
|
1968
|
+
obj.SaveValue(PERSIST_FONTPICKER_FONT, fontData)
|
|
1969
|
+
return True
|
|
1970
|
+
|
|
1971
|
+
|
|
1972
|
+
def Restore(self):
|
|
1973
|
+
|
|
1974
|
+
picker, obj = self._window, self._pObject
|
|
1975
|
+
value = obj.RestoreValue(PERSIST_FONTPICKER_FONT)
|
|
1976
|
+
|
|
1977
|
+
if value is not None:
|
|
1978
|
+
font = wx.Font(*value)
|
|
1979
|
+
if font.IsOk():
|
|
1980
|
+
picker.SetSelectedFont(font)
|
|
1981
|
+
return True
|
|
1982
|
+
|
|
1983
|
+
return False
|
|
1984
|
+
|
|
1985
|
+
|
|
1986
|
+
def GetKind(self):
|
|
1987
|
+
|
|
1988
|
+
return PERSIST_FONTPICKER_KIND
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
# ----------------------------------------------------------------------------------- #
|
|
1992
|
+
|
|
1993
|
+
class FileHistoryHandler(AbstractHandler):
|
|
1994
|
+
"""
|
|
1995
|
+
Supports saving/restoring a :class:`FileHistory` list of file names.
|
|
1996
|
+
|
|
1997
|
+
This class handles the following wxPython widgets:
|
|
1998
|
+
|
|
1999
|
+
- :class:`FileHistory`.
|
|
2000
|
+
|
|
2001
|
+
"""
|
|
2002
|
+
|
|
2003
|
+
def __init__(self, pObject):
|
|
2004
|
+
|
|
2005
|
+
AbstractHandler.__init__(self, pObject)
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
def Save(self):
|
|
2009
|
+
|
|
2010
|
+
history, obj = self._window, self._pObject
|
|
2011
|
+
|
|
2012
|
+
paths = []
|
|
2013
|
+
for indx in range(history.GetCount()):
|
|
2014
|
+
paths.append(history.GetHistoryFile(indx))
|
|
2015
|
+
|
|
2016
|
+
obj.SaveValue(PERSIST_FILEHISTORY_PATHS, paths)
|
|
2017
|
+
return True
|
|
2018
|
+
|
|
2019
|
+
|
|
2020
|
+
def Restore(self):
|
|
2021
|
+
|
|
2022
|
+
history, obj = self._window, self._pObject
|
|
2023
|
+
value = obj.RestoreValue(PERSIST_FILEHISTORY_PATHS)
|
|
2024
|
+
|
|
2025
|
+
if value is not None:
|
|
2026
|
+
count = history.GetMaxFiles()
|
|
2027
|
+
for indx, path in enumerate(value):
|
|
2028
|
+
if indx < count:
|
|
2029
|
+
history.AddFileToHistory(path)
|
|
2030
|
+
return True
|
|
2031
|
+
|
|
2032
|
+
return False
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
def GetKind(self):
|
|
2036
|
+
|
|
2037
|
+
return PERSIST_FILEHISTORY_KIND
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
# ----------------------------------------------------------------------------------- #
|
|
2041
|
+
|
|
2042
|
+
class MenuBarHandler(AbstractHandler):
|
|
2043
|
+
"""
|
|
2044
|
+
Supports saving/restoring the :class:`wx.MenuBar` and :class:`lib.agw.flatmenu.FlatMenuBar` items state.
|
|
2045
|
+
|
|
2046
|
+
This class handles the following wxPython widgets:
|
|
2047
|
+
|
|
2048
|
+
- :class:`wx.MenuBar`;
|
|
2049
|
+
- :class:`lib.agw.flatmenu.FlatMenuBar`.
|
|
2050
|
+
|
|
2051
|
+
"""
|
|
2052
|
+
|
|
2053
|
+
def __init__(self, pObject):
|
|
2054
|
+
|
|
2055
|
+
AbstractHandler.__init__(self, pObject)
|
|
2056
|
+
|
|
2057
|
+
|
|
2058
|
+
def Save(self):
|
|
2059
|
+
|
|
2060
|
+
bar, obj = self._window, self._pObject
|
|
2061
|
+
menuCount = bar.GetMenuCount()
|
|
2062
|
+
|
|
2063
|
+
if menuCount == 0:
|
|
2064
|
+
# Nothing to save
|
|
2065
|
+
return False
|
|
2066
|
+
|
|
2067
|
+
checkRadioItems = {}
|
|
2068
|
+
for indx in range(menuCount):
|
|
2069
|
+
menu = bar.GetMenu(indx)
|
|
2070
|
+
for item in menu.GetMenuItems():
|
|
2071
|
+
if item.GetKind() in [wx.ITEM_CHECK, wx.ITEM_RADIO]:
|
|
2072
|
+
checkRadioItems[item.GetId()] = item.IsChecked()
|
|
2073
|
+
|
|
2074
|
+
obj.SaveValue(PERSIST_MENUBAR_CHECKRADIO_ITEMS, checkRadioItems)
|
|
2075
|
+
return True
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
def Restore(self):
|
|
2079
|
+
|
|
2080
|
+
bar, obj = self._window, self._pObject
|
|
2081
|
+
menuCount = bar.GetMenuCount()
|
|
2082
|
+
|
|
2083
|
+
if menuCount == 0:
|
|
2084
|
+
# Nothing to restore
|
|
2085
|
+
return False
|
|
2086
|
+
|
|
2087
|
+
checkRadioItems = obj.RestoreValue(PERSIST_MENUBAR_CHECKRADIO_ITEMS)
|
|
2088
|
+
|
|
2089
|
+
if checkRadioItems is None:
|
|
2090
|
+
return False
|
|
2091
|
+
|
|
2092
|
+
retVal = True
|
|
2093
|
+
for indx in range(menuCount):
|
|
2094
|
+
menu = bar.GetMenu(indx)
|
|
2095
|
+
for item in menu.GetMenuItems():
|
|
2096
|
+
if item.GetKind() in [wx.ITEM_CHECK, wx.ITEM_RADIO]:
|
|
2097
|
+
itemId = item.GetId()
|
|
2098
|
+
if itemId in checkRadioItems:
|
|
2099
|
+
item.Check(checkRadioItems[itemId])
|
|
2100
|
+
else:
|
|
2101
|
+
retVal = False
|
|
2102
|
+
|
|
2103
|
+
return retVal
|
|
2104
|
+
|
|
2105
|
+
|
|
2106
|
+
def GetKind(self):
|
|
2107
|
+
|
|
2108
|
+
return PERSIST_MENUBAR_KIND
|
|
2109
|
+
|
|
2110
|
+
|
|
2111
|
+
# ----------------------------------------------------------------------------------- #
|
|
2112
|
+
|
|
2113
|
+
class ToolBarHandler(AbstractHandler):
|
|
2114
|
+
"""
|
|
2115
|
+
Supports saving/restoring the :class:`lib.agw.aui.auibar.AuiToolBar` items state.
|
|
2116
|
+
|
|
2117
|
+
This class handles the following wxPython widgets:
|
|
2118
|
+
|
|
2119
|
+
- :class:`lib.agw.aui.auibar.AuiToolBar`.
|
|
2120
|
+
|
|
2121
|
+
.. todo::
|
|
2122
|
+
|
|
2123
|
+
Find a way to handle :class:`ToolBar` UI settings as it has been done for
|
|
2124
|
+
:class:`lib.agw.aui.auibar.AuiToolBar`: currently :class:`ToolBar` doesn't seem
|
|
2125
|
+
to have easy access to the underlying toolbar tools.
|
|
2126
|
+
|
|
2127
|
+
"""
|
|
2128
|
+
|
|
2129
|
+
def __init__(self, pObject):
|
|
2130
|
+
|
|
2131
|
+
AbstractHandler.__init__(self, pObject)
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
def Save(self):
|
|
2135
|
+
|
|
2136
|
+
bar, obj = self._window, self._pObject
|
|
2137
|
+
toolCount = bar.GetToolCount()
|
|
2138
|
+
|
|
2139
|
+
if toolCount == 0:
|
|
2140
|
+
# Nothing to save
|
|
2141
|
+
return False
|
|
2142
|
+
|
|
2143
|
+
checkRadioItems = {}
|
|
2144
|
+
for indx in range(toolCount):
|
|
2145
|
+
tool = bar.FindToolByIndex(indx)
|
|
2146
|
+
if tool is not None:
|
|
2147
|
+
if tool.GetKind() in [AUI.ITEM_CHECK, AUI.ITEM_RADIO]:
|
|
2148
|
+
checkRadioItems[tool.GetId()] = tool.GetState() & AUI.AUI_BUTTON_STATE_CHECKED
|
|
2149
|
+
|
|
2150
|
+
obj.SaveValue(PERSIST_TOOLBAR_CHECKRADIO_ITEMS, checkRadioItems)
|
|
2151
|
+
return True
|
|
2152
|
+
|
|
2153
|
+
|
|
2154
|
+
def Restore(self):
|
|
2155
|
+
|
|
2156
|
+
bar, obj = self._window, self._pObject
|
|
2157
|
+
toolCount = bar.GetToolCount()
|
|
2158
|
+
|
|
2159
|
+
if toolCount == 0:
|
|
2160
|
+
# Nothing to save
|
|
2161
|
+
return False
|
|
2162
|
+
|
|
2163
|
+
checkRadioItems = obj.RestoreValue(PERSIST_TOOLBAR_CHECKRADIO_ITEMS)
|
|
2164
|
+
|
|
2165
|
+
if checkRadioItems is None:
|
|
2166
|
+
return False
|
|
2167
|
+
|
|
2168
|
+
for indx in range(toolCount):
|
|
2169
|
+
tool = bar.FindToolByIndex(indx)
|
|
2170
|
+
if tool is not None:
|
|
2171
|
+
toolId = tool.GetId()
|
|
2172
|
+
if toolId in checkRadioItems:
|
|
2173
|
+
if tool.GetKind() in [AUI.ITEM_CHECK, AUI.ITEM_RADIO]:
|
|
2174
|
+
state = checkRadioItems[toolId]
|
|
2175
|
+
if state & AUI.AUI_BUTTON_STATE_CHECKED:
|
|
2176
|
+
tool.SetState(tool.GetState() | AUI.AUI_BUTTON_STATE_CHECKED)
|
|
2177
|
+
else:
|
|
2178
|
+
tool.SetState(tool.GetState() & ~AUI.AUI_BUTTON_STATE_CHECKED)
|
|
2179
|
+
|
|
2180
|
+
return True
|
|
2181
|
+
|
|
2182
|
+
|
|
2183
|
+
def GetKind(self):
|
|
2184
|
+
|
|
2185
|
+
return PERSIST_TOOLBAR_KIND
|
|
2186
|
+
|
|
2187
|
+
# ----------------------------------------------------------------------------------- #
|
|
2188
|
+
|
|
2189
|
+
class FileDirDialogHandler(TLWHandler, FileDirPickerHandler):
|
|
2190
|
+
"""
|
|
2191
|
+
Supports saving/restoring a :class:`DirDialog` / :class:`FileDialog` path.
|
|
2192
|
+
|
|
2193
|
+
This class handles the following wxPython widgets:
|
|
2194
|
+
|
|
2195
|
+
- :class:`DirDialog`;
|
|
2196
|
+
- :class:`FileDialog`.
|
|
2197
|
+
"""
|
|
2198
|
+
|
|
2199
|
+
def __init__(self, pObject):
|
|
2200
|
+
|
|
2201
|
+
TLWHandler.__init__(self, pObject)
|
|
2202
|
+
FileDirPickerHandler.__init__(self, pObject)
|
|
2203
|
+
|
|
2204
|
+
|
|
2205
|
+
def Save(self):
|
|
2206
|
+
|
|
2207
|
+
tlw = TLWHandler.Save(self)
|
|
2208
|
+
fdp = FileDirPickerHandler.Save(self)
|
|
2209
|
+
|
|
2210
|
+
return (tlw and fdp)
|
|
2211
|
+
|
|
2212
|
+
|
|
2213
|
+
def Restore(self):
|
|
2214
|
+
|
|
2215
|
+
tlw = TLWHandler.Restore(self)
|
|
2216
|
+
fdp = FileDirPickerHandler.Restore(self)
|
|
2217
|
+
return (tlw and fdp)
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
def GetKind(self):
|
|
2221
|
+
|
|
2222
|
+
return PERSIST_FILEDIRPICKER_KIND
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
# ----------------------------------------------------------------------------------- #
|
|
2226
|
+
|
|
2227
|
+
class FindReplaceHandler(TLWHandler):
|
|
2228
|
+
"""
|
|
2229
|
+
Supports saving/restoring a :class:`FindReplaceDialog` data (search string, replace string
|
|
2230
|
+
and flags).
|
|
2231
|
+
|
|
2232
|
+
This class handles the following wxPython widgets:
|
|
2233
|
+
|
|
2234
|
+
- :class:`FindReplaceDialog`.
|
|
2235
|
+
|
|
2236
|
+
.. todo:: Find a way to properly save and restore dialog data (:class:`wx.ColourDialog`, :class:`wx.FontDialog` etc...).
|
|
2237
|
+
|
|
2238
|
+
"""
|
|
2239
|
+
|
|
2240
|
+
def __init__(self, pObject):
|
|
2241
|
+
|
|
2242
|
+
TLWHandler.__init__(self, pObject)
|
|
2243
|
+
|
|
2244
|
+
|
|
2245
|
+
def Save(self):
|
|
2246
|
+
|
|
2247
|
+
findDialog, obj = self._window, self._pObject
|
|
2248
|
+
data = findDialog.GetData()
|
|
2249
|
+
|
|
2250
|
+
obj.SaveValue(PERSIST_FINDREPLACE_FLAGS, data.GetFlags())
|
|
2251
|
+
obj.SaveValue(PERSIST_FINDREPLACE_SEARCH, data.GetFindString())
|
|
2252
|
+
obj.SaveValue(PERSIST_FINDREPLACE_REPLACE, data.GetReplaceString())
|
|
2253
|
+
|
|
2254
|
+
return TLWHandler.Save(self)
|
|
2255
|
+
|
|
2256
|
+
|
|
2257
|
+
def Restore(self):
|
|
2258
|
+
|
|
2259
|
+
findDialog, obj = self._window, self._pObject
|
|
2260
|
+
|
|
2261
|
+
flags = obj.RestoreValue(PERSIST_FINDREPLACE_FLAGS)
|
|
2262
|
+
search = obj.RestoreValue(PERSIST_FINDREPLACE_SEARCH)
|
|
2263
|
+
replace = obj.RestoreValue(PERSIST_FINDREPLACE_REPLACE)
|
|
2264
|
+
|
|
2265
|
+
data = findDialog.GetData()
|
|
2266
|
+
if flags is not None:
|
|
2267
|
+
data.SetFlags(flags)
|
|
2268
|
+
if search is not None:
|
|
2269
|
+
data.SetFindString(search)
|
|
2270
|
+
if replace is not None:
|
|
2271
|
+
data.SetReplaceString(replace)
|
|
2272
|
+
|
|
2273
|
+
retVal = TLWHandler.Restore(self)
|
|
2274
|
+
|
|
2275
|
+
return (flags is not None and search is not None and replace is not None and retVal)
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
def GetKind(self):
|
|
2279
|
+
|
|
2280
|
+
return PERSIST_FINDREPLACE_KIND
|
|
2281
|
+
|
|
2282
|
+
|
|
2283
|
+
# ----------------------------------------------------------------------------------- #
|
|
2284
|
+
|
|
2285
|
+
class FontDialogHandler(TLWHandler):
|
|
2286
|
+
"""
|
|
2287
|
+
Supports saving/restoring a :class:`wx.FontDialog` data (effects, symbols, colour, font, help).
|
|
2288
|
+
|
|
2289
|
+
This class handles the following wxPython widgets:
|
|
2290
|
+
|
|
2291
|
+
- :class:`wx.FontDialog`.
|
|
2292
|
+
|
|
2293
|
+
.. todo:: Find a way to properly save and restore dialog data (:class:`wx.ColourDialog`, :class:`wx.FontDialog` etc...).
|
|
2294
|
+
|
|
2295
|
+
"""
|
|
2296
|
+
|
|
2297
|
+
def __init__(self, pObject):
|
|
2298
|
+
|
|
2299
|
+
TLWHandler.__init__(self, pObject)
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
def Save(self):
|
|
2303
|
+
|
|
2304
|
+
fontDialog, obj = self._window, self._pObject
|
|
2305
|
+
data = fontDialog.GetFontData()
|
|
2306
|
+
|
|
2307
|
+
obj.SaveValue(PERSIST_FONTDIALOG_EFFECTS, data.GetEnableEffects())
|
|
2308
|
+
obj.SaveValue(PERSIST_FONTDIALOG_SYMBOLS, data.GetAllowSymbols())
|
|
2309
|
+
obj.SaveValue(PERSIST_FONTDIALOG_COLOUR, data.GetColour().Get(includeAlpha=True))
|
|
2310
|
+
obj.SaveValue(PERSIST_FONTDIALOG_FONT, CreateFont(data.GetChosenFont()))
|
|
2311
|
+
obj.SaveValue(PERSIST_FONTDIALOG_HELP, data.GetShowHelp())
|
|
2312
|
+
|
|
2313
|
+
return TLWHandler.Save(self)
|
|
2314
|
+
|
|
2315
|
+
|
|
2316
|
+
def Restore(self):
|
|
2317
|
+
|
|
2318
|
+
fontDialog, obj = self._window, self._pObject
|
|
2319
|
+
data = fontDialog.GetFontData()
|
|
2320
|
+
|
|
2321
|
+
effects = obj.RestoreValue(PERSIST_FONTDIALOG_EFFECTS)
|
|
2322
|
+
symbols = obj.RestoreValue(PERSIST_FONTDIALOG_SYMBOLS)
|
|
2323
|
+
colour = obj.RestoreValue(PERSIST_FONTDIALOG_COLOUR)
|
|
2324
|
+
font = obj.RestoreValue(PERSIST_FONTDIALOG_FONT)
|
|
2325
|
+
help = obj.RestoreValue(PERSIST_FONTDIALOG_HELP)
|
|
2326
|
+
|
|
2327
|
+
if effects is not None:
|
|
2328
|
+
data.EnableEffects(effects)
|
|
2329
|
+
if symbols is not None:
|
|
2330
|
+
data.SetAllowSymbols(symbols)
|
|
2331
|
+
if colour is not None:
|
|
2332
|
+
data.SetColour(wx.Colour(*colour))
|
|
2333
|
+
if font is not None:
|
|
2334
|
+
data.SetInitialFont(wx.Font(*font))
|
|
2335
|
+
if help is not None:
|
|
2336
|
+
data.SetShowHelp(help)
|
|
2337
|
+
|
|
2338
|
+
return (effects is not None and symbols is not None and colour is not None and \
|
|
2339
|
+
font is not None and help is not None and TLWHandler.Restore(self))
|
|
2340
|
+
|
|
2341
|
+
|
|
2342
|
+
def GetKind(self):
|
|
2343
|
+
|
|
2344
|
+
return PERSIST_FONTDIALOG_KIND
|
|
2345
|
+
|
|
2346
|
+
|
|
2347
|
+
# ----------------------------------------------------------------------------------- #
|
|
2348
|
+
|
|
2349
|
+
class ColourDialogHandler(TLWHandler):
|
|
2350
|
+
"""
|
|
2351
|
+
Supports saving/restoring a :class:`wx.ColourDialog` data (colour, custom colours and full
|
|
2352
|
+
choice in the dialog).
|
|
2353
|
+
|
|
2354
|
+
This class handles the following wxPython widgets:
|
|
2355
|
+
|
|
2356
|
+
- :class:`wx.ColourDialog`;
|
|
2357
|
+
- :class:`lib.agw.cubecolourdialog.CubeColourDialog`.
|
|
2358
|
+
|
|
2359
|
+
.. todo:: Find a way to properly save and restore dialog data (:class:`wx.ColourDialog`, :class:`wx.FontDialog` etc...).
|
|
2360
|
+
|
|
2361
|
+
"""
|
|
2362
|
+
|
|
2363
|
+
def __init__(self, pObject):
|
|
2364
|
+
|
|
2365
|
+
TLWHandler.__init__(self, pObject)
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
def Save(self):
|
|
2369
|
+
|
|
2370
|
+
colDialog, obj = self._window, self._pObject
|
|
2371
|
+
data = colDialog.GetColourData()
|
|
2372
|
+
|
|
2373
|
+
obj.SaveValue(PERSIST_COLOURDIALOG_COLOUR, data.GetColour().Get(includeAlpha=True))
|
|
2374
|
+
obj.SaveValue(PERSIST_COLOURDIALOG_CHOOSEFULL, data.GetChooseFull())
|
|
2375
|
+
|
|
2376
|
+
customColours = []
|
|
2377
|
+
for indx in range(15):
|
|
2378
|
+
colour = data.GetCustomColour(indx)
|
|
2379
|
+
if not colour.IsOk() or colour == wx.WHITE:
|
|
2380
|
+
break
|
|
2381
|
+
|
|
2382
|
+
customColours.append(colour.Get(includeAlpha=True))
|
|
2383
|
+
|
|
2384
|
+
obj.SaveValue(PERSIST_COLOURDIALOG_CUSTOMCOLOURS, customColours)
|
|
2385
|
+
|
|
2386
|
+
return TLWHandler.Save(self)
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
def Restore(self):
|
|
2390
|
+
|
|
2391
|
+
colDialog, obj = self._window, self._pObject
|
|
2392
|
+
data = colDialog.GetColourData()
|
|
2393
|
+
|
|
2394
|
+
colour = obj.RestoreValue(PERSIST_COLOURDIALOG_COLOUR)
|
|
2395
|
+
chooseFull = obj.RestoreValue(PERSIST_COLOURDIALOG_CHOOSEFULL)
|
|
2396
|
+
customColours = obj.RestoreValue(PERSIST_COLOURDIALOG_CUSTOMCOLOURS)
|
|
2397
|
+
|
|
2398
|
+
if colour is not None:
|
|
2399
|
+
data.SetColour(wx.Colour(*colour))
|
|
2400
|
+
if chooseFull is not None:
|
|
2401
|
+
data.SetChooseFull(chooseFull)
|
|
2402
|
+
if customColours is not None:
|
|
2403
|
+
for indx, colour in enumerate(customColours):
|
|
2404
|
+
data.SetCustomColour(indx, colour)
|
|
2405
|
+
|
|
2406
|
+
return (colour is not None and chooseFull is not None and customColours is not None \
|
|
2407
|
+
and TLWHandler.Restore(self))
|
|
2408
|
+
|
|
2409
|
+
|
|
2410
|
+
def GetKind(self):
|
|
2411
|
+
|
|
2412
|
+
return PERSIST_COLOURDIALOG_KIND
|
|
2413
|
+
|
|
2414
|
+
|
|
2415
|
+
# ----------------------------------------------------------------------------------- #
|
|
2416
|
+
|
|
2417
|
+
class ChoiceDialogHandler(TLWHandler):
|
|
2418
|
+
"""
|
|
2419
|
+
Supports saving/restoring a :class:`MultiChoiceDialog` / :class:`SingleChoiceDialog` choices.
|
|
2420
|
+
|
|
2421
|
+
This class handles the following wxPython widgets:
|
|
2422
|
+
|
|
2423
|
+
- :class:`SingleChoiceDialog`;
|
|
2424
|
+
- :class:`MultiChoiceDialog`.
|
|
2425
|
+
"""
|
|
2426
|
+
|
|
2427
|
+
def __init__(self, pObject):
|
|
2428
|
+
|
|
2429
|
+
TLWHandler.__init__(self, pObject)
|
|
2430
|
+
|
|
2431
|
+
|
|
2432
|
+
def Save(self):
|
|
2433
|
+
|
|
2434
|
+
dialog, obj = self._window, self._pObject
|
|
2435
|
+
|
|
2436
|
+
if issubclass(dialog.__class__, wx.SingleChoiceDialog):
|
|
2437
|
+
selections = dialog.GetSelection()
|
|
2438
|
+
selections = (selections >= 0 and [selections] or [[]])[0]
|
|
2439
|
+
else:
|
|
2440
|
+
selections = dialog.GetSelections()
|
|
2441
|
+
|
|
2442
|
+
obj.SaveValue(PERSIST_CHOICEDIALOG_SELECTIONS, selections)
|
|
2443
|
+
return True
|
|
2444
|
+
|
|
2445
|
+
|
|
2446
|
+
def Restore(self):
|
|
2447
|
+
|
|
2448
|
+
dialog, obj = self._window, self._pObject
|
|
2449
|
+
selections = obj.RestoreValue(PERSIST_CHOICEDIALOG_SELECTIONS)
|
|
2450
|
+
|
|
2451
|
+
if selections is None:
|
|
2452
|
+
return False
|
|
2453
|
+
|
|
2454
|
+
if issubclass(dialog.__class__, wx.SingleChoiceDialog):
|
|
2455
|
+
if selections:
|
|
2456
|
+
dialog.SetSelection(selections[-1])
|
|
2457
|
+
else:
|
|
2458
|
+
dialog.SetSelections(selections)
|
|
2459
|
+
|
|
2460
|
+
return True
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
def GetKind(self):
|
|
2464
|
+
|
|
2465
|
+
return PERSIST_CHOICEDIALOG_KIND
|
|
2466
|
+
|
|
2467
|
+
|
|
2468
|
+
# ----------------------------------------------------------------------------------- #
|
|
2469
|
+
|
|
2470
|
+
class TextEntryHandler(TLWHandler, TextCtrlHandler):
|
|
2471
|
+
"""
|
|
2472
|
+
Supports saving/restoring a :class:`TextEntryDialog` string.
|
|
2473
|
+
|
|
2474
|
+
This class handles the following wxPython widgets:
|
|
2475
|
+
|
|
2476
|
+
- :class:`TextEntryDialog`;
|
|
2477
|
+
- :class:`PasswordEntryDialog`.
|
|
2478
|
+
"""
|
|
2479
|
+
|
|
2480
|
+
def __init__(self, pObject):
|
|
2481
|
+
|
|
2482
|
+
TLWHandler.__init__(self, pObject)
|
|
2483
|
+
TextCtrlHandler.__init__(self, pObject)
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
def Save(self):
|
|
2487
|
+
|
|
2488
|
+
tlw = TLWHandler.Save(self)
|
|
2489
|
+
txt = TextCtrlHandler.Save(self)
|
|
2490
|
+
return (tlw and txt)
|
|
2491
|
+
|
|
2492
|
+
|
|
2493
|
+
def Restore(self):
|
|
2494
|
+
|
|
2495
|
+
tlw = TLWHandler.Restore(self)
|
|
2496
|
+
txt = TextCtrlHandler.Restore(self)
|
|
2497
|
+
return (tlw and txt)
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
def GetKind(self):
|
|
2501
|
+
|
|
2502
|
+
return PERSIST_TLW_KIND
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
# ----------------------------------------------------------------------------------- #
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
HANDLERS = [
|
|
2509
|
+
("BookHandler", (wx.BookCtrlBase, AUI.AuiNotebook, FNB.FlatNotebook,
|
|
2510
|
+
LBK.LabelBook, LBK.FlatImageBook)),
|
|
2511
|
+
("TLWHandler", (wx.TopLevelWindow, )),
|
|
2512
|
+
("CheckBoxHandler", (wx.CheckBox, )),
|
|
2513
|
+
("TreeCtrlHandler", (wx.TreeCtrl, wx.GenericDirCtrl, CT.CustomTreeCtrl, dv.TreeListCtrl)),
|
|
2514
|
+
("MenuBarHandler", (wx.MenuBar, FM.FlatMenuBar)),
|
|
2515
|
+
("ToolBarHandler", (AUI.AuiToolBar, )),
|
|
2516
|
+
("ListBoxHandler", (wx.ListBox, wx.VListBox, wx.html.HtmlListBox, wx.html.SimpleHtmlListBox,
|
|
2517
|
+
wx.adv.EditableListBox)),
|
|
2518
|
+
("ListCtrlHandler", (wx.ListCtrl, wx.ListView)), #ULC.UltimateListCtrl (later)
|
|
2519
|
+
("ChoiceComboHandler", (wx.Choice, wx.ComboBox, wx.adv.OwnerDrawnComboBox)),
|
|
2520
|
+
("RadioBoxHandler", (wx.RadioBox, )),
|
|
2521
|
+
("RadioButtonHandler", (wx.RadioButton, )),
|
|
2522
|
+
("ScrolledWindowHandler", (wx.ScrolledWindow, scrolled.ScrolledPanel)),
|
|
2523
|
+
("SliderHandler", (wx.Slider, KC.KnobCtrl)),
|
|
2524
|
+
("SpinHandler", (wx.SpinButton, wx.SpinCtrl, FS.FloatSpin)),
|
|
2525
|
+
("SplitterHandler", (wx.SplitterWindow, )),
|
|
2526
|
+
("TextCtrlHandler", (wx.TextCtrl, wx.SearchCtrl, expando.ExpandoTextCtrl, masked.TextCtrl,
|
|
2527
|
+
masked.ComboBox, masked.IpAddrCtrl, masked.TimeCtrl, masked.NumCtrl)),
|
|
2528
|
+
("TreeListCtrlHandler", (HTL.HyperTreeList, )),
|
|
2529
|
+
("CalendarCtrlHandler", (wx.adv.CalendarCtrl, )),
|
|
2530
|
+
("CollapsiblePaneHandler", (wx.CollapsiblePane, PCP.PyCollapsiblePane)),
|
|
2531
|
+
("AUIHandler", (wx.Panel, )),
|
|
2532
|
+
("DatePickerHandler", (wx.adv.DatePickerCtrl, )),
|
|
2533
|
+
# ("MediaCtrlHandler", (wx.media.MediaCtrl, )), not wrapped yet
|
|
2534
|
+
("ColourPickerHandler", (wx.ColourPickerCtrl, csel.ColourSelect)),
|
|
2535
|
+
("FileDirPickerHandler", (wx.FilePickerCtrl, wx.DirPickerCtrl)),
|
|
2536
|
+
("FontPickerHandler", (wx.FontPickerCtrl, )),
|
|
2537
|
+
("FileHistoryHandler", (wx.FileHistory, )),
|
|
2538
|
+
("ToggleButtonHandler", (wx.ToggleButton, buttons.GenToggleButton,
|
|
2539
|
+
buttons.GenBitmapToggleButton, buttons.GenBitmapTextToggleButton)),
|
|
2540
|
+
]
|
|
2541
|
+
|
|
2542
|
+
STANDALONE_HANDLERS = [
|
|
2543
|
+
("TreebookHandler", (wx.Treebook, )),
|
|
2544
|
+
("CheckListBoxHandler", (wx.CheckListBox, )),
|
|
2545
|
+
("FileDirDialogHandler", (wx.DirDialog, wx.FileDialog)),
|
|
2546
|
+
("FindReplaceHandler", (wx.FindReplaceDialog, )),
|
|
2547
|
+
("FontDialogHandler", (wx.FontDialog, )),
|
|
2548
|
+
("ColourDialogHandler", (wx.ColourDialog, CCD.CubeColourDialog)),
|
|
2549
|
+
("ChoiceDialogHandler", (wx.SingleChoiceDialog, wx.MultiChoiceDialog)),
|
|
2550
|
+
("TextEntryHandler", (wx.TextEntryDialog, wx.PasswordEntryDialog)),
|
|
2551
|
+
]
|
|
2552
|
+
|
|
2553
|
+
if hasSB:
|
|
2554
|
+
HANDLERS[-1] = ("ToggleButtonHandler", (wx.ToggleButton, buttons.GenToggleButton,
|
|
2555
|
+
buttons.GenBitmapToggleButton,
|
|
2556
|
+
buttons.GenBitmapTextToggleButton,
|
|
2557
|
+
SB.SToggleButton, SB.SBitmapToggleButton,
|
|
2558
|
+
SB.SBitmapTextToggleButton))
|
|
2559
|
+
|
|
2560
|
+
# ----------------------------------------------------------------------------------- #
|
|
2561
|
+
|
|
2562
|
+
def FindHandler(pObject):
|
|
2563
|
+
"""
|
|
2564
|
+
Finds a suitable handler for the input `Persistent Object` depending on the
|
|
2565
|
+
widget kind.
|
|
2566
|
+
|
|
2567
|
+
:param `pObject`: an instance of :class:`~wx.lib.agw.persist.persistencemanager.PersistentObject` class.
|
|
2568
|
+
"""
|
|
2569
|
+
|
|
2570
|
+
window = pObject.GetWindow()
|
|
2571
|
+
klass = window.__class__
|
|
2572
|
+
|
|
2573
|
+
if hasattr(window, "_persistentHandler"):
|
|
2574
|
+
# if control has a handler, just return it
|
|
2575
|
+
return window._persistentHandler
|
|
2576
|
+
|
|
2577
|
+
for handler, subclasses in STANDALONE_HANDLERS:
|
|
2578
|
+
for subclass in subclasses:
|
|
2579
|
+
if issubclass(klass, subclass):
|
|
2580
|
+
return eval(handler)(pObject)
|
|
2581
|
+
|
|
2582
|
+
for handler, subclasses in HANDLERS:
|
|
2583
|
+
for subclass in subclasses:
|
|
2584
|
+
if issubclass(klass, subclass):
|
|
2585
|
+
return eval(handler)(pObject)
|
|
2586
|
+
|
|
2587
|
+
raise Exception("Unsupported persistent handler (class=%s, name=%s)"%(klass, window.GetName()))
|
|
2588
|
+
|
|
2589
|
+
# ----------------------------------------------------------------------------------- #
|
|
2590
|
+
|
|
2591
|
+
def HasCtrlHandler(control):
|
|
2592
|
+
"""
|
|
2593
|
+
Is there a suitable handler for this control
|
|
2594
|
+
|
|
2595
|
+
:param `control`: the control instance to check if a handler for it exists.
|
|
2596
|
+
"""
|
|
2597
|
+
|
|
2598
|
+
klass = control.__class__
|
|
2599
|
+
|
|
2600
|
+
if hasattr(control, "_persistentHandler"):
|
|
2601
|
+
# if control has a handler, just return it
|
|
2602
|
+
return True
|
|
2603
|
+
|
|
2604
|
+
for handler, subclasses in STANDALONE_HANDLERS:
|
|
2605
|
+
for subclass in subclasses:
|
|
2606
|
+
if issubclass(klass, subclass):
|
|
2607
|
+
return True
|
|
2608
|
+
|
|
2609
|
+
for handler, subclasses in HANDLERS:
|
|
2610
|
+
for subclass in subclasses:
|
|
2611
|
+
if issubclass(klass, subclass):
|
|
2612
|
+
return True
|
|
2613
|
+
|
|
2614
|
+
return False
|