X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a12f92d0d10a463f202c545a785a84b88b0c4a9..40f5c32cbd0793445ebf61b5840242add742886c:/wxPython/demo/Main.py diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 99592b884a..65201470d4 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -18,6 +18,14 @@ import wx.html import images +##wx.Trap() + +# Use Python's bool constants if available, make aliases if not +try: + True +except NameError: + True = 1==1 + False = 1==0 #--------------------------------------------------------------------------- @@ -26,6 +34,9 @@ _treeList = [ # new stuff ('Recent Additions', [ 'wxVListBox', + 'wxListbook', + 'wxMaskedNumCtrl', + 'FloatCanvas', ]), # managed windows == things with a (optional) caption you can close @@ -73,6 +84,7 @@ _treeList = [ 'wxGenericDirCtrl', 'wxGrid', 'wxGrid_MegaExample', + 'wxListbook', 'wxListBox', 'wxListCtrl', 'wxListCtrl_virtual', @@ -97,7 +109,7 @@ _treeList = [ 'wxValidator', ]), - # controls coming from other librairies + # controls coming from other libraries ('More Windows/Controls', [ #'wxFloatBar', deprecated #'wxMVCTree', deprecated @@ -106,6 +118,7 @@ _treeList = [ 'ColourSelect', 'ContextHelp', 'FancyText', + 'FloatCanvas', 'FileBrowseButton', 'GenericButtons', 'MaskedEditControls', @@ -125,6 +138,7 @@ _treeList = [ 'wxIntCtrl', 'wxLEDNumberCtrl', 'wxMimeTypesManager', + 'wxMaskedNumCtrl', 'wxMultiSash', 'wxPopupControl', 'wxStyledTextCtrl_1', @@ -209,6 +223,7 @@ _treeList = [ #--------------------------------------------------------------------------- +# Show how to derive a custom wxLog class class MyLog(wx.PyLog): def __init__(self, textCtrl, logTime=0): @@ -232,6 +247,7 @@ class MyTP(wx.PyTipProvider): # A class to be used to display source code in the demo. Try using the # wxSTC in the wxStyledTextCtrl_2 sample first, fall back to wxTextCtrl # if there is an error, such as the stc module not being present. +# try: ##raise ImportError @@ -328,8 +344,8 @@ class wxPythonDemo(wx.Frame): splitter2 = wx.SplitterWindow(splitter, -1) def EmptyHandler(evt): pass - wx.EVT_ERASE_BACKGROUND(splitter, EmptyHandler) - wx.EVT_ERASE_BACKGROUND(splitter2, EmptyHandler) + #wx.EVT_ERASE_BACKGROUND(splitter, EmptyHandler) + #wx.EVT_ERASE_BACKGROUND(splitter2, EmptyHandler) # Prevent TreeCtrl from displaying all items after destruction when True self.dying = False @@ -460,13 +476,21 @@ class wxPythonDemo(wx.Frame): # add the windows to the splitter and split it. - splitter2.SplitHorizontally(self.nb, self.log, 450) + splitter2.SplitHorizontally(self.nb, self.log, -120) splitter.SplitVertically(self.tree, splitter2, 180) splitter.SetMinimumPaneSize(20) splitter2.SetMinimumPaneSize(20) + # Make the splitter on the right expand the top wind when resized + def SplitterOnSize(evt): + splitter = evt.GetEventObject() + sz = splitter.GetSize() + splitter.SetSashPosition(sz.height - 120, False) + evt.Skip() + wx.EVT_SIZE(splitter2, SplitterOnSize) + # select initial items self.nb.SetSelection(0) @@ -803,7 +827,7 @@ platform GUI library, which is written in C++.

Like Python and wxWindows, wxPython is Open Source which means that it is free for anyone to use and the source code is available for anyone to look at and modify. Or anyone can contribute -fixes or enhnacments to the project. +fixes or enhancements to the project.

wxPython is a cross-platform toolkit. This means that the same program will run on multiple platforms without modification.