├── .gitignore ├── 100_Frames_and_Dialogs ├── Dialog │ ├── Dialog_extended.py │ ├── Dialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── Frame │ ├── Frame_extended.py │ ├── Frame_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── phoenix16.png ├── MDIWindows │ ├── MDIDemo.py │ ├── MDISashDemo.py │ ├── MDIWindows_extended.py │ ├── __demo__.py │ └── __init__.py ├── MiniFrame │ ├── MiniFrame_extended.py │ ├── MiniFrame_minimal.py │ ├── __demo__.py │ └── __init__.py ├── Wizard │ ├── Wizard_extended.py │ ├── Wizard_minimal.py │ ├── Wizard_xwx.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── wiztest1.bmp │ │ └── wiztest2.bmp ├── __demo__.py └── __init__.py ├── 101_Common_Dialogs ├── AboutBox │ ├── AboutBox_extended.py │ ├── AboutBox_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ColourDialog │ ├── ColourDialog_extended.py │ ├── ColourDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── DirDialog │ ├── DirDialog_extended.py │ ├── DirDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── FileDialog │ ├── FileDialog_extended.py │ ├── FileDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── FindReplaceDialog │ ├── FindReplaceDialog_extended.py │ ├── FindReplaceDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── FontDialog │ ├── FontDialog_extended.py │ ├── FontDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── MessageDialog │ ├── MessageDialog_extended.py │ ├── MessageDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── MultiChoiceDialog │ ├── MultiChoiceDialog_extended.py │ ├── MultiChoiceDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── PageSetupDialog │ ├── PageSetupDialog_extended.py │ ├── PageSetupDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── PrintDialog │ ├── PrintDialog_extended.py │ ├── PrintDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ProgressDialog │ ├── ProgressDialog_extended.py │ ├── ProgressDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── SingleChoiceDialog │ ├── SingleChoiceDialog_extended.py │ ├── SingleChoiceDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── TextEntryDialog │ ├── TextEntryDialog_extended.py │ ├── TextEntryDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── __demo__.py └── __init__.py ├── 102_More_Dialogs ├── ImageBrowser │ ├── ImageBrowser_extended.py │ ├── ImageBrowser_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ScrolledMessageDialog │ ├── ScrolledMessageDialog_extended.py │ ├── ScrolledMessageDialog_minimal.py │ ├── __demo__.py │ └── __init__.py ├── __demo__.py └── __init__.py ├── 103_Core_Windows_Controls ├── BitmapButton │ ├── BitmapButton_extended.py │ ├── BitmapButton_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── phoenix32.png │ │ ├── robin.jpg │ │ └── test2.bmp ├── Button │ ├── Button_extended.py │ ├── Button_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── pencil16.png │ │ ├── phoenix16.png │ │ ├── snakey12_16.png │ │ ├── snakey16.png │ │ └── undo16.png ├── CheckBox │ ├── CheckBox_extended.py │ ├── CheckBox_minimal.py │ ├── __demo__.py │ └── __init__.py ├── CheckListBox │ ├── CheckListBox_extended.py │ ├── CheckListBox_minimal.py │ ├── __demo__.py │ └── __init__.py ├── Choice │ ├── Choice_extended.py │ ├── Choice_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ComboBox │ ├── ComboBox_extended.py │ ├── ComboBox_minimal.py │ ├── __demo__.py │ └── __init__.py ├── CommandLinkButton │ ├── CommandLinkButton_extended.py │ ├── CommandLinkButton_minimal.py │ ├── __demo__.py │ └── __init__.py ├── Gauge │ ├── Gauge_extended.py │ ├── Gauge_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ListBox │ ├── ListBox_extended.py │ ├── __demo__.py │ └── __init__.py ├── ListCtrl │ ├── ListCtrl_edit.py │ ├── ListCtrl_extended.py │ ├── ListCtrl_minimal.py │ ├── ListCtrl_virtual.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── sm_down.bmp │ │ ├── sm_up.bmp │ │ └── smiles.bmp ├── Menu │ ├── Menu_extended.py │ ├── Menu_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── book16.png │ │ └── smiley16.png ├── PopupMenu │ ├── PopupMenu_extended.py │ ├── PopupMenu_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── smiley16.png ├── PopupWindow │ ├── PopupWindow_extended.py │ ├── __demo__.py │ └── __init__.py ├── RadioBox │ ├── RadioBox_extended.py │ ├── RadioBox_minimal.py │ ├── __demo__.py │ └── __init__.py ├── RadioButton │ ├── RadioButton_extended.py │ ├── RadioButton_minimal.py │ ├── __demo__.py │ └── __init__.py ├── SashWindow │ ├── SashWindow_extended.py │ ├── __demo__.py │ └── __init__.py ├── ScrolledWindow │ ├── ScrolledWindow_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── test2.bmp ├── SearchCtrl │ ├── SearchCtrl_extended.py │ ├── SearchCtrl_minimal.py │ ├── __demo__.py │ └── __init__.py ├── Slider │ ├── Slider_extended.py │ ├── Slider_minimal.py │ ├── __demo__.py │ └── __init__.py ├── SpinButton │ ├── SpinButton_extended.py │ ├── __demo__.py │ └── __init__.py ├── SpinCtrl │ ├── SpinCtrl_extended.py │ ├── SpinCtrl_minimal.py │ ├── __demo__.py │ └── __init__.py ├── SpinCtrlDouble │ ├── SpinCtrlDouble_extended.py │ ├── __demo__.py │ └── __init__.py ├── SplitterWindow │ ├── SplitterWindow_extended.py │ ├── __demo__.py │ └── __init__.py ├── StaticBitmap │ ├── StaticBitmap_extended.py │ ├── StaticBitmap_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── robin.jpg │ │ └── test2.bmp ├── StaticBox │ ├── StaticBox_extended.py │ ├── StaticBox_minimal.py │ ├── __demo__.py │ └── __init__.py ├── StaticText │ ├── StaticText_extended.py │ ├── StaticText_minimal.py │ ├── __demo__.py │ └── __init__.py ├── StatusBar │ ├── StatusBar_extended.py │ ├── StatusBar_minimal.py │ ├── __demo__.py │ └── __init__.py ├── StockButtons │ ├── StockButtons_extended.py │ ├── StockButtons_minimal.py │ ├── __demo__.py │ └── __init__.py ├── TextCtrl │ ├── TextCtrl_extended.py │ ├── TextCtrl_minimal.py │ ├── URLTextCtrl.py │ ├── __demo__.py │ └── __init__.py ├── ToggleButton │ ├── ToggleButton_extended.py │ ├── ToggleButton_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── mondrian.ico ├── ToolBar │ ├── ToolBar_extended.py │ ├── ToolBar_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── filesave.png │ │ └── new_folder.png ├── TreeCtrl │ ├── TreeCtrl_extended.py │ ├── TreeCtrl_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── smiley16.png ├── Validator │ ├── Validator_extended.py │ ├── __demo__.py │ └── __init__.py ├── __demo__.py └── __init__.py ├── 104_Book_Controls ├── Choicebook │ ├── Choicebook_extended.py │ ├── __demo__.py │ └── __init__.py ├── Listbook │ ├── Listbook_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── LB01.png │ │ ├── LB02.png │ │ ├── LB03.png │ │ ├── LB04.png │ │ ├── LB05.png │ │ ├── LB06.png │ │ ├── LB07.png │ │ ├── LB08.png │ │ ├── LB09.png │ │ ├── LB10.png │ │ ├── LB11.png │ │ └── LB12.png ├── Notebook │ ├── Notebook_extended.py │ ├── Notebook_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── book16.png │ │ ├── book_blue16.png │ │ ├── book_green16.png │ │ └── book_red16.png ├── Toolbook │ ├── Toolbook_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── LB01.png │ │ ├── LB02.png │ │ ├── LB03.png │ │ ├── LB04.png │ │ ├── LB05.png │ │ ├── LB06.png │ │ ├── LB07.png │ │ ├── LB08.png │ │ ├── LB09.png │ │ ├── LB10.png │ │ ├── LB11.png │ │ └── LB12.png ├── Treebook │ ├── Treebook_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── LB01.png │ │ ├── LB02.png │ │ ├── LB03.png │ │ ├── LB04.png │ │ ├── LB05.png │ │ ├── LB06.png │ │ ├── LB07.png │ │ ├── LB08.png │ │ ├── LB09.png │ │ ├── LB10.png │ │ ├── LB11.png │ │ └── LB12.png ├── __demo__.py └── __init__.py ├── 105_Custom_Controls ├── AnalogClock │ ├── AnalogClock_extended.py │ ├── AnalogClock_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ColourSelect │ ├── ColourSelect_extended.py │ ├── ColourSelect_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ComboTreeBox │ ├── ComboTreeBox_extended.py │ ├── __demo__.py │ └── __init__.py ├── Editor │ ├── Editor_extended.py │ ├── Editor_minimal.py │ ├── __demo__.py │ └── __init__.py ├── GenericButtons │ ├── GenericButtons_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── bulb1.bmp │ │ ├── bulb2.bmp │ │ └── test2.bmp ├── GenericDirCtrl │ ├── GenericDirCtrl_extended.py │ ├── __demo__.py │ └── __init__.py ├── ItemsPicker │ ├── ItemsPicker_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── bp_btn1.png │ │ └── bp_btn2.png ├── MultiSash │ ├── MultiSash_extended.py │ ├── __demo__.py │ └── __init__.py ├── PlateButton │ ├── PlateButton_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── Address.png │ │ ├── Book.png │ │ ├── Devil.png │ │ ├── Home.png │ │ └── Monkey.png ├── __demo__.py └── __init__.py ├── 106_More_Windows_Controls ├── BitmapComboBox │ ├── BitmapComboBox_extended.py │ ├── BitmapComboBox_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── LB01.png │ │ ├── LB02.png │ │ ├── LB03.png │ │ ├── LB04.png │ │ ├── LB05.png │ │ ├── LB06.png │ │ ├── LB07.png │ │ ├── LB08.png │ │ ├── LB09.png │ │ ├── LB10.png │ │ ├── LB11.png │ │ └── LB12.png ├── Calendar │ ├── Calendar_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ ├── DbDec.bmp │ │ ├── DbInc.bmp │ │ ├── Dec.bmp │ │ ├── Inc.bmp │ │ └── Pt.bmp ├── CalendarCtrl │ ├── CalendarCtrl_extended.py │ ├── CalendarCtrl_minimal.py │ ├── __demo__.py │ └── __init__.py ├── CollapsiblePane │ ├── CollapsiblePane_extended.py │ ├── CollapsiblePane_minimal.py │ ├── __demo__.py │ └── __init__.py ├── ComboCtrl │ ├── ComboCtrl_extended.py │ ├── __demo__.py │ └── __init__.py ├── ContextHelp │ ├── ContextHelp.py │ ├── __demo__.py │ └── __init__.py ├── DatePickerCtrl │ ├── DatePickerCtrl_extended.py │ ├── DatePickerCtrl_minimal.py │ ├── __demo__.py │ └── __init__.py ├── InfoBar │ ├── InfoBar.py │ ├── __demo__.py │ └── __init__.py ├── __demo__.py └── __init__.py ├── 107_Window_Layout ├── __demo__.py └── __init__.py ├── 108_Process_and_Events ├── __demo__.py └── __init__.py ├── 109_Clipboard_and_DnD ├── __demo__.py └── __init__.py ├── 110_Using_Images ├── __demo__.py └── __init__.py ├── 111_Miscellaneous ├── AlphaDrawing │ ├── AlphaDrawing_extended.py │ ├── __demo__.py │ └── __init__.py ├── Cairo │ ├── Cairo_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── toucan.png ├── Cairo_Snippets │ ├── Cairo_Snippets.py │ ├── __demo__.py │ ├── __init__.py │ ├── bitmaps │ │ └── romedalen.png │ └── snippets │ │ ├── __init__.py │ │ ├── arc.py │ │ ├── arc_negative.py │ │ ├── clip.py │ │ ├── clip_image.py │ │ ├── curve_rectangle.py │ │ ├── curve_to.py │ │ ├── dash.py │ │ ├── ellipse.py │ │ ├── fill_and_stroke.py │ │ ├── fill_and_stroke2.py │ │ ├── fill_style.py │ │ ├── glyph_path.py │ │ ├── gradient.py │ │ ├── gradient_mask.py │ │ ├── group.py │ │ ├── image.py │ │ ├── imagepattern.py │ │ ├── path.py │ │ ├── set_line_cap.py │ │ ├── set_line_join.py │ │ ├── show_glyphs.py │ │ ├── text.py │ │ ├── text_align_center.py │ │ └── text_extents.py ├── ColourDB │ ├── ColourDBSelector.py │ ├── ColourDB_extended.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── GridBG.png ├── DragScroller │ ├── DragScroller_extended.py │ ├── __demo__.py │ └── __init__.py ├── FileHistory │ ├── FileHistory_extended.py │ ├── __demo__.py │ └── __init__.py ├── FontEnumerator │ ├── FontEnumerator_extended.py │ ├── FontEnumerator_minimal.py │ ├── __demo__.py │ └── __init__.py ├── GraphicsContext │ ├── GraphicsContext_extended.py │ ├── GraphicsContext_minimal.py │ ├── __demo__.py │ ├── __init__.py │ └── bitmaps │ │ └── toucan.png ├── MouseGestures │ ├── MouseGestures_extended.py │ ├── __demo__.py │ └── __init__.py ├── MouseState │ ├── GetMouseState_extended.py │ ├── GetMouseState_minimal.py │ ├── __demo__.py │ └── __init__.py ├── __demo__.py └── __init__.py ├── ExceptionHookDialog.py ├── Main.py ├── README.md ├── StyledTextCtrl_DemoCode.py ├── bitmaps ├── key16.png ├── lifesaver_help16.png ├── phoenix_title.png ├── pykey3216.png └── splash.png ├── demo.py ├── demoPy2.py ├── demoPy3.py ├── docs └── TrunkDocs.pkl ├── images.py ├── screenshots └── __demo__pySubFolderStructure.png ├── version.py └── wxpdemo.ico /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # IPython Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # dotenv 79 | .env 80 | 81 | # virtualenv 82 | venv/ 83 | ENV/ 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Dialog/Dialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | if __name__ == '__main__': 9 | gApp = wx.App(False) 10 | dlg = wx.Dialog(None, wx.ID_ANY, "Minimal Dialog Demo") 11 | dlg.ShowModal() 12 | dlg.Destroy() 13 | gApp.MainLoop() 14 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Dialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ Returns the bitmap to be used in the demo tree for the User's package. """ 34 | 35 | # Get the image as PyEmbeddedImage 36 | image = frame16 = PyEmbeddedImage( 37 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAH5J" 38 | "REFUeJztkzEOgmAUg79H/gP0rIYNXQxuxEth4Fh1+IOSmIgPVrt0aZsObUjiCEp7ar3XPNyH" 39 | "KADdpSPitmmwq65yIIkG+Mm81q31ZUnOIuIMUBssmB9zigHor71texqnFAOW9A7IhnwE/Bvs" 40 | "b1DqKCI9pNegjr6x2ZZ8xxMlwIa5mQGHJAAAAABJRU5ErkJggg==") 41 | 42 | # Return the bitmap to use in the wxPython demo tree control. 43 | return image 44 | 45 | 46 | def GetDemos(): 47 | """ 48 | Returns all the demo names in the package, together with the 49 | tree item name which will go in the wxPython demo tree control. 50 | """ 51 | 52 | # The tree item text. 53 | TreeItemText = "Dialog" 54 | 55 | # The tree item's demos. 56 | TreeItemDemos = ( 57 | 'Dialog_minimal', 58 | 'Dialog_extended', 59 | ) 60 | 61 | return TreeItemText, TreeItemDemos 62 | 63 | 64 | def GetOverview(): 65 | """ 66 | Creates the wxHTML code to display on the tree item's Overview tab. 67 | """ 68 | 69 | wxHtmlOverviewStr = '''\ 70 | 71 |

