diff --git a/demo/AUI_DockingWindowMgr.py b/demo/AUI_DockingWindowMgr.py
index 51bed68d..c1f8dafd 100644
--- a/demo/AUI_DockingWindowMgr.py
+++ b/demo/AUI_DockingWindowMgr.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.grid
import wx.html
diff --git a/demo/AUI_MDI.py b/demo/AUI_MDI.py
index 6a42ff39..142b0647 100644
--- a/demo/AUI_MDI.py
+++ b/demo/AUI_MDI.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.aui
diff --git a/demo/AUI_Notebook.py b/demo/AUI_Notebook.py
index 2d0a8495..4ae3e8b5 100644
--- a/demo/AUI_Notebook.py
+++ b/demo/AUI_Notebook.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.aui
diff --git a/demo/About.py b/demo/About.py
index 62eb7408..5f6ee1dc 100644
--- a/demo/About.py
+++ b/demo/About.py
@@ -1,6 +1,8 @@
+#!/usr/bin/env python
+
import sys
-import wx # This module uses the new wx namespace
+import wx
import wx.html
import wx.lib.wxpTag
diff --git a/demo/AboutBox.py b/demo/AboutBox.py
index dc5f5790..f2f29dcd 100644
--- a/demo/AboutBox.py
+++ b/demo/AboutBox.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.adv
from wx.lib.wordwrap import wordwrap
diff --git a/demo/ActiveXWrapper_Acrobat.py b/demo/ActiveXWrapper_Acrobat.py
index fe02f860..a1ce519d 100644
--- a/demo/ActiveXWrapper_Acrobat.py
+++ b/demo/ActiveXWrapper_Acrobat.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.)
diff --git a/demo/ActiveXWrapper_IE.py b/demo/ActiveXWrapper_IE.py
index c8236695..4d7c6a60 100644
--- a/demo/ActiveXWrapper_IE.py
+++ b/demo/ActiveXWrapper_IE.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/ActiveX_FlashWindow.py b/demo/ActiveX_FlashWindow.py
index dfc3b103..58e63af5 100644
--- a/demo/ActiveX_FlashWindow.py
+++ b/demo/ActiveX_FlashWindow.py
@@ -1,5 +1,7 @@
-import os
-import wx
+#!/usr/bin/env python
+
+import os
+import wx
if wx.Platform == '__WXMSW__':
from wx.lib.flashwin import FlashWindow
diff --git a/demo/ActiveX_IEHtmlWindow.py b/demo/ActiveX_IEHtmlWindow.py
index 414128e0..86a40955 100644
--- a/demo/ActiveX_IEHtmlWindow.py
+++ b/demo/ActiveX_IEHtmlWindow.py
@@ -1,9 +1,11 @@
+#!/usr/bin/env python
+
# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Updated for wx namespace
-#
-import wx
+
+import wx
if wx.Platform == '__WXMSW__':
import wx.lib.iewin as iewin
diff --git a/demo/ActiveX_PDFWindow.py b/demo/ActiveX_PDFWindow.py
index cf009ed9..d90089cd 100644
--- a/demo/ActiveX_PDFWindow.py
+++ b/demo/ActiveX_PDFWindow.py
@@ -1,5 +1,7 @@
-import sys
-import wx
+#!/usr/bin/env python
+
+import sys
+import wx
if wx.Platform == '__WXMSW__':
from wx.lib.pdfwin import PDFWindow
diff --git a/demo/AdjustChannels.py b/demo/AdjustChannels.py
index 7d85aa56..39479442 100644
--- a/demo/AdjustChannels.py
+++ b/demo/AdjustChannels.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
from Main import opj
diff --git a/demo/AlphaDrawing.py b/demo/AlphaDrawing.py
index 9649d0a7..4f9b6abf 100644
--- a/demo/AlphaDrawing.py
+++ b/demo/AlphaDrawing.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/AnalogClock.py b/demo/AnalogClock.py
index f1503ae6..fe89657f 100644
--- a/demo/AnalogClock.py
+++ b/demo/AnalogClock.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# AnalogClock demo
# E. A. Tacao
# http://j.domaindlx.com/elements28/wxpython/
diff --git a/demo/AnimateCtrl.py b/demo/AnimateCtrl.py
index 29cb4dbe..7f1f6073 100644
--- a/demo/AnimateCtrl.py
+++ b/demo/AnimateCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
from wx.adv import Animation, AnimationCtrl
diff --git a/demo/ArtProvider.py b/demo/ArtProvider.py
index b2d9f1ed..92d065ed 100644
--- a/demo/ArtProvider.py
+++ b/demo/ArtProvider.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import cStringIO
-import wx
+import cStringIO
+import wx
#----------------------------------------------------------------------
diff --git a/demo/BitmapButton.py b/demo/BitmapButton.py
index a3ae3d94..d50dd63a 100644
--- a/demo/BitmapButton.py
+++ b/demo/BitmapButton.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import images
+import wx
+import images
#import wx.lib.buttons
#wx.BitmapButton = wx.lib.buttons.GenBitmapButton
diff --git a/demo/BitmapComboBox.py b/demo/BitmapComboBox.py
index 8a15d2c2..33e9febb 100644
--- a/demo/BitmapComboBox.py
+++ b/demo/BitmapComboBox.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/BitmapFromBuffer.py b/demo/BitmapFromBuffer.py
index 15345b75..41ab1da2 100644
--- a/demo/BitmapFromBuffer.py
+++ b/demo/BitmapFromBuffer.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import array
diff --git a/demo/Button.py b/demo/Button.py
index bde3f382..268670da 100644
--- a/demo/Button.py
+++ b/demo/Button.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
import images
#----------------------------------------------------------------------
diff --git a/demo/Cairo.py b/demo/Cairo.py
index 392c959e..a4a1de6f 100644
--- a/demo/Cairo.py
+++ b/demo/Cairo.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import math
diff --git a/demo/Cairo_Snippets.py b/demo/Cairo_Snippets.py
index eae05518..d6e41d49 100644
--- a/demo/Cairo_Snippets.py
+++ b/demo/Cairo_Snippets.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/Calendar.py b/demo/Calendar.py
index edddd8ae..d374cdbd 100644
--- a/demo/Calendar.py
+++ b/demo/Calendar.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: Calendar.py
# Purpose: Calendar control display testing on panel for wxPython demo
@@ -24,12 +26,12 @@
# the culprit.
#
-import os
+import os
-import wx
-import wx.lib.calendar
+import wx
+import wx.lib.calendar
-import images
+import images
# highlighted days in month
diff --git a/demo/CalendarCtrl.py b/demo/CalendarCtrl.py
index d592a62a..9e6f5e70 100644
--- a/demo/CalendarCtrl.py
+++ b/demo/CalendarCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/CheckBox.py b/demo/CheckBox.py
index 0bc5b45d..00d5354c 100644
--- a/demo/CheckBox.py
+++ b/demo/CheckBox.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/CheckListBox.py b/demo/CheckListBox.py
index ffd4b180..abd9a549 100644
--- a/demo/CheckListBox.py
+++ b/demo/CheckListBox.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/CheckListCtrlMixin.py b/demo/CheckListCtrlMixin.py
index 448aa2a2..8d5a46d6 100644
--- a/demo/CheckListCtrlMixin.py
+++ b/demo/CheckListCtrlMixin.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
import wx
from wx.lib.mixins.listctrl import CheckListCtrlMixin
diff --git a/demo/Choice.py b/demo/Choice.py
index 15eccacb..54aec767 100644
--- a/demo/Choice.py
+++ b/demo/Choice.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/Choicebook.py b/demo/Choicebook.py
index 4b92842e..f63196c9 100644
--- a/demo/Choicebook.py
+++ b/demo/Choicebook.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------------
diff --git a/demo/CollapsiblePane.py b/demo/CollapsiblePane.py
index cec30260..a7a02828 100644
--- a/demo/CollapsiblePane.py
+++ b/demo/CollapsiblePane.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/ColorPanel.py b/demo/ColorPanel.py
index 6c916e2c..8a4a7e6a 100644
--- a/demo/ColorPanel.py
+++ b/demo/ColorPanel.py
@@ -1,7 +1,8 @@
-#
+#!/usr/bin/env python
+
# Note: this module is not a demo per se, but is used by many of
# the demo modules for various purposes.
-#
+
import wx
diff --git a/demo/ColourDB.py b/demo/ColourDB.py
index 58f45b0f..15ff1875 100644
--- a/demo/ColourDB.py
+++ b/demo/ColourDB.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.lib.colourdb
diff --git a/demo/ColourDialog.py b/demo/ColourDialog.py
index 74678b80..299ea53d 100644
--- a/demo/ColourDialog.py
+++ b/demo/ColourDialog.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/ColourSelect.py b/demo/ColourSelect.py
index 217c7dc7..401a4144 100644
--- a/demo/ColourSelect.py
+++ b/demo/ColourSelect.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
@@ -15,10 +17,10 @@
# - use sizers
# - other minor "improvements"
#----------------------------------------------------------------------------
-#
-import wx
-import wx.lib.colourselect as csel
+
+import wx
+import wx.lib.colourselect as csel
#----------------------------------------------------------------------------
diff --git a/demo/ComboBox.py b/demo/ComboBox.py
index cdf9b1c1..64d926da 100644
--- a/demo/ComboBox.py
+++ b/demo/ComboBox.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/ComboCtrl.py b/demo/ComboCtrl.py
index 02ec6a8f..3d6f3e35 100644
--- a/demo/ComboCtrl.py
+++ b/demo/ComboCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/ComboTreeBox.py b/demo/ComboTreeBox.py
index 4a4e5b2f..b45df47f 100644
--- a/demo/ComboTreeBox.py
+++ b/demo/ComboTreeBox.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
from wx.lib.combotreebox import ComboTreeBox
diff --git a/demo/CommandLinkButton.py b/demo/CommandLinkButton.py
index f7ae7986..9c49971b 100644
--- a/demo/CommandLinkButton.py
+++ b/demo/CommandLinkButton.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/ContextHelp.py b/demo/ContextHelp.py
index 79173595..aa4d7d95 100644
--- a/demo/ContextHelp.py
+++ b/demo/ContextHelp.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
diff --git a/demo/Cursor.py b/demo/Cursor.py
index d20eaf46..d598d1c9 100644
--- a/demo/Cursor.py
+++ b/demo/Cursor.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import images
diff --git a/demo/CustomDragAndDrop.py b/demo/CustomDragAndDrop.py
index bb42e979..0b2e363a 100644
--- a/demo/CustomDragAndDrop.py
+++ b/demo/CustomDragAndDrop.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import cPickle
-import wx
+import cPickle
+import wx
#----------------------------------------------------------------------
diff --git a/demo/DVC_CustomRenderer.py b/demo/DVC_CustomRenderer.py
index 4d5cb3c2..584e862c 100644
--- a/demo/DVC_CustomRenderer.py
+++ b/demo/DVC_CustomRenderer.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.dataview as dv
diff --git a/demo/DVC_DataViewModel.py b/demo/DVC_DataViewModel.py
index 016511f3..01714295 100644
--- a/demo/DVC_DataViewModel.py
+++ b/demo/DVC_DataViewModel.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.dataview as dv
diff --git a/demo/DVC_IndexListModel.py b/demo/DVC_IndexListModel.py
index 5105221c..bcc379f0 100644
--- a/demo/DVC_IndexListModel.py
+++ b/demo/DVC_IndexListModel.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.dataview as dv
diff --git a/demo/DVC_ListCtrl.py b/demo/DVC_ListCtrl.py
index 543d9ec7..0acaa80f 100644
--- a/demo/DVC_ListCtrl.py
+++ b/demo/DVC_ListCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.dataview as dv
diff --git a/demo/DVC_TreeCtrl.py b/demo/DVC_TreeCtrl.py
index fe2c200b..7f3651f2 100644
--- a/demo/DVC_TreeCtrl.py
+++ b/demo/DVC_TreeCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.dataview as dv
diff --git a/demo/DatePickerCtrl.py b/demo/DatePickerCtrl.py
index 661691a3..48615b6a 100644
--- a/demo/DatePickerCtrl.py
+++ b/demo/DatePickerCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/DelayedResult.py b/demo/DelayedResult.py
index f5631880..c6db2e28 100644
--- a/demo/DelayedResult.py
+++ b/demo/DelayedResult.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
This demonstrates a simple use of delayedresult: get/compute
something that takes a long time, without hanging the GUI while this
diff --git a/demo/Dialog.py b/demo/Dialog.py
index 3ac95c25..43c38259 100644
--- a/demo/Dialog.py
+++ b/demo/Dialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
diff --git a/demo/DialogUnits.py b/demo/DialogUnits.py
index b8868a1d..bd5c5055 100644
--- a/demo/DialogUnits.py
+++ b/demo/DialogUnits.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
@@ -10,9 +11,9 @@
# Copyright: (c) 1998 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------------
-#
-import wx
+
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/DirDialog.py b/demo/DirDialog.py
index eed1be3b..dbe46b90 100644
--- a/demo/DirDialog.py
+++ b/demo/DirDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/DragAndDrop.py b/demo/DragAndDrop.py
index 420d0053..2fdb41bd 100644
--- a/demo/DragAndDrop.py
+++ b/demo/DragAndDrop.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/DragImage.py b/demo/DragImage.py
index 9d2f8186..73fce528 100644
--- a/demo/DragImage.py
+++ b/demo/DragImage.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import images
+import wx
+import images
#----------------------------------------------------------------------
diff --git a/demo/DragScroller.py b/demo/DragScroller.py
index 101555ef..70c069da 100644
--- a/demo/DragScroller.py
+++ b/demo/DragScroller.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.dragscroller
diff --git a/demo/DrawXXXList.py b/demo/DrawXXXList.py
index d0082e87..ad5391ed 100644
--- a/demo/DrawXXXList.py
+++ b/demo/DrawXXXList.py
@@ -1,8 +1,9 @@
+#!/usr/bin/env python
-import random
-import time
+import random
+import time
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/DynamicSashWindow.py b/demo/DynamicSashWindow.py
index c103d0ac..91810cce 100644
--- a/demo/DynamicSashWindow.py
+++ b/demo/DynamicSashWindow.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import wx
-import wx.gizmos as gizmos
-import wx.stc as stc
+import wx
+import wx.gizmos as gizmos
+import wx.stc as stc
#----------------------------------------------------------------------
# This is an example of the complex view that manages its own scrollbars
diff --git a/demo/EditableListBox.py b/demo/EditableListBox.py
index ab904e7e..df96d407 100644
--- a/demo/EditableListBox.py
+++ b/demo/EditableListBox.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.adv
+import wx
+import wx.adv
#----------------------------------------------------------------------
diff --git a/demo/Editor.py b/demo/Editor.py
index 114f2f00..2db14502 100644
--- a/demo/Editor.py
+++ b/demo/Editor.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.editor as editor
+import wx
+import wx.lib.editor as editor
#----------------------------------------------------------------------
diff --git a/demo/EventManager.py b/demo/EventManager.py
index bcc4dfbe..16c0f5d4 100644
--- a/demo/EventManager.py
+++ b/demo/EventManager.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#---------------------------------------------------------------------------
# Name: EventManager.py
# Purpose: A module to demonstrate wxPython.lib.evtmgr.EventManager.
diff --git a/demo/ExpandoTextCtrl.py b/demo/ExpandoTextCtrl.py
index 43c7699e..8c3e9323 100644
--- a/demo/ExpandoTextCtrl.py
+++ b/demo/ExpandoTextCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
diff --git a/demo/FancyText.py b/demo/FancyText.py
index b7c954c2..99ed7884 100644
--- a/demo/FancyText.py
+++ b/demo/FancyText.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.fancytext as fancytext
+import wx
+import wx.lib.fancytext as fancytext
#----------------------------------------------------------------------
diff --git a/demo/FileBrowseButton.py b/demo/FileBrowseButton.py
index 2af110a9..50278307 100644
--- a/demo/FileBrowseButton.py
+++ b/demo/FileBrowseButton.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
""" Demonstrate filebrowsebutton module of the wxPython.lib Library.
@@ -5,8 +6,8 @@
Added demo for DirBrowseButton and improved overview text.
"""
-import wx
-import wx.lib.filebrowsebutton as filebrowse
+import wx
+import wx.lib.filebrowsebutton as filebrowse
#----------------------------------------------------------------------
diff --git a/demo/FileDialog.py b/demo/FileDialog.py
index 0e56fcf7..fa4e82e0 100644
--- a/demo/FileDialog.py
+++ b/demo/FileDialog.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import os
-import wx
+import os
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/FileHistory.py b/demo/FileHistory.py
index 92f1e03a..014d4234 100644
--- a/demo/FileHistory.py
+++ b/demo/FileHistory.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import os
-import wx
+import os
+import wx
#----------------------------------------------------------------------
diff --git a/demo/FindReplaceDialog.py b/demo/FindReplaceDialog.py
index 4e334a2d..9e62060d 100644
--- a/demo/FindReplaceDialog.py
+++ b/demo/FindReplaceDialog.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Updated for wx namespace
@@ -7,7 +9,7 @@
# o Changed the event binding slightly.
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/FloatBar.py b/demo/FloatBar.py
index cb73bd13..d9988a95 100644
--- a/demo/FloatBar.py
+++ b/demo/FloatBar.py
@@ -1,14 +1,15 @@
-#
+#!/usr/bin/env python
+
# Please note that wx.lib.floatbar is not formally supported as
# part of wxPython. If it works, fine. If not, unfortunate.
# GTK users can use the wx.TB_DOCKABLE flag with a regular
# wx.ToolBar, but everyone else has to take their chances.
-#
-import wx
-import wx.lib.floatbar
-import images
+import wx
+import wx.lib.floatbar
+
+import images
class TestFloatBar(wx.Frame):
diff --git a/demo/FontDialog.py b/demo/FontDialog.py
index 92564929..426da605 100644
--- a/demo/FontDialog.py
+++ b/demo/FontDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
from wx.lib import stattext
#---------------------------------------------------------------------------
diff --git a/demo/FontEnumerator.py b/demo/FontEnumerator.py
index 70354f56..33a25bbd 100644
--- a/demo/FontEnumerator.py
+++ b/demo/FontEnumerator.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/Frame.py b/demo/Frame.py
index b2abbf49..dacdf650 100644
--- a/demo/Frame.py
+++ b/demo/Frame.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/GIFAnimationCtrl.py b/demo/GIFAnimationCtrl.py
index 8f010385..b80fa87d 100644
--- a/demo/GIFAnimationCtrl.py
+++ b/demo/GIFAnimationCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
from wx.animate import GIFAnimationCtrl
diff --git a/demo/GLCanvas.py b/demo/GLCanvas.py
index 7cf89b91..ba011028 100644
--- a/demo/GLCanvas.py
+++ b/demo/GLCanvas.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import sys
diff --git a/demo/Gauge.py b/demo/Gauge.py
index 769c965e..cb1ea74b 100644
--- a/demo/Gauge.py
+++ b/demo/Gauge.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/GenericButtons.py b/demo/GenericButtons.py
index 1e88ba9a..96dae9bf 100644
--- a/demo/GenericButtons.py
+++ b/demo/GenericButtons.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.buttons as buttons
+import wx
+import wx.lib.buttons as buttons
import images
diff --git a/demo/GenericDirCtrl.py b/demo/GenericDirCtrl.py
index 1ebd1d47..74141b35 100644
--- a/demo/GenericDirCtrl.py
+++ b/demo/GenericDirCtrl.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/GetMouseState.py b/demo/GetMouseState.py
index 836650be..9c60e0be 100644
--- a/demo/GetMouseState.py
+++ b/demo/GetMouseState.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/GraphicsContext.py b/demo/GraphicsContext.py
index 78134144..4e62b2a3 100644
--- a/demo/GraphicsContext.py
+++ b/demo/GraphicsContext.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import colorsys
diff --git a/demo/GraphicsGradient.py b/demo/GraphicsGradient.py
index 465ad2f8..549ea788 100644
--- a/demo/GraphicsGradient.py
+++ b/demo/GraphicsGradient.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
g = wx
diff --git a/demo/Grid.py b/demo/Grid.py
index 98fac36c..081494bd 100644
--- a/demo/Grid.py
+++ b/demo/Grid.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/GridBagSizer.py b/demo/GridBagSizer.py
index a55b9cea..73b22a29 100644
--- a/demo/GridBagSizer.py
+++ b/demo/GridBagSizer.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx # This module uses the new wx namespace
+import wx
#----------------------------------------------------------------------
gbsDescription = """\
diff --git a/demo/GridCustEditor.py b/demo/GridCustEditor.py
index 51652d6e..d0dcef5a 100644
--- a/demo/GridCustEditor.py
+++ b/demo/GridCustEditor.py
@@ -1,8 +1,9 @@
+#!/usr/bin/env python
import string
-import wx
-import wx.grid as gridlib
+import wx
+import wx.grid as gridlib
#---------------------------------------------------------------------------
class MyCellEditor(gridlib.GridCellEditor):
diff --git a/demo/GridCustTable.py b/demo/GridCustTable.py
index 610ba090..070ea756 100644
--- a/demo/GridCustTable.py
+++ b/demo/GridCustTable.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.grid as gridlib
+import wx
+import wx.grid as gridlib
#---------------------------------------------------------------------------
diff --git a/demo/GridDragAndDrop.py b/demo/GridDragAndDrop.py
index b4ef7f8f..50de6775 100644
--- a/demo/GridDragAndDrop.py
+++ b/demo/GridDragAndDrop.py
@@ -1,11 +1,12 @@
+#!/usr/bin/env python
"""
Example showing how to make a grid a drop target for files.
"""
-import wx
-import wx.grid as gridlib
+import wx
+import wx.grid as gridlib
#---------------------------------------------------------------------------
# Set VIRTUAL to 1 to use a virtual grid
diff --git a/demo/GridDragable.py b/demo/GridDragable.py
index c61b2aa3..0e80c118 100644
--- a/demo/GridDragable.py
+++ b/demo/GridDragable.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import wx
-import wx.grid as gridlib
-import wx.lib.gridmovers as gridmovers
+import wx
+import wx.grid as gridlib
+import wx.lib.gridmovers as gridmovers
#---------------------------------------------------------------------------
diff --git a/demo/GridEnterHandler.py b/demo/GridEnterHandler.py
index 58de6a51..30fee9d4 100644
--- a/demo/GridEnterHandler.py
+++ b/demo/GridEnterHandler.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.grid as gridlib
+import wx
+import wx.grid as gridlib
#---------------------------------------------------------------------------
diff --git a/demo/GridHugeTable.py b/demo/GridHugeTable.py
index eeca9683..21aa38d5 100644
--- a/demo/GridHugeTable.py
+++ b/demo/GridHugeTable.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.grid as gridlib
+import wx
+import wx.grid as gridlib
#---------------------------------------------------------------------------
diff --git a/demo/GridLabelRenderer.py b/demo/GridLabelRenderer.py
index 7218ecb5..21413f5a 100644
--- a/demo/GridLabelRenderer.py
+++ b/demo/GridLabelRenderer.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.grid as grid
diff --git a/demo/GridSimple.py b/demo/GridSimple.py
index 8171b801..c79c49f9 100644
--- a/demo/GridSimple.py
+++ b/demo/GridSimple.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import wx
-import wx.grid as gridlib
-#import wx.lib.mixins.grid as mixins
+import wx
+import wx.grid as gridlib
+#import wx.lib.mixins.grid as mixins
#---------------------------------------------------------------------------
diff --git a/demo/GridStdEdRend.py b/demo/GridStdEdRend.py
index d758f590..46c2a969 100644
--- a/demo/GridStdEdRend.py
+++ b/demo/GridStdEdRend.py
@@ -1,8 +1,9 @@
+#!/usr/bin/env python
-import random
+import random
-import wx
-import wx.grid as gridlib
+import wx
+import wx.grid as gridlib
#---------------------------------------------------------------------------
diff --git a/demo/Grid_MegaExample.py b/demo/Grid_MegaExample.py
index 558349db..459941c7 100644
--- a/demo/Grid_MegaExample.py
+++ b/demo/Grid_MegaExample.py
@@ -1,8 +1,9 @@
+#!/usr/bin/env python
-import wx
-import wx.grid as Grid
+import wx
+import wx.grid as Grid
-import images
+import images
#---------------------------------------------------------------------------
diff --git a/demo/HTML2_WebView.py b/demo/HTML2_WebView.py
index 72a56c16..38c4dbec 100644
--- a/demo/HTML2_WebView.py
+++ b/demo/HTML2_WebView.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.html2 as webview
diff --git a/demo/HtmlWindow.py b/demo/HtmlWindow.py
index 632a9f2c..676db2d6 100644
--- a/demo/HtmlWindow.py
+++ b/demo/HtmlWindow.py
@@ -1,10 +1,11 @@
+#!/usr/bin/env python
-import os
-import sys
+import os
+import sys
-import wx
-import wx.html as html
-import wx.lib.wxpTag
+import wx
+import wx.html as html
+import wx.lib.wxpTag
from Main import opj
diff --git a/demo/I18N.py b/demo/I18N.py
index 15063047..31680695 100644
--- a/demo/I18N.py
+++ b/demo/I18N.py
@@ -1,5 +1,8 @@
+#!/usr/bin/env python
+
#Boa:FramePanel:LanguageSelectPanel
-import os, sys
+import os
+import sys
import wx
from wx.lib import langlistctrl
from Main import opj
diff --git a/demo/Image.py b/demo/Image.py
index b8320417..678fecbb 100644
--- a/demo/Image.py
+++ b/demo/Image.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
from Main import opj
diff --git a/demo/ImageAlpha.py b/demo/ImageAlpha.py
index 8341e919..a098e1e0 100644
--- a/demo/ImageAlpha.py
+++ b/demo/ImageAlpha.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx # This module uses the new wx namespace
+import wx
from Main import opj
diff --git a/demo/ImageBrowser.py b/demo/ImageBrowser.py
index 31509a9d..6ad50931 100644
--- a/demo/ImageBrowser.py
+++ b/demo/ImageBrowser.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: ImageBrowser.py
# Purpose: Image Selection dialog for wxPython demo
@@ -9,10 +11,10 @@
# Licence: wxWindows license
#----------------------------------------------------------------------------
-import os
+import os
-import wx
-import wx.lib.imagebrowser as ib
+import wx
+import wx.lib.imagebrowser as ib
#---------------------------------------------------------------------------
diff --git a/demo/ImageFromStream.py b/demo/ImageFromStream.py
index 0e1cc7b4..d4ac350a 100644
--- a/demo/ImageFromStream.py
+++ b/demo/ImageFromStream.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import cStringIO
+import cStringIO
-import wx
+import wx
from Main import opj
diff --git a/demo/Img2PyArtProvider.py b/demo/Img2PyArtProvider.py
index 15ce996a..b26f00ec 100644
--- a/demo/Img2PyArtProvider.py
+++ b/demo/Img2PyArtProvider.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
from wx.lib.art import flagart, img2pyartprov
diff --git a/demo/InfoBar.py b/demo/InfoBar.py
index 533b75e0..e03bb860 100644
--- a/demo/InfoBar.py
+++ b/demo/InfoBar.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
#----------------------------------------------------------------------
diff --git a/demo/IntCtrl.py b/demo/IntCtrl.py
index ba3d2b04..cc9e10e9 100644
--- a/demo/IntCtrl.py
+++ b/demo/IntCtrl.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.intctrl
+import wx
+import wx.lib.intctrl
#----------------------------------------------------------------------
diff --git a/demo/ItemsPicker.py b/demo/ItemsPicker.py
index f14006cd..d800417f 100644
--- a/demo/ItemsPicker.py
+++ b/demo/ItemsPicker.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
from wx.lib.itemspicker import ItemsPicker, \
EVT_IP_SELECTION_CHANGED, \
diff --git a/demo/Joystick.py b/demo/Joystick.py
index 6dad47d7..638ed513 100644
--- a/demo/Joystick.py
+++ b/demo/Joystick.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: Joystick.py
# Purpose: Demonstrate use of wx.Joystick
@@ -10,10 +12,10 @@
# Copyright:
# Licence: wxWindows license
#----------------------------------------------------------------------------
-#
-import math
-import wx
+
+import math
+import wx
import wx.adv
haveJoystick = True
diff --git a/demo/KeyEvents.py b/demo/KeyEvents.py
index 4404cfe8..f476ec33 100644
--- a/demo/KeyEvents.py
+++ b/demo/KeyEvents.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.mixins.listctrl as listmix
+import wx
+import wx.lib.mixins.listctrl as listmix
#----------------------------------------------------------------------
diff --git a/demo/LEDNumberCtrl.py b/demo/LEDNumberCtrl.py
index 0217d691..963444c2 100644
--- a/demo/LEDNumberCtrl.py
+++ b/demo/LEDNumberCtrl.py
@@ -1,8 +1,9 @@
+#!/usr/bin/env python
-import time
+import time
-import wx
-import wx.gizmos as gizmos
+import wx
+import wx.gizmos as gizmos
#----------------------------------------------------------------------
diff --git a/demo/LayoutAnchors.py b/demo/LayoutAnchors.py
index 153450e0..c8838952 100644
--- a/demo/LayoutAnchors.py
+++ b/demo/LayoutAnchors.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.anchors as anchors
+import wx
+import wx.lib.anchors as anchors
#----------------------------------------------------------------------
diff --git a/demo/LayoutConstraints.py b/demo/LayoutConstraints.py
index 278d2887..9641c50a 100644
--- a/demo/LayoutConstraints.py
+++ b/demo/LayoutConstraints.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/Layoutf.py b/demo/Layoutf.py
index b5b5e385..bba9cf5b 100644
--- a/demo/Layoutf.py
+++ b/demo/Layoutf.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.layoutf as layoutf
+import wx
+import wx.lib.layoutf as layoutf
#---------------------------------------------------------------------------
diff --git a/demo/ListBox.py b/demo/ListBox.py
index 2f1273c3..da6acb20 100644
--- a/demo/ListBox.py
+++ b/demo/ListBox.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/ListCtrl.py b/demo/ListCtrl.py
index df1b3d5f..fd92a55e 100644
--- a/demo/ListCtrl.py
+++ b/demo/ListCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: ListCtrl.py
# Purpose: Testing lots of stuff, controls, window types, etc.
@@ -11,10 +13,10 @@
#----------------------------------------------------------------------------
import sys
-import wx
-import wx.lib.mixins.listctrl as listmix
+import wx
+import wx.lib.mixins.listctrl as listmix
-import images
+import images
#---------------------------------------------------------------------------
diff --git a/demo/ListCtrl_edit.py b/demo/ListCtrl_edit.py
index 9ae7e044..c8b5c11d 100644
--- a/demo/ListCtrl_edit.py
+++ b/demo/ListCtrl_edit.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: ListCtrl_edit.py
# Purpose: Testing editing a ListCtrl
@@ -10,8 +12,8 @@
#----------------------------------------------------------------------------
import sys
-import wx
-import wx.lib.mixins.listctrl as listmix
+import wx
+import wx.lib.mixins.listctrl as listmix
#---------------------------------------------------------------------------
diff --git a/demo/ListCtrl_virtual.py b/demo/ListCtrl_virtual.py
index 594d2efb..befec43a 100644
--- a/demo/ListCtrl_virtual.py
+++ b/demo/ListCtrl_virtual.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import images
+import wx
+import images
#----------------------------------------------------------------------
diff --git a/demo/Listbook.py b/demo/Listbook.py
index f5840e56..d70d3897 100644
--- a/demo/Listbook.py
+++ b/demo/Listbook.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
import ColorPanel
import images
diff --git a/demo/MDIDemo.py b/demo/MDIDemo.py
index b384fe3e..0179053a 100644
--- a/demo/MDIDemo.py
+++ b/demo/MDIDemo.py
@@ -1,10 +1,11 @@
+#!/usr/bin/env python
-import wx
+import wx
# Importing ScrolledWindow demo to make use of the MyCanvas
# class defined within.
-import ScrolledWindow
-import images
+import ScrolledWindow
+import images
SHOW_BACKGROUND = 1
diff --git a/demo/MDIWindows.py b/demo/MDIWindows.py
index 4fa3ad01..1764a3f6 100644
--- a/demo/MDIWindows.py
+++ b/demo/MDIWindows.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
import os
import sys
diff --git a/demo/MVCTree.py b/demo/MVCTree.py
index ebe9ac16..0642a257 100644
--- a/demo/MVCTree.py
+++ b/demo/MVCTree.py
@@ -1,9 +1,10 @@
+#!/usr/bin/env python
-import os
-import sys
+import os
+import sys
-import wx
-import wx.lib.mvctree as tree
+import wx
+import wx.lib.mvctree as tree
logger = None
def selchanging(evt):
diff --git a/demo/Mask.py b/demo/Mask.py
index 4c49c30c..806543fe 100644
--- a/demo/Mask.py
+++ b/demo/Mask.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/MaskedEditControls.py b/demo/MaskedEditControls.py
index 01cee3c1..a2f1bfa7 100644
--- a/demo/MaskedEditControls.py
+++ b/demo/MaskedEditControls.py
@@ -1,11 +1,12 @@
+#!/usr/bin/env python
-import string
-import sys
-import traceback
+import string
+import sys
+import traceback
-import wx
-import wx.lib.masked as masked
-import wx.lib.scrolledpanel as scroll
+import wx
+import wx.lib.masked as masked
+import wx.lib.scrolledpanel as scroll
class demoMixin:
diff --git a/demo/MaskedNumCtrl.py b/demo/MaskedNumCtrl.py
index 691d6ffa..c58d126c 100644
--- a/demo/MaskedNumCtrl.py
+++ b/demo/MaskedNumCtrl.py
@@ -1,10 +1,11 @@
+#!/usr/bin/env python
-import string
-import sys
-import traceback
+import string
+import sys
+import traceback
-import wx
-from wx.lib import masked
+import wx
+from wx.lib import masked
#----------------------------------------------------------------------
diff --git a/demo/MediaCtrl.py b/demo/MediaCtrl.py
index ade9012c..b04107ce 100644
--- a/demo/MediaCtrl.py
+++ b/demo/MediaCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.media
diff --git a/demo/Menu.py b/demo/Menu.py
index a031dc0a..795e21dc 100644
--- a/demo/Menu.py
+++ b/demo/Menu.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import time
-import wx
-import images
+import time
+import wx
+import images
#-------------------------------------------------------------------
diff --git a/demo/MessageDialog.py b/demo/MessageDialog.py
index 75dd639f..47d4c912 100644
--- a/demo/MessageDialog.py
+++ b/demo/MessageDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/MimeTypesManager.py b/demo/MimeTypesManager.py
index 9b357f77..fa7dd6fd 100644
--- a/demo/MimeTypesManager.py
+++ b/demo/MimeTypesManager.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------
# Name: wxMimeTypesManager
# Purpose: Demonstrate use of wx.MimeTypesManager, wx.FileType
@@ -10,12 +12,11 @@
# Copyright:
# Licence: wxWindows license
#----------------------------------------------------------------------
-#
-import pprint
-import wx
-import images
+import pprint
+import wx
+import images
# helper function to make sure we don't convert unicode objects to strings
diff --git a/demo/MiniFrame.py b/demo/MiniFrame.py
index 305289f1..2cc58387 100644
--- a/demo/MiniFrame.py
+++ b/demo/MiniFrame.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
class MyMiniFrame(wx.MiniFrame):
diff --git a/demo/MouseGestures.py b/demo/MouseGestures.py
index b2b71431..25216a96 100644
--- a/demo/MouseGestures.py
+++ b/demo/MouseGestures.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#*******************
#By Daniel Pozmanter
@@ -8,7 +10,8 @@
#This is a hacked version of DragAndDrop.py from the wxPython demo 2.5.2.8
-import wx, wx.lib.dialogs
+import wx
+import wx.lib.dialogs
from wx.lib.gestures import MouseGestures
#ToDo:
diff --git a/demo/MultiChoiceDialog.py b/demo/MultiChoiceDialog.py
index 3ce70774..67c62738 100644
--- a/demo/MultiChoiceDialog.py
+++ b/demo/MultiChoiceDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/MultiSash.py b/demo/MultiSash.py
index d02d6eca..818c38fd 100644
--- a/demo/MultiSash.py
+++ b/demo/MultiSash.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.lib.multisash as sash
diff --git a/demo/MultiSplitterWindow.py b/demo/MultiSplitterWindow.py
index e8a3f158..1f917e57 100644
--- a/demo/MultiSplitterWindow.py
+++ b/demo/MultiSplitterWindow.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
from wx.lib.splitter import MultiSplitterWindow
diff --git a/demo/MultipleChoiceDialog.py b/demo/MultipleChoiceDialog.py
index 3a36e987..3141896b 100644
--- a/demo/MultipleChoiceDialog.py
+++ b/demo/MultipleChoiceDialog.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.dialogs
+import wx
+import wx.lib.dialogs
#---------------------------------------------------------------------------
diff --git a/demo/Notebook.py b/demo/Notebook.py
index cd95b30a..0061f7e7 100644
--- a/demo/Notebook.py
+++ b/demo/Notebook.py
@@ -1,13 +1,14 @@
+#!/usr/bin/env python
-import sys
+import sys
-import wx
+import wx
-import ColorPanel
-import GridSimple
-import ListCtrl
-import ScrolledWindow
-import images
+import ColorPanel
+import GridSimple
+import ListCtrl
+import ScrolledWindow
+import images
#----------------------------------------------------------------------------
diff --git a/demo/NotificationMessage.py b/demo/NotificationMessage.py
index 1152bc56..a78d1ccb 100644
--- a/demo/NotificationMessage.py
+++ b/demo/NotificationMessage.py
@@ -1 +1 @@
-
import wx
import wx.adv
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.btn = wx.Button(self, -1, "Notify me of something...!", pos=(50,50))
self.btn.Bind(wx.EVT_BUTTON, self.OnButton)
def OnButton(self, event):
notify = wx.adv.NotificationMessage(title="Notify!",
message="...you of something...\numm...Updates are Available.",
parent=None, flags=wx.ICON_INFORMATION)
notify.SetFlags(
# wx.ICON_INFORMATION
wx.ICON_WARNING
# wx.ICON_ERROR
)
# notify.SetTitle("Wooot")
# notify.SetMessage("It's a message!")
# notify.SetParent(self)
notify.Show(timeout=1)#1 for short timeout, 100 for long timeout
# notify.Close()# Hides the notification.
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
This class allows to show the user a message non intrusively.
Currently it is implemented natively for Windows and GTK and
uses (non-modal) dialogs for the display of the notifications
under the other platforms.
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
\ No newline at end of file
+#!/usr/bin/env python
import wx
import wx.adv
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.btn = wx.Button(self, -1, "Notify me of something...!", pos=(50,50))
self.btn.Bind(wx.EVT_BUTTON, self.OnButton)
def OnButton(self, event):
notify = wx.adv.NotificationMessage(title="Notify!",
message="...you of something...\numm...Updates are Available.",
parent=None, flags=wx.ICON_INFORMATION)
notify.SetFlags(
# wx.ICON_INFORMATION
wx.ICON_WARNING
# wx.ICON_ERROR
)
# notify.SetTitle("Wooot")
# notify.SetMessage("It's a message!")
# notify.SetParent(self)
notify.Show(timeout=1)#1 for short timeout, 100 for long timeout
# notify.Close()# Hides the notification.
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
This class allows to show the user a message non intrusively.
Currently it is implemented natively for Windows and GTK and
uses (non-modal) dialogs for the display of the notifications
under the other platforms.
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
\ No newline at end of file
diff --git a/demo/OGL.py b/demo/OGL.py
index 2c0d8d1f..c15a5db3 100644
--- a/demo/OGL.py
+++ b/demo/OGL.py
@@ -1,4 +1,6 @@
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
+
# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Updated for wx namespace
@@ -11,12 +13,12 @@
# 20040830 - Pierre Hjälm
#
# o Added DrawnShape
-#
+
import wx
import wx.lib.ogl as ogl
-import images
+import images
#----------------------------------------------------------------------
diff --git a/demo/OwnerDrawnComboBox.py b/demo/OwnerDrawnComboBox.py
index 6dda9c4b..47445c28 100644
--- a/demo/OwnerDrawnComboBox.py
+++ b/demo/OwnerDrawnComboBox.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/PDFViewer.py b/demo/PDFViewer.py
index a48a8a69..084dd50f 100644
--- a/demo/PDFViewer.py
+++ b/demo/PDFViewer.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
try:
import pyPdf
diff --git a/demo/PageSetupDialog.py b/demo/PageSetupDialog.py
index d81a3149..6d758a87 100644
--- a/demo/PageSetupDialog.py
+++ b/demo/PageSetupDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
@@ -42,19 +43,19 @@ def runTest(frame, nb, log):
overview = """\
-This class represents the page setup common dialog. The page setup dialog is standard
-from Windows 95 on, replacing the print setup dialog (which is retained in Windows
-and wxWindows for backward compatibility). On Windows 95 and NT 4.0 and above,
+This class represents the page setup common dialog. The page setup dialog is standard
+from Windows 95 on, replacing the print setup dialog (which is retained in Windows
+and wxWindows for backward compatibility). On Windows 95 and NT 4.0 and above,
the page setup dialog is native to the windowing system, otherwise it is emulated.
-The page setup dialog contains controls for paper size (A4, A5 etc.), orientation
-(landscape or portrait), and controls for setting left, top, right and bottom margin
+The page setup dialog contains controls for paper size (A4, A5 etc.), orientation
+(landscape or portrait), and controls for setting left, top, right and bottom margin
sizes in millimetres.
-When the dialog has been closed, you need to query the wx.PageSetupDialogData object
+When the dialog has been closed, you need to query the wx.PageSetupDialogData object
associated with the dialog.
-Note that the OK and Cancel buttons do not destroy the dialog; this must be done by
+Note that the OK and Cancel buttons do not destroy the dialog; this must be done by
the application. As with other dialogs, do not destroy the dialog until you are done
with the data, and, conversely, do not use the wx.PageSetupDialogData after the
dialog is destroyed.
diff --git a/demo/Pickers.py b/demo/Pickers.py
index c810a2ec..2221eabe 100644
--- a/demo/Pickers.py
+++ b/demo/Pickers.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/PlateButton.py b/demo/PlateButton.py
index 759b6afd..71b9584d 100644
--- a/demo/PlateButton.py
+++ b/demo/PlateButton.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
###############################################################################
# Name: PlateButtonDemo.py #
# Purpose: PlateButton Test and Demo File #
diff --git a/demo/PopupControl.py b/demo/PopupControl.py
index 1e3afd09..7a885111 100644
--- a/demo/PopupControl.py
+++ b/demo/PopupControl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/PopupMenu.py b/demo/PopupMenu.py
index 6cf4d151..561fd3eb 100644
--- a/demo/PopupMenu.py
+++ b/demo/PopupMenu.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import wx
+import wx
-import images
+import images
#----------------------------------------------------------------------
diff --git a/demo/PopupWindow.py b/demo/PopupWindow.py
index 2928ff27..0c964d1f 100644
--- a/demo/PopupWindow.py
+++ b/demo/PopupWindow.py
@@ -1,12 +1,13 @@
-#
+#!/usr/bin/env python
+
# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Some issues with the listbox example; I tried correcting
# it but it's still not working the way it should. Commented
# out for now, as I found it.
-#
-import wx
+
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/PrintDialog.py b/demo/PrintDialog.py
index caceebed..895db19e 100644
--- a/demo/PrintDialog.py
+++ b/demo/PrintDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/PrintFramework.py b/demo/PrintFramework.py
index 3bcc3532..8fae51c9 100644
--- a/demo/PrintFramework.py
+++ b/demo/PrintFramework.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import ScrolledWindow
+import wx
+import ScrolledWindow
#----------------------------------------------------------------------
diff --git a/demo/Process.py b/demo/Process.py
index 2ea9fe78..16f49eb9 100644
--- a/demo/Process.py
+++ b/demo/Process.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/ProgressDialog.py b/demo/ProgressDialog.py
index bb8879aa..6d28f189 100644
--- a/demo/ProgressDialog.py
+++ b/demo/ProgressDialog.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Updated for wx namespace
@@ -6,9 +8,8 @@
#
# o wx.ProgressDialog appears to be broken. No abort button
# and it's not possible to dismiss it otherwise.
-#
-import wx
+import wx
#---------------------------------------------------------------------------
diff --git a/demo/PropertyGrid.py b/demo/PropertyGrid.py
index dd77a053..c9cbdf0e 100644
--- a/demo/PropertyGrid.py
+++ b/demo/PropertyGrid.py
@@ -1,5 +1,10 @@
+#!/usr/bin/env python
-import sys, time, math, os, os.path
+import sys
+import time
+import math
+import os
+import os.path
import wx
_ = wx.GetTranslation
diff --git a/demo/PseudoDC.py b/demo/PseudoDC.py
index ece994cd..b5364f7d 100644
--- a/demo/PseudoDC.py
+++ b/demo/PseudoDC.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import images
@@ -55,7 +56,7 @@ class MyCanvas(wx.ScrolledWindow):
self.SetVirtualSize((self.maxWidth, self.maxHeight))
self.SetScrollRate(20,20)
-
+
# create a PseudoDC to record our drawing
self.pdc = wx.PseudoDC()
self.pen_cache = {}
@@ -66,11 +67,11 @@ class MyCanvas(wx.ScrolledWindow):
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_ERASE_BACKGROUND, lambda x:None)
self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouse)
-
+
# vars for handling mouse clicks
self.dragid = -1
self.lastpos = (0,0)
-
+
def ConvertEventCoords(self, event):
xView, yView = self.GetViewStart()
xDelta, yDelta = self.GetScrollPixelsPerUnit()
@@ -141,7 +142,7 @@ class MyCanvas(wx.ScrolledWindow):
def OnPaint(self, event):
# Create a buffered paint DC. It will create the real
# wx.PaintDC and then blit the bitmap to it when dc is
- # deleted.
+ # deleted.
dc = wx.BufferedPaintDC(self)
# use PrepateDC to set position correctly
self.PrepareDC(dc)
@@ -276,7 +277,7 @@ class ControlPanel(wx.Panel):
def OnChange(self, event):
global hitradius
hitradius = self.sc.GetValue()
-
+
#---------------------------------------------------------------------------
@@ -318,7 +319,7 @@ again. The PseudoDC also supports object level clipping. To enable this use:
DrawToDCClipped(dc, clippingRect)
-To draw the PseudoDC to a real dc. This is useful for large scrolled windows
+To draw the PseudoDC to a real dc. This is useful for large scrolled windows
where many objects are offscreen.
Objects can be moved around without re-drawing using:
diff --git a/demo/PyColourChooser.py b/demo/PyColourChooser.py
index 32921e15..6e661799 100644
--- a/demo/PyColourChooser.py
+++ b/demo/PyColourChooser.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.colourchooser as cc
+import wx
+import wx.lib.colourchooser as cc
#---------------------------------------------------------------
diff --git a/demo/PyCrust.py b/demo/PyCrust.py
index 3fd96ebe..51e3a1a2 100644
--- a/demo/PyCrust.py
+++ b/demo/PyCrust.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx.py as py
+import wx.py as py
#----------------------------------------------------------------------
diff --git a/demo/PyPlot.py b/demo/PyPlot.py
index 84866f64..a5758302 100644
--- a/demo/PyPlot.py
+++ b/demo/PyPlot.py
@@ -1,9 +1,10 @@
+#!/usr/bin/env python
-import wx
+import wx
hadImportError = False
try:
- import wx.lib.plot
+ import wx.lib.plot
except ImportError:
hadImportError = True
diff --git a/demo/PyShell.py b/demo/PyShell.py
index 0c9fa949..cd5b20ae 100644
--- a/demo/PyShell.py
+++ b/demo/PyShell.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx.py as py
+import wx.py as py
#----------------------------------------------------------------------
diff --git a/demo/PythonEvents.py b/demo/PythonEvents.py
index 7987ab9a..69149c71 100644
--- a/demo/PythonEvents.py
+++ b/demo/PythonEvents.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
-import sys
+import sys
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/RadioBox.py b/demo/RadioBox.py
index 6f728dcc..ac5e03f4 100644
--- a/demo/RadioBox.py
+++ b/demo/RadioBox.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
@@ -18,7 +19,7 @@ class TestRadioBox(wx.Panel):
self, -1, "wx.RadioBox", wx.DefaultPosition, wx.DefaultSize,
sampleList, 2, wx.RA_SPECIFY_COLS
)
-
+
self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb)
#rb.SetBackgroundColour(wx.BLUE)
rb.SetToolTip(wx.ToolTip("This is a ToolTip!"))
@@ -30,7 +31,7 @@ class TestRadioBox(wx.Panel):
self, -1, "", wx.DefaultPosition, wx.DefaultSize,
sampleList, 3, wx.RA_SPECIFY_COLS | wx.NO_BORDER
)
-
+
self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb)
rb.SetToolTip(wx.ToolTip("This box has no label"))
@@ -53,7 +54,7 @@ def runTest(frame, nb, log):
overview = """\
A RadioBox is used to select one of a number of mutually exclusive
choices. It is displayed as a vertical column or horizontal row of
-labelled buttons, surrounded by a box that can optionally have a
+labelled buttons, surrounded by a box that can optionally have a
label.
"""
diff --git a/demo/RadioButton.py b/demo/RadioButton.py
index b84e7e21..7e3c9e3d 100644
--- a/demo/RadioButton.py
+++ b/demo/RadioButton.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
@@ -51,7 +52,7 @@ class TestPanel( wx.Panel ):
self.group2_ctrls.append((radio4, text4))
self.group2_ctrls.append((radio5, text5))
self.group2_ctrls.append((radio6, text6))
-
+
for radio, text in self.group2_ctrls:
grid2.Add( radio, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
grid2.Add( text, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
diff --git a/demo/RawBitmapAccess.py b/demo/RawBitmapAccess.py
index 843d5abc..e9ed6abe 100644
--- a/demo/RawBitmapAccess.py
+++ b/demo/RawBitmapAccess.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
# use the numpy code instead of the raw access code for comparison
diff --git a/demo/RendererNative.py b/demo/RendererNative.py
index b0d94c4b..5e16cb22 100644
--- a/demo/RendererNative.py
+++ b/demo/RendererNative.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
@@ -39,7 +41,7 @@ class TestPanel(wx.Panel):
render.DrawRadioBitmap(self, dc, (405, 35, 16, 16), wx.CONTROL_CHECKABLE)
render.DrawRadioBitmap(self, dc, (425, 35, 16, 16))
render.DrawRadioBitmap(self, dc, (445, 35, 16, 16), wx.CONTROL_CHECKED | wx.CONTROL_DISABLED)
-
+
# Draw ComboBoxDropButton
xpos = self.GetTextExtent(cb_lbl)[0] + 40
cb_lbl = "DrawComboBoxDropButton:"
@@ -126,24 +128,24 @@ def runTest(frame, nb, log):
overview = """
wx.RendererNative
-wx.RendererNative is a class which virtualizes drawing. It abstracts the
-operations of drawing controls and allows you to draw say, a button, without
-caring about exactly how it is done, in a native and platform independant way.
+
wx.RendererNative is a class which virtualizes drawing. It abstracts the
+operations of drawing controls and allows you to draw say, a button, without
+caring about exactly how it is done, in a native and platform independant way.
All drawing functions take some standard parameters:
- win: is the window being drawn.
-- dc: is the wxDC to draw on. Only this device context should be used
+
- dc: is the wxDC to draw on. Only this device context should be used
for drawing.
- rect: The bounding rectangle for the element to be drawn.
-- flags: The optional flags (none by default) which can be a
+
- flags: The optional flags (none by default) which can be a
combination of the wx.CONTROL_XXX constants.
-Note: Each drawing function restores the wxDC attributes if it
-changes them, so it is safe to assume that the same pen, brush and colours
-that were active before the call to this function are still in effect
+
Note: Each drawing function restores the wxDC attributes if it
+changes them, so it is safe to assume that the same pen, brush and colours
+that were active before the call to this function are still in effect
after it.
"""
diff --git a/demo/ResizeWidget.py b/demo/ResizeWidget.py
index 2f44b613..c1fc1822 100644
--- a/demo/ResizeWidget.py
+++ b/demo/ResizeWidget.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.lib.resizewidget as rw
diff --git a/demo/RichTextCtrl.py b/demo/RichTextCtrl.py
index 5d54a9c8..5021280a 100644
--- a/demo/RichTextCtrl.py
+++ b/demo/RichTextCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.richtext as rt
@@ -179,7 +180,7 @@ class RichTextFrame(wx.Frame):
self.rtc.Newline()
self.rtc.WriteText("I find some of the RichTextCtrl method names, as used above, to be misleading. Some character styles are stacked in the RichTextCtrl, and they are removed in the reverse order from how they are added, regardless of the method called. Allow me to demonstrate what I mean.")
self.rtc.Newline()
-
+
self.rtc.WriteText('Start with plain text. ')
self.rtc.BeginBold()
self.rtc.WriteText('BeginBold() makes it bold. ')
@@ -233,7 +234,7 @@ class RichTextFrame(wx.Frame):
self.rtc.EndSuppressUndo()
self.rtc.Thaw()
-
+
def SetFontStyle(self, fontColor = None, fontBgColor = None, fontFace = None, fontSize = None,
fontBold = None, fontItalic = None, fontUnderline = None):
@@ -264,7 +265,7 @@ class RichTextFrame(wx.Frame):
def OnURL(self, evt):
wx.MessageBox(evt.GetString(), "URL Clicked")
-
+
def OnFileOpen(self, evt):
# This gives us a string suitable for the file dialog based on
@@ -280,14 +281,14 @@ class RichTextFrame(wx.Frame):
self.rtc.LoadFile(path, fileType)
dlg.Destroy()
-
+
def OnFileSave(self, evt):
if not self.rtc.GetFilename():
self.OnFileSaveAs(evt)
return
self.rtc.SaveFile()
-
+
def OnFileSaveAs(self, evt):
wildcard, types = rt.RichTextBuffer.GetExtWildcard(save=True)
@@ -303,8 +304,8 @@ class RichTextFrame(wx.Frame):
path += '.' + ext
self.rtc.SaveFile(path, fileType)
dlg.Destroy()
-
-
+
+
def OnFileViewHTML(self, evt):
# Get an instance of the html file handler, use it to save the
# document to a StringIO stream, and then display the
@@ -332,31 +333,31 @@ class RichTextFrame(wx.Frame):
dlg.ShowModal()
handler.DeleteTemporaryImages()
-
-
+
+
def OnFileExit(self, evt):
self.Close(True)
-
+
def OnBold(self, evt):
self.rtc.ApplyBoldToSelection()
-
- def OnItalic(self, evt):
+
+ def OnItalic(self, evt):
self.rtc.ApplyItalicToSelection()
-
+
def OnUnderline(self, evt):
self.rtc.ApplyUnderlineToSelection()
-
+
def OnAlignLeft(self, evt):
self.rtc.ApplyAlignmentToSelection(wx.TEXT_ALIGNMENT_LEFT)
-
+
def OnAlignRight(self, evt):
self.rtc.ApplyAlignmentToSelection(wx.TEXT_ALIGNMENT_RIGHT)
-
+
def OnAlignCenter(self, evt):
self.rtc.ApplyAlignmentToSelection(wx.TEXT_ALIGNMENT_CENTRE)
-
+
def OnIndentMore(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT)
@@ -369,8 +370,8 @@ class RichTextFrame(wx.Frame):
attr.SetLeftIndent(attr.GetLeftIndent() + 100)
attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT)
self.rtc.SetStyle(r, attr)
-
-
+
+
def OnIndentLess(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT)
@@ -385,7 +386,7 @@ class RichTextFrame(wx.Frame):
attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT)
self.rtc.SetStyle(r, attr)
-
+
def OnParagraphSpacingMore(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER)
@@ -399,7 +400,7 @@ class RichTextFrame(wx.Frame):
attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER)
self.rtc.SetStyle(r, attr)
-
+
def OnParagraphSpacingLess(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER)
@@ -414,8 +415,8 @@ class RichTextFrame(wx.Frame):
attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER)
self.rtc.SetStyle(r, attr)
-
- def OnLineSpacingSingle(self, evt):
+
+ def OnLineSpacingSingle(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_LINE_SPACING)
ip = self.rtc.GetInsertionPoint()
@@ -427,8 +428,8 @@ class RichTextFrame(wx.Frame):
attr.SetFlags(wx.TEXT_ATTR_LINE_SPACING)
attr.SetLineSpacing(10)
self.rtc.SetStyle(r, attr)
-
-
+
+
def OnLineSpacingHalf(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_LINE_SPACING)
@@ -442,7 +443,7 @@ class RichTextFrame(wx.Frame):
attr.SetLineSpacing(15)
self.rtc.SetStyle(r, attr)
-
+
def OnLineSpacingDouble(self, evt):
attr = wx.TextAttr()
attr.SetFlags(wx.TEXT_ATTR_LINE_SPACING)
@@ -500,28 +501,28 @@ class RichTextFrame(wx.Frame):
attr.SetTextColour(colour)
self.rtc.SetStyle(r, attr)
dlg.Destroy()
-
+
def OnUpdateBold(self, evt):
evt.Check(self.rtc.IsSelectionBold())
-
- def OnUpdateItalic(self, evt):
+
+ def OnUpdateItalic(self, evt):
evt.Check(self.rtc.IsSelectionItalics())
-
- def OnUpdateUnderline(self, evt):
+
+ def OnUpdateUnderline(self, evt):
evt.Check(self.rtc.IsSelectionUnderlined())
-
+
def OnUpdateAlignLeft(self, evt):
evt.Check(self.rtc.IsSelectionAligned(wx.TEXT_ALIGNMENT_LEFT))
-
+
def OnUpdateAlignCenter(self, evt):
evt.Check(self.rtc.IsSelectionAligned(wx.TEXT_ALIGNMENT_CENTRE))
-
+
def OnUpdateAlignRight(self, evt):
evt.Check(self.rtc.IsSelectionAligned(wx.TEXT_ALIGNMENT_RIGHT))
-
+
def ForwardEvent(self, evt):
# The RichTextCtrl can handle menu and update events for undo,
# redo, cut, copy, paste, delete, and select all, so just
@@ -534,7 +535,7 @@ class RichTextFrame(wx.Frame):
self.Bind(wx.EVT_MENU, handler, item)
if updateUI is not None:
self.Bind(wx.EVT_UPDATE_UI, updateUI, item)
-
+
fileMenu = wx.Menu()
doBind( fileMenu.Append(-1, "&Open\tCtrl+O", "Open a file"),
self.OnFileOpen )
@@ -548,7 +549,7 @@ class RichTextFrame(wx.Frame):
fileMenu.AppendSeparator()
doBind( fileMenu.Append(-1, "E&xit\tCtrl+Q", "Quit this program"),
self.OnFileExit )
-
+
editMenu = wx.Menu()
doBind( editMenu.Append(wx.ID_UNDO, "&Undo\tCtrl+Z"),
self.ForwardEvent, self.ForwardEvent)
@@ -566,7 +567,7 @@ class RichTextFrame(wx.Frame):
editMenu.AppendSeparator()
doBind( editMenu.Append(wx.ID_SELECTALL, "Select A&ll\tCtrl+A"),
self.ForwardEvent, self.ForwardEvent )
-
+
#doBind( editMenu.AppendSeparator(), )
#doBind( editMenu.Append(-1, "&Find...\tCtrl+F"), )
#doBind( editMenu.Append(-1, "&Replace...\tCtrl+R"), )
@@ -597,7 +598,7 @@ class RichTextFrame(wx.Frame):
doBind( formatMenu.Append(-1, "Double Line Spacing"), self.OnLineSpacingDouble)
formatMenu.AppendSeparator()
doBind( formatMenu.Append(-1, "&Font..."), self.OnFont)
-
+
mb = wx.MenuBar()
mb.Append(fileMenu, "&File")
mb.Append(editMenu, "&Edit")
@@ -610,7 +611,7 @@ class RichTextFrame(wx.Frame):
self.Bind(wx.EVT_TOOL, handler, item)
if updateUI is not None:
self.Bind(wx.EVT_UPDATE_UI, updateUI, item)
-
+
tbar = self.CreateToolBar()
doBind( tbar.AddTool(-1, images._rt_open.GetBitmap(),
shortHelpString="Open"), self.OnFileOpen)
@@ -655,7 +656,7 @@ class RichTextFrame(wx.Frame):
tbar.Realize()
-
+
#----------------------------------------------------------------------
@@ -675,7 +676,7 @@ class TestPanel(wx.Panel):
# make sure we haven't already added them.
if rt.RichTextBuffer.FindHandlerByType(rt.RICHTEXT_TYPE_HTML) is not None:
return
-
+
# This would normally go in your app's OnInit method. I'm
# not sure why these file handlers are not loaded by
# default by the C++ richtext code, I guess it's so you
diff --git a/demo/RightTextCtrl.py b/demo/RightTextCtrl.py
index c24da5c1..c21c27c4 100644
--- a/demo/RightTextCtrl.py
+++ b/demo/RightTextCtrl.py
@@ -1,11 +1,13 @@
+#!/usr/bin/env python
+
#####################################################################\
# Note: This control is deprecated because wx.TextCtrl now supports |
# the wx.TE_RIGHT style flag, which makes this control completely |
# superfluous. |
#####################################################################/
-import wx
-import wx.lib.rightalign as right
+import wx
+import wx.lib.rightalign as right
#----------------------------------------------------------------------
@@ -18,8 +20,8 @@ class TestPanel(wx.Panel):
txt = wx.StaticText(
self, -1,
"These text controls will align their contents to\n"
- "the right (on wxMSW) when they don't have focus.",
- style=wx.ALIGN_RIGHT
+ "the right (on wxMSW) when they don't have focus.",
+ style=wx.ALIGN_RIGHT
)
fgs.Add(txt)
diff --git a/demo/RowColSizer.py b/demo/RowColSizer.py
index d1fb3f56..1770b74f 100644
--- a/demo/RowColSizer.py
+++ b/demo/RowColSizer.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.rcsizer as rcs
+import wx
+import wx.lib.rcsizer as rcs
#----------------------------------------------------------------------
@@ -24,7 +25,7 @@ class TestPanel(wx.Panel):
sizer.Add(wx.TextCtrl(self, -1, "(3,3)"), row=3, col=3)
sizer.Add(wx.TextCtrl(self, -1, "(3,4)"), row=3, col=4)
sizer.Add(
- wx.TextCtrl(self, -1, "(4,2) span:(2,2)"),
+ wx.TextCtrl(self, -1, "(4,2) span:(2,2)"),
flag=wx.EXPAND, row=4, col=2, rowspan=2, colspan=2
)
@@ -32,10 +33,10 @@ class TestPanel(wx.Panel):
sizer.Add(wx.TextCtrl(self, -1, "(7,2)"), row=7, col=2)
sizer.Add(wx.TextCtrl(self, -1, "(8,3)"), row=8, col=3)
sizer.Add(
- wx.TextCtrl(self, -1, "(10,1) colspan: 4"),
+ wx.TextCtrl(self, -1, "(10,1) colspan: 4"),
flag=wx.EXPAND, pos=(10,1), colspan=4
)
-
+
sizer.Add(
wx.TextCtrl(self, -1, "(3,5) rowspan: 8, growable col", style=wx.TE_MULTILINE),
flag=wx.EXPAND, pos=(3,5), size=(8,1)
@@ -48,18 +49,18 @@ class TestPanel(wx.Panel):
sizer.Add(box, pos=(12,1))
sizer.Add(
- wx.TextCtrl(self, -1, "(12,2) align bottom"),
+ wx.TextCtrl(self, -1, "(12,2) align bottom"),
flag=wx.ALIGN_BOTTOM, pos=(12,2)
)
sizer.Add(
- wx.TextCtrl(self, -1, "(12,3) align center"),
+ wx.TextCtrl(self, -1, "(12,3) align center"),
flag=wx.ALIGN_CENTER_VERTICAL, pos=(12,3)
)
sizer.Add(wx.TextCtrl(self, -1, "(12,4)"),pos=(12,4))
sizer.Add(
- wx.TextCtrl(self, -1, "(12,5) full border"),
+ wx.TextCtrl(self, -1, "(12,5) full border"),
flag=wx.EXPAND|wx.ALL, border=15, pos=(12,5)
)
diff --git a/demo/SashWindow.py b/demo/SashWindow.py
index c703e37d..67af3e4f 100644
--- a/demo/SashWindow.py
+++ b/demo/SashWindow.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
@@ -15,7 +16,7 @@ class TestSashWindow(wx.Panel):
# Create some layout windows
# A window like a toolbar
topwin = wx.adv.SashLayoutWindow(
- self, -1, wx.DefaultPosition, (200, 30),
+ self, -1, wx.DefaultPosition, (200, 30),
wx.NO_BORDER|wx.adv.SW_3D
)
@@ -30,7 +31,7 @@ class TestSashWindow(wx.Panel):
# A window like a statusbar
bottomwin = wx.adv.SashLayoutWindow(
- self, -1, wx.DefaultPosition, (200, 30),
+ self, -1, wx.DefaultPosition, (200, 30),
wx.NO_BORDER|wx.adv.SW_3D
)
@@ -45,7 +46,7 @@ class TestSashWindow(wx.Panel):
# A window to the left of the client window
leftwin1 = wx.adv.SashLayoutWindow(
- self, -1, wx.DefaultPosition, (200, 30),
+ self, -1, wx.DefaultPosition, (200, 30),
wx.NO_BORDER|wx.adv.SW_3D
)
@@ -56,7 +57,7 @@ class TestSashWindow(wx.Panel):
leftwin1.SetSashVisible(wx.adv.SASH_RIGHT, True)
leftwin1.SetExtraBorderSize(10)
textWindow = wx.TextCtrl(
- leftwin1, -1, "", wx.DefaultPosition, wx.DefaultSize,
+ leftwin1, -1, "", wx.DefaultPosition, wx.DefaultSize,
wx.TE_MULTILINE|wx.SUNKEN_BORDER
)
@@ -68,7 +69,7 @@ class TestSashWindow(wx.Panel):
# Another window to the left of the client window
leftwin2 = wx.adv.SashLayoutWindow(
- self, -1, wx.DefaultPosition, (200, 30),
+ self, -1, wx.DefaultPosition, (200, 30),
wx.NO_BORDER|wx.adv.SW_3D
)
@@ -132,13 +133,13 @@ def runTest(frame, nb, log):
overview = """\
-wx.adv.SashLayoutWindow responds to OnCalculateLayout events generated by
-wx.adv.LayoutAlgorithm. It allows the application to use simple accessors to
-specify how the window should be laid out, rather than having to respond
-to events. The fact that the class derives from wx.SashWindow allows sashes
+wx.adv.SashLayoutWindow responds to OnCalculateLayout events generated by
+wx.adv.LayoutAlgorithm. It allows the application to use simple accessors to
+specify how the window should be laid out, rather than having to respond
+to events. The fact that the class derives from wx.SashWindow allows sashes
to be used if required, to allow the windows to be user-resizable.
-The documentation for wx.LayoutAlgorithm explains the purpose of this class
+The documentation for wx.LayoutAlgorithm explains the purpose of this class
in more detail.
"""
diff --git a/demo/ScrolledMessageDialog.py b/demo/ScrolledMessageDialog.py
index 8620a7b1..42ab0386 100644
--- a/demo/ScrolledMessageDialog.py
+++ b/demo/ScrolledMessageDialog.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.dialogs
+import wx
+import wx.lib.dialogs
#---------------------------------------------------------------------------
@@ -40,7 +41,7 @@ overview = """\
This class represents a message dialog that uses a wxTextCtrl to display the
message. This allows more flexible information display without having to be
-as much concerned with layout requirements. A text file can simply be used
+as much concerned with layout requirements. A text file can simply be used
This dialog offers no special attributes or methods beyond those supported
by wxDialog.
diff --git a/demo/ScrolledPanel.py b/demo/ScrolledPanel.py
index e5226cf7..9b8a5910 100644
--- a/demo/ScrolledPanel.py
+++ b/demo/ScrolledPanel.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.scrolledpanel as scrolled
+import wx
+import wx.lib.scrolledpanel as scrolled
#----------------------------------------------------------------------
diff --git a/demo/ScrolledWindow.py b/demo/ScrolledWindow.py
index f6ec1a84..c57d9d5b 100644
--- a/demo/ScrolledWindow.py
+++ b/demo/ScrolledWindow.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import images
+import wx
+import images
# There are two different approaches to drawing, buffered or direct.
# This sample shows both approaches so you can easily compare and
@@ -161,7 +162,7 @@ class MyCanvas(wx.ScrolledWindow):
def OnLeftButtonEvent(self, event):
if self.IsAutoScrolling():
self.StopAutoScrolling()
-
+
if event.LeftDown():
self.SetFocus()
self.SetXY(event)
@@ -187,7 +188,7 @@ class MyCanvas(wx.ScrolledWindow):
self.curLine.append(coords)
dc.DrawLine(*coords)
self.SetXY(event)
-
+
if BUFFERED:
# figure out what part of the window to refresh, based
# on what parts of the buffer we just updated
@@ -211,7 +212,7 @@ class MyCanvas(wx.ScrolledWindow):
## This is an example of what to do for the EVT_MOUSEWHEEL event,
## but since wx.ScrolledWindow does this already it's not
-## necessary to do it ourselves. You would need to add an event table
+## necessary to do it ourselves. You would need to add an event table
## entry to __init__() to direct wheelmouse events to this handler.
## wheelScroll = 0
@@ -244,8 +245,8 @@ def runTest(frame, nb, log):
overview = """
-The wx.ScrolledWindow class manages scrolling for its client area, transforming the
-coordinates according to the scrollbar positions, and setting the scroll positions,
+The wx.ScrolledWindow class manages scrolling for its client area, transforming the
+coordinates according to the scrollbar positions, and setting the scroll positions,
thumb sizes and ranges according to the area in view.
diff --git a/demo/SearchCtrl.py b/demo/SearchCtrl.py
index 8776ea85..115c8c41 100644
--- a/demo/SearchCtrl.py
+++ b/demo/SearchCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
@@ -42,15 +43,15 @@ class TestPanel(wx.Panel):
self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnSearch, self.search)
self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancel, self.search)
self.Bind(wx.EVT_TEXT_ENTER, self.OnDoSearch, self.search)
- ##self.Bind(wx.EVT_TEXT, self.OnDoSearch, self.search)
+ ##self.Bind(wx.EVT_TEXT, self.OnDoSearch, self.search)
def OnToggleSearchButton(self, evt):
self.search.ShowSearchButton( evt.GetInt() )
-
+
def OnToggleCancelButton(self, evt):
self.search.ShowCancelButton( evt.GetInt() )
-
+
def OnToggleSearchMenu(self, evt):
if evt.GetInt():
self.search.SetMenu( self.MakeMenu() )
@@ -60,13 +61,13 @@ class TestPanel(wx.Panel):
def OnSearch(self, evt):
self.log.write("OnSearch")
-
+
def OnCancel(self, evt):
self.log.write("OnCancel")
def OnDoSearch(self, evt):
self.log.write("OnDoSearch: " + self.search.GetValue())
-
+
def MakeMenu(self):
menu = wx.Menu()
@@ -79,7 +80,7 @@ class TestPanel(wx.Panel):
"catch their selections" ]:
menu.Append(-1, txt)
return menu
-
+
#----------------------------------------------------------------------
diff --git a/demo/ShapedWindow.py b/demo/ShapedWindow.py
index 5f179d3e..fe2701dc 100644
--- a/demo/ShapedWindow.py
+++ b/demo/ShapedWindow.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
-import wx
-import images
+import wx
+import images
#----------------------------------------------------------------------
diff --git a/demo/SingleChoiceDialog.py b/demo/SingleChoiceDialog.py
index 2317d7e3..2ee21f99 100644
--- a/demo/SingleChoiceDialog.py
+++ b/demo/SingleChoiceDialog.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#---------------------------------------------------------------------------
@@ -15,7 +16,7 @@ class TestPanel(wx.Panel):
def OnButton(self, evt):
dlg = wx.SingleChoiceDialog(
self, 'Test Single Choice', 'The Caption',
- ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'],
+ ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'],
wx.CHOICEDLG_STYLE
)
diff --git a/demo/SizedControls.py b/demo/SizedControls.py
index d5f3c2fb..df4afae0 100644
--- a/demo/SizedControls.py
+++ b/demo/SizedControls.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.sized_controls as sc
@@ -101,14 +103,14 @@ in action.
| expand | True/False |
-Whether or not the control should grow to fill free space if
+ | Whether or not the control should grow to fill free space if
free space is available. |
-| proportion | Number (typically 0-10) |
-How much of the free space the control should take up. Note that this value is
-relative to other controls, so a proportion of 2 means take up
+ | proportion | Number (typically 0-10) |
+How much of the free space the control should take up. Note that this value is
+relative to other controls, so a proportion of 2 means take up
'twice as much' space as controls with a proportion of 1. |
@@ -140,48 +142,48 @@ it is not currently possible to assign different border sizes to each direction.
class FormDialog(sc.SizedDialog):
def __init__(self, parent, id):
- sc.SizedDialog.__init__(self, None, -1, "SizedForm Dialog",
+ sc.SizedDialog.__init__(self, None, -1, "SizedForm Dialog",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
-
+
pane = self.GetContentsPane()
pane.SetSizerType("form")
-
+
# row 1
wx.StaticText(pane, -1, "Name")
textCtrl = wx.TextCtrl(pane, -1, "Your name here")
textCtrl.SetSizerProps(expand=True)
-
+
# row 2
wx.StaticText(pane, -1, "Email")
emailCtrl = wx.TextCtrl(pane, -1, "")
emailCtrl.SetSizerProps(expand=True)
-
+
# row 3
wx.StaticText(pane, -1, "Gender")
wx.Choice(pane, -1, choices=["male", "female"])
-
+
# row 4
wx.StaticText(pane, -1, "State")
wx.TextCtrl(pane, -1, size=(60, -1)) # two chars for state
-
+
# row 5
wx.StaticText(pane, -1, "Title")
-
+
# here's how to add a 'nested sizer' using sized_controls
radioPane = sc.SizedPanel(pane, -1)
radioPane.SetSizerType("horizontal")
radioPane.SetSizerProps(expand=True)
-
+
# make these children of the radioPane to have them use
# the horizontal layout
wx.RadioButton(radioPane, -1, "Mr.")
wx.RadioButton(radioPane, -1, "Mrs.")
wx.RadioButton(radioPane, -1, "Dr.")
# end row 5
-
+
# add dialog buttons
self.SetButtonSizer(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL))
-
+
# a little trick to make sure that you can't resize the dialog to
# less screen space than the controls need
self.Fit()
@@ -190,77 +192,77 @@ class FormDialog(sc.SizedDialog):
class ScrolledFormDialog(sc.SizedDialog):
def __init__(self, parent, id):
- sc.SizedDialog.__init__(self, None, -1, "SizedForm Dialog with a scolled panel",
+ sc.SizedDialog.__init__(self, None, -1, "SizedForm Dialog with a scolled panel",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
size=wx.Size(-1, 220))
-
+
cPane = self.GetContentsPane()
pane = sc.SizedScrolledPanel(cPane, wx.ID_ANY)
pane.SetSizerProps(expand=True, proportion=1)
pane.SetSizerType("form")
-
+
# row 1
wx.StaticText(pane, -1, "Name")
textCtrl = wx.TextCtrl(pane, -1, "Your name here")
textCtrl.SetSizerProps(expand=True)
-
+
# row 2
wx.StaticText(pane, -1, "Email")
emailCtrl = wx.TextCtrl(pane, -1, "")
emailCtrl.SetSizerProps(expand=True)
-
+
# row 3
wx.StaticText(pane, -1, "Gender")
wx.Choice(pane, -1, choices=["male", "female"])
-
+
# row 4
wx.StaticText(pane, -1, "State")
wx.TextCtrl(pane, -1, size=(60, -1)) # two chars for state
-
+
# row 5
wx.StaticText(pane, -1, "Title")
-
+
# here's how to add a 'nested sizer' using sized_controls
radioPane = sc.SizedPanel(pane, -1)
radioPane.SetSizerType("horizontal")
radioPane.SetSizerProps(expand=True)
-
+
# make these children of the radioPane to have them use
# the horizontal layout
wx.RadioButton(radioPane, -1, "Mr.")
wx.RadioButton(radioPane, -1, "Mrs.")
wx.RadioButton(radioPane, -1, "Dr.")
# end row 5
-
+
# add dialog buttons
self.SetButtonSizer(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL))
-
+
class ErrorDialog(sc.SizedDialog):
def __init__(self, parent, id):
- sc.SizedDialog.__init__(self, parent, id, "Error log viewer",
+ sc.SizedDialog.__init__(self, parent, id, "Error log viewer",
style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
-
+
# Always use self.GetContentsPane() - this ensures that your dialog
# automatically adheres to HIG spacing requirements on all platforms.
# pane here is a sc.SizedPanel with a vertical sizer layout. All children
# should be added to this pane, NOT to self.
pane = self.GetContentsPane()
-
+
# first row
self.listCtrl = wx.ListCtrl(pane, -1, size=(300, -1), style=wx.LC_REPORT)
self.listCtrl.SetSizerProps(expand=True, proportion=1)
self.ConfigureListCtrl()
-
+
# second row
self.lblDetails = wx.StaticText(pane, -1, "Error Details")
-
+
# third row
self.details = wx.TextCtrl(pane, -1, style=wx.TE_MULTILINE)
self.details.SetSizerProps(expand=True, proportion=1)
# final row
- # since we want to use a custom button layout, we won't use the
+ # since we want to use a custom button layout, we won't use the
# CreateStdDialogBtnSizer here, we'll just create our own panel with
# a horizontal layout and add the buttons to that.
btnpane = sc.SizedPanel(pane, -1)
@@ -275,42 +277,42 @@ class ErrorDialog(sc.SizedDialog):
self.Fit()
self.SetMinSize(self.GetSize())
-
+
def ConfigureListCtrl(self):
self.listCtrl.InsertColumn(0, "Time")
self.listCtrl.InsertColumn(1, "Error Message")
self.listCtrl.SetColumnWidth(0, 100)
self.listCtrl.SetColumnWidth(1, 280)
-
+
class GridFrame(sc.SizedFrame):
def __init__(self, parent, id):
sc.SizedFrame.__init__(self, parent, id, "Grid Layout Demo Frame")
-
+
pane = self.GetContentsPane()
pane.SetSizerType("grid", {"cols":3}) # 3-column grid layout
-
+
# row 1
wx.TextCtrl(pane, -1).SetSizerProps(halign="left")
wx.TextCtrl(pane, -1).SetSizerProps(halign="center")
wx.TextCtrl(pane, -1).SetSizerProps(halign="right")
-
+
# row 2
wx.TextCtrl(pane, -1).SetSizerProps(valign="center")
wx.TextCtrl(pane, -1).SetSizerProps(expand=True, proportion=1)
wx.TextCtrl(pane, -1).SetSizerProps(valign="center")
-
+
# row 3
wx.TextCtrl(pane, -1).SetSizerProps(halign="left")
wx.TextCtrl(pane, -1).SetSizerProps(halign="center")
wx.TextCtrl(pane, -1).SetSizerProps(halign="right")
-
+
self.CreateStatusBar() # should always do this when there's a resize border
-
+
self.Fit()
self.SetMinSize(self.GetSize())
-
-
+
+
#---------------------------------------------------------------------------
class TestPanel(sc.SizedScrolledPanel):
@@ -330,11 +332,11 @@ class TestPanel(sc.SizedScrolledPanel):
b2 = wx.Button(self, -1, "Sized Controls Error Dialog")
b2.SetSizerProps({'halign': 'center', 'border': ('all', 15)})
self.Bind(wx.EVT_BUTTON, self.OnErrorButton, b2)
-
+
b3 = wx.Button(self, -1, "Sized Controls Grid Layout Demo")
b3.SetSizerProps({'halign': 'center', 'border': ('all', 15)})
- self.Bind(wx.EVT_BUTTON, self.OnGridButton, b3)
-
+ self.Bind(wx.EVT_BUTTON, self.OnGridButton, b3)
+
def OnFormButton(self, evt):
@@ -343,14 +345,14 @@ class TestPanel(sc.SizedScrolledPanel):
# this does not return until the dialog is closed.
val = dlg.ShowModal()
-
+
if val == wx.ID_OK:
self.log.WriteText("You pressed OK\n")
else:
self.log.WriteText("You pressed Cancel\n")
dlg.Destroy()
-
+
def OnFormScrolledButton(self, evt):
dlg = ScrolledFormDialog(self, -1)
@@ -358,7 +360,7 @@ class TestPanel(sc.SizedScrolledPanel):
# this does not return until the dialog is closed.
val = dlg.ShowModal()
-
+
if val == wx.ID_OK:
self.log.WriteText("You pressed OK\n")
else:
@@ -367,27 +369,27 @@ class TestPanel(sc.SizedScrolledPanel):
dlg.Destroy()
def OnErrorButton(self, evt):
-
+
dlg = ErrorDialog(self, -1)
dlg.CenterOnScreen()
# this does not return until the dialog is closed.
val = dlg.ShowModal()
-
+
if val == wx.ID_OK:
self.log.WriteText("You pressed OK\n")
else:
self.log.WriteText("You pressed Cancel\n")
dlg.Destroy()
-
+
def OnGridButton(self, evt):
-
+
dlg = GridFrame(self, -1)
dlg.CenterOnScreen()
dlg.Show()
-
+
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
diff --git a/demo/Sizers.py b/demo/Sizers.py
index 2482b8b6..c13f4d06 100644
--- a/demo/Sizers.py
+++ b/demo/Sizers.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Had to do a bit of rework for the demo; there was no panel attached
@@ -5,13 +7,13 @@
# dark gray. I have no idea why this didn't break before. Robin,
# please examine my changes to ensure you approve. It's rather
# hackish looking.
-#
+
#----------------------------------------------------------------------
# sizer test code
#----------------------------------------------------------------------
-import wx
+import wx
#----------------------------------------------------------------------
@@ -22,10 +24,10 @@ class SampleWindow(wx.Window):
"""
def __init__(self, parent, text, pos=wx.DefaultPosition, size=wx.DefaultSize):
wx.Window.__init__(self, parent, -1,
- #style=wx.RAISED_BORDER
- #style=wx.SUNKEN_BORDER
- style=wx.SIMPLE_BORDER
- )
+ #style=wx.RAISED_BORDER
+ #style=wx.SUNKEN_BORDER
+ style=wx.SIMPLE_BORDER
+ )
self.text = text
if size != wx.DefaultSize:
self.bestsize = size
diff --git a/demo/Slider.py b/demo/Slider.py
index 2b829c0e..df4c6db6 100644
--- a/demo/Slider.py
+++ b/demo/Slider.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/Sound.py b/demo/Sound.py
index 13c6e976..c50543f9 100644
--- a/demo/Sound.py
+++ b/demo/Sound.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
-import wx
+import wx
import wx.adv
from Main import opj
diff --git a/demo/SpinButton.py b/demo/SpinButton.py
index 12fb117f..5061998b 100644
--- a/demo/SpinButton.py
+++ b/demo/SpinButton.py
@@ -1,9 +1,11 @@
+#!/usr/bin/env python
+
# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o EVT_SPIN events (or something about them) freezes up the app.
-#
-import wx
+
+import wx
#----------------------------------------------------------------------
diff --git a/demo/SpinCtrl.py b/demo/SpinCtrl.py
index b110ab0d..93d16e96 100644
--- a/demo/SpinCtrl.py
+++ b/demo/SpinCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
@@ -16,14 +17,14 @@ class TestPanel(wx.Panel):
self.Bind(wx.EVT_SPINCTRL, self.OnSpin, sc)
self.Bind(wx.EVT_TEXT, self.OnText, sc)
-
+
def OnSpin(self, evt):
self.log.write('OnSpin: %d\n' % self.sc.GetValue())
def OnText(self, evt):
self.log.write('OnText: %d\n' % self.sc.GetValue())
-
+
#----------------------------------------------------------------------
@@ -37,12 +38,12 @@ def runTest(frame, nb, log):
overview = """\
wx.SpinCtrl combines wx.TextCtrl and wx.SpinButton in one control.
-Portable programs should try to use this control as wx.SpinButton is not
+Portable programs should try to use this control as wx.SpinButton is not
implemented for all platforms (Win32 and GTK only currently).
-NB: the range supported by this control depends on the platform
-but is at least -0x8000 to 0x7fff. Under GTK and Win32 with sufficiently new version
-of comctrl32.dll (at least 4.71 is required, 5.80 is recommended) the full 32 bit
+NB: the range supported by this control depends on the platform
+but is at least -0x8000 to 0x7fff. Under GTK and Win32 with sufficiently new version
+of comctrl32.dll (at least 4.71 is required, 5.80 is recommended) the full 32 bit
range is supported.
diff --git a/demo/SpinCtrlDouble.py b/demo/SpinCtrlDouble.py
index bf608bc1..a7b69e83 100644
--- a/demo/SpinCtrlDouble.py
+++ b/demo/SpinCtrlDouble.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/SplitterWindow.py b/demo/SplitterWindow.py
index dafc4600..3bec07a6 100644
--- a/demo/SplitterWindow.py
+++ b/demo/SplitterWindow.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
@@ -9,7 +10,7 @@ class MySplitter(wx.SplitterWindow):
style = wx.SP_LIVE_UPDATE
)
self.log = log
-
+
self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnSashChanged)
self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGING, self.OnSashChanging)
@@ -30,7 +31,7 @@ def runTest(frame, nb, log):
#sty = wx.BORDER_NONE
#sty = wx.BORDER_SIMPLE
sty = wx.BORDER_SUNKEN
-
+
p1 = wx.Window(splitter, style=sty)
p1.SetBackgroundColour("pink")
wx.StaticText(p1, -1, "Panel One", (5,5))
diff --git a/demo/StandardPaths.py b/demo/StandardPaths.py
index 050c19bc..7b49ee95 100644
--- a/demo/StandardPaths.py
+++ b/demo/StandardPaths.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
@@ -44,7 +45,7 @@ class TestPanel(wx.Panel):
btn = wx.Button(self, wx.ID_HELP)
sizer.Add(btn)
self.help[btn] = func.__doc__
-
+
for x in ['GetConfigDir',
'GetUserConfigDir',
'GetDataDir',
@@ -80,8 +81,8 @@ class TestPanel(wx.Panel):
lines.append(line.strip())
doc = '\n'.join(lines)
wx.TipWindow(self, doc, 500)
-
-
+
+
#----------------------------------------------------------------------
def runTest(frame, nb, log):
diff --git a/demo/StaticBitmap.py b/demo/StaticBitmap.py
index 968e3659..75dad2b4 100644
--- a/demo/StaticBitmap.py
+++ b/demo/StaticBitmap.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import images
diff --git a/demo/StaticBox.py b/demo/StaticBox.py
index f4ab8934..d669f406 100644
--- a/demo/StaticBox.py
+++ b/demo/StaticBox.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
@@ -18,7 +19,7 @@ class TestPanel(wx.Panel):
border = wx.BoxSizer()
border.Add(bsizer, 1, wx.EXPAND|wx.ALL, 25)
self.SetSizer(border)
-
+
#----------------------------------------------------------------------
diff --git a/demo/StaticText.py b/demo/StaticText.py
index 3acb63f7..a26ef65e 100644
--- a/demo/StaticText.py
+++ b/demo/StaticText.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/StatusBar.py b/demo/StatusBar.py
index 0e379ed5..5fe90434 100644
--- a/demo/StatusBar.py
+++ b/demo/StatusBar.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import time
import wx
diff --git a/demo/StockButtons.py b/demo/StockButtons.py
index 59957a7c..e484c034 100644
--- a/demo/StockButtons.py
+++ b/demo/StockButtons.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/StyledTextCtrl_1.py b/demo/StyledTextCtrl_1.py
index 4dfdcb9f..37f0ecdf 100644
--- a/demo/StyledTextCtrl_1.py
+++ b/demo/StyledTextCtrl_1.py
@@ -1,8 +1,9 @@
-#
+#!/usr/bin/env python
+
# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wx.TheClipboard.Flush() generates a warning on program exit.
-#
+
import wx
import wx.stc as stc
@@ -282,7 +283,7 @@ def runTest(frame, nb, log):
ed.SetSelection(25, 35)
print("GetSelectedText(): ", repr(ed.GetSelectedText()))
print("GetTextRange(25, 35): ", repr(ed.GetTextRange(25, 35)))
- print("FindText(0, max, 'indicators'): ",
+ print("FindText(0, max, 'indicators'): ",
ed.FindText(0, ed.GetTextLength(), "indicators"))
# if wx.USE_UNICODE:
end = ed.GetLength()
diff --git a/demo/StyledTextCtrl_2.py b/demo/StyledTextCtrl_2.py
index 37d98d06..6e897f9b 100644
--- a/demo/StyledTextCtrl_2.py
+++ b/demo/StyledTextCtrl_2.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import keyword
diff --git a/demo/SystemSettings.py b/demo/SystemSettings.py
index 5eae4c71..84465518 100644
--- a/demo/SystemSettings.py
+++ b/demo/SystemSettings.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
###############################################################################
# Name: SystemSettingsDemo.py #
# Purpose: SystemSettings Test and Demo File #
@@ -73,7 +74,7 @@ class SysPanelBase(wx.Panel):
self.Bind(wx.EVT_SIZE, self.OnSize)
self.Bind(wx.EVT_SCROLLWIN, self.OnScroll)
-
+
def DoGetBestSize(self):
"""Return the best size for this panel"""
maxw = 0
@@ -125,8 +126,8 @@ class SysColorPanel(SysPanelBase):
self._box = (50, 15) # Color box dimensions
self._maxw = 0
self._vals = [ color for color in dir(wx)
- if color.startswith('SYS_COLOUR_') ]
-
+ if color.startswith('SYS_COLOUR_') ]
+
def OnPaint(self, evt):
dc = wx.AutoBufferedPaintDCFactory(self)
self.SetupPaintDC(dc)
@@ -158,13 +159,13 @@ class SysFontPanel(SysPanelBase):
# Attributes:
self._maxw = 0
- self._vals = ['SYS_ANSI_FIXED_FONT',
+ self._vals = ['SYS_ANSI_FIXED_FONT',
'SYS_ANSI_VAR_FONT',
- 'SYS_DEFAULT_GUI_FONT',
+ 'SYS_DEFAULT_GUI_FONT',
'SYS_DEVICE_DEFAULT_FONT',
- # 'SYS_ICONTITLE_FONT',
+ # 'SYS_ICONTITLE_FONT',
'SYS_OEM_FIXED_FONT',
- # 'SYS_SYSTEM_FIXED_FONT',
+ # 'SYS_SYSTEM_FIXED_FONT',
'SYS_SYSTEM_FONT'
]
diff --git a/demo/TablePrint.py b/demo/TablePrint.py
index 1c9098b8..2be3db08 100644
--- a/demo/TablePrint.py
+++ b/demo/TablePrint.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import os
import wx
@@ -6,11 +7,11 @@ import wx.lib.printout as printout
#---------------------------------------------------------------------------
buttonDefs = {
- 814 : ('PreviewWide', 'Preview print of a wide table'),
- 815 : ('PreviewNarrow', 'Preview print of a narrow table with color highlights'),
- 816 : ('PreviewText', 'Preview print of a text file'),
- 818 : ('OnPreviewMatrix', 'Preview print of a narrow column grid without a table header'),
- 817 : ('PreviewLine', 'Preview print to demonstrate the use of line breaks'),
+ 814 : ('PreviewWide', 'Preview print of a wide table'),
+ 815 : ('PreviewNarrow', 'Preview print of a narrow table with color highlights'),
+ 816 : ('PreviewText', 'Preview print of a text file'),
+ 818 : ('OnPreviewMatrix', 'Preview print of a narrow column grid without a table header'),
+ 817 : ('PreviewLine', 'Preview print to demonstrate the use of line breaks'),
819 : ('PrintWide', 'Direct print (no preview) of a wide table'),
}
diff --git a/demo/TextCtrl.py b/demo/TextCtrl.py
index b83a5cb8..22f3fce0 100644
--- a/demo/TextCtrl.py
+++ b/demo/TextCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import sys
import wx
@@ -152,8 +153,8 @@ class TestPanel(wx.Panel):
"\tGetLastPosition:\t%d\n"
"\tlen(text):\t\t%d\n"
% (ip, text[ip], lp, len(text)))
- except Exception as e:#last position eol or eof
- # print('Exception', e)
+ except Exception as exc:#last position eol or eof
+ # print('Exception', exc)
self.log.write("LogT5Position:\n"
"\tGetInsertionPoint:\t%d\n"
"\tGetLastPosition:\t%d\n"
diff --git a/demo/TextEntryDialog.py b/demo/TextEntryDialog.py
index 568095aa..7a3d1f3c 100644
--- a/demo/TextEntryDialog.py
+++ b/demo/TextEntryDialog.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/Threads.py b/demo/Threads.py
index e849ada5..1cfe59b1 100644
--- a/demo/Threads.py
+++ b/demo/Threads.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import random
import time
@@ -36,7 +37,7 @@ class CalcBarThread:
# no manipulation of UI objects from the worker thread.
evt = UpdateBarEvent(barNum = self.barNum, value = int(self.val))
wx.PostEvent(self.win, evt)
-
+
sleeptime = (random.random() * 2) + 0.5
time.sleep(sleeptime/4)
@@ -126,8 +127,6 @@ class GraphWindow(wx.Window):
pass
-
-
#----------------------------------------------------------------------
class TestFrame(wx.Frame):
@@ -232,8 +231,6 @@ def runTest(frame, nb, log):
-
-
overview = """\
The main issue with multi-threaded GUI programming is the thread safty
of the GUI itself. On most platforms the GUI is not thread safe and
diff --git a/demo/Throbber.py b/demo/Throbber.py
index 0829d06c..30716358 100644
--- a/demo/Throbber.py
+++ b/demo/Throbber.py
@@ -1,8 +1,9 @@
+#!/usr/bin/env python
-import wx
-import wx.lib.throbber as throb
+import wx
+import wx.lib.throbber as throb
-import throbImages
+import throbImages
from wx.lib.throbber import __doc__ as docString
@@ -35,7 +36,7 @@ class TestPanel(wx.Panel):
self.throbbers['plain']['throbber'] = \
throb.Throbber(self, -1, images, size=(36, 36),frameDelay = 0.1)
-
+
self.throbbers['reverse']['throbber'] = \
throb.Throbber(self, -1, images, frameDelay = 0.07)
@@ -55,13 +56,13 @@ class TestPanel(wx.Panel):
self.throbbers['overlay']['throbber'] = \
throb.Throbber(
- self, -1, images, frameDelay = 0.1,
+ self, -1, images, frameDelay = 0.1,
overlay = throbImages.catalog['logo'].GetBitmap()
)
self.throbbers['overlay+text']['throbber'] = \
throb.Throbber(
- self, -1, images, frameDelay = 0.1,
+ self, -1, images, frameDelay = 0.1,
overlay = throbImages.catalog['logo'].GetBitmap(), label = "Python!"
)
@@ -75,7 +76,7 @@ class TestPanel(wx.Panel):
rest = 4,
sequence = [ 1, 5, 2, 7, 3, 6, 4, 4, 4, 4, 7, 2, 2, 0 ]
)
-
+
box = wx.BoxSizer(wx.VERTICAL)
sizer = wx.GridBagSizer()
box.Add(sizer, 1, wx.EXPAND|wx.ALL, 5)
@@ -85,12 +86,12 @@ class TestPanel(wx.Panel):
# use a list so we can keep our order
for t in ['plain', 'reverse', 'autoreverse', 'label', 'overlay', 'overlay+text']:
sizer.Add(
- self.throbbers[t]['throbber'], (row, 0), (1, 1),
+ self.throbbers[t]['throbber'], (row, 0), (1, 1),
flag = wx.ALIGN_CENTER|wx.ALL, border=2
)
sizer.Add(
- wx.StaticText(self, -1, self.throbbers[t]['text']),
+ wx.StaticText(self, -1, self.throbbers[t]['text']),
(row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT
)
@@ -99,12 +100,12 @@ class TestPanel(wx.Panel):
# Add custom throbber to sizer.
row += 2
sizer.Add(
- self.customThrobber, (row, 0), (1, 1),
+ self.customThrobber, (row, 0), (1, 1),
flag = wx.ALIGN_CENTER|wx.ALL, border=2
)
sizer.Add(
- wx.StaticText(self, -1, 'with custom & manual sequences'),
+ wx.StaticText(self, -1, 'with custom & manual sequences'),
(row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT
)
diff --git a/demo/Ticker.py b/demo/Ticker.py
index 12ad5e5e..4a0e9833 100644
--- a/demo/Ticker.py
+++ b/demo/Ticker.py
@@ -1,7 +1,8 @@
+#!/usr/bin/env python
import wx
from wx.lib.ticker import Ticker
-import wx.lib.colourselect as csel #for easy color selection
+import wx.lib.colourselect as csel #for easy color selection
#----------------------------------------------------------------------
@@ -12,7 +13,7 @@ class TestPanel(wx.Panel):
self.ticker = Ticker(self)
- # Controls for ...controlling... the ticker.
+ # Controls for ...controlling... the ticker.
self.txt = wx.TextCtrl(self, value="I am a scrolling ticker!!!!", size=(200,-1))
wx.CallAfter(self.txt.SetInsertionPoint, 0)
txtl = wx.StaticText(self, label="Ticker text:")
@@ -34,7 +35,7 @@ class TestPanel(wx.Panel):
size=(150,-1),
style=wx.SL_HORIZONTAL|wx.SL_AUTOTICKS|wx.SL_LABELS)
- # Do layout
+ # Do layout
sz = wx.FlexGridSizer(cols=2, hgap=4, vgap=4)
sz.Add(txtl, flag=wx.ALIGN_CENTER_VERTICAL)
@@ -64,7 +65,7 @@ class TestPanel(wx.Panel):
self.SetSizer(sz2)
sz2.SetSizeHints(self)
- # Bind events
+ # Bind events
self.Bind(wx.EVT_BUTTON, self.OnChangeTickDirection, dirb)
self.Bind(wx.EVT_BUTTON, self.OnChangeTickFont, fontb)
self.Bind(wx.EVT_TEXT, self.OnText, self.txt)
@@ -73,7 +74,7 @@ class TestPanel(wx.Panel):
self.Bind(wx.EVT_SCROLL, self.ChangeFPS, fps)
self.Bind(wx.EVT_SCROLL, self.ChangePPF, ppf)
- # Set defaults
+ # Set defaults
self.SetTickDirection("rtl")
self.SetTickFont(self.ticker.GetFont())
self.ticker.SetText(self.txt.GetValue())
diff --git a/demo/TimeCtrl.py b/demo/TimeCtrl.py
index 3635e3c4..5bc7322c 100644
--- a/demo/TimeCtrl.py
+++ b/demo/TimeCtrl.py
@@ -1,8 +1,9 @@
-#
+#!/usr/bin/env python
+
# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o presense of spin control causing probs (see spin ctrl demo for details)
-#
+
import wx
import wx.lib.scrolledpanel as scrolled
diff --git a/demo/Timer.py b/demo/Timer.py
index 5a5c9457..fecf5432 100644
--- a/demo/Timer.py
+++ b/demo/Timer.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import time
import wx
import wx.lib.scrolledpanel as sp
diff --git a/demo/ToggleButton.py b/demo/ToggleButton.py
index 50073863..a111ca13 100644
--- a/demo/ToggleButton.py
+++ b/demo/ToggleButton.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import images
diff --git a/demo/ToolBar.py b/demo/ToolBar.py
index bfe5b361..eeb56cc7 100644
--- a/demo/ToolBar.py
+++ b/demo/ToolBar.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import images
diff --git a/demo/Toolbook.py b/demo/Toolbook.py
index 61dd9acf..96e1505b 100644
--- a/demo/Toolbook.py
+++ b/demo/Toolbook.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/TreeCtrl.py b/demo/TreeCtrl.py
index b871e92f..4b7ceb54 100644
--- a/demo/TreeCtrl.py
+++ b/demo/TreeCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import string
import wx
diff --git a/demo/TreeListCtrl.py b/demo/TreeListCtrl.py
index e4a76926..11cd37ef 100644
--- a/demo/TreeListCtrl.py
+++ b/demo/TreeListCtrl.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/TreeMixin.py b/demo/TreeMixin.py
index 27b07fc1..b838ac1a 100644
--- a/demo/TreeMixin.py
+++ b/demo/TreeMixin.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.adv
import wx.lib.agw.customtreectrl
diff --git a/demo/Treebook.py b/demo/Treebook.py
index 33ffacdb..c35bc44e 100644
--- a/demo/Treebook.py
+++ b/demo/Treebook.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/UIActionSimulator.py b/demo/UIActionSimulator.py
index f3b1b4b5..64c7a5de 100644
--- a/demo/UIActionSimulator.py
+++ b/demo/UIActionSimulator.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.lib.buttons as buttons
diff --git a/demo/URLDragAndDrop.py b/demo/URLDragAndDrop.py
index 0715f611..698380b8 100644
--- a/demo/URLDragAndDrop.py
+++ b/demo/URLDragAndDrop.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/Unicode.py b/demo/Unicode.py
index 41a92ee7..ab28224d 100644
--- a/demo/Unicode.py
+++ b/demo/Unicode.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/VListBox.py b/demo/VListBox.py
index 4df700e8..fbc0afff 100644
--- a/demo/VListBox.py
+++ b/demo/VListBox.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
from wx import html
diff --git a/demo/Validator.py b/demo/Validator.py
index c4103fdd..5cc5e6ce 100644
--- a/demo/Validator.py
+++ b/demo/Validator.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import string
import wx
diff --git a/demo/Wizard.py b/demo/Wizard.py
index f65872cf..6cfffed8 100644
--- a/demo/Wizard.py
+++ b/demo/Wizard.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.adv
diff --git a/demo/WrapSizer.py b/demo/WrapSizer.py
index a45abb7c..5aa71a44 100644
--- a/demo/WrapSizer.py
+++ b/demo/WrapSizer.py
@@ -1,4 +1,4 @@
-
+#!/usr/bin/env python
import wx
from wx.lib.buttons import GenButton
diff --git a/demo/XMLtreeview.py b/demo/XMLtreeview.py
index 4071c668..9afe79ac 100644
--- a/demo/XMLtreeview.py
+++ b/demo/XMLtreeview.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import sys
import wx
diff --git a/demo/XmlResource.py b/demo/XmlResource.py
index 410ecb50..8b7060e6 100644
--- a/demo/XmlResource.py
+++ b/demo/XmlResource.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.xrc as xrc
diff --git a/demo/XmlResourceHandler.py b/demo/XmlResourceHandler.py
index 326a4277..cf10c439 100644
--- a/demo/XmlResourceHandler.py
+++ b/demo/XmlResourceHandler.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.xrc as xrc
diff --git a/demo/XmlResourceSubclass.py b/demo/XmlResourceSubclass.py
index d142601b..07b44b8a 100644
--- a/demo/XmlResourceSubclass.py
+++ b/demo/XmlResourceSubclass.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
import wx.xrc as xrc
diff --git a/demo/agw/AGWInfoBar.py b/demo/agw/AGWInfoBar.py
index 46e1b6bc..8e699df3 100644
--- a/demo/agw/AGWInfoBar.py
+++ b/demo/agw/AGWInfoBar.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import random
diff --git a/demo/agw/AUI.py b/demo/agw/AUI.py
index ba9a673f..1b937acc 100644
--- a/demo/agw/AUI.py
+++ b/demo/agw/AUI.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.html
import wx.grid
diff --git a/demo/agw/AdvancedSplash.py b/demo/agw/AdvancedSplash.py
index 9f804fad..9299c4bc 100644
--- a/demo/agw/AdvancedSplash.py
+++ b/demo/agw/AdvancedSplash.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.buttons
diff --git a/demo/agw/AquaButton.py b/demo/agw/AquaButton.py
index 42e48dc6..ce4e66ed 100644
--- a/demo/agw/AquaButton.py
+++ b/demo/agw/AquaButton.py
@@ -1,7 +1,6 @@
-import wx
+#!/usr/bin/env python
-if wx.VERSION < (2, 8, 9, 0):
- raise Exception("This demo requires wxPython version greater than 2.8.9.0")
+import wx
import os
import sys
diff --git a/demo/agw/BalloonTip.py b/demo/agw/BalloonTip.py
index 12080047..53c566d3 100644
--- a/demo/agw/BalloonTip.py
+++ b/demo/agw/BalloonTip.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# ----------------------------------------------------------------------------
# BalloonTip Demo Implementation
#
diff --git a/demo/agw/ButtonPanel.py b/demo/agw/ButtonPanel.py
index c8836432..06bcb3b7 100644
--- a/demo/agw/ButtonPanel.py
+++ b/demo/agw/ButtonPanel.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
import sys
diff --git a/demo/agw/CubeColourDialog.py b/demo/agw/CubeColourDialog.py
index a615818a..46106154 100644
--- a/demo/agw/CubeColourDialog.py
+++ b/demo/agw/CubeColourDialog.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/CustomTreeCtrl.py b/demo/agw/CustomTreeCtrl.py
index 4b1501b7..955ec121 100644
--- a/demo/agw/CustomTreeCtrl.py
+++ b/demo/agw/CustomTreeCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import string
import os
diff --git a/demo/agw/FlatMenu.py b/demo/agw/FlatMenu.py
index 6b8d307d..fb372949 100644
--- a/demo/agw/FlatMenu.py
+++ b/demo/agw/FlatMenu.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import math
import random
diff --git a/demo/agw/FlatNotebook.py b/demo/agw/FlatNotebook.py
index 11b98535..d997584b 100644
--- a/demo/agw/FlatNotebook.py
+++ b/demo/agw/FlatNotebook.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/FloatSpin.py b/demo/agw/FloatSpin.py
index e27c0583..0f46b576 100644
--- a/demo/agw/FloatSpin.py
+++ b/demo/agw/FloatSpin.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/FoldPanelBar.py b/demo/agw/FoldPanelBar.py
index 215143fb..7973239f 100644
--- a/demo/agw/FoldPanelBar.py
+++ b/demo/agw/FoldPanelBar.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.adv
import os
diff --git a/demo/agw/FourWaySplitter.py b/demo/agw/FourWaySplitter.py
index bfa1206d..19919ed6 100644
--- a/demo/agw/FourWaySplitter.py
+++ b/demo/agw/FourWaySplitter.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/GenericMessageDialog.py b/demo/agw/GenericMessageDialog.py
index 002ea5ed..4b3800d8 100644
--- a/demo/agw/GenericMessageDialog.py
+++ b/demo/agw/GenericMessageDialog.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/GradientButton.py b/demo/agw/GradientButton.py
index 91d907bc..256809c1 100644
--- a/demo/agw/GradientButton.py
+++ b/demo/agw/GradientButton.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/HyperLinkCtrl.py b/demo/agw/HyperLinkCtrl.py
index c615cfc9..3f9dba8e 100644
--- a/demo/agw/HyperLinkCtrl.py
+++ b/demo/agw/HyperLinkCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/HyperTreeList.py b/demo/agw/HyperTreeList.py
index e1bfe95f..6dcc32c9 100644
--- a/demo/agw/HyperTreeList.py
+++ b/demo/agw/HyperTreeList.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import os
import string
import random
diff --git a/demo/agw/KnobCtrl.py b/demo/agw/KnobCtrl.py
index d98fb7d8..abe578f2 100644
--- a/demo/agw/KnobCtrl.py
+++ b/demo/agw/KnobCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/LabelBook.py b/demo/agw/LabelBook.py
index ae148766..21b88be5 100644
--- a/demo/agw/LabelBook.py
+++ b/demo/agw/LabelBook.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.colourselect as csel
import random
diff --git a/demo/agw/ListCtrl.py b/demo/agw/ListCtrl.py
index 4e3b5464..90b7efcd 100644
--- a/demo/agw/ListCtrl.py
+++ b/demo/agw/ListCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: ListCtrl.py
# Purpose: Testing lots of stuff, controls, window types, etc.
@@ -11,10 +13,10 @@
#----------------------------------------------------------------------------
import sys
-import wx
-import wx.lib.mixins.listctrl as listmix
+import wx
+import wx.lib.mixins.listctrl as listmix
-import images
+import images
#---------------------------------------------------------------------------
diff --git a/demo/agw/MacLargeDemo.py b/demo/agw/MacLargeDemo.py
index 9b76e52d..07cd0659 100644
--- a/demo/agw/MacLargeDemo.py
+++ b/demo/agw/MacLargeDemo.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
import os
import wx
diff --git a/demo/agw/MultiDirDialog.py b/demo/agw/MultiDirDialog.py
index 85f47e52..584df9f3 100644
--- a/demo/agw/MultiDirDialog.py
+++ b/demo/agw/MultiDirDialog.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/PeakMeter.py b/demo/agw/PeakMeter.py
index 0f1ec951..edac56fc 100644
--- a/demo/agw/PeakMeter.py
+++ b/demo/agw/PeakMeter.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import random
diff --git a/demo/agw/PersistentControls.py b/demo/agw/PersistentControls.py
index e2f2fe9b..b9e356f0 100644
--- a/demo/agw/PersistentControls.py
+++ b/demo/agw/PersistentControls.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.adv
import os
diff --git a/demo/agw/PieCtrl.py b/demo/agw/PieCtrl.py
index bc1f161d..27228721 100644
--- a/demo/agw/PieCtrl.py
+++ b/demo/agw/PieCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
from math import pi
diff --git a/demo/agw/PyBusyInfo.py b/demo/agw/PyBusyInfo.py
index fee90ea3..bf246504 100644
--- a/demo/agw/PyBusyInfo.py
+++ b/demo/agw/PyBusyInfo.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/PyCollapsiblePane.py b/demo/agw/PyCollapsiblePane.py
index 2da8a577..aa9e00f4 100644
--- a/demo/agw/PyCollapsiblePane.py
+++ b/demo/agw/PyCollapsiblePane.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.buttons as buttons
diff --git a/demo/agw/PyGauge.py b/demo/agw/PyGauge.py
index db0f72ac..50b91d4b 100644
--- a/demo/agw/PyGauge.py
+++ b/demo/agw/PyGauge.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
import sys
diff --git a/demo/agw/PyProgress.py b/demo/agw/PyProgress.py
index 93bcf036..2f4522ea 100644
--- a/demo/agw/PyProgress.py
+++ b/demo/agw/PyProgress.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.colourselect as csel
diff --git a/demo/agw/RibbonBar.py b/demo/agw/RibbonBar.py
index 75c29a9d..17bf2bc3 100644
--- a/demo/agw/RibbonBar.py
+++ b/demo/agw/RibbonBar.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/RulerCtrl.py b/demo/agw/RulerCtrl.py
index 16cd3fe3..071e6311 100644
--- a/demo/agw/RulerCtrl.py
+++ b/demo/agw/RulerCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.stc as stc
import keyword
diff --git a/demo/agw/ShortcutEditor.py b/demo/agw/ShortcutEditor.py
index f6619eb8..dc7d26a2 100644
--- a/demo/agw/ShortcutEditor.py
+++ b/demo/agw/ShortcutEditor.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/SpeedMeter.py b/demo/agw/SpeedMeter.py
index 9c90acd0..f3c11114 100644
--- a/demo/agw/SpeedMeter.py
+++ b/demo/agw/SpeedMeter.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.buttons
from math import pi, sqrt
diff --git a/demo/agw/SuperToolTip.py b/demo/agw/SuperToolTip.py
index 9b0c86ff..9bacaf83 100644
--- a/demo/agw/SuperToolTip.py
+++ b/demo/agw/SuperToolTip.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import wx.lib.buttons as buttons
import wx.lib.scrolledpanel as scrolled
diff --git a/demo/agw/ThumbnailCtrl.py b/demo/agw/ThumbnailCtrl.py
index dd5d2296..b43c6970 100644
--- a/demo/agw/ThumbnailCtrl.py
+++ b/demo/agw/ThumbnailCtrl.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
diff --git a/demo/agw/ToasterBox.py b/demo/agw/ToasterBox.py
index f5974c02..f50fbffc 100644
--- a/demo/agw/ToasterBox.py
+++ b/demo/agw/ToasterBox.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# Main ToasterBoxDemo
import wx
diff --git a/demo/agw/UltimateListCtrl.py b/demo/agw/UltimateListCtrl.py
index 3920e970..6b6b1820 100644
--- a/demo/agw/UltimateListCtrl.py
+++ b/demo/agw/UltimateListCtrl.py
@@ -1,5 +1,8 @@
+#!/usr/bin/env python
+
import wx
-import sys, os
+import os
+import sys
try:
dirName = os.path.dirname(os.path.abspath(__file__))
diff --git a/demo/agw/UltimateListIconDemo.py b/demo/agw/UltimateListIconDemo.py
index 67db9847..cee69f37 100644
--- a/demo/agw/UltimateListIconDemo.py
+++ b/demo/agw/UltimateListIconDemo.py
@@ -1,5 +1,8 @@
+#!/usr/bin/env python
+
import wx
-import os, sys
+import os
+import sys
import images
from wx.lib.embeddedimage import PyEmbeddedImage
diff --git a/demo/agw/UltimateListListDemo.py b/demo/agw/UltimateListListDemo.py
index 342d640d..d2cb75a4 100644
--- a/demo/agw/UltimateListListDemo.py
+++ b/demo/agw/UltimateListListDemo.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os, sys
import random
diff --git a/demo/agw/UltimateReportDemo.py b/demo/agw/UltimateReportDemo.py
index f76df010..7bd1eafa 100644
--- a/demo/agw/UltimateReportDemo.py
+++ b/demo/agw/UltimateReportDemo.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
import os
import wx
diff --git a/demo/agw/UltimateVirtualDemo.py b/demo/agw/UltimateVirtualDemo.py
index 159436ab..a8424db1 100644
--- a/demo/agw/UltimateVirtualDemo.py
+++ b/demo/agw/UltimateVirtualDemo.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import images
import random
diff --git a/demo/agw/Windows7Explorer_Contents.py b/demo/agw/Windows7Explorer_Contents.py
index 232c702e..8e707f8e 100644
--- a/demo/agw/Windows7Explorer_Contents.py
+++ b/demo/agw/Windows7Explorer_Contents.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
import os
import wx
diff --git a/demo/agw/XLSGrid.py b/demo/agw/XLSGrid.py
index b36ec770..c909d8b6 100644
--- a/demo/agw/XLSGrid.py
+++ b/demo/agw/XLSGrid.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import os
import sys
import wx
diff --git a/demo/agw/ZoomBar.py b/demo/agw/ZoomBar.py
index df21d845..a8ac920a 100644
--- a/demo/agw/ZoomBar.py
+++ b/demo/agw/ZoomBar.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import wx
import os
@@ -5,7 +7,7 @@ import sys
import glob
import random
-from wx.lib import masked
+from wx.lib import masked
try:
dirName = os.path.dirname(os.path.abspath(__file__))
diff --git a/demo/agw/__demo__.py b/demo/agw/__demo__.py
index affa8233..26981e69 100644
--- a/demo/agw/__demo__.py
+++ b/demo/agw/__demo__.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
This module contains the meta data needed for integrating the samples
in the AGW subdir into the wxPython demo framework. Once imported,
diff --git a/demo/encode_bitmaps.py b/demo/encode_bitmaps.py
index 5be7ffbb..0c27e8a5 100644
--- a/demo/encode_bitmaps.py
+++ b/demo/encode_bitmaps.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
"""
This is a way to save the startup time when running img2py on lots of
diff --git a/demo/infoframe.py b/demo/infoframe.py
index f58e51be..46b4a0b4 100644
--- a/demo/infoframe.py
+++ b/demo/infoframe.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import sys
diff --git a/demo/pyTree.py b/demo/pyTree.py
index 24892a90..9518bc83 100644
--- a/demo/pyTree.py
+++ b/demo/pyTree.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
Hello, and welcome to this test of the wxTreeItemData
class.
@@ -23,10 +25,10 @@ sample not because it's used, but because it's so
beautifully documented...
"""
-import string # Used for demo purposes, nothing more. :-)
-import sys
+import string # Used for demo purposes, nothing more. :-)
+import sys
-import wx
+import wx
#----------------------------------------------------------------------
diff --git a/demo/run.py b/demo/run.py
index dbc42bfa..5b3a11fe 100755
--- a/demo/run.py
+++ b/demo/run.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+
#----------------------------------------------------------------------------
# Name: run.py
# Purpose: Simple framework for running individual demos
diff --git a/demo/template.py b/demo/template.py
index 4f8bbaa4..be981442 100644
--- a/demo/template.py
+++ b/demo/template.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import wx
diff --git a/demo/viewer_basics.py b/demo/viewer_basics.py
index fb857774..60564e15 100644
--- a/demo/viewer_basics.py
+++ b/demo/viewer_basics.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Updated for wx namespace
diff --git a/demo/widgetTest.py b/demo/widgetTest.py
index 73b962f7..f81dd4a6 100644
--- a/demo/widgetTest.py
+++ b/demo/widgetTest.py
@@ -1,6 +1,6 @@
-#
+#!/usr/bin/env python
+
# This file is used for the wx.HtmlWindow demo.
-#
import sys