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