]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/Main.py
Optimized drawing code in OnMouse() for freehand drawing.
[wxWidgets.git] / utils / wxPython / demo / Main.py
index d9483a9e5141775797b9f0fa8c58d4c09425cf08..6b526172343868b241051238eaa7cc72dac80577 100644 (file)
@@ -22,14 +22,14 @@ _useNestedSplitter = true
 
 _treeList = [
     ('New since last release', ['wxMVCTree', 'wxVTKRenderWindow',
 
 _treeList = [
     ('New since last release', ['wxMVCTree', 'wxVTKRenderWindow',
-                                'FileBrowseButton', #'wxToggleButton',
-                                'GenericButtons']),
+                                'FileBrowseButton', 'GenericButtons',
+                                'wxMask', 'wxEditor']),
 
     ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']),
 
     ('Non-Managed Windows', ['wxGrid', 'wxSashWindow',
                                'wxScrolledWindow', 'wxSplitterWindow',
 
     ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']),
 
     ('Non-Managed Windows', ['wxGrid', 'wxSashWindow',
                                'wxScrolledWindow', 'wxSplitterWindow',
-                               'wxStatusBar', 'wxToolBar', 'wxNotebook',
+                               'wxStatusBar', 'wxNotebook',
                                'wxHtmlWindow']),
 
     ('Common Dialogs', ['wxColourDialog', 'wxDirDialog', 'wxFileDialog',
                                'wxHtmlWindow']),
 
     ('Common Dialogs', ['wxColourDialog', 'wxDirDialog', 'wxFileDialog',
@@ -40,20 +40,20 @@ _treeList = [
     ('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice',
                   'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl',
                   'wxTreeCtrl', 'wxSpinButton', 'wxStaticText', 'wxStaticBitmap',
     ('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice',
                   'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl',
                   'wxTreeCtrl', 'wxSpinButton', 'wxStaticText', 'wxStaticBitmap',
-                  'wxRadioBox', 'wxSlider', #'wxToggleButton'
+                  'wxRadioBox', 'wxSlider', 'wxToolBar', #'wxToggleButton'
                   ]),
 
     ('Window Layout', ['wxLayoutConstraints', 'Sizers', 'OldSizers']),
 
     ('Miscellaneous', [ 'DragAndDrop', 'CustomDragAndDrop', 'FontEnumerator',
                         'wxTimer', 'wxValidator', 'wxGLCanvas', 'DialogUnits',
                   ]),
 
     ('Window Layout', ['wxLayoutConstraints', 'Sizers', 'OldSizers']),
 
     ('Miscellaneous', [ 'DragAndDrop', 'CustomDragAndDrop', 'FontEnumerator',
                         'wxTimer', 'wxValidator', 'wxGLCanvas', 'DialogUnits',
-                        'wxImage', 'PrintFramework', 'wxOGL', 'PythonEvents',
-                        'Threads']),
+                        'wxImage', 'wxMask', 'PrintFramework', 'wxOGL',
+                        'PythonEvents', 'Threads']),
 
     ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
                           'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
                           'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
 
     ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
                           'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
                           'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
-                          'FileBrowseButton', 'GenericButtons']),
+                          'FileBrowseButton', 'GenericButtons', 'wxEditor']),
 
     ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']),
 
 
     ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']),
 
@@ -137,6 +137,7 @@ class wxPythonDemo(wxFrame):
             tID = wxNewId()
             self.treeMap = {}
             self.tree = wxTreeCtrl(splitter, tID)
             tID = wxNewId()
             self.treeMap = {}
             self.tree = wxTreeCtrl(splitter, tID)
+            #self.tree.SetBackgroundColour(wxNamedColour("Pink"))
             root = self.tree.AddRoot("Overview")
             firstChild = None
             for item in _treeList:
             root = self.tree.AddRoot("Overview")
             firstChild = None
             for item in _treeList:
@@ -276,6 +277,7 @@ class wxPythonDemo(wxFrame):
                     self.nb.AddPage(self.window, 'Demo')
                     #self.nb.ResizeChildren()
                     self.nb.SetSelection(2)
                     self.nb.AddPage(self.window, 'Demo')
                     #self.nb.ResizeChildren()
                     self.nb.SetSelection(2)
+                    #self.window.Refresh()
                     #self.nb.ResizeChildren()
                     #if self.window.GetAutoLayout():
                     #    self.window.Layout()
                     #self.nb.ResizeChildren()
                     #if self.window.GetAutoLayout():
                     #    self.window.Layout()
@@ -382,6 +384,11 @@ class MyApp(wxApp):
 #---------------------------------------------------------------------------
 
 def main():
 #---------------------------------------------------------------------------
 
 def main():
+    try:
+        demoPath = os.path.split(__file__)[0]
+        os.chdir(demoPath)
+    except:
+        pass
     app = MyApp(0)
     app.MainLoop()
 
     app = MyApp(0)
     app.MainLoop()