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
This commit is contained in:
Włodzimierz Skiba 2005-06-10 17:53:19 +00:00
parent 97bdb4c890
commit 532d575bd9
18 changed files with 117 additions and 57 deletions

View File

@ -142,11 +142,12 @@ public:
// include the platform-specific version of the class // include the platform-specific version of the class
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the // NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the
// Unix code (and otherwise __UNIX__ wouldn't be defined) // 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__) #if defined(__WXPALMOS__)
#include "wx/palmos/apptbase.h" #include "wx/palmos/apptbase.h"
#elif defined(__WXMSW__) #elif defined(__WIN32__)
#include "wx/msw/apptbase.h" #include "wx/msw/apptbase.h"
#elif defined(__UNIX__) && !defined(__EMX__) #elif defined(__UNIX__) && !defined(__EMX__)
#include "wx/unix/apptbase.h" #include "wx/unix/apptbase.h"
@ -229,9 +230,10 @@ public:
// include the platform-specific version of the classes above // 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__) #if defined(__WXPALMOS__)
#include "wx/palmos/apptrait.h" #include "wx/palmos/apptrait.h"
#elif defined(__WXMSW__) #elif defined(__WIN32__)
#include "wx/msw/apptrait.h" #include "wx/msw/apptrait.h"
#elif defined(__UNIX__) && !defined(__EMX__) #elif defined(__UNIX__) && !defined(__EMX__)
#include "wx/unix/apptrait.h" #include "wx/unix/apptrait.h"

View File

@ -240,7 +240,8 @@
it always returns false in other cases. it always returns false in other cases.
*/ */
#ifdef __cplusplus #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(); extern bool WXDLLIMPEXP_BASE wxIsDebuggerRunning();
#else /* !Mac */ #else /* !Mac */
inline bool wxIsDebuggerRunning() { return false; } inline bool wxIsDebuggerRunning() { return false; }

View File

@ -2291,7 +2291,7 @@ enum wxUpdateUI
NASTY HACK because the gethostname in sys/unistd.h which the gnu NASTY HACK because the gethostname in sys/unistd.h which the gnu
stl includes and wx builds with by default clash with each other stl includes and wx builds with by default clash with each other
(windows version 2nd param is int, sys/unistd.h version is unsigned (windows version 2nd param is int, sys/unistd.h version is unsigned
int). int).
*/ */
# define gethostname gethostnameHACK # define gethostname gethostnameHACK
# include <unistd.h> # include <unistd.h>
@ -2466,7 +2466,8 @@ typedef WXWINHANDLE WXWidget;
#endif /* __WXPALMOS__ */ #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 */ /* the keywords needed for WinMain() declaration */
#ifndef WXFAR #ifndef WXFAR
@ -2518,12 +2519,12 @@ typedef long WXLPARAM;
typedef long WXLRESULT; typedef long WXLRESULT;
#endif #endif
#if !defined(__WIN32__) || defined(__GNUWIN32__) || defined(__WXMICROWIN__) #if defined(__GNUWIN32__) || defined(__WXMICROWIN__)
typedef int (*WXFARPROC)(); typedef int (*WXFARPROC)();
#else #else
typedef int (__stdcall *WXFARPROC)(); typedef int (__stdcall *WXFARPROC)();
#endif #endif
#endif /* __WXMSW__ */ #endif /* __WIN32__ */
#if defined(__WXPM__) || defined(__EMX__) #if defined(__WXPM__) || defined(__EMX__)

View File

@ -16,6 +16,10 @@
#pragma interface "propdlg.h" #pragma interface "propdlg.h"
#endif #endif
#include "wx/defs.h"
#if wxUSE_BOOKCTRL
class WXDLLEXPORT wxBookCtrlBase; class WXDLLEXPORT wxBookCtrlBase;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -112,5 +116,7 @@ protected:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif // wxUSE_BOOKCTRL
#endif // _WX_PROPDLG_H_ #endif // _WX_PROPDLG_H_

View File

