From eae4425db65fd3399aecdc70a8a05cc4f82d1eec Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 18 Nov 2003 21:25:44 +0000 Subject: [PATCH] WinCE fixes from "Viktor Voroshylo" git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/arrstr.h | 4 ++-- include/wx/msw/wince/missing.h | 6 +++++- src/common/string.cpp | 4 ++-- src/common/wxchar.cpp | 4 +--- src/generic/dirctrlg.cpp | 2 +- src/msw/dragimag.cpp | 4 ++++ src/msw/menu.cpp | 1 + src/msw/settings.cpp | 6 ++++++ src/msw/wince/tbarwce.cpp | 1 + src/msw/wince/time.cpp | 2 +- 10 files changed, 24 insertions(+), 10 deletions(-) diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index 4cf5cc4acc..34011d8df7 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -15,8 +15,8 @@ #include "wx/defs.h" #include "wx/string.h" -WXDLLIMPEXP_BASE int wxStringSortAscending(wxString*, wxString*); -WXDLLIMPEXP_BASE int wxStringSortDescending(wxString*, wxString*); +WXDLLIMPEXP_BASE int wxCMPFUNC_CONV wxStringSortAscending(wxString*, wxString*); +WXDLLIMPEXP_BASE int wxCMPFUNC_CONV wxStringSortDescending(wxString*, wxString*); #if wxUSE_STL diff --git a/include/wx/msw/wince/missing.h b/include/wx/msw/wince/missing.h index 08fb428b87..22df67f45d 100644 --- a/include/wx/msw/wince/missing.h +++ b/include/wx/msw/wince/missing.h @@ -12,7 +12,7 @@ #ifndef _WX_CE_MISSING_H_ #define _WX_CE_MISSING_H_ -BOOL IsIconic( HWND hWnd ) +inline BOOL IsIconic( HWND hWnd ) { // Probably not right... #if 0 @@ -22,6 +22,10 @@ BOOL IsIconic( HWND hWnd ) return FALSE; } +#ifdef WIN32_PLATFORM_PSPC +#define SM_CXCURSOR 13 +#define SM_CYCURSOR 14 +#endif /* Most of these are in MSVC++6.0 diff --git a/src/common/string.cpp b/src/common/string.cpp index f0cb6d2910..aa461904f4 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -2325,12 +2325,12 @@ bool wxArrayString::operator==(const wxArrayString& a) const #endif // !wxUSE_STL -int wxStringSortAscending(wxString* s1, wxString* s2) +int wxCMPFUNC_CONV wxStringSortAscending(wxString* s1, wxString* s2) { return wxStrcmp(s1->c_str(), s2->c_str()); } -int wxStringSortDescending(wxString* s1, wxString* s2) +int wxCMPFUNC_CONV wxStringSortDescending(wxString* s1, wxString* s2) { return -wxStrcmp(s1->c_str(), s2->c_str()); } diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 846e7d5058..06c69bd0cd 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -1389,7 +1389,7 @@ int isascii( int c ) } #endif -#if defined(__WXWINCE__) +#if defined(__WXWINCE__) && (_WIN32_WCE <= 211) #if (_WIN32_WCE < 300) void *calloc( size_t num, size_t size ) { @@ -1399,12 +1399,10 @@ void *calloc( size_t num, size_t size ) } #endif -#if (_WIN32_WCE <= 211) int isspace(int c) { return (c == ' '); } -#endif #endif diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 41b405cf02..ad330b9af6 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -361,7 +361,7 @@ bool wxIsDriveAvailable(const wxString& dirName) // Function which is called by quick sort. We want to override the default wxArrayString behaviour, // and sort regardless of case. -static int LINKAGEMODE wxDirCtrlStringCompareFunction(wxString* strFirst, wxString* strSecond) +static int wxCMPFUNC_CONV wxDirCtrlStringCompareFunction(wxString* strFirst, wxString* strSecond) { return strFirst->CmpNoCase(*strSecond); } diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index de1e7b088e..0789752ef0 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -51,6 +51,10 @@ #include "wx/msw/dragimag.h" #include "wx/msw/private.h" +#ifdef __WXWINCE__ // for SM_CXCURSOR and SM_CYCURSOR +#include "wx/msw/wince/missing.h" +#endif // __WXWINCE__ + #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) #include #endif diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 30e097fa47..cf6c36043a 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index 6087406cf4..55939bf02b 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -40,6 +40,10 @@ #include "wx/module.h" #include "wx/fontutil.h" +#ifdef __WXWINCE__ // for SM_CXCURSOR and SM_CYCURSOR +#include "wx/msw/wince/missing.h" +#endif // __WXWINCE__ + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -250,6 +254,7 @@ wxFont wxCreateFontFromStockObject(int index) wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) { +#ifdef __WXWINCE__ // this one is special: we don't get it from GetStockObject() if ( index == wxSYS_ICONTITLE_FONT ) { @@ -257,6 +262,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0); return wxCreateFontFromLogFont(&lf); } +#endif // __WXWINCE__ // wxWindow ctor calls GetSystemFont(wxSYS_DEFAULT_GUI_FONT) so we're // called fairly often - this is why we cache this particular font diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 491006ad37..a1be85a8c6 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include diff --git a/src/msw/wince/time.cpp b/src/msw/wince/time.cpp index 22fd23687f..b512e22ec7 100644 --- a/src/msw/wince/time.cpp +++ b/src/msw/wince/time.cpp @@ -173,7 +173,7 @@ time_t __cdecl time(time_t *t) //////////////////////////////////////////////////////////////////////// time_t __cdecl mktime(struct tm *t) { - return (common_tm_to_time(t->tm_mday, t->tm_mon, t->tm_year, t->tm_hour, t->tm_min, t->tm_sec)) ; + return (common_tm_to_time(t->tm_mday, t->tm_mon+1, t->tm_year+1900, t->tm_hour, t->tm_min, t->tm_sec)) ; } -- 2.47.2