]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow MSW Base be usable in other ports than wxMSW (ie. wxTVision in windows console...
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 10 Jun 2005 17:53:19 +0000 (17:53 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 10 Jun 2005 17:53:19 +0000 (17:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

18 files changed:
include/wx/apptrait.h
include/wx/debug.h
include/wx/defs.h
include/wx/generic/propdlg.h
samples/dialogs/dialogs.cpp
samples/dialogs/dialogs.h
samples/menu/menu.cpp
src/common/artstd.cpp
src/common/msgout.cpp
src/common/strconv.cpp
src/common/utilscmn.cpp
src/generic/propdlg.cpp
src/msw/dir.cpp
src/msw/main.cpp
src/msw/registry.cpp
src/msw/utils.cpp
utils/tex2rtf/src/tex2rtf.bkl
utils/tex2rtf/src/texutils.cpp

index 10e4d6b8dc6127def449538b3095893042c09585..ef7686fd46eb18a3e764b815c256f33c91fa87ad 100644 (file)
@@ -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"
index f6f3242e957ce5bd91bda65de2afcfdd50d292c7..c944baba82ff81b6a1a450af65b2c97406898d36 100644 (file)
     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; }
index a395b94c7367eb84a21913d02e026c1ff8ea339e..48bdab9b33965fbdd61b859cbe4cbb41f5d2e6a8 100644 (file)
@@ -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 <unistd.h>
@@ -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__)
index a2d43c9c574f1630b4ae7063e3c1bcb94dd9052e..ec63003b14575e570ef8e9f625f1e8a3ffed6adb 100644 (file)
 #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_
 
index b4e1d0128cc1d524268a1c8ca7dab71b060c25d9..7ea81edd1220c4816f01f5c85059e58ee453344a 100644 (file)
@@ -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
index 7629330a8305c6d563d621c28784bd3e8aac03cb..79e8c49d694d02e3bc9f8e99289e8c3bb1932ec0 100644 (file)
@@ -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
 {
index 96f99913d07b9bb281ac8f70d35396df6a1cd83c..e147f5c5a13b371cd4caab4194fd00b7f89c3fc0 100644 (file)
@@ -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
                      );
 
index b82d687330eebff574f8940666b63501b44630cc..fbd908ecab3f7d997283bd70ad1ac51062a6e439 100644 (file)
@@ -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;
index 84bb0547e4462b0188af678013239d189820bc10..87d9e708d4b6a39c4c3f9bbc326984684511f600 100755 (executable)
@@ -52,7 +52,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
     #include "wx/msw/private.h"
 #endif
 #ifdef __WXMAC__
index aea1e1a18af397c745fed35b26afb06974b988e3..5c75db40983c10e9ef7bc5f76f91e15ae521258a 100644 (file)
 
 #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)
index 8bb3fcd9828b168a830bfe0dd36be814cfe721da..04bac3aa0af32ff26f291ecf905d2ea66195db0f 100644 (file)
@@ -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 <url> (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;
 }
 
 // ----------------------------------------------------------------------------
index d8ee50ab878930e8aee107faa02bb7832a05b94d..5c7c51b26d063b2d2aac6d62c94f020f6be357f7 100644 (file)
@@ -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
index d13cf27c0bc7a8ef00704ca0042fc116655e2d5a..5c64584b62dd6fc985e520f72ea047e17092e454 100644 (file)
@@ -36,7 +36,7 @@
 #include "wx/dir.h"
 #include "wx/filefn.h"          // for wxDirExists()
 
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
     #include "wx/msw/private.h"
 #endif
 
index 577873e340989c39537fe69b98fa125977c5b258..ffd0db8921b47fe6127d99f2368cce5f0a0c5149 100644 (file)
@@ -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
index 2607a3f2c70c018dbc83fbe8611a9dfc6674d4ec..7020b4c030aa36e72ced499751b6c3225c0fe2e2 100644 (file)
@@ -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);
 }
 
index 3fea3de8d738f9eec4c13ccf3b04fdd6f44a12dd..6bf3dfd69b6b55ab28cdeffb14bc825512f52139 100644 (file)
@@ -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
 }
 
 // ----------------------------------------------------------------------------
index 582d493e0526fe437359b9f6ddc2f00d8a64b43e..a7cd0e370371fdd488ddf2ff761f2db3b627b477 100644 (file)
@@ -25,8 +25,9 @@
         <install-to>$(BINDIR)</install-to>
     </exe>
 
-    <exe id="tex2rtf_gui" template="wx_util" template_append="wx_append"
-         cond="USE_GUI=='1'">
+    <exe id="tex2rtf_gui" template="wx_util"
+                          template_append="wx_append"
+                          cond="USE_GUI=='1'">
         <sources>$(TEX2RTF_SRC)</sources>
         <wx-lib>html</wx-lib>
         <wx-lib>core</wx-lib>
index 5308bb3971094081aedbd411a0b160cbeebf971e..d53d63f783804a873d039fea318ac74c562b4b06 100644 (file)
@@ -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
 }