@ -193,7 +193,10 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_FIND_CLOSE(wxID_ANY, MyFrame::OnFindDialog) EVT_FIND_CLOSE(wxID_ANY, MyFrame::OnFindDialog)
#endif // wxUSE_FINDREPLDLG #endif // wxUSE_FINDREPLDLG
#if USE_SETTINGS_DIALOG
EVT_MENU(DIALOGS_PROPERTY_SHEET, MyFrame::OnPropertySheet) EVT_MENU(DIALOGS_PROPERTY_SHEET, MyFrame::OnPropertySheet)
#endif
EVT_MENU(DIALOGS_REQUEST, MyFrame::OnRequestUserAttention) EVT_MENU(DIALOGS_REQUEST, MyFrame::OnRequestUserAttention)
EVT_MENU(wxID_EXIT, MyFrame::OnExit) EVT_MENU(wxID_EXIT, MyFrame::OnExit)
@ -357,7 +360,10 @@ bool MyApp::OnInit()
file_menu->Append(wxID_ANY,_T("&Modal/Modeless"),modal_menu); file_menu->Append(wxID_ANY,_T("&Modal/Modeless"),modal_menu);
#endif // USE_MODAL_PRESENTATION #endif // USE_MODAL_PRESENTATION
#if USE_SETTINGS_DIALOG
file_menu->Append(DIALOGS_PROPERTY_SHEET, _T("&Property Sheet Dialog\tCtrl-P")); 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->Append(DIALOGS_REQUEST, _T("&Request user attention\tCtrl-R"));
file_menu->AppendSeparator(); file_menu->AppendSeparator();
@ -386,7 +392,7 @@ MyFrame::MyFrame(wxWindow *parent,
: wxFrame(parent, wxID_ANY, title) : wxFrame(parent, wxID_ANY, title)
{ {
SetIcon(sample_xpm); SetIcon(sample_xpm);
#if USE_MODAL_PRESENTATION #if USE_MODAL_PRESENTATION
m_dialog = (MyModelessDialog *)NULL; m_dialog = (MyModelessDialog *)NULL;
#endif // USE_MODAL_PRESENTATION #endif // USE_MODAL_PRESENTATION
@ -964,11 +970,13 @@ void MyFrame::ShowTip(wxCommandEvent& WXUNUSED(event))
} }
#endif // wxUSE_STARTUP_TIPS #endif // wxUSE_STARTUP_TIPS
#if USE_SETTINGS_DIALOG
void MyFrame::OnPropertySheet(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPropertySheet(wxCommandEvent& WXUNUSED(event))
{ {
SettingsDialog dialog(this); SettingsDialog dialog(this);
dialog.ShowModal(); dialog.ShowModal();
} }
#endif // USE_SETTINGS_DIALOG
void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event))
{ {
@ -1356,6 +1364,7 @@ void MyModalDialog::OnButton(wxCommandEvent& event)
#endif // USE_MODAL_PRESENTATION #endif // USE_MODAL_PRESENTATION
#if USE_SETTINGS_DIALOG
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// SettingsDialog // SettingsDialog
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -1369,11 +1378,11 @@ SettingsDialog::SettingsDialog(wxWindow* win)
{ {
SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY); SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY);
Create(win, -1, _("Preferences"), wxDefaultPosition, wxDefaultSize, Create(win, wxID_ANY, _("Preferences"), wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE wxDEFAULT_DIALOG_STYLE
#ifndef __WXWINCE__ #ifndef __WXWINCE__
|wxRESIZE_BORDER |wxRESIZE_BORDER
#endif #endif
); );
CreateButtons(wxOK|wxCANCEL|wxHELP); CreateButtons(wxOK|wxCANCEL|wxHELP);
@ -1412,9 +1421,9 @@ wxPanel* SettingsDialog::CreateGeneralSettingsPage(wxWindow* parent)
#if wxUSE_SPINCTRL #if wxUSE_SPINCTRL
wxSpinCtrl* spinCtrl12 = new wxSpinCtrl(panel, ID_AUTO_SAVE_MINS, wxEmptyString, 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 #endif
itemSizer12->Add(checkBox12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); itemSizer12->Add(checkBox12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
#if wxUSE_SPINCTRL #if wxUSE_SPINCTRL
itemSizer12->Add(spinCtrl12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); 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); item0->Add(itemSizer12, 0, wxGROW|wxALL, 0);
//// TOOLTIPS //// TOOLTIPS
wxBoxSizer* itemSizer8 = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* itemSizer8 = new wxBoxSizer( wxHORIZONTAL );
wxCheckBox* checkBox6 = new wxCheckBox(panel, ID_SHOW_TOOLTIPS, _("Show &tooltips"), wxDefaultPosition, wxDefaultSize); wxCheckBox* checkBox6 = new wxCheckBox(panel, ID_SHOW_TOOLTIPS, _("Show &tooltips"), wxDefaultPosition, wxDefaultSize);
itemSizer8->Add(checkBox6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); itemSizer8->Add(checkBox6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
@ -1433,7 +1442,7 @@ wxPanel* SettingsDialog::CreateGeneralSettingsPage(wxWindow* parent)
panel->SetSizer(topSizer); panel->SetSizer(topSizer);
topSizer->Fit(panel); topSizer->Fit(panel);
return panel; return panel;
} }
@ -1459,7 +1468,7 @@ wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent)
wxArrayString backgroundStyleChoices; wxArrayString backgroundStyleChoices;
backgroundStyleChoices.Add(wxT("Colour")); backgroundStyleChoices.Add(wxT("Colour"));
backgroundStyleChoices.Add(wxT("Image")); 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 ); wxBoxSizer* styleSizer = new wxStaticBoxSizer( staticBox3, wxVERTICAL );
item0->Add(styleSizer, 0, wxGROW|wxALL, 5); item0->Add(styleSizer, 0, wxGROW|wxALL, 5);
@ -1477,11 +1486,11 @@ wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent)
#if wxUSE_SPINCTRL #if wxUSE_SPINCTRL
//// FONT SIZE SELECTION //// 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 ); wxBoxSizer* itemSizer5 = new wxStaticBoxSizer( staticBox1, wxHORIZONTAL );
wxSpinCtrl* spinCtrl = new wxSpinCtrl(panel, ID_FONT_SIZE, wxEmptyString, wxDefaultPosition, 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); itemSizer5->Add(spinCtrl, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
item0->Add(itemSizer5, 0, wxGROW|wxLEFT|wxRIGHT, 5); item0->Add(itemSizer5, 0, wxGROW|wxLEFT|wxRIGHT, 5);
@ -1492,7 +1501,8 @@ wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent)
panel->SetSizer(topSizer); panel->SetSizer(topSizer);
topSizer->Fit(panel); topSizer->Fit(panel);
return panel; return panel;
} }
#endif // USE_SETTINGS_DIALOG