Dialog

72 |

wx.Dialog demos. 73 | 74 | ''' 75 | 76 | return wxHtmlOverviewStr 77 | 78 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Dialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/Dialog/__init__.py -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Frame/Frame_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports.-------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal Frame Demo') 12 | frame.Show() 13 | app.MainLoop() 14 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Frame/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ Returns the bitmap to be used in the demo tree for the User's package. """ 34 | 35 | # Get the image as PyEmbeddedImage 36 | image = frame16 = PyEmbeddedImage( 37 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAH5J" 38 | "REFUeJztkzEOgmAUg79H/gP0rIYNXQxuxEth4Fh1+IOSmIgPVrt0aZsObUjiCEp7ar3XPNyH" 39 | "KADdpSPitmmwq65yIIkG+Mm81q31ZUnOIuIMUBssmB9zigHor71texqnFAOW9A7IhnwE/Bvs" 40 | "b1DqKCI9pNegjr6x2ZZ8xxMlwIa5mQGHJAAAAABJRU5ErkJggg==") 41 | 42 | # Return the bitmap to use in the wxPython demo tree control. 43 | return image 44 | 45 | 46 | def GetDemos(): 47 | """ 48 | Returns all the demo names in the package, together with the 49 | tree item name which will go in the wxPython demo tree control. 50 | """ 51 | 52 | # The tree item text. 53 | TreeItemText = "Frame" 54 | 55 | # The tree item's demos. 56 | TreeItemDemos = ( 57 | 'Frame_minimal', 58 | 'Frame_extended', 59 | ) 60 | 61 | return TreeItemText, TreeItemDemos 62 | 63 | 64 | def GetOverview(): 65 | """ 66 | Creates the wxHTML code to display on the tree item's Overview tab. 67 | """ 68 | 69 | wxHtmlOverviewStr = '''\ 70 | 71 |

Frame

72 |

wx.Frame demos 73 | 74 | ''' 75 | 76 | return wxHtmlOverviewStr 77 | 78 | 79 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Frame/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/Frame/__init__.py -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Frame/bitmaps/phoenix16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/Frame/bitmaps/phoenix16.png -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/MDIWindows/MDIDemo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--Python Imports. 7 | import random 8 | 9 | #--wxPython Imports. 10 | import wx 11 | 12 | 13 | #-Globals---------------------------------------------------------------------- 14 | HEX = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'] 15 | NUM = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] 16 | 17 | 18 | def random_hex_color(): 19 | random.shuffle(HEX) # Order is random now 20 | ## print(HEX) 21 | randomcolor = '' 22 | for item in range(0, 6): 23 | random.shuffle(HEX) # Twice for doubles and good luck :) 24 | ## print(HEX[item]) 25 | randomcolor = randomcolor + '%s' % HEX[item] 26 | ## print(randomcolor) 27 | return '#%s' % randomcolor 28 | 29 | 30 | class MyParentFrame(wx.MDIParentFrame): 31 | def __init__(self): 32 | wx.MDIParentFrame.__init__(self, None, -1, "MDI Parent", size=(600, 400)) 33 | 34 | self.winCount = 0 35 | menu = wx.Menu() 36 | menu.Append(wx.ID_NEW, "&New Window\tCtrl+N") 37 | menu.AppendSeparator() 38 | menu.Append(wx.ID_EXIT, "E&xit") 39 | 40 | menubar = wx.MenuBar() 41 | menubar.Append(menu, "&File") 42 | self.SetMenuBar(menubar) 43 | 44 | self.CreateStatusBar() 45 | 46 | self.Bind(wx.EVT_MENU, self.OnNewWindow, id=wx.ID_NEW) 47 | self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) 48 | 49 | 50 | def OnExit(self, evt): 51 | self.Close(True) 52 | 53 | def OnNewWindow(self, evt): 54 | self.winCount = self.winCount + 1 55 | win = wx.MDIChildFrame(self, -1, "Child Window: %d" % self.winCount) 56 | canvas = wx.Panel(win) 57 | canvas.SetBackgroundColour(random_hex_color()) 58 | win.Show(True) 59 | 60 | 61 | 62 | #- __main__ ------------------------------------------------------------------- 63 | 64 | 65 | if __name__ == '__main__': 66 | class MyApp(wx.App): 67 | def OnInit(self): 68 | # wx.InitAllImageHandlers() 69 | frame = MyParentFrame() 70 | frame.Show(True) 71 | self.SetTopWindow(frame) 72 | return True 73 | 74 | app = MyApp(False) 75 | app.MainLoop() 76 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/MDIWindows/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ Returns the bitmap to be used in the demo tree for the User's package. """ 34 | 35 | # Get the image as PyEmbeddedImage 36 | image = frame16 = PyEmbeddedImage( 37 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAH5J" 38 | "REFUeJztkzEOgmAUg79H/gP0rIYNXQxuxEth4Fh1+IOSmIgPVrt0aZsObUjiCEp7ar3XPNyH" 39 | "KADdpSPitmmwq65yIIkG+Mm81q31ZUnOIuIMUBssmB9zigHor71texqnFAOW9A7IhnwE/Bvs" 40 | "b1DqKCI9pNegjr6x2ZZ8xxMlwIa5mQGHJAAAAABJRU5ErkJggg==") 41 | 42 | # Return the bitmap to use in the wxPython demo tree control. 43 | return image 44 | 45 | 46 | def GetDemos(): 47 | """ 48 | Returns all the demo names in the package, together with the 49 | tree item name which will go in the wxPython demo tree control. 50 | """ 51 | 52 | # The tree item text. 53 | TreeItemText = "MDIWindows" 54 | 55 | # The tree item's demos. 56 | TreeItemDemos = ( 57 | 'MDIDemo.py', 58 | 'MDISashDemo.py', 59 | 'MDIWindows_extended', 60 | ) 61 | 62 | return TreeItemText, TreeItemDemos 63 | 64 | 65 | def GetOverview(): 66 | """ 67 | Creates the wxHTML code to display on the tree item's Overview tab. 68 | """ 69 | 70 | wxHtmlOverviewStr = '''\ 71 | 72 |

MDIWindows

73 |

MDIWindows demos. 74 | 75 | ''' 76 | 77 | return wxHtmlOverviewStr 78 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/MDIWindows/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/MDIWindows/__init__.py -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/MiniFrame/MiniFrame_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports.--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | if __name__ == '__main__': 9 | app = wx.App() 10 | miniframe = wx.MiniFrame(None, -1, 'Minimal MiniFrame Demo', 11 | style=wx.DEFAULT_FRAME_STYLE) 12 | miniframe.Show() 13 | app.MainLoop() 14 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/MiniFrame/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ Returns the bitmap to be used in the demo tree for the User's package. """ 34 | 35 | # Get the image as PyEmbeddedImage 36 | image = frame16 = PyEmbeddedImage( 37 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAH5J" 38 | "REFUeJztkzEOgmAUg79H/gP0rIYNXQxuxEth4Fh1+IOSmIgPVrt0aZsObUjiCEp7ar3XPNyH" 39 | "KADdpSPitmmwq65yIIkG+Mm81q31ZUnOIuIMUBssmB9zigHor71texqnFAOW9A7IhnwE/Bvs" 40 | "b1DqKCI9pNegjr6x2ZZ8xxMlwIa5mQGHJAAAAABJRU5ErkJggg==") 41 | 42 | # Return the bitmap to use in the wxPython demo tree control. 43 | return image 44 | 45 | 46 | def GetDemos(): 47 | """ 48 | Returns all the demo names in the package, together with the 49 | tree item name which will go in the wxPython demo tree control. 50 | """ 51 | 52 | # The tree item text. 53 | TreeItemText = "MiniFrame" 54 | 55 | # The tree item's demos. 56 | TreeItemDemos = ( 57 | 'MiniFrame_minimal', 58 | 'MiniFrame_extended', 59 | ) 60 | 61 | return TreeItemText, TreeItemDemos 62 | 63 | 64 | def GetOverview(): 65 | """ 66 | Creates the wxHTML code to display on the tree item's Overview tab. 67 | """ 68 | 69 | wxHtmlOverviewStr = '''\ 70 | 71 |

MiniFrame

72 |

MiniFrame demos. 73 | 74 | ''' 75 | 76 | return wxHtmlOverviewStr 77 | 78 | 79 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/MiniFrame/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/MiniFrame/__init__.py -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Wizard/Wizard_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports---------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | if 'phoenix' in wx.version(): 8 | from wx.adv import Wizard, WizardPageSimple 9 | else: # Classic 10 | from wx.wizard import Wizard, WizardPageSimple 11 | 12 | 13 | if __name__ == '__main__': 14 | app = wx.App(False) 15 | 16 | mywiz = Wizard(None, -1, 'My Wizard') 17 | mywiz.pages = [] 18 | 19 | for i in range(3): 20 | page = WizardPageSimple(mywiz) 21 | st = wx.StaticText(page, -1, 'Wizard Page %d' % (i + 1)) 22 | 23 | if mywiz.pages: 24 | previous_page = mywiz.pages[-1] 25 | page.SetPrev(previous_page) 26 | previous_page.SetNext(page) 27 | mywiz.pages.append(page) 28 | 29 | mywiz.RunWizard(mywiz.pages[0]) 30 | mywiz.Destroy() 31 | app.MainLoop() 32 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Wizard/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ Returns the bitmap to be used in the demo tree for the User's package. """ 34 | 35 | # Get the image as PyEmbeddedImage 36 | image = frame16 = PyEmbeddedImage( 37 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAH5J" 38 | "REFUeJztkzEOgmAUg79H/gP0rIYNXQxuxEth4Fh1+IOSmIgPVrt0aZsObUjiCEp7ar3XPNyH" 39 | "KADdpSPitmmwq65yIIkG+Mm81q31ZUnOIuIMUBssmB9zigHor71texqnFAOW9A7IhnwE/Bvs" 40 | "b1DqKCI9pNegjr6x2ZZ8xxMlwIa5mQGHJAAAAABJRU5ErkJggg==") 41 | 42 | # Return the bitmap to use in the wxPython demo tree control. 43 | return image 44 | 45 | 46 | def GetDemos(): 47 | """ 48 | Returns all the demo names in the package, together with the 49 | tree item name which will go in the wxPython demo tree control. 50 | """ 51 | 52 | # The tree item text. 53 | TreeItemText = "Wizard" 54 | 55 | # The tree item's demos. 56 | TreeItemDemos = ( 57 | 'Wizard_minimal', 58 | 'Wizard_extended', 59 | 'Wizard_xwx', 60 | ) 61 | 62 | return TreeItemText, TreeItemDemos 63 | 64 | 65 | def GetOverview(): 66 | """ 67 | Creates the wxHTML code to display on the tree item's Overview tab. 68 | """ 69 | 70 | wxHtmlOverviewStr = '''\ 71 | 72 |

Wizard

73 |

Wizard demos. 74 | 75 | ''' 76 | 77 | return wxHtmlOverviewStr 78 | 79 | 80 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Wizard/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/Wizard/__init__.py -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Wizard/bitmaps/wiztest1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/Wizard/bitmaps/wiztest1.bmp -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/Wizard/bitmaps/wiztest2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/Wizard/bitmaps/wiztest2.bmp -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = frame16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAH5J" 40 | "REFUeJztkzEOgmAUg79H/gP0rIYNXQxuxEth4Fh1+IOSmIgPVrt0aZsObUjiCEp7ar3XPNyH" 41 | "KADdpSPitmmwq65yIIkG+Mm81q31ZUnOIuIMUBssmB9zigHor71texqnFAOW9A7IhnwE/Bvs" 42 | "b1DqKCI9pNegjr6x2ZZ8xxMlwIa5mQGHJAAAAABJRU5ErkJggg==") 43 | 44 | # Return the bitmap to use in the wxPython demo tree control. 45 | return image 46 | 47 | 48 | def GetDemos(): 49 | """ 50 | Returns all the demo names in the package, together with the 51 | tree item name which will go in the wxPython demo tree control. 52 | """ 53 | 54 | # The tree item text. 55 | TreeItemText = "Frames and Dialogs" 56 | 57 | # The tree item's demos. 58 | TreeItemDemos = () 59 | 60 | return TreeItemText, TreeItemDemos 61 | 62 | 63 | def GetOverview(): 64 | """ 65 | Creates the wxHTML code to display on the tree item's Overview tab. 66 | """ 67 | 68 | wxHtmlOverviewStr = '''\ 69 | 70 |

