# For debugging
##wx.Trap();
-##print "wx.VERSION_STRING = ", wx.VERSION_STRING
-##print os.getpid();
+##print "wx.VERSION_STRING = %s (%s)" % (wx.VERSION_STRING, wx.USE_UNICODE and 'unicode' or 'ansi')
+##print "pid:", os.getpid()
##raw_input("Press Enter...")
_treeList = [
# new stuff
('Recent Additions/Updates', [
- 'FoldPanelBar',
+ 'AnalogClock',
+ 'CheckListCtrlMixin',
+ 'Treebook',
+ 'Toolbook',
]),
# managed windows == things with a (optional) caption you can close
'FindReplaceDialog',
'FontDialog',
'MessageDialog',
+ 'MultiChoiceDialog',
'PageSetupDialog',
'PrintDialog',
'ProgressDialog',
# dialogs from libraries
('More Dialogs', [
'ImageBrowser',
- 'MultipleChoiceDialog',
'ScrolledMessageDialog',
]),
'CheckBox',
'CheckListBox',
'Choice',
- 'Choicebook',
'ComboBox',
'Gauge',
'Grid',
'ListCtrl',
'ListCtrl_virtual',
'ListCtrl_edit',
- 'Listbook',
'Menu',
- 'Notebook',
'PopupMenu',
'PopupWindow',
'RadioBox',
'TreeCtrl',
'Validator',
]),
+
+ ('"Book" Controls', [
+ 'Choicebook',
+ 'Listbook',
+ 'Notebook',
+ 'Toolbook',
+ 'Treebook',
+ ]),
('Custom Controls', [
- 'AnalogClockWindow',
+ 'AnalogClock',
'ColourSelect',
'Editor',
'GenericButtons',
#'RightTextCtrl', deprecated as we have wxTE_RIGHT now.
'Calendar',
'CalendarCtrl',
+ 'CheckListCtrlMixin',
'ContextHelp',
'DatePickerCtrl',
'DynamicSashWindow',
'FloatBar',
'FloatCanvas',
'FoldPanelBar',
+ 'GIFAnimationCtrl',
'HtmlWindow',
+ 'HyperLinkCtrl',
'IntCtrl',
- 'MediaCtrl',
'MVCTree',
'MaskedEditControls',
'MaskedNumCtrl',
- 'MimeTypesManager',
+ 'MediaCtrl',
+ 'MultiSplitterWindow',
'PyCrust',
'PyPlot',
'PyShell',
'ArtProvider',
'Cursor',
'DragImage',
+ 'GIFAnimationCtrl',
'Image',
'ImageAlpha',
'ImageFromStream',
'DrawXXXList',
'FileHistory',
'FontEnumerator',
+ 'GLCanvas',
'Joystick',
+ 'MimeTypesManager',
'MouseGestures',
'OGL',
'PrintFramework',
'Unicode',
]),
- # need libs not coming with the demo
- ('Samples using an external library', [
- 'GLCanvas',
- ]),
-
('Check out the samples dir too', [
]),
def LoadDict(self, modID):
if self.name != __name__:
source = self.modules[modID][1]
- description = self.modules[modID][3]
+ #description = self.modules[modID][3]
+ description = self.modules[modID][2]
try:
self.modules[modID][0] = {}
self.box = wx.BoxSizer(wx.VERTICAL)
# Main Label
- self.box.Add(wx.StaticText(self, -1, "An error has occured while trying to run the demo")
+ self.box.Add(wx.StaticText(self, -1, "An error has occurred while trying to run the demo")
, 0, wx.ALIGN_CENTER | wx.TOP, 10)
# Exception Information
def OnTaskBarChange(self, evt):
- names = [ "WXPdemo", "WXP", "Mondrian", "Test2m",
- "Blom08m", "Blom10m", "Blom15m" ]
+ names = [ "WXPdemo", "Mondrian", "Pencil", "Carrot" ]
name = names[self.imgidx]
getFunc = getattr(images, "get%sImage" % name)
self.SetMenuBar(self.mainmenu)
self.finddata = wx.FindReplaceData()
+ self.finddata.SetFlags(wx.FR_DOWN)
if 0:
# This is another way to set Accelerators, in addition to
# o The RunTest() for all samples must now return a window that can
# be palced in a tab in the main notebook.
- # o If an error occurs (or has occured before) an error tab is created.
+ # o If an error occurs (or has occurred before) an error tab is created.
if module is not None:
wx.LogMessage("Running demo module...")
self.nb.SetSelection(1)
self.finddlg = wx.FindReplaceDialog(self, self.finddata, "Find",
- wx.FR_NOUPDOWN |
- wx.FR_NOMATCHCASE |
- wx.FR_NOWHOLEWORD)
+ wx.FR_NOMATCHCASE | wx.FR_NOWHOLEWORD)
self.finddlg.Show(True)
self.nb.SetSelection(1)
end = editor.GetLastPosition()
textstring = editor.GetRange(0, end).lower()
- start = editor.GetSelection()[1]
findstring = self.finddata.GetFindString().lower()
- loc = textstring.find(findstring, start)
+ backward = not (self.finddata.GetFlags() & wx.FR_DOWN)
+ if backward:
+ start = editor.GetSelection()[0]
+ loc = textstring.rfind(findstring, 0, start)
+ else:
+ start = editor.GetSelection()[1]
+ loc = textstring.find(findstring, start)
if loc == -1 and start != 0:
# string not found, start at beginning
- start = 0
- loc = textstring.find(findstring, start)
+ if backward:
+ start = end
+ loc = textstring.rfind(findstring, 0, start)
+ else:
+ start = 0
+ loc = textstring.find(findstring, start)
if loc == -1:
dlg = wx.MessageDialog(self, 'Find String Not Found',
'Find String Not Found in Demo File',
class MySplashScreen(wx.SplashScreen):
def __init__(self):
- bmp = wx.Image(opj("bitmaps/splash.gif")).ConvertToBitmap()
+ bmp = wx.Image(opj("bitmaps/splash.png")).ConvertToBitmap()
wx.SplashScreen.__init__(self, bmp,
wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
- 3000, None, -1)
+ 5000, None, -1)
self.Bind(wx.EVT_CLOSE, self.OnClose)
+ self.fc = wx.FutureCall(2000, self.ShowMain)
+
def OnClose(self, evt):
+ # Make sure the default handler runs too so this window gets
+ # destroyed
+ evt.Skip()
self.Hide()
+
+ # if the timer is still running then go ahead and show the
+ # main frame now
+ if self.fc.IsRunning():
+ self.fc.Stop()
+ self.ShowMain()
+
+
+ def ShowMain(self):
frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
frame.Show()
- evt.Skip() # Make sure the default handler runs too...
-
+ if self.fc.IsRunning():
+ self.Raise()
+
class MyApp(wx.App):
def OnInit(self):
# initialization, finally creating and showing the main
# application window(s). In this case we have nothing else to
# do so we'll delay showing the main frame until later (see
- # OnClose above) so the users can see the SplashScreen effect.
+ # ShowMain above) so the users can see the SplashScreen effect.
splash = MySplashScreen()
splash.Show()