From 532d575bd9baedbbf1c52907a66255975f527530 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 10 Jun 2005 17:53:19 +0000 Subject: [PATCH] Allow MSW Base be usable in other ports than wxMSW (ie. wxTVision in windows console). Adjustements for limited setup.h (as in wxTV) and minor source cleaning. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/apptrait.h | 10 ++++++---- include/wx/debug.h | 3 ++- include/wx/defs.h | 9 +++++---- include/wx/generic/propdlg.h | 6 ++++++ samples/dialogs/dialogs.cpp | 32 +++++++++++++++++++++----------- samples/dialogs/dialogs.h | 13 ++++++++++++- samples/menu/menu.cpp | 10 ++++++---- src/common/artstd.cpp | 11 +++++++---- src/common/msgout.cpp | 2 +- src/common/strconv.cpp | 7 ++----- src/common/utilscmn.cpp | 10 ++++++---- src/generic/propdlg.cpp | 9 ++++++--- src/msw/dir.cpp | 2 +- src/msw/main.cpp | 4 ++-- src/msw/registry.cpp | 33 ++++++++++++++++++++++++--------- src/msw/utils.cpp | 4 ++++ utils/tex2rtf/src/tex2rtf.bkl | 5 +++-- utils/tex2rtf/src/texutils.cpp | 4 +++- 18 files changed, 117 insertions(+), 57 deletions(-) diff --git a/include/wx/apptrait.h b/include/wx/apptrait.h index 10e4d6b8dc..ef7686fd46 100644 --- a/include/wx/apptrait.h +++ b/include/wx/apptrait.h @@ -142,11 +142,12 @@ public: // include the platform-specific version of the class // ---------------------------------------------------------------------------- -// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the -// Unix code (and otherwise __UNIX__ wouldn't be defined) +// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the +// Unix code (and otherwise __UNIX__ wouldn't be defined) +// ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port #if defined(__WXPALMOS__) #include "wx/palmos/apptbase.h" -#elif defined(__WXMSW__) +#elif defined(__WIN32__) #include "wx/msw/apptbase.h" #elif defined(__UNIX__) && !defined(__EMX__) #include "wx/unix/apptbase.h" @@ -229,9 +230,10 @@ public: // include the platform-specific version of the classes above // ---------------------------------------------------------------------------- +// ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port #if defined(__WXPALMOS__) #include "wx/palmos/apptrait.h" -#elif defined(__WXMSW__) +#elif defined(__WIN32__) #include "wx/msw/apptrait.h" #elif defined(__UNIX__) && !defined(__EMX__) #include "wx/unix/apptrait.h" diff --git a/include/wx/debug.h b/include/wx/debug.h index f6f3242e95..c944baba82 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -240,7 +240,8 @@ it always returns false in other cases. */ #ifdef __cplusplus - #if defined(__WXMAC__) || defined(__WXMSW__) + /* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */ + #if defined(__WXMAC__) || defined(__WIN32__) extern bool WXDLLIMPEXP_BASE wxIsDebuggerRunning(); #else /* !Mac */ inline bool wxIsDebuggerRunning() { return false; } diff --git a/include/wx/defs.h b/include/wx/defs.h index a395b94c73..48bdab9b33 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2291,7 +2291,7 @@ enum wxUpdateUI NASTY HACK because the gethostname in sys/unistd.h which the gnu stl includes and wx builds with by default clash with each other (windows version 2nd param is int, sys/unistd.h version is unsigned - int). + int). */ # define gethostname gethostnameHACK # include @@ -2466,7 +2466,8 @@ typedef WXWINHANDLE WXWidget; #endif /* __WXPALMOS__ */ -#if defined(__WXMSW__) +/* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */ +#if defined(__WIN32__) /* the keywords needed for WinMain() declaration */ #ifndef WXFAR @@ -2518,12 +2519,12 @@ typedef long WXLPARAM; typedef long WXLRESULT; #endif -#if !defined(__WIN32__) || defined(__GNUWIN32__) || defined(__WXMICROWIN__) +#if defined(__GNUWIN32__) || defined(__WXMICROWIN__) typedef int (*WXFARPROC)(); #else typedef int (__stdcall *WXFARPROC)(); #endif -#endif /* __WXMSW__ */ +#endif /* __WIN32__ */ #if defined(__WXPM__) || defined(__EMX__) diff --git a/include/wx/generic/propdlg.h b/include/wx/generic/propdlg.h index a2d43c9c57..ec63003b14 100644 --- a/include/wx/generic/propdlg.h +++ b/include/wx/generic/propdlg.h @@ -16,6 +16,10 @@ #pragma interface "propdlg.h" #endif +#include "wx/defs.h" + +#if wxUSE_BOOKCTRL + class WXDLLEXPORT wxBookCtrlBase; //----------------------------------------------------------------------------- @@ -112,5 +116,7 @@ protected: DECLARE_EVENT_TABLE() }; +#endif // wxUSE_BOOKCTRL + #endif // _WX_PROPDLG_H_ diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index b4e1d0128c..7ea81edd12 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -193,7 +193,10 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_FIND_CLOSE(wxID_ANY, MyFrame::OnFindDialog) #endif // wxUSE_FINDREPLDLG +#if USE_SETTINGS_DIALOG EVT_MENU(DIALOGS_PROPERTY_SHEET, MyFrame::OnPropertySheet) +#endif + EVT_MENU(DIALOGS_REQUEST, MyFrame::OnRequestUserAttention) EVT_MENU(wxID_EXIT, MyFrame::OnExit) @@ -357,7 +360,10 @@ bool MyApp::OnInit() file_menu->Append(wxID_ANY,_T("&Modal/Modeless"),modal_menu); #endif // USE_MODAL_PRESENTATION +#if USE_SETTINGS_DIALOG file_menu->Append(DIALOGS_PROPERTY_SHEET, _T("&Property Sheet Dialog\tCtrl-P")); +#endif + file_menu->Append(DIALOGS_REQUEST, _T("&Request user attention\tCtrl-R")); file_menu->AppendSeparator(); @@ -386,7 +392,7 @@ MyFrame::MyFrame(wxWindow *parent, : wxFrame(parent, wxID_ANY, title) { SetIcon(sample_xpm); - + #if USE_MODAL_PRESENTATION m_dialog = (MyModelessDialog *)NULL; #endif // USE_MODAL_PRESENTATION @@ -964,11 +970,13 @@ void MyFrame::ShowTip(wxCommandEvent& WXUNUSED(event)) } #endif // wxUSE_STARTUP_TIPS +#if USE_SETTINGS_DIALOG void MyFrame::OnPropertySheet(wxCommandEvent& WXUNUSED(event)) { SettingsDialog dialog(this); dialog.ShowModal(); } +#endif // USE_SETTINGS_DIALOG void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event)) { @@ -1356,6 +1364,7 @@ void MyModalDialog::OnButton(wxCommandEvent& event) #endif // USE_MODAL_PRESENTATION +#if USE_SETTINGS_DIALOG // ---------------------------------------------------------------------------- // SettingsDialog // ---------------------------------------------------------------------------- @@ -1369,11 +1378,11 @@ SettingsDialog::SettingsDialog(wxWindow* win) { SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY); - Create(win, -1, _("Preferences"), wxDefaultPosition, wxDefaultSize, + Create(win, wxID_ANY, _("Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE #ifndef __WXWINCE__ |wxRESIZE_BORDER -#endif +#endif ); CreateButtons(wxOK|wxCANCEL|wxHELP); @@ -1412,9 +1421,9 @@ wxPanel* SettingsDialog::CreateGeneralSettingsPage(wxWindow* parent) #if wxUSE_SPINCTRL wxSpinCtrl* spinCtrl12 = new wxSpinCtrl(panel, ID_AUTO_SAVE_MINS, wxEmptyString, - wxDefaultPosition, wxSize(40, -1), wxSP_ARROW_KEYS, 1, 60, 1); + wxDefaultPosition, wxSize(40, wxDefaultCoord), wxSP_ARROW_KEYS, 1, 60, 1); #endif - + itemSizer12->Add(checkBox12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); #if wxUSE_SPINCTRL itemSizer12->Add(spinCtrl12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); @@ -1423,7 +1432,7 @@ wxPanel* SettingsDialog::CreateGeneralSettingsPage(wxWindow* parent) item0->Add(itemSizer12, 0, wxGROW|wxALL, 0); //// TOOLTIPS - + wxBoxSizer* itemSizer8 = new wxBoxSizer( wxHORIZONTAL ); wxCheckBox* checkBox6 = new wxCheckBox(panel, ID_SHOW_TOOLTIPS, _("Show &tooltips"), wxDefaultPosition, wxDefaultSize); itemSizer8->Add(checkBox6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); @@ -1433,7 +1442,7 @@ wxPanel* SettingsDialog::CreateGeneralSettingsPage(wxWindow* parent) panel->SetSizer(topSizer); topSizer->Fit(panel); - + return panel; } @@ -1459,7 +1468,7 @@ wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent) wxArrayString backgroundStyleChoices; backgroundStyleChoices.Add(wxT("Colour")); backgroundStyleChoices.Add(wxT("Image")); - wxStaticBox* staticBox3 = new wxStaticBox(panel, -1, _("Background style:")); + wxStaticBox* staticBox3 = new wxStaticBox(panel, wxID_ANY, _("Background style:")); wxBoxSizer* styleSizer = new wxStaticBoxSizer( staticBox3, wxVERTICAL ); item0->Add(styleSizer, 0, wxGROW|wxALL, 5); @@ -1477,11 +1486,11 @@ wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent) #if wxUSE_SPINCTRL //// FONT SIZE SELECTION - wxStaticBox* staticBox1 = new wxStaticBox(panel, -1, _("Tile font size:")); + wxStaticBox* staticBox1 = new wxStaticBox(panel, wxID_ANY, _("Tile font size:")); wxBoxSizer* itemSizer5 = new wxStaticBoxSizer( staticBox1, wxHORIZONTAL ); wxSpinCtrl* spinCtrl = new wxSpinCtrl(panel, ID_FONT_SIZE, wxEmptyString, wxDefaultPosition, - wxSize(80, -1)); + wxSize(80, wxDefaultCoord)); itemSizer5->Add(spinCtrl, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); item0->Add(itemSizer5, 0, wxGROW|wxLEFT|wxRIGHT, 5); @@ -1492,7 +1501,8 @@ wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent) panel->SetSizer(topSizer); topSizer->Fit(panel); - + return panel; } +#endif // USE_SETTINGS_DIALOG diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h index 7629330a83..79e8c49d69 100644 --- a/samples/dialogs/dialogs.h +++ b/samples/dialogs/dialogs.h @@ -78,13 +78,21 @@ of MSW, MAC and OS2 // Turn USE_MODAL_PRESENTATION to 0 if there is any reason for not presenting difference // between modal and modeless dialogs (ie. not implemented it in your port yet) -#if defined(__SMARTPHONE__) +#if defined(__SMARTPHONE__) || !wxUSE_BOOKCTRL #define USE_MODAL_PRESENTATION 0 #else #define USE_MODAL_PRESENTATION 1 #endif +// Turn USE_SETTINGS_DIALOG to 0 if supported +#if wxUSE_BOOKCTRL + #define USE_SETTINGS_DIALOG 1 +#else + #define USE_SETTINGS_DIALOG 0 +#endif + + // Define a new application type class MyApp: public wxApp { @@ -128,6 +136,7 @@ private: #endif // USE_MODAL_PRESENTATION +#if USE_SETTINGS_DIALOG // Property sheet dialog class SettingsDialog: public wxPropertySheetDialog { @@ -154,6 +163,8 @@ protected: DECLARE_EVENT_TABLE() }; +#endif // USE_SETTINGS_DIALOG + // Define a new frame type class MyFrame: public wxFrame { diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 96f99913d0..e147f5c5a1 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -438,8 +438,10 @@ MyFrame::MyFrame() menuMenu->AppendSeparator(); menuMenu->Append(Menu_Menu_GetInfo, _T("Get menu item in&fo\tAlt-F"), _T("Show the state of the last menu item")); +#if wxUSE_TEXTDLG menuMenu->Append(Menu_Menu_SetLabel, _T("Set menu item label\tAlt-L"), _T("Set the label of a menu item")); +#endif #if wxUSE_TEXTDLG menuMenu->AppendSeparator(); menuMenu->Append(Menu_Menu_FindItem, _T("Find menu item from label"), @@ -480,7 +482,7 @@ MyFrame::MyFrame() #if USE_LOG_WINDOW // create the log text window - m_textctrl = new wxTextCtrl(this, wxID_ANY, _T(""), + m_textctrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); m_textctrl->SetEditable(false); @@ -679,7 +681,7 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event)) ( _T("Enter label to search for: "), _T("Find menu"), - _T(""), + wxEmptyString, this ); @@ -747,7 +749,7 @@ void MyFrame::OnInsertMenuItem(wxCommandEvent& WXUNUSED(event)) menu->Insert(0, wxMenuItem::New(menu, Menu_Dummy_Fourth, _T("Fourth dummy item\tCtrl-F4"))); - menu->Insert(1, wxMenuItem::New(menu, wxID_SEPARATOR, _T(""))); + menu->Insert(1, wxMenuItem::New(menu, wxID_SEPARATOR)); } void MyFrame::OnEnableMenuItem(wxCommandEvent& WXUNUSED(event)) @@ -898,7 +900,7 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event)) ( _T("Enter label to search for: "), _T("Find menu item"), - _T(""), + wxEmptyString, this ); diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index b82d687330..fbd908ecab 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -202,8 +202,8 @@ wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id) ART(wxART_TICK_MARK, tick) ART(wxART_CROSS_MARK, cross) - ART(wxART_FILE_SAVE, filesave) - ART(wxART_FILE_SAVE_AS, filesaveas) + ART(wxART_FILE_SAVE, filesave) + ART(wxART_FILE_SAVE_AS, filesaveas) ART(wxART_COPY, copy) ART(wxART_CUT, cut) ART(wxART_PASTE, paste) @@ -214,8 +214,8 @@ wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id) ART(wxART_FIND, find) ART(wxART_FIND_AND_REPLACE, findrepl) ART(wxART_NEW, new) - - + + return wxNullBitmap; } @@ -252,6 +252,9 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, } } } +#else + wxUnusedVar(client); + wxUnusedVar(reqSize); #endif // wxUSE_IMAGE return bmp; diff --git a/src/common/msgout.cpp b/src/common/msgout.cpp index 84bb0547e4..87d9e708d4 100755 --- a/src/common/msgout.cpp +++ b/src/common/msgout.cpp @@ -52,7 +52,7 @@ #include #include -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" #endif #ifdef __WXMAC__ diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index aea1e1a18a..5c75db4098 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -40,11 +40,8 @@ #if wxUSE_WCHAR_T -#ifdef __WXMSW__ - #include "wx/msw/private.h" -#endif - #ifdef __WINDOWS__ + #include "wx/msw/private.h" #include "wx/msw/missing.h" #endif @@ -360,7 +357,7 @@ size_t wxMBConvLibc::WC2MB(char *buf, const wchar_t *psz, size_t n) const #ifdef __UNIX__ // ---------------------------------------------------------------------------- -// wxConvBrokenFileNames +// wxConvBrokenFileNames // ---------------------------------------------------------------------------- wxConvBrokenFileNames::wxConvBrokenFileNames(const wxChar *charset) diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 8bb3fcd982..04bac3aa0a 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -533,6 +533,8 @@ long wxExecute(const wxString& command, bool wxLaunchDefaultBrowser(const wxString& url) { + bool success = true; + wxString finalurl = url; //if it isn't a full url, try appending http:// to it @@ -619,7 +621,7 @@ bool wxLaunchDefaultBrowser(const wxString& url) // Windows sometimes doesn't open the browser correctly when using mime // types, so do ShellExecute - i.e. start (from James Carroll) nResult = (int) (*lpShellExecute)(NULL, NULL, finalurl.c_str(), - NULL, wxT(""), SW_SHOWNORMAL); + NULL, wxT(""), SW_SHOWNORMAL); // Unload Shell32.dll ::FreeLibrary(hShellDll); #else @@ -701,16 +703,16 @@ bool wxLaunchDefaultBrowser(const wxString& url) if ( cmd.empty() || wxExecute(cmd + wxT(" ") + finalurl) == -1) return false; } - + #else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG) - return false; + success = false; #endif //success - hopefully - return true; + return success; } // ---------------------------------------------------------------------------- diff --git a/src/generic/propdlg.cpp b/src/generic/propdlg.cpp index d8ee50ab87..5c7c51b26d 100644 --- a/src/generic/propdlg.cpp +++ b/src/generic/propdlg.cpp @@ -22,6 +22,8 @@ #include "wx/defs.h" +#if wxUSE_BOOKCTRL + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/sizer.h" @@ -43,13 +45,13 @@ BEGIN_EVENT_TABLE(wxPropertySheetDialog, wxDialog) EVT_ACTIVATE(wxPropertySheetDialog::OnActivate) END_EVENT_TABLE() -bool wxPropertySheetDialog::Create(wxWindow* parent, wxWindowID id, const wxString& title, +bool wxPropertySheetDialog::Create(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& sz, long style, const wxString& name) { if (!wxDialog::Create(parent, id, title, pos, sz, style|wxCLIP_CHILDREN, name)) return false; - + wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); SetSizer(topSizer); @@ -141,7 +143,7 @@ void wxPropertySheetDialog::OnActivate(wxActivateEvent& event) // of the dialog (the choicebook). if (event.GetActive()) { - wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook); + wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook); if (choiceBook) choiceBook->SetFocus(); } @@ -150,3 +152,4 @@ void wxPropertySheetDialog::OnActivate(wxActivateEvent& event) event.Skip(); } +#endif // wxUSE_BOOKCTRL diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index d13cf27c0b..5c64584b62 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -36,7 +36,7 @@ #include "wx/dir.h" #include "wx/filefn.h" // for wxDirExists() -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/private.h" #endif diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 577873e340..ffd0db8921 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -251,7 +251,7 @@ int wxEntry(int& argc, wxChar **argv) #endif // wxUSE_BASE -#if wxUSE_GUI +#if wxUSE_GUI && defined(__WXMSW__) // ---------------------------------------------------------------------------- // Windows-specific wxEntry @@ -370,7 +370,7 @@ DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved)) #endif // !NOMAIN -#endif // wxUSE_GUI +#endif // wxUSE_GUI && __WXMSW__ // ---------------------------------------------------------------------------- // global HINSTANCE diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 2607a3f2c7..7020b4c030 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -163,7 +163,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey) } else { strKey = strKey.After(REG_SEPARATOR); - if ( !strKey.IsEmpty() && strKey.Last() == REG_SEPARATOR ) + if ( !strKey.empty() && strKey.Last() == REG_SEPARATOR ) strKey.Truncate(strKey.Len() - 1); } @@ -214,8 +214,8 @@ wxRegKey::wxRegKey(const wxRegKey& keyParent, const wxString& strKey) : m_strKey(keyParent.m_strKey) { // combine our name with parent's to get the full name - if ( !m_strKey.IsEmpty() && - (strKey.IsEmpty() || strKey[0] != REG_SEPARATOR) ) { + if ( !m_strKey.empty() && + (strKey.empty() || strKey[0] != REG_SEPARATOR) ) { m_strKey += REG_SEPARATOR; } @@ -270,7 +270,7 @@ void wxRegKey::SetName(const wxRegKey& keyParent, const wxString& strKey) // next line! m_strKey.clear(); m_strKey += keyParent.m_strKey; - if ( !strKey.IsEmpty() && strKey[0] != REG_SEPARATOR ) + if ( !strKey.empty() && strKey[0] != REG_SEPARATOR ) m_strKey += REG_SEPARATOR; m_strKey += strKey; @@ -304,7 +304,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const StdKey key = GetStdKeyFromHkey((WXHKEY) m_hRootKey); wxString str = bShortPrefix ? aStdKeys[key].szShortName : aStdKeys[key].szName; - if ( !m_strKey.IsEmpty() ) + if ( !m_strKey.empty() ) str << _T("\\") << m_strKey; return str; @@ -523,7 +523,7 @@ bool wxRegKey::CopyValue(const wxChar *szValue, bool wxRegKey::Rename(const wxChar *szNewName) { - wxCHECK_MSG( !m_strKey.IsEmpty(), false, _T("registry hives can't be renamed") ); + wxCHECK_MSG( !m_strKey.empty(), false, _T("registry hives can't be renamed") ); if ( !Exists() ) { wxLogError(_("Registry key '%s' does not exist, cannot rename it."), @@ -541,7 +541,7 @@ bool wxRegKey::Rename(const wxChar *szNewName) if ( inSameHive ) { // rename the key to the new name under the same parent wxString strKey = m_strKey.BeforeLast(REG_SEPARATOR); - if ( !strKey.IsEmpty() ) { + if ( !strKey.empty() ) { // don't add '\\' in the start if strFullNewName is empty strKey += REG_SEPARATOR; } @@ -655,7 +655,7 @@ bool wxRegKey::DeleteSelf() // prevent a buggy program from erasing one of the root registry keys or an // immediate subkey (i.e. one which doesn't have '\\' inside) of any other // key except HKCR (HKCR has some "deleteable" subkeys) - if ( m_strKey.IsEmpty() || + if ( m_strKey.empty() || ((m_hRootKey != (WXHKEY) aStdKeys[HKCR].hkey) && (m_strKey.Find(REG_SEPARATOR) == wxNOT_FOUND)) ) { wxLogError(_("Registry key '%s' is needed for normal system operation,\ndeleting it will leave your system in unusable state:\noperation aborted."), @@ -1096,6 +1096,8 @@ bool wxRegKey::IsNumericValue(const wxChar *szValue) const // exporting registry keys to file // ---------------------------------------------------------------------------- +#if wxUSE_STREAMS + // helper functions for writing ASCII strings (even in Unicode build) static inline bool WriteAsciiChar(wxOutputStream& ostr, char ch) { @@ -1126,8 +1128,11 @@ static inline bool WriteAsciiString(wxOutputStream& ostr, const wxString& s) return ostr.IsOk(); } +#endif // wxUSE_STREAMS + bool wxRegKey::Export(const wxString& filename) const { +#if wxUSE_FFILE && wxUSE_STREAMS if ( wxFile::Exists(filename) ) { wxLogError(_("Exporting registry key: file \"%s\" already exists and won't be overwritten."), @@ -1138,8 +1143,13 @@ bool wxRegKey::Export(const wxString& filename) const wxFFileOutputStream ostr(filename, _T("w")); return ostr.Ok() && Export(ostr); +#else + wxUnusedVar(filename); + return false; +#endif } +#if wxUSE_STREAMS bool wxRegKey::Export(wxOutputStream& ostr) const { // write out the header @@ -1148,6 +1158,7 @@ bool wxRegKey::Export(wxOutputStream& ostr) const return DoExport(ostr); } +#endif // wxUSE_STREAMS static wxString @@ -1278,6 +1289,8 @@ wxString wxRegKey::FormatValue(const wxString& name) const return rhs; } +#if wxUSE_STREAMS + bool wxRegKey::DoExportValue(wxOutputStream& ostr, const wxString& name) const { // first examine the value type: if it's unsupported, simply skip it @@ -1357,6 +1370,8 @@ bool wxRegKey::DoExport(wxOutputStream& ostr) const return true; } +#endif // wxUSE_STREAMS + // ============================================================================ // implementation of global private functions // ============================================================================ @@ -1397,7 +1412,7 @@ const wxChar *GetFullName(const wxRegKey *pKey, const wxChar *szValue) void RemoveTrailingSeparator(wxString& str) { - if ( !str.IsEmpty() && str.Last() == REG_SEPARATOR ) + if ( !str.empty() && str.Last() == REG_SEPARATOR ) str.Truncate(str.Len() - 1); } diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 3fea3de8d7..6bf3dfd69b 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1069,6 +1069,7 @@ void wxBell() bool wxIsDebuggerRunning() { +#if wxUSE_DYNLIB_CLASS // IsDebuggerPresent() is not available under Win95, so load it dynamically wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM); @@ -1080,6 +1081,9 @@ bool wxIsDebuggerRunning() } return (*(IsDebuggerPresent_t)dll.GetSymbol(_T("IsDebuggerPresent")))() != 0; +#else + return false; +#endif } // ---------------------------------------------------------------------------- diff --git a/utils/tex2rtf/src/tex2rtf.bkl b/utils/tex2rtf/src/tex2rtf.bkl index 582d493e05..a7cd0e3703 100644 --- a/utils/tex2rtf/src/tex2rtf.bkl +++ b/utils/tex2rtf/src/tex2rtf.bkl @@ -25,8 +25,9 @@ $(BINDIR) - + $(TEX2RTF_SRC) html core diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index 5308bb3971..d53d63f783 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -1631,7 +1631,7 @@ void InitialiseColourTable(void) void Tex2RTFYield(bool force) { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ static int yieldCount = 0; if (isSync) @@ -1646,6 +1646,8 @@ void Tex2RTFYield(bool force) yieldCount = 10; } yieldCount --; +#else + wxUnusedVar(force); #endif } -- 2.45.2