Frames and Dialogs

71 |

Various wx.Frame and wx.Dialog demos 72 | 73 | ''' 74 | 75 | return wxHtmlOverviewStr 76 | 77 | -------------------------------------------------------------------------------- /100_Frames_and_Dialogs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/100_Frames_and_Dialogs/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/AboutBox/AboutBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | if not 'phoenix' in wx.version(): 9 | wx.adv = wx 10 | else: 11 | import wx.adv 12 | 13 | if __name__ == '__main__': 14 | app = wx.App() 15 | 16 | info = wx.adv.AboutDialogInfo() 17 | info.Name = "Hello World" 18 | info.Version = "1.2.3" 19 | info.Copyright = "(C) 2006 Programmers and Coders Everywhere" 20 | info.Description = """\ 21 | A \"hello world\" program is a software program that prints out 22 | \"Hello world!\" on a display device. It is used in many introductory 23 | tutorials for teaching a programming language. 24 | 25 | Such a program is typically one of the simplest programs possible 26 | in a computer language. A \"hello world\" program can be a useful 27 | sanity test to make sure that a language's compiler, development 28 | environment, and run-time environment are correctly installed. 29 | """ 30 | info.WebSite = ("http://en.wikipedia.org/wiki/Hello_world", 31 | "Hello World home page") 32 | info.Developers = ("Joe Programmer", 33 | "Jane Coder", 34 | "Vippy the Mascot") 35 | 36 | info.License = "blah " * 250 + "\n\n" + "yadda " * 100 37 | 38 | # Then we call wx.AboutBox giving it that info object 39 | wx.adv.AboutBox(info) 40 | 41 | app.MainLoop() 42 | -------------------------------------------------------------------------------- /101_Common_Dialogs/AboutBox/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "AboutBox" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'AboutBox_minimal.py', 61 | 'AboutBox_extended.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

AboutBox

75 |

AboutBox demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/AboutBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/AboutBox/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/ColourDialog/ColourDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | dlg = wx.ColourDialog(None) 13 | if dlg.ShowModal() == wx.ID_OK: 14 | print('%s' % str(dlg.GetColourData().GetColour().Get())) 15 | dlg.Destroy() 16 | 17 | app.MainLoop() 18 | -------------------------------------------------------------------------------- /101_Common_Dialogs/ColourDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "ColourDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'ColourDialog_extended.py', 61 | 'ColourDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

ColourDialog

75 |

ColourDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/ColourDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/ColourDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/DirDialog/DirDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | dlg = wx.DirDialog(None, "Choose a directory:") 13 | if dlg.ShowModal() == wx.ID_OK: 14 | print('%s' % dlg.GetPath()) 15 | dlg.Destroy() 16 | 17 | app.MainLoop() 18 | -------------------------------------------------------------------------------- /101_Common_Dialogs/DirDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "DirDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'DirDialog_extended.py', 61 | 'DirDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

DirDialog

75 |

DirDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/DirDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/DirDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/FileDialog/FileDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | dlg = wx.FileDialog(None) 13 | if dlg.ShowModal() == wx.ID_OK: 14 | print('%s' % dlg.GetPath()) 15 | dlg.Destroy() 16 | 17 | app.MainLoop() 18 | -------------------------------------------------------------------------------- /101_Common_Dialogs/FileDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "FileDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'FileDialog_extended.py', 61 | 'FileDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

FileDialog

75 |

FileDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/FileDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/FileDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/FindReplaceDialog/FindReplaceDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | frame = wx.Frame(None, wx.ID_ANY, 'Minimal FindReplaceDialog Demo') 13 | dlg = wx.FindReplaceDialog(frame, wx.FindReplaceData(), 14 | "Find & Replace", wx.FR_REPLACEDIALOG) 15 | dlg.Show(True) 16 | def OnClose(event): 17 | frame.Close(True) 18 | dlg.Bind(wx.EVT_FIND_CLOSE, OnClose) 19 | 20 | app.MainLoop() 21 | -------------------------------------------------------------------------------- /101_Common_Dialogs/FindReplaceDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "FindReplaceDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'FindReplaceDialog_extended.py', 61 | 'FindReplaceDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

FindReplaceDialog

75 |

FindReplaceDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/FindReplaceDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/FindReplaceDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/FontDialog/FontDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | dlg = wx.FontDialog(None, wx.FontData()) 13 | 14 | if dlg.ShowModal() == wx.ID_OK: 15 | data = dlg.GetFontData() 16 | font = data.GetChosenFont() 17 | colour = data.GetColour() 18 | print('%s' % font.GetFaceName()) 19 | print('%s' % font.GetPointSize()) 20 | print('%s' % colour.Get()) 21 | dlg.Destroy() 22 | 23 | app.MainLoop() 24 | -------------------------------------------------------------------------------- /101_Common_Dialogs/FontDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "FontDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'FontDialog_extended.py', 61 | 'FontDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

FontDialog

75 |

FontDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | -------------------------------------------------------------------------------- /101_Common_Dialogs/FontDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/FontDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/MessageDialog/MessageDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports---------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.lib.dialogs 8 | 9 | 10 | if __name__ == '__main__': 11 | app = wx.App() 12 | 13 | msg = "I'm a MessageDialog \n\n" * 5 14 | cap = "MessageDialog Caption" 15 | sty = wx.ICON_INFORMATION 16 | dlg = wx.MessageDialog(None, message=msg, caption=cap, style=sty) 17 | dlg.ShowModal() 18 | dlg.Destroy() 19 | 20 | app.MainLoop() 21 | -------------------------------------------------------------------------------- /101_Common_Dialogs/MessageDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "MessageDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'MessageDialog_extended.py', 61 | 'MessageDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

MessageDialog

75 |

MessageDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/MessageDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/MessageDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/MultiChoiceDialog/MultiChoiceDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | lst = ['apple', 'pear', 'banana', 'coconut', 'orange', 'grape', 'peach', 13 | 'pineapple', 'blueberry', 'raspberry', 'blackberry', 'strawberry', 14 | 'apricot', 'mango', 'gooseberry'] 15 | dlg = wx.MultiChoiceDialog(None, 16 | "Pick some fruit from this list...", 17 | "wx.MultiChoiceDialog", sorted(lst)) 18 | if dlg.ShowModal() == wx.ID_OK: 19 | print(dlg.GetSelections()) 20 | dlg.Destroy() 21 | 22 | app.MainLoop() 23 | -------------------------------------------------------------------------------- /101_Common_Dialogs/MultiChoiceDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "MultiChoiceDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'MultiChoiceDialog_extended.py', 61 | 'MultiChoiceDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

MultiChoiceDialog

75 |

MultiChoiceDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | -------------------------------------------------------------------------------- /101_Common_Dialogs/MultiChoiceDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/MultiChoiceDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/PageSetupDialog/PageSetupDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | data = wx.PageSetupDialogData() 13 | data.SetMarginTopLeft((15, 15)) 14 | data.SetMarginBottomRight((15, 15)) 15 | ## data.SetDefaultMinMargins(True) 16 | data.SetPaperId(wx.PAPER_LETTER) 17 | 18 | dlg = wx.PageSetupDialog(None, data) 19 | 20 | if dlg.ShowModal() == wx.ID_OK: 21 | data = dlg.GetPageSetupData() 22 | tl = data.GetMarginTopLeft() 23 | br = data.GetMarginBottomRight() 24 | print('Margins are: %s %s\n' % (str(tl), str(br))) 25 | 26 | dlg.Destroy() 27 | 28 | app.MainLoop() 29 | -------------------------------------------------------------------------------- /101_Common_Dialogs/PageSetupDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "PageSetupDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'PageSetupDialog_extended.py', 61 | 'PageSetupDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

PageSetupDialog

75 |

PageSetupDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | -------------------------------------------------------------------------------- /101_Common_Dialogs/PageSetupDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/PageSetupDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/PrintDialog/PrintDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | data = wx.PrintDialogData() 13 | 14 | data.EnableSelection(True) 15 | data.EnablePrintToFile(True) 16 | data.EnablePageNumbers(True) 17 | data.SetMinPage(1) 18 | data.SetMaxPage(5) 19 | ## data.SetAllPages(True) 20 | 21 | dlg = wx.PrintDialog(None, data) 22 | 23 | if dlg.ShowModal() == wx.ID_OK: 24 | data = dlg.GetPrintDialogData() 25 | print('GetAllPages: %d\n' % data.GetAllPages()) 26 | 27 | dlg.Destroy() 28 | 29 | app.MainLoop() 30 | -------------------------------------------------------------------------------- /101_Common_Dialogs/PrintDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "PrintDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'PrintDialog_extended.py', 61 | 'PrintDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

PrintDialog

75 |

PrintDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | -------------------------------------------------------------------------------- /101_Common_Dialogs/PrintDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/PrintDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/ProgressDialog/ProgressDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports---------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | max = 10 13 | dlg = wx.ProgressDialog("Minimal ProgressDialog Demo", 14 | "An informative message", 15 | maximum=max, 16 | parent=None, 17 | style=0 18 | | wx.PD_APP_MODAL 19 | | wx.PD_CAN_ABORT 20 | ## | wx.PD_CAN_SKIP 21 | | wx.PD_ELAPSED_TIME 22 | | wx.PD_ESTIMATED_TIME 23 | | wx.PD_REMAINING_TIME 24 | ## | wx.PD_AUTO_HIDE 25 | ) 26 | 27 | keepGoing = True 28 | count = 0 29 | 30 | while keepGoing and count < max: 31 | count += 1 32 | wx.MilliSleep(1000) 33 | wx.Yield() 34 | 35 | if count >= max: 36 | (keepGoing, skip) = dlg.Update(count, "Done.") 37 | elif count >= max / 2: 38 | (keepGoing, skip) = dlg.Update(count, "Half-time!") 39 | else: 40 | (keepGoing, skip) = dlg.Update(count) 41 | 42 | dlg.Destroy() 43 | 44 | app.MainLoop() 45 | -------------------------------------------------------------------------------- /101_Common_Dialogs/ProgressDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "ProgressDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'ProgressDialog_extended.py', 61 | 'ProgressDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

ProgressDialog

75 |

ProgressDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/ProgressDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/ProgressDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/SingleChoiceDialog/SingleChoiceDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | dlg = wx.SingleChoiceDialog(None, 13 | 'Minimal SingleChoiceDialog Demo', 'The Caption', 14 | ['zero', 'one', 'two', 'three', 'four', 'five', 15 | 'six', 'seven', 'eight', 'nine', 'ten'], 16 | wx.CHOICEDLG_STYLE 17 | ) 18 | if dlg.ShowModal() == wx.ID_OK: 19 | print(dlg.GetStringSelection()) 20 | dlg.Destroy() 21 | 22 | app.MainLoop() 23 | -------------------------------------------------------------------------------- /101_Common_Dialogs/SingleChoiceDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "SingleChoiceDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'SingleChoiceDialog_extended.py', 61 | 'SingleChoiceDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

SingleChoiceDialog

75 |

SingleChoiceDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | -------------------------------------------------------------------------------- /101_Common_Dialogs/SingleChoiceDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/SingleChoiceDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/TextEntryDialog/TextEntryDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | 12 | dlg = wx.TextEntryDialog(None, 13 | 'What is your favorite programming language?', 14 | 'Eh??', 'Python') 15 | dlg.SetValue("Python is the best!") 16 | if dlg.ShowModal() == wx.ID_OK: 17 | print(dlg.GetValue()) 18 | dlg.Destroy() 19 | 20 | app.MainLoop() 21 | -------------------------------------------------------------------------------- /101_Common_Dialogs/TextEntryDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "TextEntryDialog" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = ( 60 | 'TextEntryDialog_extended.py', 61 | 'TextEntryDialog_minimal.py', 62 | ) 63 | 64 | return TreeItemText, TreeItemDemos 65 | 66 | 67 | def GetOverview(): 68 | """ 69 | Creates the wxHTML code to display on the tree item's Overview tab. 70 | """ 71 | 72 | wxHtmlOverviewStr = '''\ 73 | 74 |

TextEntryDialog

75 |

TextEntryDialog demos. 76 | 77 | ''' 78 | 79 | return wxHtmlOverviewStr 80 | 81 | -------------------------------------------------------------------------------- /101_Common_Dialogs/TextEntryDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/TextEntryDialog/__init__.py -------------------------------------------------------------------------------- /101_Common_Dialogs/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = dialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAKRJ" 40 | "REFUeJytk0EOwjAMBGdRH+DvVOJVqLfCBZVbxadaJc8yB5RCSguEMhdLK3uzshWZGVuomkPj" 41 | "vw73114VQHtqkS5fD7q3SMLM2AFFw/P+KjmWIh0B7gkScYxFFYDu3Lm7exhCUQXczB4GpSYv" 42 | "Bn9J8AwwNS/pyWBa4tKC6n29qmdnTKKk7FRxjKt6Ikvg7oQhTDUlWNKzBPMXStDW37j73PKe" 43 | "G2AyEYLJPQvVAAAAAElFTkSuQmCC") 44 | 45 | # Return the bitmap to use in the wxPython demo tree control. 46 | return image 47 | 48 | 49 | def GetDemos(): 50 | """ 51 | Returns all the demo names in the package, together with the 52 | tree item name which will go in the wxPython demo tree control. 53 | """ 54 | 55 | # The tree item text. 56 | TreeItemText = "Common Dialogs" 57 | 58 | # The tree item's demos. 59 | TreeItemDemos = () 60 | 61 | return TreeItemText, TreeItemDemos 62 | 63 | 64 | def GetOverview(): 65 | """ 66 | Creates the wxHTML code to display on the tree item's Overview tab. 67 | """ 68 | 69 | wxHtmlOverviewStr = '''\ 70 | 71 |

