From 7010702f631a71afdb7beef50fcb4857db0cc5a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 20 Jul 2004 11:11:46 +0000 Subject: [PATCH] WinCE fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/bitmap.cpp | 7 ++++--- src/msw/dc.cpp | 4 +--- src/msw/gdiimage.cpp | 7 ++++++- src/msw/registry.cpp | 2 ++ src/msw/thread.cpp | 7 +++++-- src/msw/utils.cpp | 21 +++++++++++---------- src/msw/wince/tbarwce.cpp | 11 ++++++----- src/msw/window.cpp | 1 + 8 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index f0c834bb24..99cad6f681 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -249,7 +249,7 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon) { wxLogLastError(wxT("GetIconInfo")); - return FALSE; + return false; } wxBitmapRefData *refData = new wxBitmapRefData; @@ -272,9 +272,10 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon) // delete the old one now as we don't need it any more ::DeleteObject(iconInfo.hbmMask); - return TRUE; + return true; #else - return FALSE; + wxUnusedVar(icon); + return false; #endif } diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index ea8b0d55c0..619844b2ec 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1766,15 +1766,13 @@ void wxDC::SetUserScale(double x, double y) { WXMICROWIN_CHECK_HDC -#ifndef __WXWINCE__ if ( x == m_userScaleX && y == m_userScaleY ) return; m_userScaleX = x; m_userScaleY = y; - SetMapMode(m_mappingMode); -#endif + this->SetMapMode(m_mappingMode); } void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp) diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 26cabaa71c..3df7a17979 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -585,7 +585,10 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, wxSize wxGetHiconSize(HICON hicon) { - wxSize size(32, 32); // default + // default icon size on this hardware + // usually 32x32 but can be other (smaller) on pocket devices + wxSize size(::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + #ifndef __WXWINCE__ if ( hicon && wxGetOsVersion() != wxWIN32S ) { @@ -611,6 +614,8 @@ wxSize wxGetHiconSize(HICON hicon) ::DeleteObject(info.hbmColor); } } +#else + wxUnusedVar(hicon); #endif return size; } diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index be83d9d14e..7d451eaab8 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -937,6 +937,8 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxLogLastError(_T("ExpandEnvironmentStrings")); } } +#else + wxUnusedVar(raw); #endif // __WXWINCE__ } diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 6a8e87350c..0a1d611ca4 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -893,7 +893,10 @@ unsigned long wxThread::GetCurrentId() bool wxThread::SetConcurrency(size_t level) { -#ifndef __WXWINCE__ +#ifdef __WXWINCE__ + wxUnusedVar(level); + return false; +#else wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); // ok only for the default one @@ -983,9 +986,9 @@ bool wxThread::SetConcurrency(size_t level) return false; } -#endif // !__WXWINCE__ return true; +#endif // __WXWINCE__/!__WXWINCE__ } // ctor and dtor diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 696fdc5fa8..9d83179e0a 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -119,14 +119,14 @@ static const wxChar eUSERNAME[] = wxT("UserName"); bool wxGetHostName(wxChar *buf, int maxSize) { #if defined(__WXWINCE__) - return FALSE; + return false; #elif defined(__WIN32__) && !defined(__WXMICROWIN__) DWORD nSize = maxSize; if ( !::GetComputerName(buf, &nSize) ) { wxLogLastError(wxT("GetComputerName")); - return FALSE; + return false; } return TRUE; @@ -231,7 +231,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) bool wxGetUserId(wxChar *buf, int maxSize) { #if defined(__WXWINCE__) - return FALSE; + return false; #elif defined(__WIN32__) && !defined(__WXMICROWIN__) DWORD nSize = maxSize; if ( ::GetUserName(buf, &nSize) == 0 ) @@ -271,11 +271,11 @@ bool wxGetUserId(wxChar *buf, int maxSize) bool wxGetUserName(wxChar *buf, int maxSize) { #if defined(__WXWINCE__) - return FALSE; + return false; #elif defined(USE_NET_API) CHAR szUserName[256]; if ( !wxGetUserId(szUserName, WXSIZEOF(szUserName)) ) - return FALSE; + return false; // TODO how to get the domain name? CHAR *szDomain = ""; @@ -469,10 +469,10 @@ bool wxDirExists(const wxString& dir) bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) { #ifdef __WXWINCE__ - return FALSE; + return false; #else if ( path.empty() ) - return FALSE; + return false; // old w32api don't have ULARGE_INTEGER #if defined(__WIN32__) && \ @@ -817,14 +817,15 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc) // Execute a program in an Interactive Shell bool wxShell(const wxString& command) { + wxString cmd; + #ifdef __WXWINCE__ - return FALSE; + cmd = command; #else wxChar *shell = wxGetenv(wxT("COMSPEC")); if ( !shell ) shell = (wxChar*) wxT("\\COMMAND.COM"); - wxString cmd; if ( !command ) { // just the shell @@ -835,9 +836,9 @@ bool wxShell(const wxString& command) // pass the command to execute to the command processor cmd.Printf(wxT("%s /c %s"), shell, command.c_str()); } +#endif return wxExecute(cmd, wxEXEC_SYNC) == 0; -#endif } // Shutdown or reboot the PC diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 5682d2a5ec..4cb447f393 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -575,8 +575,6 @@ bool wxToolBar::Realize() return TRUE; } - const bool isVertical = HasFlag(wxTB_VERTICAL); - #if 0 // delete all old buttons, if any for ( size_t pos = 0; pos < m_nButtons; pos++ ) @@ -586,7 +584,7 @@ bool wxToolBar::Realize() wxLogDebug(wxT("TB_DELETEBUTTON failed")); } } -#endif +#endif // 0 // add the buttons and separators // ------------------------------ @@ -702,6 +700,9 @@ bool wxToolBar::Realize() delete [] buttons; #if 0 + + const bool isVertical = HasFlag(wxTB_VERTICAL); + // Deal with the controls finally // ------------------------------ @@ -846,9 +847,9 @@ bool wxToolBar::Realize() SetRows(m_nButtons); } } -#endif +#endif // 0 - return TRUE; + return true; } // ---------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 07f324b547..223ae9ef0a 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4180,6 +4180,7 @@ bool wxWindowMSW::HandleSizing(wxRect& rect) bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo) { #ifdef __WXWINCE__ + wxUnusedVar(mmInfo); return false; #else MINMAXINFO *info = (MINMAXINFO *)mmInfo; -- 2.45.2