removed a few warnings and CW compilation problems (patch from Dimitri)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-03-27 18:43:13 +00:00
parent cebab22d9e
commit 4ccf704abd
9 changed files with 225 additions and 200 deletions

View File

@@ -773,6 +773,16 @@
# endif # endif
#endif /* wxUSE_UNICODE_MSLU */ #endif /* wxUSE_UNICODE_MSLU */
#if wxUSE_ODBC && wxUSE_UNICODE
# ifdef wxABORT_ON_CONFIG_ERROR
/* (ODBC classes aren't Unicode-compatible yet) */
# error "wxUSE_ODBC can't be used with wxUSE_UNICODE"
# else
# undef wxUSE_ODBC
# define wxUSE_ODBC 0
# endif
#endif /* wxUSE_ODBC */
/* the rest of the tests is for the GUI settings only */ /* the rest of the tests is for the GUI settings only */
#if wxUSE_GUI #if wxUSE_GUI

View File

@@ -1017,12 +1017,6 @@
#define wxUSE_DEBUG_NEW_ALWAYS 0 #define wxUSE_DEBUG_NEW_ALWAYS 0
#endif // wxUSE_MFC #endif // wxUSE_MFC
// ODBC classes aren't Unicode-compatible yet
#if wxUSE_UNICODE
#undef wxUSE_ODBC
#define wxUSE_ODBC 0
#endif
// Only WIN32 supports wxStatusBar95 // Only WIN32 supports wxStatusBar95
#if !defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR #if !defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR

View File

@@ -12,7 +12,7 @@
#ifndef _WX_CURSOR_H_ #ifndef _WX_CURSOR_H_
#define _WX_CURSOR_H_ #define _WX_CURSOR_H_
#include <wx/image.h> #include "wx/image.h"
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "cursor.h" #pragma interface "cursor.h"

View File

@@ -1086,12 +1086,6 @@
#define wxUSE_DEBUG_NEW_ALWAYS 0 #define wxUSE_DEBUG_NEW_ALWAYS 0
#endif // wxUSE_MFC #endif // wxUSE_MFC
// ODBC classes aren't Unicode-compatible yet
#if wxUSE_UNICODE
#undef wxUSE_ODBC
#define wxUSE_ODBC 0
#endif
#if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) #if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)
// Can't use OLE drag and drop in Windows 3.1 because we don't know how // Can't use OLE drag and drop in Windows 3.1 because we don't know how
// to implement UUIDs // to implement UUIDs

View File

@@ -1063,12 +1063,6 @@
#define wxUSE_DEBUG_NEW_ALWAYS 0 #define wxUSE_DEBUG_NEW_ALWAYS 0
#endif // wxUSE_MFC #endif // wxUSE_MFC
// ODBC classes aren't Unicode-compatible yet
#if wxUSE_UNICODE
#undef wxUSE_ODBC
#define wxUSE_ODBC 0
#endif
#if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) #if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)
// Can't use OLE drag and drop in Windows 3.1 because we don't know how // Can't use OLE drag and drop in Windows 3.1 because we don't know how
// to implement UUIDs // to implement UUIDs

View File

@@ -174,6 +174,19 @@
#endif #endif
#endif #endif
/*
When this file is included, sometimes the wxCHECK_W32API_VERSION macro
is undefined. With for example CodeWarrior this gives problems with
the following code:
#if 0 && wxCHECK_W32API_VERSION( 0, 5 )
Because CodeWarrior does macro expansion before test evaluation.
We define wxCHECK_W32API_VERSION here if it's undefined.
*/
#if !defined(__GNUG__) && !defined(wxCHECK_W32API_VERSION)
#define wxCHECK_W32API_VERSION(maj, min) (0)
#endif
// StartDoc // StartDoc
#ifdef StartDoc #ifdef StartDoc

View File