Common Dialogs

72 |

Various common dialog demos. 73 | 74 | ''' 75 | 76 | return wxHtmlOverviewStr 77 | 78 | -------------------------------------------------------------------------------- /101_Common_Dialogs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/101_Common_Dialogs/__init__.py -------------------------------------------------------------------------------- /102_More_Dialogs/ImageBrowser/ImageBrowser_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports.-------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.lib.imagebrowser as IB 8 | 9 | 10 | if __name__ == '__main__': 11 | app = wx.App(False) 12 | 13 | dlg = IB.ImageDialog(None) 14 | dlg.Centre() 15 | if dlg.ShowModal() == wx.ID_OK: 16 | print("You Selected File: " + dlg.GetFile()) 17 | else: 18 | print("You pressed Cancel") 19 | dlg.Destroy() 20 | 21 | app.MainLoop() 22 | -------------------------------------------------------------------------------- /102_More_Dialogs/ImageBrowser/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = moredialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABtklEQVR4nJ2STWsTURSGn5NM" 40 | "W8Gv0pYuagmiNoiiDajoDOnCrRsVlBbdG/oDuroEAmXEhTsXIqV0XfADd67cmGQWIkhBrGJD" 41 | "60JBMWiwX0NvjwvjMGkmVD2bc+89vM95z73XUVV2C+dM+mrf5f0lEOpPG6WtV/ZJVPOn/V0J" 42 | "N87d5PSlk1i1vP387rE/7QNgikac5gIRvyNgz6Bl5FaIVcv8I8v6F4OIYIoGB+ggDptZIG1Z" 43 | "s1+xapG0RaT0uyKy1wFQNW3ywzPDnB3OkRKlW0GdLlQtV2a/s0qZ5ZVjLG2vfHLioqAc4OZd" 44 | "gnLA0f5BvJEjkArZYpVva3VULaeyvYRWOZHp49mb8ICTJHbzLi8LH1h+/YON9Q02U5tcG8+g" 45 | "bDMzFzCwb4BarQZd1CNAXByUAxoPGtF+6vYUPw/eR1DunL9L7lAOb8xDVfs7OojnocwQ3b2j" 46 | "ILD4fpHJ8clo7BYH8eyNeVRfVHHzLpWlCs8XPpISeHivysTFiXbAzs7xsQrXC4wu5Mgez1Lp" 47 | "uRDV2xyISMtT/oElnSc6UNXEO0g6bwHs7PAv4ZiiEVNs/4l/DfhvZTN+AbNUzvDHFuq4AAAA" 48 | "AElFTkSuQmCC") 49 | 50 | # Return the bitmap to use in the wxPython demo tree control. 51 | return image 52 | 53 | 54 | def GetDemos(): 55 | """ 56 | Returns all the demo names in the package, together with the 57 | tree item name which will go in the wxPython demo tree control. 58 | """ 59 | 60 | # The tree item text. 61 | TreeItemText = "ImageBrowser" 62 | 63 | # The tree item's demos. 64 | TreeItemDemos = ( 65 | 'ImageBrowser_extended.py', 66 | 'ImageBrowser_minimal.py', 67 | ) 68 | 69 | return TreeItemText, TreeItemDemos 70 | 71 | 72 | def GetOverview(): 73 | """ 74 | Creates the wxHTML code to display on the tree item's Overview tab. 75 | """ 76 | 77 | wxHtmlOverviewStr = '''\ 78 | 79 |

ImageBrowser

80 |

ImageBrowser demos. 81 | 82 | ''' 83 | 84 | return wxHtmlOverviewStr 85 | 86 | -------------------------------------------------------------------------------- /102_More_Dialogs/ImageBrowser/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/102_More_Dialogs/ImageBrowser/__init__.py -------------------------------------------------------------------------------- /102_More_Dialogs/ScrolledMessageDialog/ScrolledMessageDialog_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.lib.dialogs 8 | 9 | 10 | if __name__ == '__main__': 11 | app = wx.App() 12 | 13 | message = "I'm a ScrolledMessageDialog.\n\n" * 10 14 | dlg = wx.lib.dialogs.ScrolledMessageDialog(None, 15 | message, "Minimal ScrolledMessageDialog Demo") 16 | dlg.ShowModal() 17 | dlg.Destroy() 18 | 19 | app.MainLoop() 20 | -------------------------------------------------------------------------------- /102_More_Dialogs/ScrolledMessageDialog/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = moredialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABtklEQVR4nJ2STWsTURSGn5NM" 40 | "W8Gv0pYuagmiNoiiDajoDOnCrRsVlBbdG/oDuroEAmXEhTsXIqV0XfADd67cmGQWIkhBrGJD" 41 | "60JBMWiwX0NvjwvjMGkmVD2bc+89vM95z73XUVV2C+dM+mrf5f0lEOpPG6WtV/ZJVPOn/V0J" 42 | "N87d5PSlk1i1vP387rE/7QNgikac5gIRvyNgz6Bl5FaIVcv8I8v6F4OIYIoGB+ggDptZIG1Z" 43 | "s1+xapG0RaT0uyKy1wFQNW3ywzPDnB3OkRKlW0GdLlQtV2a/s0qZ5ZVjLG2vfHLioqAc4OZd" 44 | "gnLA0f5BvJEjkArZYpVva3VULaeyvYRWOZHp49mb8ICTJHbzLi8LH1h+/YON9Q02U5tcG8+g" 45 | "bDMzFzCwb4BarQZd1CNAXByUAxoPGtF+6vYUPw/eR1DunL9L7lAOb8xDVfs7OojnocwQ3b2j" 46 | "ILD4fpHJ8clo7BYH8eyNeVRfVHHzLpWlCs8XPpISeHivysTFiXbAzs7xsQrXC4wu5Mgez1Lp" 47 | "uRDV2xyISMtT/oElnSc6UNXEO0g6bwHs7PAv4ZiiEVNs/4l/DfhvZTN+AbNUzvDHFuq4AAAA" 48 | "AElFTkSuQmCC") 49 | 50 | # Return the bitmap to use in the wxPython demo tree control. 51 | return image 52 | 53 | 54 | def GetDemos(): 55 | """ 56 | Returns all the demo names in the package, together with the 57 | tree item name which will go in the wxPython demo tree control. 58 | """ 59 | 60 | # The tree item text. 61 | TreeItemText = "ScrolledMessageDialog" 62 | 63 | # The tree item's demos. 64 | TreeItemDemos = ( 65 | 'ScrolledMessageDialog_extended.py', 66 | 'ScrolledMessageDialog_minimal.py', 67 | ) 68 | 69 | return TreeItemText, TreeItemDemos 70 | 71 | 72 | def GetOverview(): 73 | """ 74 | Creates the wxHTML code to display on the tree item's Overview tab. 75 | """ 76 | 77 | wxHtmlOverviewStr = '''\ 78 | 79 |

ScrolledMessageDialog

80 |

ScrolledMessageDialog demos. 81 | 82 | ''' 83 | 84 | return wxHtmlOverviewStr 85 | -------------------------------------------------------------------------------- /102_More_Dialogs/ScrolledMessageDialog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/102_More_Dialogs/ScrolledMessageDialog/__init__.py -------------------------------------------------------------------------------- /102_More_Dialogs/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = moredialog16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABtklEQVR4nJ2STWsTURSGn5NM" 40 | "W8Gv0pYuagmiNoiiDajoDOnCrRsVlBbdG/oDuroEAmXEhTsXIqV0XfADd67cmGQWIkhBrGJD" 41 | "60JBMWiwX0NvjwvjMGkmVD2bc+89vM95z73XUVV2C+dM+mrf5f0lEOpPG6WtV/ZJVPOn/V0J" 42 | "N87d5PSlk1i1vP387rE/7QNgikac5gIRvyNgz6Bl5FaIVcv8I8v6F4OIYIoGB+ggDptZIG1Z" 43 | "s1+xapG0RaT0uyKy1wFQNW3ywzPDnB3OkRKlW0GdLlQtV2a/s0qZ5ZVjLG2vfHLioqAc4OZd" 44 | "gnLA0f5BvJEjkArZYpVva3VULaeyvYRWOZHp49mb8ICTJHbzLi8LH1h+/YON9Q02U5tcG8+g" 45 | "bDMzFzCwb4BarQZd1CNAXByUAxoPGtF+6vYUPw/eR1DunL9L7lAOb8xDVfs7OojnocwQ3b2j" 46 | "ILD4fpHJ8clo7BYH8eyNeVRfVHHzLpWlCs8XPpISeHivysTFiXbAzs7xsQrXC4wu5Mgez1Lp" 47 | "uRDV2xyISMtT/oElnSc6UNXEO0g6bwHs7PAv4ZiiEVNs/4l/DfhvZTN+AbNUzvDHFuq4AAAA" 48 | "AElFTkSuQmCC") 49 | 50 | # Return the bitmap to use in the wxPython demo tree control. 51 | return image 52 | 53 | 54 | def GetDemos(): 55 | """ 56 | Returns all the demo names in the package, together with the 57 | tree item name which will go in the wxPython demo tree control. 58 | """ 59 | 60 | # The tree item text. 61 | TreeItemText = "More Dialogs" 62 | 63 | # The tree item's demos. 64 | TreeItemDemos = () 65 | 66 | return TreeItemText, TreeItemDemos 67 | 68 | 69 | def GetOverview(): 70 | """ 71 | Creates the wxHTML code to display on the tree item's Overview tab. 72 | """ 73 | 74 | wxHtmlOverviewStr = '''\ 75 | 76 |

More Dialogs

77 |

More dialog demos. 78 | 79 | ''' 80 | 81 | return wxHtmlOverviewStr 82 | 83 | -------------------------------------------------------------------------------- /102_More_Dialogs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/102_More_Dialogs/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/BitmapButton/BitmapButton_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal BitmapButton Demo - wxPython %s' % wx.version()) 12 | bmp = wx.Bitmap('bitmaps/phoenix32.png', wx.BITMAP_TYPE_PNG) 13 | bmpBtn1 = wx.BitmapButton(frame, -1, bmp, pos=(32, 32)) 14 | bmpBtn2 = wx.BitmapButton(frame, -1, bmp, pos=(128, 32)) 15 | frame.Show() 16 | app.MainLoop() 17 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/BitmapButton/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/BitmapButton/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/BitmapButton/bitmaps/phoenix32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/BitmapButton/bitmaps/phoenix32.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/BitmapButton/bitmaps/robin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/BitmapButton/bitmaps/robin.jpg -------------------------------------------------------------------------------- /103_Core_Windows_Controls/BitmapButton/bitmaps/test2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/BitmapButton/bitmaps/test2.bmp -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/Button_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports.-------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | if __name__ == '__main__': 10 | def OnButton(event): 11 | print('Button clicked!') 12 | 13 | app = wx.App() 14 | frame = wx.Frame(None, -1, 'Minimal Button Demo') 15 | frame.button = wx.Button(frame, -1, 'I am a wx.Button') 16 | frame.button.Bind(wx.EVT_BUTTON, OnButton) 17 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 18 | frame.Show() 19 | app.MainLoop() 20 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = button16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAAA" 40 | "6UlEQVR4AY3RQW6EMAyFYeNB4vxsKi7Egs1wFKDTJgDE6R8xZdOA+mRVNP4eCEZFpOu6vu+f" 41 | "twHAhLRtOwxD/EdgYA0h8A/NeV6c89lhBYCBy7MQgnEtuTwekinEaEzOsyrOgm7bZpYKZsFs" 42 | "5++fSYcAGLg0M6q/t1HJpDifANZ1XZdl9ilf3n9fDCsPA6tz7vX6nKZxHKebAcDAGlPSc1W1" 43 | "uAgrAAyaXjrzNXOBgd8FYrcBvAshHF/NYuQ0S9MKwCVY9/24u8Qo2bfgkBUABi7hqlpVFSXW" 44 | "F790BMDAQuq6bprm4zYAGPgHG5TdP+C2jIkAAAAASUVORK5CYII=") 45 | 46 | # Return the bitmap to use in the wxPython demo tree control. 47 | return image 48 | 49 | 50 | def GetDemos(): 51 | """ 52 | Returns all the demo names in the package, together with the 53 | tree item name which will go in the wxPython demo tree control. 54 | """ 55 | 56 | # The tree item text. 57 | TreeItemText = "Button" 58 | 59 | # The tree item's demos. 60 | TreeItemDemos = ( 61 | 'Button_extended.py', 62 | 'Button_minimal.py', 63 | ) 64 | 65 | return TreeItemText, TreeItemDemos 66 | 67 | 68 | def GetOverview(): 69 | """ 70 | Creates the wxHTML code to display on the tree item's Overview tab. 71 | """ 72 | 73 | wxHtmlOverviewStr = '''\ 74 | 75 |

Button

76 |

