Some more demo tweaks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-02-24 02:01:04 +00:00
parent 632783de61
commit b4f1aaad5d
6 changed files with 30 additions and 12 deletions

View File

@@ -38,13 +38,13 @@ class TestPanel(wx.Panel):
mask = wx.MaskColour(bmp, wx.BLUE) mask = wx.MaskColour(bmp, wx.BLUE)
bmp.SetMask(mask) bmp.SetMask(mask)
b = wx.BitmapButton(self, 30, bmp, (160, 20), b = wx.BitmapButton(self, 30, bmp, (260, 20),
(bmp.GetWidth()+10, bmp.GetHeight()+10)) (bmp.GetWidth()+10, bmp.GetHeight()+10))
b.SetToolTipString("This is a bitmap button.") b.SetToolTipString("This is a bitmap button.")
self.Bind(wx.EVT_BUTTON, self.OnClick, b) self.Bind(wx.EVT_BUTTON, self.OnClick, b)
b = wx.Button(self, 40, "Flat Button", (20,150), style=wx.NO_BORDER) b = wx.Button(self, 40, "Flat Button?", (20,150), style=wx.NO_BORDER)
b.SetToolTipString("This button has a style flag of wx.NO_BORDER") b.SetToolTipString("This button has a style flag of wx.NO_BORDER")
self.Bind(wx.EVT_BUTTON, self.OnClick, b) self.Bind(wx.EVT_BUTTON, self.OnClick, b)

View File

@@ -89,8 +89,17 @@ class TestPanel(wx.Panel):
#---------------------------------------------------------------------- #----------------------------------------------------------------------
def runTest(frame, nb, log): def runTest(frame, nb, log):
win = TestPanel(nb, log) if wx.Platform == "__WXMAC__":
return win dlg = wx.MessageDialog(
frame, 'The ContextHelp sample does not currently work well on this platform.',
'Sorry', wx.OK | wx.ICON_INFORMATION
)
dlg.ShowModal()
dlg.Destroy()
else:
win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------- #----------------------------------------------------------------------

View File

@@ -81,9 +81,17 @@ class TestFloatBar(wx.Frame):
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
def runTest(frame, nb, log): def runTest(frame, nb, log):
win = TestFloatBar(frame, log) if wx.Platform == "__WXMAC__":
frame.otherWin = win dlg = wx.MessageDialog(
win.Show(True) frame, 'FloatBar does not work well on this platform.',
'Sorry', wx.OK | wx.ICON_INFORMATION
)
dlg.ShowModal()
dlg.Destroy()
else:
win = TestFloatBar(frame, log)
frame.otherWin = win
win.Show(True)
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------

View File

@@ -86,7 +86,7 @@ class TestListBox(wx.Panel):
wx.StaticText(self, -1, "Select many:", (200, 50), (65, 18)) wx.StaticText(self, -1, "Select many:", (200, 50), (65, 18))
self.lb2 = wx.ListBox(self, 70, (280, 50), (80, 120), sampleList, wx.LB_EXTENDED) self.lb2 = wx.ListBox(self, 70, (300, 50), (80, 120), sampleList, wx.LB_EXTENDED)
self.Bind(wx.EVT_LISTBOX, self.EvtMultiListBox, self.lb2) self.Bind(wx.EVT_LISTBOX, self.EvtMultiListBox, self.lb2)
self.lb2.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton) self.lb2.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton)
self.lb2.SetSelection(0) self.lb2.SetSelection(0)

View File

@@ -930,7 +930,7 @@ def main():
os.chdir(demoPath) os.chdir(demoPath)
except: except:
pass pass
app = MyApp(0) #wx.Platform == "__WXMAC__") app = MyApp(wx.Platform == "__WXMAC__")
app.MainLoop() app.MainLoop()

View File

@@ -41,18 +41,19 @@ def runTest(frame, nb, log):
overview = """\ overview = """\
<html><body>
This class represents a dialog that shows a short message and a progress bar. This class represents a dialog that shows a short message and a progress bar.
Optionally, it can display an ABORT button Optionally, it can display an ABORT button
<p>
This dialog indicates the progress of some event that takes a while to accomplish, This dialog indicates the progress of some event that takes a while to accomplish,
usually, such as file copy progress, download progress, and so on. The display usually, such as file copy progress, download progress, and so on. The display
is <b>completely</b> under control of the program; you must update the dialog from is <b>completely</b> under control of the program; you must update the dialog from
within the program creating it. within the program creating it.
<p>
When the dialog closes, you must check to see if the user aborted the process or When the dialog closes, you must check to see if the user aborted the process or
not, and act accordingly -- that is, if the PD_CAN_ABORT style flag is set. not, and act accordingly -- that is, if the PD_CAN_ABORT style flag is set.
If not then you may progress blissfully onward. If not then you may progress blissfully onward.
</body></html>
""" """
if __name__ == '__main__': if __name__ == '__main__':