2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
6 def runTest(frame
, nb
, log
):
7 win
= wxDialog(frame
, -1, "This is a wxDialog", size
=wxSize(350, 200))
9 sizer
= wxBoxSizer(wxVERTICAL
)
11 label
= wxStaticText(win
, -1, "This is a wxDialog")
12 sizer
.Add(label
, 0, wxALIGN_CENTRE|wxALL
, 5)
14 box
= wxBoxSizer(wxHORIZONTAL
)
16 label
= wxStaticText(win
, -1, "Field #1:")
17 box
.Add(label
, 0, wxALIGN_CENTRE|wxALL
, 5)
19 text
= wxTextCtrl(win
, -1, "", size
=(80,-1))
20 box
.Add(text
, 1, wxALIGN_CENTRE|wxALL
, 5)
22 sizer
.AddSizer(box
, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL
, 5)
24 box
= wxBoxSizer(wxHORIZONTAL
)
26 label
= wxStaticText(win
, -1, "Field #2:")
27 box
.Add(label
, 0, wxALIGN_CENTRE|wxALL
, 5)
29 text
= wxTextCtrl(win
, -1, "", size
=(80,-1))
30 box
.Add(text
, 1, wxALIGN_CENTRE|wxALL
, 5)
32 sizer
.AddSizer(box
, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL
, 5)
34 line
= wxStaticLine(win
, -1, size
=(20,-1), style
=wxLI_HORIZONTAL
)
35 sizer
.Add(line
, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP
, 5)
37 box
= wxBoxSizer(wxHORIZONTAL
)
39 btn
= wxButton(win
, wxID_OK
, " OK ")
41 box
.Add(btn
, 0, wxALIGN_CENTRE|wxALL
, 5)
43 btn
= wxButton(win
, wxID_CANCEL
, " Cancel ")
44 box
.Add(btn
, 0, wxALIGN_CENTRE|wxALL
, 5)
46 sizer
.AddSizer(box
, 0, wxALIGN_CENTER_VERTICAL|wxALL
, 5)
49 win
.SetAutoLayout(true
)
54 log
.WriteText("You pressed OK\n")
56 log
.WriteText("You pressed Cancel\n")
60 #---------------------------------------------------------------------------