Button demos. 77 | 78 | ''' 79 | 80 | return wxHtmlOverviewStr 81 | 82 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Button/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/bitmaps/pencil16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Button/bitmaps/pencil16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/bitmaps/phoenix16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Button/bitmaps/phoenix16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/bitmaps/snakey12_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Button/bitmaps/snakey12_16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/bitmaps/snakey16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Button/bitmaps/snakey16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Button/bitmaps/undo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Button/bitmaps/undo16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/CheckBox/CheckBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports.-------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, 'Minimal CheckBox Demo') 12 | panel = wx.Panel(frame, wx.ID_ANY) 13 | cb = wx.CheckBox(panel, wx.ID_ANY, 'wx.CheckBox', pos=(20, 20)) 14 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 15 | frame.Show() 16 | app.MainLoop() 17 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/CheckBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/CheckBox/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/CheckListBox/CheckListBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal CheckListBox Demo') 12 | sampleList = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 13 | 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 14 | 'thirteen', 'fourteen'] 15 | clb = wx.CheckListBox(frame, -1, choices=sampleList) 16 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 17 | frame.Show() 18 | app.MainLoop() 19 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/CheckListBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/CheckListBox/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Choice/Choice_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal CheckListBox Demo') 12 | sampleList1 = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 13 | 'seven', 'eight', 'nine', 'ten'] 14 | sampleList2 = ['Choice %d' % i for i in range(100)] 15 | c1 = wx.Choice(frame, -1, choices=sampleList1, pos=(20, 20)) 16 | c1.Select(3) 17 | c2 = wx.Choice(frame, -1, choices=sampleList2, pos=(20, 60)) 18 | c2.Select(0) 19 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 20 | frame.Show() 21 | app.MainLoop() 22 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Choice/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Choice/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ComboBox/ComboBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal ComboBox Demo") 12 | 13 | def OnComboBox(event): 14 | print(event.GetString()) 15 | 16 | sampleList = ["Default value", "one", "two", "three", "42", "wxPython", 17 | "wx.CB_DROPDOWN", "wx.CB_SORT", "wx.EVT_COMBOBOX", 18 | "__init__.py", "@User"] 19 | cb1 = wx.ComboBox(frame, wx.ID_ANY, "Default value", 20 | pos=(20, 20), choices=sampleList, 21 | style=wx.CB_DROPDOWN) 22 | 23 | cb2 = wx.ComboBox(frame, wx.ID_ANY, "wx.CB_SORT", 24 | pos=(20, 50), choices=sampleList, 25 | style=wx.CB_DROPDOWN | wx.CB_SORT) 26 | cb2.Bind(wx.EVT_COMBOBOX, OnComboBox) 27 | 28 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 29 | frame.Show() 30 | app.MainLoop() 31 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ComboBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ComboBox/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/CommandLinkButton/CommandLinkButton_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.adv 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal CommandLinkButton Demo') 12 | 13 | cmd = wx.adv.CommandLinkButton(frame, -1, "wx.CommandLinkButton", 14 | """\ 15 | This type of button includes both a main label and a 'note' that is meant to 16 | contain a description of what the button does or what it is used for. On 17 | Windows 7 it is a new native widget type, on the other platforms it is 18 | implemented generically.""", pos=(25,25)) 19 | 20 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 21 | frame.Show() 22 | app.MainLoop() 23 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/CommandLinkButton/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/CommandLinkButton/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Gauge/Gauge_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal Gauge Demo") 12 | 13 | gauge1 = wx.Gauge(frame, wx.ID_ANY, 100, pos=(20, 20), size=(250, 25)) 14 | gauge1.SetValue(20) 15 | 16 | gauge2 = wx.Gauge(frame, wx.ID_ANY, 50, pos=(20, 60), size=(250, 25)) 17 | gauge2.Pulse() 18 | 19 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 20 | frame.Show() 21 | app.MainLoop() 22 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Gauge/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Gauge/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ListBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ListBox/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ListCtrl/ListCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal ListCtrl Demo") 12 | 13 | wxPyVer = wx.version() 14 | lc = wx.ListCtrl(frame, -1, style=wx.LC_REPORT) 15 | lc.InsertColumn(0, "ListCtrl") 16 | lc.InsertColumn(1, "style") 17 | lc.InsertColumn(2, "wx.version()") 18 | for i in range(100): 19 | lc.InsertItem(i, 'InsertItem %d' % i) 20 | lc.SetItem(i, 1, 'wx.LC_REPORT') 21 | lc.SetItem(i, 2, 'wxPython ' + wxPyVer) 22 | lc.SetColumnWidth(0, 100) 23 | lc.SetColumnWidth(1, 125) 24 | lc.SetColumnWidth(2, wx.LIST_AUTOSIZE) 25 | 26 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wxPyVer) 27 | frame.Show() 28 | app.MainLoop() 29 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ListCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ListCtrl/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ListCtrl/bitmaps/sm_down.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ListCtrl/bitmaps/sm_down.bmp -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ListCtrl/bitmaps/sm_up.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ListCtrl/bitmaps/sm_up.bmp -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ListCtrl/bitmaps/smiles.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ListCtrl/bitmaps/smiles.bmp -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Menu/Menu_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal Menu Demo") 12 | 13 | def OnClose(event): 14 | frame.Close(True) 15 | 16 | menuBar = wx.MenuBar() 17 | menu = wx.Menu() 18 | menu.Append(wx.ID_EXIT, "&Exit\tCtrl+Q") 19 | menu.Bind(wx.EVT_MENU, OnClose) 20 | menuBar.Append(menu, "&File") 21 | frame.SetMenuBar(menuBar) 22 | 23 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 24 | frame.Show() 25 | app.MainLoop() 26 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Menu/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Menu/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Menu/bitmaps/book16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Menu/bitmaps/book16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Menu/bitmaps/smiley16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Menu/bitmaps/smiley16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/PopupMenu/PopupMenu_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal PopupMenu Demo") 12 | panel = wx.Panel(frame, wx.ID_ANY) 13 | 14 | def OnContextMenu(event): 15 | # Make a menu. 16 | menu = wx.Menu() 17 | # Show how to add the items to the menu. 18 | myID1 = 101 19 | myID2 = 102 20 | item1 = wx.MenuItem(menu, myID1, "One") 21 | item2 = wx.MenuItem(menu, myID2, "Two") 22 | if 'phoenix' in wx.version(): 23 | menu.Append(item1) 24 | menu.Append(item2) 25 | else: # Classic 26 | menu.AppendItem(item1) 27 | menu.AppendItem(item2) 28 | menu.Bind(wx.EVT_MENU, OnPopupOne, id=myID1) 29 | menu.Bind(wx.EVT_MENU, OnPopupTwo, id=myID2) 30 | # Popup the menu. If an item is selected then its handler 31 | # will be called before PopupMenu returns. 32 | evtObj = event.GetEventObject() 33 | evtObj.PopupMenu(menu) 34 | menu.Destroy() 35 | 36 | def OnPopupOne(event): 37 | print("Popup one") 38 | 39 | def OnPopupTwo(event): 40 | print("Popup two") 41 | 42 | panel.Bind(wx.EVT_CONTEXT_MENU, OnContextMenu) 43 | 44 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 45 | frame.Show() 46 | app.MainLoop() 47 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/PopupMenu/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/PopupMenu/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/PopupMenu/bitmaps/smiley16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/PopupMenu/bitmaps/smiley16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/PopupWindow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/PopupWindow/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/RadioBox/RadioBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal RadioBox Demo") 12 | 13 | sampleList = ["True", "False", "None"] 14 | rb = wx.RadioBox(frame, wx.ID_ANY, "wx.RadioBox", choices=sampleList, 15 | majorDimension=3, style=wx.RA_SPECIFY_COLS | wx.NO_BORDER) 16 | 17 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 18 | frame.Show() 19 | app.MainLoop() 20 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/RadioBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/RadioBox/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/RadioButton/RadioButton_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal RadioButton Demo") 12 | 13 | radio1 = wx.RadioButton(frame, -1, " Radio1 ", pos=(20, 20), style=wx.RB_GROUP) 14 | radio2 = wx.RadioButton(frame, -1, " Radio2 ", pos=(20, 40)) 15 | radio3 = wx.RadioButton(frame, -1, " Radio3 ", pos=(20, 60)) 16 | 17 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 18 | frame.Show() 19 | app.MainLoop() 20 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/RadioButton/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/RadioButton/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SashWindow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/SashWindow/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ScrolledWindow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ScrolledWindow/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ScrolledWindow/bitmaps/test2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ScrolledWindow/bitmaps/test2.bmp -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SearchCtrl/SearchCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal SearchCtrl Demo") 12 | 13 | search1 = wx.SearchCtrl(frame) 14 | 15 | search2 = wx.SearchCtrl(frame) 16 | search2.SetDescriptiveText("Set Descriptive Text") 17 | search2.ShowSearchButton(True) 18 | search2.ShowCancelButton(True) 19 | 20 | vbSizer = wx.BoxSizer(wx.VERTICAL) 21 | vbSizer.Add(search1, 0, wx.EXPAND | wx.ALL, 15) 22 | vbSizer.Add(search2, 0, wx.EXPAND | wx.ALL, 15) 23 | frame.SetSizer(vbSizer) 24 | 25 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 26 | frame.Show() 27 | app.MainLoop() 28 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SearchCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/SearchCtrl/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Slider/Slider_extended.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | 10 | #- wxPython Demo -------------------------------------------------------------- 11 | __wxPyOnlineDocs__ = 'https://wxpython.org/Phoenix/docs/html/wx.Slider.html' 12 | __wxPyDemoPanel__ = 'TestPanel' 13 | 14 | overview = """\ 15 | 16 |

wx.Slider

17 |

18 | A slider is a control with a handle which can be pulled back and forth to 19 | change the value. 20 |

21 | In Windows versions below Windows 95, a scrollbar is used 22 | to simulate the slider. 23 | In Windows 95, the track bar control is used. 24 | 25 | """ 26 | 27 | 28 | class TestPanel(wx.Panel): 29 | def __init__(self, parent, log): 30 | wx.Panel.__init__(self, parent, -1) 31 | self.log = log 32 | self.count = 0 33 | 34 | wx.StaticText(self, -1, "This is a wx.Slider.", (45, 15)) 35 | 36 | slider = wx.Slider( 37 | self, 100, 25, 1, 100, (30, 60), (250, -1), 38 | wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS 39 | ) 40 | 41 | slider.SetTickFreq(5) 42 | 43 | 44 | #- wxPy Demo ----------------------------------------------------------------- 45 | 46 | 47 | def runTest(frame, nb, log): 48 | win = TestPanel(nb, log) 49 | return win 50 | 51 | 52 | #- __main__ Demo -------------------------------------------------------------- 53 | 54 | 55 | class printLog: 56 | def __init__(self): 57 | pass 58 | 59 | def write(self, txt): 60 | print('%s' % txt) 61 | 62 | def WriteText(self, txt): 63 | print('%s' % txt) 64 | 65 | 66 | class TestFrame(wx.Frame): 67 | def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, 68 | pos=wx.DefaultPosition, size=wx.DefaultSize, 69 | style=wx.DEFAULT_FRAME_STYLE, name='frame'): 70 | wx.Frame.__init__(self, parent, id, title, pos, size, style, name) 71 | 72 | log = printLog() 73 | 74 | panel = TestPanel(self, log) 75 | self.Bind(wx.EVT_CLOSE, self.OnDestroy) 76 | 77 | 78 | def OnDestroy(self, event): 79 | self.Destroy() 80 | 81 | 82 | class TestApp(wx.App): 83 | def OnInit(self): 84 | gMainWin = TestFrame(None) 85 | gMainWin.SetTitle('Test Demo') 86 | gMainWin.Show() 87 | 88 | return True 89 | 90 | 91 | #- __main__ ------------------------------------------------------------------- 92 | 93 | 94 | if __name__ == '__main__': 95 | import sys 96 | print('Python %s.%s.%s %s' % sys.version_info[0:4]) 97 | print('wxPython %s' % wx.version()) 98 | gApp = TestApp(redirect=False, 99 | filename=None, 100 | useBestVisual=False, 101 | clearSigInt=True) 102 | 103 | gApp.MainLoop() 104 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Slider/Slider_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal Slider Demo") 12 | 13 | slider = wx.Slider(frame, wx.ID_ANY, 14 | value=25, minValue=0, maxValue=100, 15 | style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) 16 | slider.SetTickFreq(5) 17 | 18 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 19 | frame.Show() 20 | app.MainLoop() 21 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Slider/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Slider/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SpinButton/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/SpinButton/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SpinCtrl/SpinCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | 10 | if __name__ == '__main__': 11 | app = wx.App() 12 | frame = wx.Frame(None, wx.ID_ANY, "Minimal SpinCtrl Demo") 13 | 14 | def OnSpin(event): 15 | spinctrl = event.GetEventObject() 16 | print('OnSpin: %d\n' % spinctrl.GetValue()) 17 | 18 | def OnText(event): 19 | spinctrl = event.GetEventObject() 20 | print('OnText: %d\n' % spinctrl.GetValue()) 21 | 22 | spinctrl = wx.SpinCtrl(frame, wx.ID_ANY, "", (30, 50)) 23 | spinctrl.SetRange(1, 100) 24 | spinctrl.SetValue(5) 25 | 26 | spinctrl.Bind(wx.EVT_SPINCTRL, OnSpin) 27 | spinctrl.Bind(wx.EVT_TEXT, OnText) 28 | 29 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 30 | frame.Show() 31 | app.MainLoop() -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SpinCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/SpinCtrl/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SpinCtrlDouble/SpinCtrlDouble_extended.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | #- wxPython Demo -------------------------------------------------------------- 10 | __wxPyOnlineDocs__ = 'https://wxpython.org/Phoenix/docs/html/wx.SpinCtrlDouble.html' 11 | __wxPyDemoPanel__ = 'TestPanel' 12 | 13 | overview = """ 14 |

wx.SpinCtrlDouble

15 | 16 | Essentially the same as a wx.SpinCtrl, except it can handle floating 17 | point numbers, and fractional increments. 18 | 19 | 20 | """ 21 | 22 | #---------------------------------------------------------------------- 23 | 24 | class TestPanel(wx.Panel): 25 | def __init__(self, parent, log): 26 | self.log = log 27 | wx.Panel.__init__(self, parent, -1) 28 | 29 | wx.StaticText(self, wx.ID_ANY, "wx.SpinCtrlDouble:", pos=(25, 25)) 30 | spin = wx.SpinCtrlDouble(self, value='0.00', pos=(75, 50), size=(80, -1), 31 | min=-5.0, max=25.25, inc=0.25) 32 | spin.SetDigits(2) 33 | 34 | 35 | #- wxPy Demo ----------------------------------------------------------------- 36 | 37 | 38 | def runTest(frame, nb, log): 39 | """Used for the wxPython Demo Notebook.""" 40 | win = TestPanel(nb, log) 41 | return win 42 | 43 | 44 | #- __main__ Demo -------------------------------------------------------------- 45 | 46 | 47 | class printLog: 48 | def __init__(self): 49 | pass 50 | 51 | def write(self, txt): 52 | print('%s' % txt) 53 | 54 | def WriteText(self, txt): 55 | print('%s' % txt) 56 | 57 | 58 | class TestFrame(wx.Frame): 59 | def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, 60 | pos=wx.DefaultPosition, size=wx.DefaultSize, 61 | style=wx.DEFAULT_FRAME_STYLE, name='frame'): 62 | wx.Frame.__init__(self, parent, id, title, pos, size, style, name) 63 | 64 | log = printLog() 65 | 66 | panel = TestPanel(self, log) 67 | self.Bind(wx.EVT_CLOSE, self.OnDestroy) 68 | 69 | 70 | def OnDestroy(self, event): 71 | self.Destroy() 72 | 73 | 74 | class TestApp(wx.App): 75 | def OnInit(self): 76 | gMainWin = TestFrame(None) 77 | gMainWin.SetTitle('Test Demo') 78 | gMainWin.Show() 79 | 80 | return True 81 | 82 | 83 | #- __main__ ------------------------------------------------------------------- 84 | 85 | 86 | if __name__ == '__main__': 87 | import sys 88 | print('Python %s.%s.%s %s' % sys.version_info[0:4]) 89 | print('wxPython %s' % wx.version()) 90 | gApp = TestApp(redirect=False, 91 | filename=None, 92 | useBestVisual=False, 93 | clearSigInt=True) 94 | gApp.MainLoop() 95 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SpinCtrlDouble/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/SpinCtrlDouble/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/SplitterWindow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/SplitterWindow/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBitmap/StaticBitmap_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports---------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal StaticBimap Demo") 12 | 13 | bmp = wx.Bitmap('bitmaps/robin.jpg') 14 | statBmp = wx.StaticBitmap(frame, -1, bmp) 15 | 16 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 17 | frame.Show() 18 | app.MainLoop() 19 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBitmap/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StaticBitmap/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBitmap/bitmaps/robin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StaticBitmap/bitmaps/robin.jpg -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBitmap/bitmaps/test2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StaticBitmap/bitmaps/test2.bmp -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBox/StaticBox_extended.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | 10 | #- wxPython Demo -------------------------------------------------------------- 11 | __wxPyOnlineDocs__ = 'https://wxpython.org/Phoenix/docs/html/wx.StaticBox.html' 12 | __wxPyDemoPanel__ = 'TestPanel' 13 | 14 | overview = """ 15 |

wx.StaticBox

16 | 17 | This control draws a box and can be used to group other controls. 18 | 19 | 20 | """ 21 | 22 | 23 | class TestPanel(wx.Panel): 24 | def __init__(self, parent, log): 25 | self.log = log 26 | wx.Panel.__init__(self, parent, -1) 27 | 28 | box = wx.StaticBox(self, -1, "This is a wx.StaticBox") 29 | bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) 30 | 31 | t = wx.StaticText(self, -1, 32 | 'Controls placed "inside" the box are really its siblings.') 33 | bsizer.Add(t, 0, wx.TOP|wx.LEFT, 10) 34 | 35 | 36 | border = wx.BoxSizer() 37 | border.Add(bsizer, 1, wx.EXPAND|wx.ALL, 25) 38 | self.SetSizer(border) 39 | 40 | 41 | #- wxPy Demo ----------------------------------------------------------------- 42 | 43 | 44 | def runTest(frame, nb, log): 45 | win = TestPanel(nb, log) 46 | return win 47 | 48 | 49 | #- __main__ Demo -------------------------------------------------------------- 50 | 51 | 52 | class printLog: 53 | def __init__(self): 54 | pass 55 | 56 | def write(self, txt): 57 | print('%s' % txt) 58 | 59 | def WriteText(self, txt): 60 | print('%s' % txt) 61 | 62 | 63 | class TestFrame(wx.Frame): 64 | def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, 65 | pos=wx.DefaultPosition, size=wx.DefaultSize, 66 | style=wx.DEFAULT_FRAME_STYLE, name='frame'): 67 | wx.Frame.__init__(self, parent, id, title, pos, size, style, name) 68 | 69 | log = printLog() 70 | 71 | panel = TestPanel(self, log) 72 | self.Bind(wx.EVT_CLOSE, self.OnDestroy) 73 | 74 | 75 | def OnDestroy(self, event): 76 | self.Destroy() 77 | 78 | 79 | class TestApp(wx.App): 80 | def OnInit(self): 81 | gMainWin = TestFrame(None) 82 | gMainWin.SetTitle('Test Demo') 83 | gMainWin.Show() 84 | 85 | return True 86 | 87 | 88 | #- __main__ ------------------------------------------------------------------- 89 | 90 | 91 | if __name__ == '__main__': 92 | import sys 93 | print('Python %s.%s.%s %s' % sys.version_info[0:4]) 94 | print('wxPython %s' % wx.version()) 95 | gApp = TestApp(redirect=False, 96 | filename=None, 97 | useBestVisual=False, 98 | clearSigInt=True) 99 | 100 | gApp.MainLoop() 101 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBox/StaticBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports---------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal StaticBox Demo") 12 | 13 | statBox = wx.StaticBox(frame, -1, "This is a wx.StaticBox") 14 | statBoxSizer = wx.StaticBoxSizer(statBox, wx.VERTICAL) 15 | 16 | st = wx.StaticText(frame, -1, 17 | 'Controls placed "inside" the StaticBox are really its siblings.') 18 | statBoxSizer.Add(st, 0, wx.TOP|wx.LEFT, 10) 19 | 20 | border = wx.BoxSizer() 21 | border.Add(statBoxSizer, 1, wx.EXPAND | wx.ALL, 25) 22 | frame.SetSizer(border) 23 | 24 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 25 | frame.Show() 26 | app.MainLoop() 27 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StaticBox/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticText/StaticText_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal StaticBox Demo") 12 | 13 | st = wx.StaticText(frame, wx.ID_ANY, 'wx.StaticText') 14 | 15 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 16 | frame.Show() 17 | app.MainLoop() 18 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StaticText/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StaticText/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StatusBar/StatusBar_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal StatusBar Demo") 12 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 13 | frame.Show() 14 | app.MainLoop() 15 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StatusBar/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StatusBar/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StockButtons/StockButtons_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal StockButtons Demo") 12 | 13 | gSizer = wx.GridSizer(cols=5, hgap=4, vgap=4) 14 | for i in dir(wx): 15 | if 'ID_' in i: 16 | print(i) 17 | try: 18 | execStr = "stockBtn = wx.Button(frame, wx.%s)" % i 19 | exec(execStr) 20 | if not stockBtn.GetLabel(): # Not a supported Stock ID. 21 | stockBtn.Destroy() 22 | continue 23 | stockBtn.SetToolTip(wx.ToolTip('wx.%s' % i)) 24 | gSizer.Add(stockBtn) 25 | except Exception: 26 | pass 27 | frame.SetSizerAndFit(gSizer) 28 | 29 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 30 | frame.Show() 31 | app.MainLoop() 32 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/StockButtons/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/StockButtons/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/TextCtrl/TextCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal TextCtrl Demo") 12 | 13 | tc = wx.TextCtrl(frame, wx.ID_ANY, "I'm a wx.TextCtrl", 14 | style=wx.TE_MULTILINE | wx.TE_RICH) 15 | 16 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 17 | frame.Show() 18 | app.MainLoop() 19 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/TextCtrl/URLTextCtrl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | #-Imports.--------------------------------------------------------------------- 6 | 7 | #--Python Imports. 8 | import webbrowser 9 | 10 | #--wxPython Imports. 11 | import wx 12 | 13 | urls = """ 14 | http://www.python.org/ 15 | 16 | http://wxpython.org/ 17 | 18 | http://micropython.org/ 19 | 20 | http://www.scintilla.org/ 21 | 22 | """ 23 | 24 | class MyTextCtrl(wx.TextCtrl): 25 | def __init__(self, parent, id=wx.ID_ANY, value=wx.EmptyString, 26 | pos=wx.DefaultPosition, size=wx.DefaultSize, 27 | style=wx.TE_MULTILINE | wx.TE_AUTO_URL, 28 | val=wx.DefaultValidator, name='textCtrl'): 29 | """Default class constructor.""" 30 | wx.TextCtrl.__init__(self, parent, id, value, pos, size, style, val, name) 31 | 32 | self.SetValue(urls) 33 | self.BindEvents() 34 | 35 | 36 | def BindEvents(self): 37 | self.Bind(wx.EVT_TEXT_URL, self.OnTextURL) 38 | 39 | def OnTextURL(self, event): 40 | ## print('OnTextURL') 41 | if event.MouseEvent.LeftUp(): 42 | ## print('OnTextURL LeftUp %s' % url) 43 | url = self.GetRange(event.GetURLStart(), event.GetURLEnd()) 44 | webbrowser.open_new_tab(url) 45 | event.Skip() 46 | 47 | 48 | class MyTestFrame(wx.Frame): 49 | def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, 50 | pos=wx.DefaultPosition, size=wx.DefaultSize, 51 | style=wx.DEFAULT_FRAME_STYLE, name='frame'): 52 | wx.Frame.__init__(self, parent, id, title, pos, size, style, name) 53 | 54 | urlTextCtrl = MyTextCtrl(self) 55 | 56 | self.Bind(wx.EVT_CLOSE, self.OnDestroy) 57 | 58 | def OnDestroy(self, event): 59 | self.Destroy() 60 | 61 | 62 | class TextURLApp(wx.App): 63 | def OnInit(self): 64 | gMainWin = MyTestFrame(None) 65 | gMainWin.SetTitle('Text URL Demo') 66 | self.SetTopWindow(gMainWin) 67 | gMainWin.Show() 68 | return True 69 | 70 | 71 | if __name__ == '__main__': 72 | gApp = TextURLApp(redirect=False, 73 | filename=None, 74 | useBestVisual=False, 75 | clearSigInt=True) 76 | gApp.MainLoop() 77 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/TextCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/TextCtrl/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToggleButton/ToggleButton_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal ToggleButton Demo") 12 | 13 | togBtn1 = wx.ToggleButton(frame, -1, 'ToggleButton 1', pos=(20, 20)) 14 | togBtn2 = wx.ToggleButton(frame, -1, 'ToggleButton 2', pos=(20, 60)) 15 | 16 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 17 | frame.Show() 18 | app.MainLoop() 19 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToggleButton/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ToggleButton/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToggleButton/bitmaps/mondrian.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ToggleButton/bitmaps/mondrian.ico -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToolBar/ToolBar_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal ToolBar Demo") 12 | 13 | tb = frame.CreateToolBar() 14 | tb.AddTool(wx.ID_OPEN, "Open", 15 | wx.Bitmap('bitmaps/new_folder.png'), 16 | "Open Short Help", wx.ITEM_NORMAL) 17 | 18 | tb.AddTool(wx.ID_SAVE, "Save", 19 | wx.Bitmap('bitmaps/filesave.png'), 20 | "Save Short Help", wx.ITEM_NORMAL) 21 | tb.Realize() 22 | 23 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 24 | frame.Show() 25 | app.MainLoop() 26 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToolBar/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ToolBar/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToolBar/bitmaps/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ToolBar/bitmaps/filesave.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/ToolBar/bitmaps/new_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/ToolBar/bitmaps/new_folder.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/TreeCtrl/TreeCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal TreeCtrl Demo - wxPython %s' % wx.version()) 12 | frame.treectrl = tree = wx.TreeCtrl(frame, -1) 13 | frame.treectrl.root = root = tree.AddRoot("The Root Item") 14 | for x in range(3): 15 | child = tree.AppendItem(root, "Item %d" % x) 16 | tree.SetItemData(child, None) 17 | 18 | for y in range(3): 19 | last = tree.AppendItem(child, "item %d-%s" % (x, chr(ord("a") + y))) 20 | tree.SetItemData(last, None) 21 | 22 | for z in range(3): 23 | item = tree.AppendItem(last, "item %d-%s-%d" % (x, chr(ord("a") + y), z)) 24 | tree.SetItemData(item, None) 25 | tree.ExpandAll() 26 | tree.SelectItem(root) 27 | frame.Show() 28 | app.MainLoop() 29 | -------------------------------------------------------------------------------- /103_Core_Windows_Controls/TreeCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/TreeCtrl/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/TreeCtrl/bitmaps/smiley16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/TreeCtrl/bitmaps/smiley16.png -------------------------------------------------------------------------------- /103_Core_Windows_Controls/Validator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/Validator/__init__.py -------------------------------------------------------------------------------- /103_Core_Windows_Controls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/103_Core_Windows_Controls/__init__.py -------------------------------------------------------------------------------- /104_Book_Controls/Choicebook/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Choicebook/__init__.py -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = book16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0" 40 | "RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIASURBVDjLpVPPaxNREJ6Vt01c" 41 | "aH4oWk1T0ZKlGIo9RG+BUsEK4kEP/Q8qPXnpqRdPBf8A8Wahhx7FQ0GF9FJ6UksqwfTSBDGy" 42 | "B5HkkphC9tfb7jfbtyQQTx142byZ75v5ZnZWC4KALmICPy+2DkvKIX2f/POz83LxCL7nrz+W" 43 | "PNcll49DrhM9v7xdO9JW330DuXrrqkFSgig5iR2Cfv3t3gNxOnv5BwU+eZ5HuON5/PMPJZKJ" 44 | "+yKQfpW0S7TxdC6WJaWkyvff1LDaFRAeLZj05MHsiPTS6hua0PUqtwC5sHq9zv9RYWl+nu5c" 45 | "ETcnJ1M0M5WlWq3GsX6/T+VymRzHDluZiGYAAsw0TQahV8uyyGq1qFgskm0bHIO/1+sx1rFt" 46 | "chJhArwEyIQ1Gg2WD2A6nWawHQJVDIWgIJfLhQowTIeE9D0mKAU8qPC0220afsWFQoH93W6X" 47 | "7yCDJ+DEBeBmsxnPIJVKxWQVUwry+XyUwBlKMKwA8jqdDhOVCqVAzQDVvXAXhOdGBFgymYwr" 48 | "GoZBmUyGjxCCdF0fSahaFdgoTHRxfTveMCXvWfkuE3Y+f40qhgT/nMitupzApdvT18bu+YeD" 49 | "QwY9Xl4aG9/d/URiMBhQq/dvZMeVghtT17lSZW9/rAKsvPa/r9Fc2dw+Pe0/xI6kM9mT5vtX" 50 | "y+Nw2kU/5zOGRpvuMIu0YAAAAABJRU5ErkJggg==") 51 | 52 | # Return the bitmap to use in the wxPython demo tree control. 53 | return image 54 | 55 | 56 | def GetDemos(): 57 | """ 58 | Returns all the demo names in the package, together with the 59 | tree item name which will go in the wxPython demo tree control. 60 | """ 61 | 62 | # The tree item text. 63 | TreeItemText = "Listbook" 64 | 65 | # The tree item's demos. 66 | TreeItemDemos = ( 67 | 'Listbook_extended.py', 68 | 'Listbook_minimal.py', 69 | ) 70 | 71 | return TreeItemText, TreeItemDemos 72 | 73 | 74 | def GetOverview(): 75 | """ 76 | Creates the wxHTML code to display on the tree item's Overview tab. 77 | """ 78 | 79 | wxHtmlOverviewStr = '''\ 80 | 81 |

