void GlobalReplaceDialog::OnContextHelp ( wxHelpEvent& e ) { int id = e.GetId(); if ( id == ID_FIND ) new wxTipWindow ( this, _ ( "Provides a space for you to type the text you want to find" ) ); else if ( id == ID_REPLACE ) new wxTipWindow ( this, _ ( "Provides a space for you to type the text you want to replace the text you typed in Find what" ) ); else if ( id == ID_MATCHCASE ) new wxTipWindow ( this, _ ( "Finds only text with lowercase and uppercase letters as specified in Find what" ) ); else if ( id == ID_ALLDOCUMENTS ) new wxTipWindow ( this, _ ( "Extends the scope to all open documents" ) ); else if ( id == ID_REGEX ) new wxTipWindow ( this, _ ( "Interprets the text specified in Find what as a regular expression" ) ); else if ( id == wxID_OK ) new wxTipWindow ( this, _ ( "Finds all instances of the text specified in Find what and replaces them with the text in Replace with" ) ); else if ( id == wxID_CANCEL ) new wxTipWindow ( this, _ ( "Closes the dialog box without saving any changes you have made" ) ); else { } e.Skip(); }
void AssociateDialog::OnContextHelp ( wxHelpEvent& e ) { int id = e.GetId(); if ( id == ID_URL ) new wxTipWindow ( this, _ ( "Provides a space for you to type the path of the file" ) ); else if ( id == ID_BROWSE ) new wxTipWindow ( this, _ ( "Opens a standard file dialog" ) ); else if ( id == ID_AUX ) new wxTipWindow ( this, _ ( "Provides a space for you to type additional information" ) ); else if ( id == wxID_CANCEL ) new wxTipWindow ( this, _ ( "Closes this dialog without making any changes" ) ); else if ( id == wxID_OK ) new wxTipWindow ( this, _ ( "Selects the file specified" ) ); else { } e.Skip(); }
void wxBookCtrlBase::OnHelp(wxHelpEvent& event) { // determine where does this even originate from to avoid redirecting it // back to the page which generated it (resulting in an infinite loop) // notice that we have to check in the hard(er) way instead of just testing // if the event object == this because the book control can have other // subcontrols inside it (e.g. wxSpinButton in case of a notebook in wxUniv) wxWindow *source = wxStaticCast(event.GetEventObject(), wxWindow); while ( source && source != this && source->GetParent() != this ) { source = source->GetParent(); } if ( source && m_pages.Index(source) == wxNOT_FOUND ) { // this event is for the book control itself, redirect it to the // corresponding page wxWindow *page = NULL; if ( event.GetOrigin() == wxHelpEvent::Origin_HelpButton ) { // show help for the page under the mouse const int pagePos = HitTest(ScreenToClient(event.GetPosition())); if ( pagePos != wxNOT_FOUND) { page = GetPage((size_t)pagePos); } } else // event from keyboard or unknown source { // otherwise show the current page help page = GetCurrentPage(); } if ( page ) { // change event object to the page to avoid infinite recursion if // we get this event ourselves if the page doesn't handle it event.SetEventObject(page); if ( page->GetEventHandler()->ProcessEvent(event) ) { // don't call event.Skip() return; } } } //else: event coming from one of our pages already event.Skip(); }
// show help for this window void ecConfigTreeCtrl::OnHelp(wxHelpEvent& event) { wxPoint pt = ScreenToClient(event.GetPosition()); int flags = 0; wxTreeItemId id = HitTest(pt, flags); wxHelpProvider *helpProvider = wxHelpProvider::Get(); if ( helpProvider && id > 0) { ecConfigItem* item = ((ecTreeItemData*) GetItemData(id))->GetConfigItem(); if (item) { wxGetApp().GetHelpController().DisplayTextPopup(item->GetDescription(), event.GetPosition()); return; } } event.Skip(); }
// Show help for this window void ctConfigTreeCtrl::OnHelp(wxHelpEvent& event) { wxPoint pt = ScreenToClient(event.GetPosition()); int flags = 0; wxTreeItemId id = HitTest(pt, flags); ctTreeItemData *itemData = (ctTreeItemData*) GetItemData(id); wxHelpProvider *helpProvider = wxHelpProvider::Get(); if ( helpProvider && itemData) { ctConfigItem* item = itemData->GetConfigItem(); if (item) { wxString helpTopic = item->GetPropertyString(wxT("help-topic")); if (!helpTopic.IsEmpty()) { wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic); return; } } } event.Skip(); }