]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxDialog.py
wxUniversal fixes:
[wxWidgets.git] / wxPython / demo / wxDialog.py
1
2 from wxPython.wx import *
3
4 #---------------------------------------------------------------------------
5
6 def runTest(frame, nb, log):
7 win = wxDialog(frame, -1, "This is a wxDialog", size=wxSize(350, 200), style=wxCAPTION)
8
9 sizer = wxBoxSizer(wxVERTICAL)
10
11 label = wxStaticText(win, -1, "This is a wxDialog")
12 sizer.Add(label, 0, wxALIGN_CENTRE|wxALL, 5)
13
14 box = wxBoxSizer(wxHORIZONTAL)
15
16 label = wxStaticText(win, -1, "Field #1:")
17 box.Add(label, 0, wxALIGN_CENTRE|wxALL, 5)
18
19 text = wxTextCtrl(win, -1, "", size=(80,-1))
20 box.Add(text, 1, wxALIGN_CENTRE|wxALL, 5)
21
22 sizer.AddSizer(box, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5)
23
24 box = wxBoxSizer(wxHORIZONTAL)
25
26 label = wxStaticText(win, -1, "Field #2:")
27 box.Add(label, 0, wxALIGN_CENTRE|wxALL, 5)
28
29 text = wxTextCtrl(win, -1, "", size=(80,-1))
30 box.Add(text, 1, wxALIGN_CENTRE|wxALL, 5)
31
32 sizer.AddSizer(box, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5)
33
34 line = wxStaticLine(win, -1, size=(20,-1), style=wxLI_HORIZONTAL)
35 sizer.Add(line, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5)
36
37 box = wxBoxSizer(wxHORIZONTAL)
38
39 btn = wxButton(win, wxID_OK, " OK ")
40 btn.SetDefault()
41 box.Add(btn, 0, wxALIGN_CENTRE|wxALL, 5)
42
43 btn = wxButton(win, wxID_CANCEL, " Cancel ")
44 box.Add(btn, 0, wxALIGN_CENTRE|wxALL, 5)
45
46 sizer.AddSizer(box, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5)
47
48 win.SetSizer(sizer)
49 win.SetAutoLayout(true)
50 sizer.Fit(win)
51
52 val = win.ShowModal()
53 if val == wxID_OK:
54 log.WriteText("You pressed OK\n")
55 else:
56 log.WriteText("You pressed Cancel\n")
57
58
59
60 #---------------------------------------------------------------------------
61
62
63
64
65
66
67
68
69
70
71 overview = """\
72 """