Listbook

82 |

Listbook demos. 83 | 84 | ''' 85 | 86 | return wxHtmlOverviewStr 87 | -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/__init__.py -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB01.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB02.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB03.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB04.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB05.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB06.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB07.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB08.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB09.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB10.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB11.png -------------------------------------------------------------------------------- /104_Book_Controls/Listbook/bitmaps/LB12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Listbook/bitmaps/LB12.png -------------------------------------------------------------------------------- /104_Book_Controls/Notebook/Notebook_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports---------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, wx.ID_ANY, "Minimal Notebook Demo") 12 | 13 | colors = ( 14 | '#F39D76', '#F5B57F', '#F9CD8A', '#FFF99D', '#C7E19D', '#A8D59D', 15 | '#88C99D', '#8CCCCA', '#8DCFF3', '#93A9D5', '#9595C5', '#9681B6', 16 | '#AF88B8', '#C78FB9', '#F59FBC', '#F49E9C') 17 | nb = wx.Notebook(frame, wx.ID_ANY, size=(21, 21), style=wx.BK_DEFAULT) 18 | for i in range(len(colors)): 19 | p = wx.Panel(nb, wx.ID_ANY) 20 | p.SetBackgroundColour(colors[i]) 21 | nb.AddPage(p, 'Page %d' % i) 22 | 23 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 24 | frame.Show() 25 | app.MainLoop() 26 | -------------------------------------------------------------------------------- /104_Book_Controls/Notebook/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Notebook/__init__.py -------------------------------------------------------------------------------- /104_Book_Controls/Notebook/bitmaps/book16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Notebook/bitmaps/book16.png -------------------------------------------------------------------------------- /104_Book_Controls/Notebook/bitmaps/book_blue16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Notebook/bitmaps/book_blue16.png -------------------------------------------------------------------------------- /104_Book_Controls/Notebook/bitmaps/book_green16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Notebook/bitmaps/book_green16.png -------------------------------------------------------------------------------- /104_Book_Controls/Notebook/bitmaps/book_red16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Notebook/bitmaps/book_red16.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = book16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0" 40 | "RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIASURBVDjLpVPPaxNREJ6Vt01c" 41 | "aH4oWk1T0ZKlGIo9RG+BUsEK4kEP/Q8qPXnpqRdPBf8A8Wahhx7FQ0GF9FJ6UksqwfTSBDGy" 42 | "B5HkkphC9tfb7jfbtyQQTx142byZ75v5ZnZWC4KALmICPy+2DkvKIX2f/POz83LxCL7nrz+W" 43 | "PNcll49DrhM9v7xdO9JW330DuXrrqkFSgig5iR2Cfv3t3gNxOnv5BwU+eZ5HuON5/PMPJZKJ" 44 | "+yKQfpW0S7TxdC6WJaWkyvff1LDaFRAeLZj05MHsiPTS6hua0PUqtwC5sHq9zv9RYWl+nu5c" 45 | "ETcnJ1M0M5WlWq3GsX6/T+VymRzHDluZiGYAAsw0TQahV8uyyGq1qFgskm0bHIO/1+sx1rFt" 46 | "chJhArwEyIQ1Gg2WD2A6nWawHQJVDIWgIJfLhQowTIeE9D0mKAU8qPC0220afsWFQoH93W6X" 47 | "7yCDJ+DEBeBmsxnPIJVKxWQVUwry+XyUwBlKMKwA8jqdDhOVCqVAzQDVvXAXhOdGBFgymYwr" 48 | "GoZBmUyGjxCCdF0fSahaFdgoTHRxfTveMCXvWfkuE3Y+f40qhgT/nMitupzApdvT18bu+YeD" 49 | "QwY9Xl4aG9/d/URiMBhQq/dvZMeVghtT17lSZW9/rAKsvPa/r9Fc2dw+Pe0/xI6kM9mT5vtX" 50 | "y+Nw2kU/5zOGRpvuMIu0YAAAAABJRU5ErkJggg==") 51 | 52 | # Return the bitmap to use in the wxPython demo tree control. 53 | return image 54 | 55 | 56 | def GetDemos(): 57 | """ 58 | Returns all the demo names in the package, together with the 59 | tree item name which will go in the wxPython demo tree control. 60 | """ 61 | 62 | # The tree item text. 63 | TreeItemText = "Toolbook" 64 | 65 | # The tree item's demos. 66 | TreeItemDemos = ( 67 | 'Toolbook_extended.py', 68 | 'Toolbook_minimal.py', 69 | ) 70 | 71 | return TreeItemText, TreeItemDemos 72 | 73 | 74 | def GetOverview(): 75 | """ 76 | Creates the wxHTML code to display on the tree item's Overview tab. 77 | """ 78 | 79 | wxHtmlOverviewStr = '''\ 80 | 81 |

