X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e564aa153eb1dc5ebd9f8c9f5f055c2a49c15b05..830efc9b0cb87eae22d4435af7858175017522ab:/samples/help/demo.cpp?ds=sidebyside diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index f88a1650bc..a038747f0d 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -44,6 +44,11 @@ #define USE_HTML_HELP 1 +// Define this to 0 to use the help controller as the help +// provider, or to 1 to use the 'simple help provider' +// (the one implemented with wxTipWindow). +#define USE_SIMPLE_HELP_PROVIDER 0 + #if !wxUSE_HTML #undef USE_HTML_HELP #define USE_HTML_HELP 0 @@ -257,8 +262,11 @@ bool MyApp::OnInit() { // Create a simple help provider to make SetHelpText() do something. // Note that this must be set before any SetHelpText() calls are made. - //wxHelpProvider::Set(new wxSimpleHelpProvider); +#if USE_SIMPLE_HELP_PROVIDER + wxSimpleHelpProvider* provider = new wxSimpleHelpProvider; +#else wxHelpControllerHelpProvider* provider = new wxHelpControllerHelpProvider; +#endif wxHelpProvider::Set(provider); #if wxUSE_HTML @@ -278,10 +286,12 @@ bool MyApp::OnInit() MyFrame *frame = new MyFrame("HelpDemo wxWindows App", wxPoint(50, 50), wxSize(450, 340)); +#if !USE_SIMPLE_HELP_PROVIDER #if wxUSE_MS_HTML_HELP provider->SetHelpController(& frame->GetMSHtmlHelpController()); #else provider->SetHelpController(& frame->GetHelpController()); +#endif #endif frame->Show(TRUE); @@ -416,8 +426,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // a panel first - if there were several controls, it would allow us to // navigate between them from the keyboard wxPanel *panel = new wxPanel(this, 301, wxPoint(0, 0), wxSize(400, 200)); - //panel->SetHelpText(_("This panel just holds a static text control.")); - panel->SetHelpText(wxContextId(300)); + panel->SetHelpText(_("This panel just holds a static text control.")); + //panel->SetHelpText(wxContextId(300)); // and a static control whose parent is the panel wxStaticText* staticText = new wxStaticText(panel, 302, "Hello, world!", wxPoint(10, 10));