X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb9010ed40454cc978a9cbaa6de2ee41ea8b6c84..5d7792236f7e4fcbb94cdc2a5213e0c5788e8c28:/src/os2/helpwin.cpp diff --git a/src/os2/helpwin.cpp b/src/os2/helpwin.cpp index 3d7e6c1360..dacf83e524 100644 --- a/src/os2/helpwin.cpp +++ b/src/os2/helpwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpwin.cpp +// Name: src/os2/helpwin.cpp // Purpose: Help system: native implementation // Author: David Webster // Modified by: @@ -9,16 +9,19 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if wxUSE_HELP + #ifndef WX_PRECOMP -#include "wx/defs.h" #endif #include "wx/os2/helpwin.h" -#if wxUSE_HELP #include -#include +#include "wx/os2/private.h" #include @@ -28,13 +31,11 @@ // MAX length of Help descriptor #define _MAX_HELP_LEN 500 -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxWinHelpController, wxHelpControllerBase) -#endif wxWinHelpController::wxWinHelpController() { - m_helpFile = ""; + m_helpFile = wxEmptyString; } wxWinHelpController::~wxWinHelpController() @@ -45,77 +46,82 @@ bool wxWinHelpController::Initialize(const wxString& filename) { m_helpFile = filename; // TODO any other inits - return TRUE; + return true; } bool wxWinHelpController::LoadFile(const wxString& file) { m_helpFile = file; // TODO - return TRUE; + return true; } bool wxWinHelpController::DisplayContents() { - if (m_helpFile == wxT("")) return FALSE; + if (m_helpFile.empty()) + return false; wxString str = m_helpFile; - size_t len = str.Length(); + size_t len = str.length(); if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.'))) - str += wxT(".hlp"); + str += wxT(".hlp"); if (wxTheApp->GetTopWindow()) { - // TODO : display the help - return TRUE; + // TODO : display the help + return true; } - return FALSE; + return false; } -bool wxWinHelpController::DisplaySection(int section) +bool wxWinHelpController::DisplaySection(int WXUNUSED(section)) { // Use context number - if (m_helpFile == wxT("")) return FALSE; + if (m_helpFile.empty()) + return false; wxString str = m_helpFile; - size_t len = str.Length(); + size_t len = str.length(); if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.'))) str += wxT(".hlp"); if (wxTheApp->GetTopWindow()) - { - // TODO :: - // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section); - return TRUE; - } - return FALSE; + { + // TODO :: + // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section); + return true; + } + + return false; } -bool wxWinHelpController::DisplayBlock(long block) +bool wxWinHelpController::DisplayBlock(long WXUNUSED(block)) { // Use context number -- a very rough equivalent to block id! - if (m_helpFile == wxT("")) return FALSE; + if (m_helpFile.empty()) + return false; wxString str = m_helpFile; - size_t len = str.Length(); - if (!(str[(size_t)(len-1)] == 'p' && str[(size_t)(len-2)] == 'l' && str[(size_t)(len-3)] == 'h' && str[(size_t)(len-4)] == '.')) + size_t len = str.length(); + if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.'))) str += wxT(".hlp"); if (wxTheApp->GetTopWindow()) - { - // TODO: - // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block); - return TRUE; - } - return FALSE; + { + // TODO: + // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block); + return true; + } + return false; } -bool wxWinHelpController::KeywordSearch(const wxString& k) +bool wxWinHelpController::KeywordSearch(const wxString& WXUNUSED(k), + wxHelpSearchMode WXUNUSED(mode)) { - if (m_helpFile == "") return FALSE; + if (m_helpFile == wxEmptyString) return false; wxString str = m_helpFile; - size_t len = str.Length(); + size_t len = str.length(); if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.'))) str += wxT(".hlp"); @@ -123,26 +129,26 @@ bool wxWinHelpController::KeywordSearch(const wxString& k) { // TODO: // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k); - return TRUE; + return true; } - return FALSE; + return false; } // Can't close the help window explicitly in WinHelp bool wxWinHelpController::Quit() { - if (wxTheApp->GetTopWindow()) - { - // TODO: - // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L); - return TRUE; - } - else - return FALSE; + if (wxTheApp->GetTopWindow()) + { + // TODO: + // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L); + return true; + } + + return false; } void wxWinHelpController::OnQuit() { } -#endif // wxUSE_HELP +#endif // wxUSE_HELP