Toolbook

82 |

Toolbook demos. 83 | 84 | ''' 85 | 86 | return wxHtmlOverviewStr 87 | -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/__init__.py -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB01.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB02.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB03.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB04.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB05.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB06.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB07.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB08.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB09.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB10.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB11.png -------------------------------------------------------------------------------- /104_Book_Controls/Toolbook/bitmaps/LB12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Toolbook/bitmaps/LB12.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/__init__.py -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB01.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB02.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB03.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB04.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB05.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB06.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB07.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB08.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB09.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB10.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB11.png -------------------------------------------------------------------------------- /104_Book_Controls/Treebook/bitmaps/LB12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/Treebook/bitmaps/LB12.png -------------------------------------------------------------------------------- /104_Book_Controls/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = book16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0" 40 | "RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIASURBVDjLpVPPaxNREJ6Vt01c" 41 | "aH4oWk1T0ZKlGIo9RG+BUsEK4kEP/Q8qPXnpqRdPBf8A8Wahhx7FQ0GF9FJ6UksqwfTSBDGy" 42 | "B5HkkphC9tfb7jfbtyQQTx142byZ75v5ZnZWC4KALmICPy+2DkvKIX2f/POz83LxCL7nrz+W" 43 | "PNcll49DrhM9v7xdO9JW330DuXrrqkFSgig5iR2Cfv3t3gNxOnv5BwU+eZ5HuON5/PMPJZKJ" 44 | "+yKQfpW0S7TxdC6WJaWkyvff1LDaFRAeLZj05MHsiPTS6hua0PUqtwC5sHq9zv9RYWl+nu5c" 45 | "ETcnJ1M0M5WlWq3GsX6/T+VymRzHDluZiGYAAsw0TQahV8uyyGq1qFgskm0bHIO/1+sx1rFt" 46 | "chJhArwEyIQ1Gg2WD2A6nWawHQJVDIWgIJfLhQowTIeE9D0mKAU8qPC0220afsWFQoH93W6X" 47 | "7yCDJ+DEBeBmsxnPIJVKxWQVUwry+XyUwBlKMKwA8jqdDhOVCqVAzQDVvXAXhOdGBFgymYwr" 48 | "GoZBmUyGjxCCdF0fSahaFdgoTHRxfTveMCXvWfkuE3Y+f40qhgT/nMitupzApdvT18bu+YeD" 49 | "QwY9Xl4aG9/d/URiMBhQq/dvZMeVghtT17lSZW9/rAKsvPa/r9Fc2dw+Pe0/xI6kM9mT5vtX" 50 | "y+Nw2kU/5zOGRpvuMIu0YAAAAABJRU5ErkJggg==") 51 | 52 | # Return the bitmap to use in the wxPython demo tree control. 53 | return image 54 | 55 | 56 | def GetDemos(): 57 | """ 58 | Returns all the demo names in the package, together with the 59 | tree item name which will go in the wxPython demo tree control. 60 | """ 61 | 62 | # The tree item text. 63 | TreeItemText = '"Book" Controls' 64 | 65 | # The tree item's demos. 66 | TreeItemDemos = () 67 | 68 | return TreeItemText, TreeItemDemos 69 | 70 | 71 | def GetOverview(): 72 | """ 73 | Creates the wxHTML code to display on the tree item's Overview tab. 74 | """ 75 | 76 | wxHtmlOverviewStr = '''\ 77 | 78 |

"Book" Controls

79 |

