1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
import wx
|
2001-04-09 19:36:36 +00:00
|
|
|
|
1999-04-30 03:29:54 +00:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
class TestPanel(wx.Panel):
|
1999-04-30 03:29:54 +00:00
|
|
|
def __init__(self, parent, log):
|
2003-12-09 01:23:28 +00:00
|
|
|
wx.Panel.__init__(self, parent, -1,
|
|
|
|
style=wx.NO_FULL_REPAINT_ON_RESIZE)
|
1999-04-30 03:29:54 +00:00
|
|
|
self.log = log
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
b = wx.Button(self, 10, "Default Button", (20, 20))
|
2003-12-11 19:55:48 +00:00
|
|
|
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
|
1999-12-23 20:05:08 +00:00
|
|
|
b.SetDefault()
|
2003-12-03 03:26:20 +00:00
|
|
|
b.SetSize(b.GetBestSize())
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2004-03-15 22:45:00 +00:00
|
|
|
b = wx.Button(self, 20, "HELLO AGAIN!", (20, 80)) ##, (120, 45))
|
2003-12-11 19:55:48 +00:00
|
|
|
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
|
2000-11-21 03:44:14 +00:00
|
|
|
b.SetToolTipString("This is a Hello button...")
|
|
|
|
|
2004-02-24 02:01:04 +00:00
|
|
|
b = wx.Button(self, 40, "Flat Button?", (20,150), style=wx.NO_BORDER)
|
2004-03-15 22:45:00 +00:00
|
|
|
b.SetToolTipString("This button has a style flag of wx.NO_BORDER. On some platforms that will give it a flattened look.")
|
2004-01-13 03:17:17 +00:00
|
|
|
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-03-25 06:35:27 +00:00
|
|
|
|
1999-04-30 03:29:54 +00:00
|
|
|
def OnClick(self, event):
|
2003-03-25 06:35:27 +00:00
|
|
|
self.log.write("Click! (%d)\n" % event.GetId())
|
1999-10-06 16:27:10 +00:00
|
|
|
|
1999-04-30 03:29:54 +00:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestPanel(nb, log)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2003-03-25 06:35:27 +00:00
|
|
|
overview = """<html><body>
|
2003-12-09 01:23:28 +00:00
|
|
|
<h2>Button</h2>
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
A button is a control that contains a text string or a bitmap and can be
|
2003-03-25 06:35:27 +00:00
|
|
|
placed on nearly any kind of window.
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-03-25 06:35:27 +00:00
|
|
|
</body></html>
|
|
|
|
"""
|
1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2003-03-25 06:35:27 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
2004-03-05 00:06:33 +00:00
|
|
|
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|
1999-04-30 03:29:54 +00:00
|
|
|
|