View 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 // 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) // 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 #define USE_MODAL_PRESENTATION 0
#else #else
#define USE_MODAL_PRESENTATION 1 #define USE_MODAL_PRESENTATION 1
#endif #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 // Define a new application type
class MyApp: public wxApp class MyApp: public wxApp
{ {
@ -128,6 +136,7 @@ private:
#endif // USE_MODAL_PRESENTATION #endif // USE_MODAL_PRESENTATION
#if USE_SETTINGS_DIALOG
// Property sheet dialog // Property sheet dialog
class SettingsDialog: public wxPropertySheetDialog class SettingsDialog: public wxPropertySheetDialog
{ {
@ -154,6 +163,8 @@ protected:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif // USE_SETTINGS_DIALOG
// Define a new frame type // Define a new frame type
class MyFrame: public wxFrame class MyFrame: public wxFrame
{ {

View File

@ -438,8 +438,10 @@ MyFrame::MyFrame()
menuMenu->AppendSeparator(); menuMenu->AppendSeparator();
menuMenu->Append(Menu_Menu_GetInfo, _T("Get menu item in&fo\tAlt-F"), menuMenu->Append(Menu_Menu_GetInfo, _T("Get menu item in&fo\tAlt-F"),
_T("Show the state of the last menu item")); _T("Show the state of the last menu item"));
#if wxUSE_TEXTDLG
menuMenu->Append(Menu_Menu_SetLabel, _T("Set menu item label\tAlt-L"), menuMenu->Append(Menu_Menu_SetLabel, _T("Set menu item label\tAlt-L"),
_T("Set the label of a menu item")); _T("Set the label of a menu item"));
#endif
#if wxUSE_TEXTDLG #if wxUSE_TEXTDLG
menuMenu->AppendSeparator(); menuMenu->AppendSeparator();
menuMenu->Append(Menu_Menu_FindItem, _T("Find menu item from label"), menuMenu->Append(Menu_Menu_FindItem, _T("Find menu item from label"),
@ -480,7 +482,7 @@ MyFrame::MyFrame()
#if USE_LOG_WINDOW #if USE_LOG_WINDOW
// create the log text window // create the log text window
m_textctrl = new wxTextCtrl(this, wxID_ANY, _T(""), m_textctrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE); wxTE_MULTILINE);
m_textctrl->SetEditable(false); m_textctrl->SetEditable(false);
@ -679,7 +681,7 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event))
( (
_T("Enter label to search for: "), _T("Enter label to search for: "),
_T("Find menu"), _T("Find menu"),
_T(""), wxEmptyString,
this this
); );
@ -747,7 +749,7 @@ void MyFrame::OnInsertMenuItem(wxCommandEvent& WXUNUSED(event))
menu->Insert(0, wxMenuItem::New(menu, Menu_Dummy_Fourth, menu->Insert(0, wxMenuItem::New(menu, Menu_Dummy_Fourth,
_T("Fourth dummy item\tCtrl-F4"))); _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)) void MyFrame::OnEnableMenuItem(wxCommandEvent& WXUNUSED(event))
@ -898,7 +900,7 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event))
( (
_T("Enter label to search for: "), _T("Enter label to search for: "),
_T("Find menu item"), _T("Find menu item"),
_T(""), wxEmptyString,
this this
); );

View File

@ -202,8 +202,8 @@ wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id)
ART(wxART_TICK_MARK, tick) ART(wxART_TICK_MARK, tick)
ART(wxART_CROSS_MARK, cross) ART(wxART_CROSS_MARK, cross)
ART(wxART_FILE_SAVE, filesave) ART(wxART_FILE_SAVE, filesave)
ART(wxART_FILE_SAVE_AS, filesaveas) ART(wxART_FILE_SAVE_AS, filesaveas)
ART(wxART_COPY, copy) ART(wxART_COPY, copy)
ART(wxART_CUT, cut) ART(wxART_CUT, cut)
ART(wxART_PASTE, paste) ART(wxART_PASTE, paste)
@ -214,8 +214,8 @@ wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id)
ART(wxART_FIND, find) ART(wxART_FIND, find)
ART(wxART_FIND_AND_REPLACE, findrepl) ART(wxART_FIND_AND_REPLACE, findrepl)
ART(wxART_NEW, new) ART(wxART_NEW, new)
return wxNullBitmap; return wxNullBitmap;
} }
@ -252,6 +252,9 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
} }
} }
} }
#else
wxUnusedVar(client);
wxUnusedVar(reqSize);
#endif // wxUSE_IMAGE #endif // wxUSE_IMAGE
return bmp; return bmp;

