From b62b320a40151849dc56d07f680c4127ab71ea81 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 11 Feb 2003 19:06:22 +0000 Subject: [PATCH] Show calling SetExtraStyle before the dialog is created, also show more context sensitive help. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/wxDialog.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/wxPython/demo/wxDialog.py b/wxPython/demo/wxDialog.py index 399ebe3c1e..7985b60dfd 100644 --- a/wxPython/demo/wxDialog.py +++ b/wxPython/demo/wxDialog.py @@ -1,25 +1,41 @@ from wxPython.wx import * +from wxPython.help import * #--------------------------------------------------------------------------- def runTest(frame, nb, log): - win = wxDialog(frame, -1, "This is a wxDialog", size=wxSize(350, 200), - style = wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME - #style = wxDEFAULT_DIALOG_STYLE +## win = wxDialog(frame, -1, "This is a wxDialog", size=wxSize(350, 200), +## style = wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME +## #style = wxDEFAULT_DIALOG_STYLE +## ) + + # Create and set a help provider. Normally you would do this in + # the app's OnInit as it must be done before any SetHelpText calls. + provider = wxSimpleHelpProvider() + wxHelpProvider_Set(provider) + + win = wxPreDialog() + win.SetExtraStyle(wxDIALOG_EX_CONTEXTHELP) + win.Create(frame, -1, "This is a wxDialog", size=wxSize(350, 200), + #style = wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME + style = wxDEFAULT_DIALOG_STYLE ) sizer = wxBoxSizer(wxVERTICAL) label = wxStaticText(win, -1, "This is a wxDialog") + label.SetHelpText("This is the help text for the label") sizer.Add(label, 0, wxALIGN_CENTRE|wxALL, 5) box = wxBoxSizer(wxHORIZONTAL) label = wxStaticText(win, -1, "Field #1:") + label.SetHelpText("This is the help text for the label") box.Add(label, 0, wxALIGN_CENTRE|wxALL, 5) text = wxTextCtrl(win, -1, "", size=(80,-1)) + text.SetHelpText("Here's some help text for field #1") box.Add(text, 1, wxALIGN_CENTRE|wxALL, 5) sizer.AddSizer(box, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5) @@ -27,9 +43,11 @@ def runTest(frame, nb, log): box = wxBoxSizer(wxHORIZONTAL) label = wxStaticText(win, -1, "Field #2:") + label.SetHelpText("This is the help text for the label") box.Add(label, 0, wxALIGN_CENTRE|wxALL, 5) text = wxTextCtrl(win, -1, "", size=(80,-1)) + text.SetHelpText("Here's some help text for field #2") box.Add(text, 1, wxALIGN_CENTRE|wxALL, 5) sizer.AddSizer(box, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5) @@ -41,9 +59,11 @@ def runTest(frame, nb, log): btn = wxButton(win, wxID_OK, " OK ") btn.SetDefault() + btn.SetHelpText("The OK button completes the dialog") box.Add(btn, 0, wxALIGN_CENTRE|wxALL, 5) btn = wxButton(win, wxID_CANCEL, " Cancel ") + btn.SetHelpText("The Cancel button cnacels the dialog. (Duh!)") box.Add(btn, 0, wxALIGN_CENTRE|wxALL, 5) sizer.AddSizer(box, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5)