Book control demos. 80 | 81 | ''' 82 | 83 | return wxHtmlOverviewStr 84 | 85 | -------------------------------------------------------------------------------- /104_Book_Controls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/104_Book_Controls/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/AnalogClock/AnalogClock_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.lib.analogclock as ac 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal AnalogClock Demo') 12 | clock = ac.AnalogClock(frame, size=(200, 200)) 13 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 14 | frame.Show() 15 | app.MainLoop() 16 | -------------------------------------------------------------------------------- /105_Custom_Controls/AnalogClock/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/AnalogClock/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/ColourSelect/ColourSelect_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.lib.colourselect as csel 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal ColourSelect Demo') 12 | coloursel1 = csel.ColourSelect(frame, -1, colour=wx.RED, pos=(50, 50)) 13 | coloursel2 = csel.ColourSelect(frame, -1, label='ColourSelect', colour=wx.BLUE, pos=(100, 100)) 14 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 15 | frame.Show() 16 | app.MainLoop() 17 | -------------------------------------------------------------------------------- /105_Custom_Controls/ColourSelect/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/ColourSelect/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/ComboTreeBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/ComboTreeBox/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/Editor/Editor_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.lib.editor as editor 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal Editor Demo') 12 | ed = editor.Editor(frame, wx.ID_ANY) 13 | ed.SetText(['Hello world!']) 14 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 15 | frame.Show() 16 | app.MainLoop() 17 | -------------------------------------------------------------------------------- /105_Custom_Controls/Editor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/Editor/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/GenericButtons/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/GenericButtons/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/GenericButtons/bitmaps/bulb1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/GenericButtons/bitmaps/bulb1.bmp -------------------------------------------------------------------------------- /105_Custom_Controls/GenericButtons/bitmaps/bulb2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/GenericButtons/bitmaps/bulb2.bmp -------------------------------------------------------------------------------- /105_Custom_Controls/GenericButtons/bitmaps/test2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/GenericButtons/bitmaps/test2.bmp -------------------------------------------------------------------------------- /105_Custom_Controls/GenericDirCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/GenericDirCtrl/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/ItemsPicker/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/ItemsPicker/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/ItemsPicker/bitmaps/bp_btn1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/ItemsPicker/bitmaps/bp_btn1.png -------------------------------------------------------------------------------- /105_Custom_Controls/ItemsPicker/bitmaps/bp_btn2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/ItemsPicker/bitmaps/bp_btn2.png -------------------------------------------------------------------------------- /105_Custom_Controls/MultiSash/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/MultiSash/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/PlateButton/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/PlateButton/__init__.py -------------------------------------------------------------------------------- /105_Custom_Controls/PlateButton/bitmaps/Address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/PlateButton/bitmaps/Address.png -------------------------------------------------------------------------------- /105_Custom_Controls/PlateButton/bitmaps/Book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/PlateButton/bitmaps/Book.png -------------------------------------------------------------------------------- /105_Custom_Controls/PlateButton/bitmaps/Devil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/PlateButton/bitmaps/Devil.png -------------------------------------------------------------------------------- /105_Custom_Controls/PlateButton/bitmaps/Home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/PlateButton/bitmaps/Home.png -------------------------------------------------------------------------------- /105_Custom_Controls/PlateButton/bitmaps/Monkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/PlateButton/bitmaps/Monkey.png -------------------------------------------------------------------------------- /105_Custom_Controls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/105_Custom_Controls/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/BitmapComboBox_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #-Imports--------------------------------------------------------------------- 4 | 5 | #--wxPython Imports. 6 | import wx 7 | import wx.adv 8 | 9 | if __name__ == '__main__': 10 | app = wx.App() 11 | frame = wx.Frame(None, -1, 'Minimal BitmapComboBox Demo') 12 | panel = wx.Panel(frame) 13 | bcb = wx.adv.BitmapComboBox(panel, pos=(10, 10), size=(200, -1)) 14 | 15 | for name in dir(wx): 16 | if name.startswith('ART_'): 17 | id = eval('wx.%s' % name) 18 | bmp = wx.ArtProvider.GetBitmap(id, wx.ART_OTHER, (16, 16)) 19 | bcb.Append('wx.%s' % name, bmp, name) 20 | 21 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 22 | frame.Show() 23 | app.MainLoop() 24 | -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB01.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB02.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB03.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB04.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB05.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB06.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB07.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB08.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB09.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB10.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB11.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/BitmapComboBox/bitmaps/LB12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/BitmapComboBox/bitmaps/LB12.png -------------------------------------------------------------------------------- /106_More_Windows_Controls/Calendar/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/Calendar/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/Calendar/bitmaps/DbDec.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/Calendar/bitmaps/DbDec.bmp -------------------------------------------------------------------------------- /106_More_Windows_Controls/Calendar/bitmaps/DbInc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/Calendar/bitmaps/DbInc.bmp -------------------------------------------------------------------------------- /106_More_Windows_Controls/Calendar/bitmaps/Dec.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/Calendar/bitmaps/Dec.bmp -------------------------------------------------------------------------------- /106_More_Windows_Controls/Calendar/bitmaps/Inc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/Calendar/bitmaps/Inc.bmp -------------------------------------------------------------------------------- /106_More_Windows_Controls/Calendar/bitmaps/Pt.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/Calendar/bitmaps/Pt.bmp -------------------------------------------------------------------------------- /106_More_Windows_Controls/CalendarCtrl/CalendarCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports--------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | import wx.adv 9 | 10 | 11 | if __name__ == '__main__': 12 | app = wx.App() 13 | frame = wx.Frame(None, -1, 'Minimal CalendarCtrl Demo') 14 | cal = wx.adv.CalendarCtrl(frame, -1, wx.DateTime().Today(), 15 | style=wx.adv.CAL_SEQUENTIAL_MONTH_SELECTION) 16 | frame.Show() 17 | app.MainLoop() 18 | -------------------------------------------------------------------------------- /106_More_Windows_Controls/CalendarCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/CalendarCtrl/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/CollapsiblePane/CollapsiblePane_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports--------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | 9 | 10 | class TestPanel(wx.Panel): 11 | def __init__(self, parent): 12 | wx.Panel.__init__(self, parent, wx.ID_ANY) 13 | 14 | cp = wx.CollapsiblePane(self, label='wx.CollapsiblePane', 15 | style=wx.CP_DEFAULT_STYLE | wx.CP_NO_TLW_RESIZE) 16 | tc = wx.TextCtrl(cp.GetPane(), wx.ID_ANY, "testing text") 17 | 18 | sizer = wx.BoxSizer(wx.VERTICAL) 19 | sizer.Add(cp, 0, wx.ALL | wx.EXPAND, 25) 20 | self.SetSizer(sizer) 21 | 22 | 23 | if __name__ == '__main__': 24 | import sys 25 | print('Python %s.%s.%s %s' % sys.version_info[0:4]) 26 | print('wxPython %s' % wx.version()) 27 | app = wx.App() 28 | frame = wx.Frame(None, -1, 'wx.CollapsiblePane Demo') 29 | pnl = TestPanel(frame) 30 | frame.Show() 31 | app.MainLoop() 32 | -------------------------------------------------------------------------------- /106_More_Windows_Controls/CollapsiblePane/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/CollapsiblePane/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/ComboCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/ComboCtrl/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/ContextHelp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/ContextHelp/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/DatePickerCtrl/DatePickerCtrl_minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-Imports---------------------------------------------------------------------- 5 | 6 | #--wxPython Imports. 7 | import wx 8 | import wx.adv 9 | 10 | 11 | if __name__ == '__main__': 12 | app = wx.App() 13 | frame = wx.Frame(None, -1, 'Minimal DatePickerCtrl Demo') 14 | panel = wx.Panel(frame) 15 | dpc = wx.adv.DatePickerCtrl(panel, size=(120, -1), pos=(10, 10), 16 | style = wx.adv.DP_DROPDOWN 17 | | wx.adv.DP_SHOWCENTURY 18 | | wx.adv.DP_ALLOWNONE ) 19 | frame.CreateStatusBar().SetStatusText('wxPython %s' % wx.version()) 20 | frame.Show() 21 | app.MainLoop() 22 | -------------------------------------------------------------------------------- /106_More_Windows_Controls/DatePickerCtrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/DatePickerCtrl/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/InfoBar/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/InfoBar/__init__.py -------------------------------------------------------------------------------- /106_More_Windows_Controls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/106_More_Windows_Controls/__init__.py -------------------------------------------------------------------------------- /107_Window_Layout/__demo__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | #-MetaData -------------------------------------------------------------------- 5 | __doc__ = """ 6 | This module contains the meta data needed for integrating the samples 7 | in the directory into the wxPython demo framework. Once imported, 8 | this module returns the following information: 9 | 10 | * GetDemoBitmap: returns the bitmap used in the wxPython tree control 11 | to characterize the package; 12 | * GetDemos: returns all the demos in the package; 13 | * GetOverview: returns a wx.html-ready representation of the package's docs. 14 | 15 | These meta data are merged into the wxPython demo tree at startup. 16 | 17 | Last updated: User's Name @ 08 Aug 20xx, 21.00 GMT. 18 | Version 0.0.1 19 | 20 | """ 21 | 22 | __version__ = "0.0.1" 23 | __author__ = "wxPython Team" 24 | 25 | 26 | #-Imports---------------------------------------------------------------------- 27 | #--wxPython Imports. 28 | import wx 29 | from wx.lib.embeddedimage import PyEmbeddedImage 30 | 31 | 32 | def GetDemoBitmap(): 33 | """ 34 | Returns the bitmap to be used for the demo tree item's bitmap. 35 | """ 36 | 37 | # Get the image as PyEmbeddedImage 38 | image = layout16 = PyEmbeddedImage( 39 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0" 40 | "RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGZSURBVBgZpcHPi41hHMbhz/P2" 41 | "oJijzEKSQn4uFRsNK8lKKWZtFvMPKFulrKxZKGzs2MhismI3S5Qpg0YNZUFiaso5Z973e9+e" 42 | "J45mYWo015VssxGZYur2qyvAXuAUcBxsTEKmaRJNAkkoWNqUvXBkz/YTyFy9eDRhm8u3Xt71" 43 | "f7r56I0LMr+dprg/+50Rs7bpiXHefloaUmQqeRd/HNq5hSol/undlyFVf9BupsgUtrdSGHj/" 44 | "dch6OCJRZArLmWJ6Ypz1UogqU1hOFJPXnzGQkGHmxlnO3ztHr9dDEpKQRETweGoGK6gyhSWq" 45 | "b/2WM8d2M/PiM1WvN8bBA/uobGOL13PzVO6CqqGwTLU8CFqbn8OOKkIkEqt1EVRSR5UpkkQ1" 46 | "HLb02yAGLZUkbAMGG9tEF1TuVqgyhTEjNn91XSAHlW1kEwoqu6PKFOpkIFE8nV1kpDe2jYUP" 47 | "H2nblpW2JbqgSQ2VZVNkipAWgf1zdy6w2oNLD1mL7R8UmSr0ZPLa88O2TyLtkDqwsAKrAweW" 48 | "sA3YoGVo5imSbTbiFyrGMBGmEu5TAAAAAElFTkSuQmCC") 49 | 50 | # Return the bitmap to use in the wxPython demo tree control. 51 | return image 52 | 53 | 54 | def GetDemos(): 55 | """ 56 | Returns all the demo names in the package, together with the 57 | tree item name which will go in the wxPython demo tree control. 58 | """ 59 | 60 | # The tree item text. 61 | TreeItemText = "Window Layout" 62 | 63 | # The tree item's demos. 64 | TreeItemDemos = () 65 | 66 | return TreeItemText, TreeItemDemos 67 | 68 | 69 | def GetOverview(): 70 | """ 71 | Creates the wxHTML code to display on the tree item's Overview tab. 72 | """ 73 | 74 | wxHtmlOverviewStr = '''\ 75 | 76 |

Window Layout

77 |

Window Layout demos. 78 | 79 | ''' 80 | 81 | return wxHtmlOverviewStr 82 | -------------------------------------------------------------------------------- /107_Window_Layout/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/107_Window_Layout/__init__.py -------------------------------------------------------------------------------- /108_Process_and_Events/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/108_Process_and_Events/__init__.py -------------------------------------------------------------------------------- /109_Clipboard_and_DnD/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/109_Clipboard_and_DnD/__init__.py -------------------------------------------------------------------------------- /110_Using_Images/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/110_Using_Images/__init__.py -------------------------------------------------------------------------------- /111_Miscellaneous/AlphaDrawing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/111_Miscellaneous/AlphaDrawing/__init__.py -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/111_Miscellaneous/Cairo/__init__.py -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo/bitmaps/toucan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/111_Miscellaneous/Cairo/bitmaps/toucan.png -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/111_Miscellaneous/Cairo_Snippets/__init__.py -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/bitmaps/romedalen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Metallicow/wxPython-Sample-Apps-and-Demos/65e6828e92217445367420c9c2ebb4a7ed9a1d6e/111_Miscellaneous/Cairo_Snippets/bitmaps/romedalen.png -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/snippets/__init__.py: -------------------------------------------------------------------------------- 1 | # snippet list generation 2 | import os 3 | 4 | # list of snippet files 5 | snip_list = [x[:-3] for x in os.listdir (os.path.dirname (__file__)) 6 | if not x.startswith('_') and x.endswith('.py')] 7 | snip_list = sorted(snip_list) 8 | 9 | # function used by some or all snippets 10 | def snippet_normalize (ctx, width, height): 11 | size = min(width, height) 12 | ctx.scale(size, size) 13 | ctx.set_line_width (0.04) 14 | -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/snippets/arc.py: -------------------------------------------------------------------------------- 1 | xc = 0.5 2 | yc = 0.5 3 | radius = 0.4 4 | angle1 = 45.0 * (M_PI/180.0) #/* angles are specified */ 5 | angle2 = 180.0 * (M_PI/180.0) #/* in radians */ 6 | 7 | snippet_normalize (cr, width, height) 8 | 9 | cr.arc (xc, yc, radius, angle1, angle2) 10 | cr.stroke () 11 | 12 | #/* draw helping lines */ 13 | cr.set_source_rgba (1,0.2,0.2,0.6) 14 | cr.arc (xc, yc, 0.05, 0, 2*M_PI) 15 | cr.fill () 16 | cr.set_line_width (0.03) 17 | cr.arc (xc, yc, radius, angle1, angle1) 18 | cr.line_to (xc, yc) 19 | cr.arc (xc, yc, radius, angle2, angle2) 20 | cr.line_to (xc, yc) 21 | cr.stroke () 22 | -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/snippets/arc_negative.py: -------------------------------------------------------------------------------- 1 | xc = 0.5 2 | yc = 0.5 3 | radius = 0.4 4 | angle1 = 45.0 * (M_PI/180.0) #/* angles are specified */ 5 | angle2 = 180.0 * (M_PI/180.0) #/* in radians */ 6 | 7 | snippet_normalize (cr, width, height) 8 | 9 | cr.arc_negative (xc, yc, radius, angle1, angle2) 10 | cr.stroke () 11 | 12 | #/* draw helping lines */ 13 | cr.set_source_rgba (1,0.2,0.2,0.6) 14 | cr.arc (xc, yc, 0.05, 0, 2*M_PI) 15 | cr.fill () 16 | cr.set_line_width (0.03) 17 | cr.arc (xc, yc, radius, angle1, angle1) 18 | cr.line_to (xc, yc) 19 | cr.arc (xc, yc, radius, angle2, angle2) 20 | cr.line_to (xc, yc) 21 | cr.stroke () 22 | -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/snippets/clip.py: -------------------------------------------------------------------------------- 1 | snippet_normalize (cr, width, height) 2 | 3 | cr.arc (0.5, 0.5, 0.3, 0, 2 * M_PI) 4 | cr.clip () 5 | 6 | cr.rectangle (0, 0, 1, 1) 7 | cr.fill () 8 | cr.set_source_rgb (0, 1, 0) 9 | cr.move_to (0, 0) 10 | cr.line_to (1, 1) 11 | cr.move_to (1, 0) 12 | cr.line_to (0, 1) 13 | cr.stroke () 14 | -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/snippets/clip_image.py: -------------------------------------------------------------------------------- 1 | snippet_normalize(cr, width, height) 2 | 3 | cr.arc(0.5, 0.5, 0.3, 0, 2*M_PI) 4 | cr.clip() 5 | 6 | image = cairo.ImageSurface.create_from_png("bitmaps/romedalen.png") 7 | w = image.get_width() 8 | h = image.get_height() 9 | 10 | cr.scale(1.0/w, 1.0/h) 11 | 12 | cr.set_source_surface(image, 0, 0) 13 | cr.paint() 14 | -------------------------------------------------------------------------------- /111_Miscellaneous/Cairo_Snippets/snippets/curve_rectangle.py: -------------------------------------------------------------------------------- 1 | #/* a custom shape, that could be wrapped in a function */ 2 | x0 = 0.1 #/*< parameters like cairo_rectangle */ 3 | y0 = 0.1 4 | rect_width = 0.8 5 | rect_height = 0.8 6 | radius = 0.4 #/*< and an approximate curvature radius */ 7 | 8 | snippet_normalize (cr, width, height) 9 | 10 | x1=x0+rect_width 11 | y1=y0+rect_height 12 | #if (!rect_width || !rect_height) 13 | # return 14 | if rect_width/2