View File

@ -52,7 +52,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#if defined(__WXMSW__) #if defined(__WINDOWS__)
#include "wx/msw/private.h" #include "wx/msw/private.h"
#endif #endif
#ifdef __WXMAC__ #ifdef __WXMAC__

View File

@ -40,11 +40,8 @@
#if wxUSE_WCHAR_T #if wxUSE_WCHAR_T
#ifdef __WXMSW__
#include "wx/msw/private.h"
#endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#include "wx/msw/private.h"
#include "wx/msw/missing.h" #include "wx/msw/missing.h"
#endif #endif
@ -360,7 +357,7 @@ size_t wxMBConvLibc::WC2MB(char *buf, const wchar_t *psz, size_t n) const
#ifdef __UNIX__ #ifdef __UNIX__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxConvBrokenFileNames // wxConvBrokenFileNames
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxConvBrokenFileNames::wxConvBrokenFileNames(const wxChar *charset) wxConvBrokenFileNames::wxConvBrokenFileNames(const wxChar *charset)

View File

@ -533,6 +533,8 @@ long wxExecute(const wxString& command,
bool wxLaunchDefaultBrowser(const wxString& url) bool wxLaunchDefaultBrowser(const wxString& url)
{ {
bool success = true;
wxString finalurl = url; wxString finalurl = url;
//if it isn't a full url, try appending http:// to it //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 // Windows sometimes doesn't open the browser correctly when using mime
// types, so do ShellExecute - i.e. start <url> (from James Carroll) // types, so do ShellExecute - i.e. start <url> (from James Carroll)
nResult = (int) (*lpShellExecute)(NULL, NULL, finalurl.c_str(), nResult = (int) (*lpShellExecute)(NULL, NULL, finalurl.c_str(),
NULL, wxT(""), SW_SHOWNORMAL); NULL, wxT(""), SW_SHOWNORMAL);
// Unload Shell32.dll // Unload Shell32.dll
::FreeLibrary(hShellDll); ::FreeLibrary(hShellDll);
#else #else
@ -701,16 +703,16 @@ bool wxLaunchDefaultBrowser(const wxString& url)
if ( cmd.empty() || wxExecute(cmd + wxT(" ") + finalurl) == -1) if ( cmd.empty() || wxExecute(cmd + wxT(" ") + finalurl) == -1)
return false; return false;
} }
#else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG) #else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG)
return false; success = false;
#endif #endif
//success - hopefully //success - hopefully
return true; return success;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -22,6 +22,8 @@
#include "wx/defs.h" #include "wx/defs.h"
#if wxUSE_BOOKCTRL
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/button.h" #include "wx/button.h"
#include "wx/sizer.h" #include "wx/sizer.h"
@ -43,13 +45,13 @@ BEGIN_EVENT_TABLE(wxPropertySheetDialog, wxDialog)
EVT_ACTIVATE(wxPropertySheetDialog::OnActivate) EVT_ACTIVATE(wxPropertySheetDialog::OnActivate)
END_EVENT_TABLE() 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 wxPoint& pos, const wxSize& sz, long style,
const wxString& name) const wxString& name)
{ {
if (!wxDialog::Create(parent, id, title, pos, sz, style|wxCLIP_CHILDREN, name)) if (!wxDialog::Create(parent, id, title, pos, sz, style|wxCLIP_CHILDREN, name))
return false; return false;
wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
SetSizer(topSizer); SetSizer(topSizer);
@ -141,7 +143,7 @@ void wxPropertySheetDialog::OnActivate(wxActivateEvent& event)
// of the dialog (the choicebook). // of the dialog (the choicebook).
if (event.GetActive()) if (event.GetActive())
{ {
wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook); wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook);
if (choiceBook) if (choiceBook)
choiceBook->SetFocus(); choiceBook->SetFocus();
} }
@ -150,3 +152,4 @@ void wxPropertySheetDialog::OnActivate(wxActivateEvent& event)
event.Skip(); event.Skip();
} }
#endif // wxUSE_BOOKCTRL

