From 5523df9f4b4fae15ab3f60b9f7bd11202e237f81 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 10 Aug 2004 01:36:45 +0000 Subject: [PATCH] More tweaks and fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/LayoutAnchors.py | 23 ++++++++++++++++++----- wxPython/demo/ListBox.py | 6 +++--- wxPython/demo/Notebook.py | 3 ++- wxPython/demo/PyPlot.py | 26 ++++++++++++++++++++------ wxPython/demo/Threads.py | 2 +- 5 files changed, 44 insertions(+), 16 deletions(-) diff --git a/wxPython/demo/LayoutAnchors.py b/wxPython/demo/LayoutAnchors.py index 188cdd2f5b..a15f34f6c1 100644 --- a/wxPython/demo/LayoutAnchors.py +++ b/wxPython/demo/LayoutAnchors.py @@ -172,15 +172,28 @@ class AnchorsDemoFrame(wx.Frame): def OnOkButtonButton(self, event): self.Close() -#---------------------------------------------------------------------- +#--------------------------------------------------------------------------- + +class TestPanel(wx.Panel): + def __init__(self, parent, log): + self.log = log + wx.Panel.__init__(self, parent, -1) + + b = wx.Button(self, -1, "Show the LayoutAnchors sample", (50,50)) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) -def runTest(frame, nb, log): - win = AnchorsDemoFrame(frame) - frame.otherWin = win - win.Show(True) + def OnButton(self, evt): + win = AnchorsDemoFrame(self) + win.Show(True) +#--------------------------------------------------------------------------- + + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win #---------------------------------------------------------------------- diff --git a/wxPython/demo/ListBox.py b/wxPython/demo/ListBox.py index 8ae15a76d6..357a2b4b21 100644 --- a/wxPython/demo/ListBox.py +++ b/wxPython/demo/ListBox.py @@ -76,7 +76,7 @@ class TestListBox(wx.Panel): wx.StaticText(self, -1, "This example uses the wx.ListBox control.", (45, 10)) wx.StaticText(self, -1, "Select one:", (15, 50), (65, 18)) - self.lb1 = wx.ListBox(self, 60, (80, 50), (80, 120), sampleList, wx.LB_SINGLE) + self.lb1 = wx.ListBox(self, 60, (80, 50), (90, 120), sampleList, wx.LB_SINGLE) self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.lb1) self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, self.lb1) self.lb1.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton) @@ -86,7 +86,7 @@ class TestListBox(wx.Panel): wx.StaticText(self, -1, "Select many:", (200, 50), (65, 18)) - self.lb2 = wx.ListBox(self, 70, (300, 50), (80, 120), sampleList, wx.LB_EXTENDED) + self.lb2 = wx.ListBox(self, 70, (300, 50), (90, 120), sampleList, wx.LB_EXTENDED) self.Bind(wx.EVT_LISTBOX, self.EvtMultiListBox, self.lb2) self.lb2.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton) self.lb2.SetSelection(0) @@ -96,7 +96,7 @@ class TestListBox(wx.Panel): 'test abcd' ] sampleList.sort() wx.StaticText(self, -1, "Find Prefix:", (15, 250)) - fp = FindPrefixListBox(self, -1, (80, 250), (80, 120), sampleList, wx.LB_SINGLE) + fp = FindPrefixListBox(self, -1, (80, 250), (90, 120), sampleList, wx.LB_SINGLE) fp.SetSelection(0) diff --git a/wxPython/demo/Notebook.py b/wxPython/demo/Notebook.py index 9637ba95fa..3f369001f3 100644 --- a/wxPython/demo/Notebook.py +++ b/wxPython/demo/Notebook.py @@ -13,7 +13,8 @@ import images class TestNB(wx.Notebook): def __init__(self, parent, id, log): - wx.Notebook.__init__(self, parent, id, size=(21,21), style= + wx.Notebook.__init__(self, parent, id, size=(21,21), + #style= #wx.NB_TOP # | wx.NB_MULTILINE #wx.NB_BOTTOM #wx.NB_LEFT diff --git a/wxPython/demo/PyPlot.py b/wxPython/demo/PyPlot.py index 2281057b76..f916dc6615 100644 --- a/wxPython/demo/PyPlot.py +++ b/wxPython/demo/PyPlot.py @@ -13,14 +13,28 @@ import wx.lib.plot # the file, as expected. | ################################################################/ -#---------------------------------------------------------------------- +#--------------------------------------------------------------------------- + +class TestPanel(wx.Panel): + def __init__(self, parent, log): + self.log = log + wx.Panel.__init__(self, parent, -1) + + b = wx.Button(self, -1, "Show the PyPlot sample", (50,50)) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) + + + def OnButton(self, evt): + win = wx.lib.plot.TestFrame(self, -1, "PlotCanvas Demo") + win.Show() + +#--------------------------------------------------------------------------- + def runTest(frame, nb, log): - # Loading the demo class directly from the library's - # test code. - win = wx.lib.plot.TestFrame(nb, -1, "PlotCanvas Demo") - frame.otherWin = win - return None + win = TestPanel(nb, log) + return win + #---------------------------------------------------------------------- diff --git a/wxPython/demo/Threads.py b/wxPython/demo/Threads.py index 8e64bf8347..07910dc4d7 100644 --- a/wxPython/demo/Threads.py +++ b/wxPython/demo/Threads.py @@ -224,7 +224,7 @@ class TestPanel(wx.Panel): def OnButton(self, evt): - win = TestFrame(frame, log) + win = TestFrame(self, self.log) win.Show(True) -- 2.45.2