Updated demo to be a more realistic dialog, to show tab traversal,
etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
caa74ba3bb
commit
031787ded7
@ -4,11 +4,50 @@ from wxPython.wx import *
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = wxDialog(frame, -1, "This is a wxDialog", wxDefaultPosition, wxSize(350, 200))
|
||||
win = wxDialog(frame, -1, "This is a wxDialog", size=wxSize(350, 200))
|
||||
|
||||
wxStaticText(win, -1, "This is a wxDialog", wxPoint(20, 20))
|
||||
wxButton(win, wxID_OK, " OK ", wxPoint(75, 120), wxDefaultSize).SetDefault()
|
||||
wxButton(win, wxID_CANCEL, " Cancel ", wxPoint(200, 120), wxDefaultSize)
|
||||
sizer = wxBoxSizer(wxVERTICAL)
|
||||
|
||||
label = wxStaticText(win, -1, "This is a wxDialog")
|
||||
sizer.Add(label, 0, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
box = wxBoxSizer(wxHORIZONTAL)
|
||||
|
||||
label = wxStaticText(win, -1, "Field #1:")
|
||||
box.Add(label, 0, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
text = wxTextCtrl(win, -1, "", size=(80,-1))
|
||||
box.Add(text, 1, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
sizer.AddSizer(box, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5)
|
||||
|
||||
box = wxBoxSizer(wxHORIZONTAL)
|
||||
|
||||
label = wxStaticText(win, -1, "Field #2:")
|
||||
box.Add(label, 0, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
text = wxTextCtrl(win, -1, "", size=(80,-1))
|
||||
box.Add(text, 1, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
sizer.AddSizer(box, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5)
|
||||
|
||||
line = wxStaticLine(win, -1, size=(20,-1), style=wxLI_HORIZONTAL)
|
||||
sizer.Add(line, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5)
|
||||
|
||||
box = wxBoxSizer(wxHORIZONTAL)
|
||||
|
||||
btn = wxButton(win, wxID_OK, " OK ")
|
||||
btn.SetDefault()
|
||||
box.Add(btn, 0, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
btn = wxButton(win, wxID_CANCEL, " Cancel ")
|
||||
box.Add(btn, 0, wxALIGN_CENTRE|wxALL, 5)
|
||||
|
||||
sizer.AddSizer(box, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5)
|
||||
|
||||
win.SetSizer(sizer)
|
||||
win.SetAutoLayout(true)
|
||||
sizer.Fit(win)
|
||||
|
||||
val = win.ShowModal()
|
||||
if val == wxID_OK:
|
||||
|
Loading…
Reference in New Issue
Block a user