View File

@ -36,7 +36,7 @@
#include "wx/dir.h" #include "wx/dir.h"
#include "wx/filefn.h" // for wxDirExists() #include "wx/filefn.h" // for wxDirExists()
#ifdef __WXMSW__ #ifdef __WINDOWS__
#include "wx/msw/private.h" #include "wx/msw/private.h"
#endif #endif

View File

@ -251,7 +251,7 @@ int wxEntry(int& argc, wxChar **argv)
#endif // wxUSE_BASE #endif // wxUSE_BASE
#if wxUSE_GUI #if wxUSE_GUI && defined(__WXMSW__)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Windows-specific wxEntry // Windows-specific wxEntry
@ -370,7 +370,7 @@ DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved))
#endif // !NOMAIN #endif // !NOMAIN
#endif // wxUSE_GUI #endif // wxUSE_GUI && __WXMSW__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// global HINSTANCE // global HINSTANCE

View File

@ -163,7 +163,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
} }
else { else {
strKey = strKey.After(REG_SEPARATOR); strKey = strKey.After(REG_SEPARATOR);
if ( !strKey.IsEmpty() && strKey.Last() == REG_SEPARATOR ) if ( !strKey.empty() && strKey.Last() == REG_SEPARATOR )
strKey.Truncate(strKey.Len() - 1); strKey.Truncate(strKey.Len() - 1);
} }
@ -214,8 +214,8 @@ wxRegKey::wxRegKey(const wxRegKey& keyParent, const wxString& strKey)
: m_strKey(keyParent.m_strKey) : m_strKey(keyParent.m_strKey)
{ {
// combine our name with parent's to get the full name // combine our name with parent's to get the full name
if ( !m_strKey.IsEmpty() && if ( !m_strKey.empty() &&
(strKey.IsEmpty() || strKey[0] != REG_SEPARATOR) ) { (strKey.empty() || strKey[0] != REG_SEPARATOR) ) {
m_strKey += REG_SEPARATOR; m_strKey += REG_SEPARATOR;
} }
@ -270,7 +270,7 @@ void wxRegKey::SetName(const wxRegKey& keyParent, const wxString& strKey)
// next line! // next line!
m_strKey.clear(); m_strKey.clear();
m_strKey += keyParent.m_strKey; 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 += REG_SEPARATOR;
m_strKey += strKey; m_strKey += strKey;
@ -304,7 +304,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const
StdKey key = GetStdKeyFromHkey((WXHKEY) m_hRootKey); StdKey key = GetStdKeyFromHkey((WXHKEY) m_hRootKey);
wxString str = bShortPrefix ? aStdKeys[key].szShortName wxString str = bShortPrefix ? aStdKeys[key].szShortName
: aStdKeys[key].szName; : aStdKeys[key].szName;
if ( !m_strKey.IsEmpty() ) if ( !m_strKey.empty() )
str << _T("\\") << m_strKey; str << _T("\\") << m_strKey;
return str; return str;
@ -523,7 +523,7 @@ bool wxRegKey::CopyValue(const wxChar *szValue,
bool wxRegKey::Rename(const wxChar *szNewName) 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() ) { if ( !Exists() ) {
wxLogError(_("Registry key '%s' does not exist, cannot rename it."), wxLogError(_("Registry key '%s' does not exist, cannot rename it."),
@ -541,7 +541,7 @@ bool wxRegKey::Rename(const wxChar *szNewName)
if ( inSameHive ) { if ( inSameHive ) {
// rename the key to the new name under the same parent // rename the key to the new name under the same parent
wxString strKey = m_strKey.BeforeLast(REG_SEPARATOR); wxString strKey = m_strKey.BeforeLast(REG_SEPARATOR);
if ( !strKey.IsEmpty() ) { if ( !strKey.empty() ) {
// don't add '\\' in the start if strFullNewName is empty // don't add '\\' in the start if strFullNewName is empty
strKey += REG_SEPARATOR; strKey += REG_SEPARATOR;
} }
@ -655,7 +655,7 @@ bool wxRegKey::DeleteSelf()
// prevent a buggy program from erasing one of the root registry keys or an // 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 // immediate subkey (i.e. one which doesn't have '\\' inside) of any other
// key except HKCR (HKCR has some "deleteable" subkeys) // key except HKCR (HKCR has some "deleteable" subkeys)
if ( m_strKey.IsEmpty() || if ( m_strKey.empty() ||
((m_hRootKey != (WXHKEY) aStdKeys[HKCR].hkey) && ((m_hRootKey != (WXHKEY) aStdKeys[HKCR].hkey) &&
(m_strKey.Find(REG_SEPARATOR) == wxNOT_FOUND)) ) { (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."), 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 // exporting registry keys to file
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if wxUSE_STREAMS
// helper functions for writing ASCII strings (even in Unicode build) // helper functions for writing ASCII strings (even in Unicode build)
static inline bool WriteAsciiChar(wxOutputStream& ostr, char ch) static inline bool WriteAsciiChar(wxOutputStream& ostr, char ch)
{ {
@ -1126,8 +1128,11 @@ static inline bool WriteAsciiString(wxOutputStream& ostr, const wxString& s)
return ostr.IsOk(); return ostr.IsOk();
} }
#endif // wxUSE_STREAMS
bool wxRegKey::Export(const wxString& filename) const bool wxRegKey::Export(const wxString& filename) const
{ {
#if wxUSE_FFILE && wxUSE_STREAMS
if ( wxFile::Exists(filename) ) if ( wxFile::Exists(filename) )
{ {
wxLogError(_("Exporting registry key: file \"%s\" already exists and won't be overwritten."), 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")); wxFFileOutputStream ostr(filename, _T("w"));
return ostr.Ok() && Export(ostr); return ostr.Ok() && Export(ostr);
#else
wxUnusedVar(filename);
return false;
#endif
} }
#if wxUSE_STREAMS
bool wxRegKey::Export(wxOutputStream& ostr) const bool wxRegKey::Export(wxOutputStream& ostr) const
{ {
// write out the header // write out the header
@ -1148,6 +1158,7 @@ bool wxRegKey::Export(wxOutputStream& ostr) const
return DoExport(ostr); return DoExport(ostr);
} }
#endif // wxUSE_STREAMS
static static
wxString wxString
@ -1278,6 +1289,8 @@ wxString wxRegKey::FormatValue(const wxString& name) const
return rhs; return rhs;
} }
#if wxUSE_STREAMS
bool wxRegKey::DoExportValue(wxOutputStream& ostr, const wxString& name) const bool wxRegKey::DoExportValue(wxOutputStream& ostr, const wxString& name) const
{ {
// first examine the value type: if it's unsupported, simply skip it // first examine the value type: if it's unsupported, simply skip it
@ -1357,6 +1370,8 @@ bool wxRegKey::DoExport(wxOutputStream& ostr) const
return true; return true;
} }
#endif // wxUSE_STREAMS
// ============================================================================ // ============================================================================
// implementation of global private functions // implementation of global private functions
// ============================================================================ // ============================================================================
@ -1397,7 +1412,7 @@ const wxChar *GetFullName(const wxRegKey *pKey, const wxChar *szValue)
void RemoveTrailingSeparator(wxString& str) void RemoveTrailingSeparator(wxString& str)
{ {
if ( !str.IsEmpty() && str.Last() == REG_SEPARATOR ) if ( !str.empty() && str.Last() == REG_SEPARATOR )
str.Truncate(str.Len() - 1); str.Truncate(str.Len() - 1);
} }

View File

@ -1069,6 +1069,7 @@ void wxBell()
bool wxIsDebuggerRunning() bool wxIsDebuggerRunning()
{ {
#if wxUSE_DYNLIB_CLASS
// IsDebuggerPresent() is not available under Win95, so load it dynamically // IsDebuggerPresent() is not available under Win95, so load it dynamically
wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM); wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM);
@ -1080,6 +1081,9 @@ bool wxIsDebuggerRunning()
} }
return (*(IsDebuggerPresent_t)dll.GetSymbol(_T("IsDebuggerPresent")))() != 0; return (*(IsDebuggerPresent_t)dll.GetSymbol(_T("IsDebuggerPresent")))() != 0;
#else
return false;
#endif
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -25,8 +25,9 @@
<install-to>$(BINDIR)</install-to> <install-to>$(BINDIR)</install-to>
</exe> </exe>
<exe id="tex2rtf_gui" template="wx_util" template_append="wx_append" <exe id="tex2rtf_gui" template="wx_util"
cond="USE_GUI=='1'"> template_append="wx_append"
cond="USE_GUI=='1'">
<sources>$(TEX2RTF_SRC)</sources> <sources>$(TEX2RTF_SRC)</sources>
<wx-lib>html</wx-lib> <wx-lib>html</wx-lib>
<wx-lib>core</wx-lib> <wx-lib>core</wx-lib>

View File

@ -1631,7 +1631,7 @@ void InitialiseColourTable(void)
void Tex2RTFYield(bool force) void Tex2RTFYield(bool force)
{ {
#ifdef __WXMSW__ #ifdef __WINDOWS__
static int yieldCount = 0; static int yieldCount = 0;
if (isSync) if (isSync)
@ -1646,6 +1646,8 @@ void Tex2RTFYield(bool force)
yieldCount = 10; yieldCount = 10;
} }
yieldCount --; yieldCount --;
#else
wxUnusedVar(force);
#endif #endif
} }