@@ -83,8 +83,10 @@ IMPLEMENT_APP(OwnerDrawnApp);
// init our app: create windows // init our app: create windows
bool OwnerDrawnApp::OnInit(void) bool OwnerDrawnApp::OnInit(void)
{ {
OwnerDrawnFrame *pFrame = new OwnerDrawnFrame(NULL, "wxWindows Ownerdraw Sample", OwnerDrawnFrame *pFrame
= new OwnerDrawnFrame(NULL, "wxWindows Ownerdraw Sample",
50, 50, 450, 340); 50, 50, 450, 340);
SetTopWindow(pFrame); SetTopWindow(pFrame);
return TRUE; return TRUE;
@@ -109,15 +111,18 @@ void OwnerDrawnFrame::InitMenu()
wxBitmap bmpBell("bell"), bmpSound("sound"), bmpNoSound("nosound"); wxBitmap bmpBell("bell"), bmpSound("sound"), bmpNoSound("nosound");
// construct submenu // construct submenu
pItem = new wxMenuItem(sub_menu, Menu_Sub1, "Submenu &first", "large", TRUE); pItem = new wxMenuItem(sub_menu, Menu_Sub1, "Submenu &first", "large");
pItem->SetFont(fontLarge); pItem->SetFont(fontLarge);
sub_menu->Append(pItem); sub_menu->Append(pItem);
pItem = new wxMenuItem(sub_menu, Menu_Sub2, "Submenu &second", "italic", TRUE); pItem = new wxMenuItem(sub_menu, Menu_Sub2, "Submenu &second", "italic",
wxITEM_CHECK);
pItem->SetFont(fontItalic); pItem->SetFont(fontItalic);
sub_menu->Append(pItem); sub_menu->Append(pItem);
pItem = new wxMenuItem(sub_menu, Menu_Sub3, "Submenu &third", "underlined", TRUE); pItem = new wxMenuItem(sub_menu, Menu_Sub3, "Submenu &third", "underlined",
wxITEM_CHECK);
pItem->SetFont(fontUlined); pItem->SetFont(fontUlined);
sub_menu->Append(pItem); sub_menu->Append(pItem);
@@ -128,7 +133,8 @@ void OwnerDrawnFrame::InitMenu()
pItem->SetMarginWidth(23); pItem->SetMarginWidth(23);
file_menu->Append(pItem); file_menu->Append(pItem);
pItem = new wxMenuItem(file_menu, Menu_Test2, "&Checkable", "checkable item", TRUE); pItem = new wxMenuItem(file_menu, Menu_Test2, "&Checkable",
"checkable item", wxITEM_CHECK);
pItem->SetFont(*wxSMALL_FONT); pItem->SetFont(*wxSMALL_FONT);
file_menu->Append(pItem); file_menu->Append(pItem);
file_menu->Check(Menu_Test2, TRUE); file_menu->Check(Menu_Test2, TRUE);
@@ -140,19 +146,22 @@ void OwnerDrawnFrame::InitMenu()
file_menu->AppendSeparator(); file_menu->AppendSeparator();
pItem = new wxMenuItem(file_menu, Menu_Bitmap, "&Bell", "check/uncheck me!", TRUE); pItem = new wxMenuItem(file_menu, Menu_Bitmap, "&Bell",
"check/uncheck me!", wxITEM_CHECK);
pItem->SetFont(fontBmp); pItem->SetFont(fontBmp);
pItem->SetBitmaps(bmpBell); pItem->SetBitmaps(bmpBell);
file_menu->Append(pItem); file_menu->Append(pItem);
pItem = new wxMenuItem(file_menu, Menu_Bitmap2, "So&und", "icon changes!", TRUE); pItem = new wxMenuItem(file_menu, Menu_Bitmap2, "So&und",
"icon changes!", wxITEM_CHECK);
pItem->SetFont(fontBmp); pItem->SetFont(fontBmp);
pItem->SetBitmaps(bmpSound, bmpNoSound); pItem->SetBitmaps(bmpSound, bmpNoSound);
file_menu->Append(pItem); file_menu->Append(pItem);
file_menu->AppendSeparator(); file_menu->AppendSeparator();
pItem = new wxMenuItem(file_menu, Menu_Submenu, "&Sub menu", "", TRUE, sub_menu); pItem = new wxMenuItem(file_menu, Menu_Submenu, "&Sub menu", "",
wxITEM_CHECK, sub_menu);
pItem->SetFont(*wxSWISS_FONT); pItem->SetFont(*wxSWISS_FONT);
file_menu->Append(pItem); file_menu->Append(pItem);
@@ -166,7 +175,8 @@ void OwnerDrawnFrame::InitMenu()
} }
// main frame constructor // main frame constructor
OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int w, int h) OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title,
int x, int y, int w, int h)
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
{ {
// set the icon // set the icon
@@ -199,7 +209,7 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int
( (
pPanel, // parent pPanel, // parent
Control_Listbox, // control id Control_Listbox, // control id
wxPoint(10, 10), // listbox poistion wxPoint(10, 10), // listbox position
wxSize(200, 200), // listbox size wxSize(200, 200), // listbox size
WXSIZEOF(aszChoices), // number of strings WXSIZEOF(aszChoices), // number of strings
astrChoices // array of strings astrChoices // array of strings
@@ -207,7 +217,8 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int
delete [] astrChoices; delete [] astrChoices;
for ( ui = 0; ui < WXSIZEOF(aszChoices); ui += 2 ) { for ( ui = 0; ui < WXSIZEOF(aszChoices); ui += 2 )
{
m_pListBox->GetItem(ui)->SetBackgroundColour(wxColor(200, 200, 200)); m_pListBox->GetItem(ui)->SetBackgroundColour(wxColor(200, 200, 200));
} }
@@ -217,18 +228,25 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int
static const char* aszColors[] = { "Red", "Blue", "Pink", static const char* aszColors[] = { "Red", "Blue", "Pink",
"Green", "Yellow", "Green", "Yellow",
"Black", "Violet" }; "Black", "Violet" };
struct { unsigned int r, g, b; } aColors[] = { {255,0,0}, {0,0,255}, {255,128,192}, struct { unsigned int r, g, b; } aColors[] =
{
{255,0,0}, {0,0,255}, {255,128,192},
{0,255,0}, {255,255,128}, {0,255,0}, {255,255,128},
{0,0,0}, {128,0,255} }; {0,0,0}, {128,0,255}
};
astrChoices = new wxString[WXSIZEOF(aszColors)]; astrChoices = new wxString[WXSIZEOF(aszColors)];
for ( ui = 0; ui < WXSIZEOF(aszColors); ui++ ) for ( ui = 0; ui < WXSIZEOF(aszColors); ui++ )
{
astrChoices[ui] = aszColors[ui]; astrChoices[ui] = aszColors[ui];
}
wxListBox *pListBox = new wxListBox wxListBox *pListBox = new wxListBox
( (
pPanel, // parent pPanel, // parent
Control_Listbox2, // control id Control_Listbox2, // control id
wxPoint(220, 10), // listbox poistion wxPoint(220, 10), // listbox position
wxDefaultSize, // listbox size wxDefaultSize, // listbox size
WXSIZEOF(aszColors), // number of strings WXSIZEOF(aszColors), // number of strings
astrChoices, // array of strings astrChoices, // array of strings
@@ -237,13 +255,16 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int
wxListBoxNameStr wxListBoxNameStr
); );
for ( ui = 0; ui < WXSIZEOF(aszColors); ui++ ) { for ( ui = 0; ui < WXSIZEOF(aszColors); ui++ )
{
pListBox->GetItem(ui)->SetTextColour(wxColor(aColors[ui].r, pListBox->GetItem(ui)->SetTextColour(wxColor(aColors[ui].r,
aColors[ui].g, aColors[ui].g,
aColors[ui].b)); aColors[ui].b));
// yellow on white is horrible... // yellow on white is horrible...
if ( ui == 4 ) if ( ui == 4 )
{
pListBox->GetItem(ui)->SetBackgroundColour(wxColor(0, 0, 0)); pListBox->GetItem(ui)->SetBackgroundColour(wxColor(0, 0, 0));
}
} }

View File

@@ -416,8 +416,7 @@ bool wxPropertyListView::CreateControls()
if (!panel) if (!panel)
return FALSE; return FALSE;
wxSystemSettings settings; wxFont guiFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
wxFont guiFont = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
#ifdef __WXMSW__ #ifdef __WXMSW__
wxFont *boringFont = wxFont *boringFont =

View File

@@ -956,8 +956,8 @@ bool wxDialUpManagerMSW::IsAlwaysOnline() const
if ( pfnInternetGetConnectedState(&flags, 0 /* reserved */) ) if ( pfnInternetGetConnectedState(&flags, 0 /* reserved */) )
{ {
// there is some connection to the net, see of which type // there is some connection to the net, see of which type
ms_isAlwaysOnline = (flags & INTERNET_CONNECTION_LAN != 0) || ms_isAlwaysOnline = ((flags & INTERNET_CONNECTION_LAN) != 0)
(flags & INTERNET_CONNECTION_PROXY != 0); || ((flags & INTERNET_CONNECTION_PROXY) != 0);
} }
else else
{ {