WinCE fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-07-20 11:11:46 +00:00
parent 422d0ff0be
commit 7010702f63
8 changed files with 36 additions and 24 deletions

View File

@ -249,7 +249,7 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon)
{ {
wxLogLastError(wxT("GetIconInfo")); wxLogLastError(wxT("GetIconInfo"));
return FALSE; return false;
} }
wxBitmapRefData *refData = new wxBitmapRefData; 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 // delete the old one now as we don't need it any more
::DeleteObject(iconInfo.hbmMask); ::DeleteObject(iconInfo.hbmMask);
return TRUE; return true;
#else #else
return FALSE; wxUnusedVar(icon);
return false;
#endif #endif
} }

View File

@ -1766,15 +1766,13 @@ void wxDC::SetUserScale(double x, double y)
{ {
WXMICROWIN_CHECK_HDC WXMICROWIN_CHECK_HDC
#ifndef __WXWINCE__
if ( x == m_userScaleX && y == m_userScaleY ) if ( x == m_userScaleX && y == m_userScaleY )
return; return;
m_userScaleX = x; m_userScaleX = x;
m_userScaleY = y; m_userScaleY = y;
SetMapMode(m_mappingMode); this->SetMapMode(m_mappingMode);
#endif
} }
void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp) void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)

View File

@ -585,7 +585,10 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
wxSize wxGetHiconSize(HICON hicon) 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__ #ifndef __WXWINCE__
if ( hicon && wxGetOsVersion() != wxWIN32S ) if ( hicon && wxGetOsVersion() != wxWIN32S )
{ {
@ -611,6 +614,8 @@ wxSize wxGetHiconSize(HICON hicon)
::DeleteObject(info.hbmColor); ::DeleteObject(info.hbmColor);
} }
} }
#else
wxUnusedVar(hicon);
#endif #endif
return size; return size;
} }

View File

@ -937,6 +937,8 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
wxLogLastError(_T("ExpandEnvironmentStrings")); wxLogLastError(_T("ExpandEnvironmentStrings"));
} }
} }
#else
wxUnusedVar(raw);
#endif #endif
// __WXWINCE__ // __WXWINCE__
} }

View File

@ -893,7 +893,10 @@ unsigned long wxThread::GetCurrentId()
bool wxThread::SetConcurrency(size_t level) 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") ); wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") );
// ok only for the default one // ok only for the default one
@ -983,9 +986,9 @@ bool wxThread::SetConcurrency(size_t level)
return false; return false;
} }
#endif // !__WXWINCE__
return true; return true;
#endif // __WXWINCE__/!__WXWINCE__
} }
// ctor and dtor // ctor and dtor

View File

@ -119,14 +119,14 @@ static const wxChar eUSERNAME[] = wxT("UserName");
bool wxGetHostName(wxChar *buf, int maxSize) bool wxGetHostName(wxChar *buf, int maxSize)
{ {
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
return FALSE; return false;
#elif defined(__WIN32__) && !defined(__WXMICROWIN__) #elif defined(__WIN32__) && !defined(__WXMICROWIN__)
DWORD nSize = maxSize; DWORD nSize = maxSize;
if ( !::GetComputerName(buf, &nSize) ) if ( !::GetComputerName(buf, &nSize) )
{ {
wxLogLastError(wxT("GetComputerName")); wxLogLastError(wxT("GetComputerName"));
return FALSE; return false;
} }
return TRUE; return TRUE;
@ -231,7 +231,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
bool wxGetUserId(wxChar *buf, int maxSize) bool wxGetUserId(wxChar *buf, int maxSize)
{ {
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
return FALSE; return false;
#elif defined(__WIN32__) && !defined(__WXMICROWIN__) #elif defined(__WIN32__) && !defined(__WXMICROWIN__)
DWORD nSize = maxSize; DWORD nSize = maxSize;
if ( ::GetUserName(buf, &nSize) == 0 ) if ( ::GetUserName(buf, &nSize) == 0 )
@ -271,11 +271,11 @@ bool wxGetUserId(wxChar *buf, int maxSize)
bool wxGetUserName(wxChar *buf, int maxSize) bool wxGetUserName(wxChar *buf, int maxSize)
{ {
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
return FALSE; return false;
#elif defined(USE_NET_API) #elif defined(USE_NET_API)
CHAR szUserName[256]; CHAR szUserName[256];
if ( !wxGetUserId(szUserName, WXSIZEOF(szUserName)) ) if ( !wxGetUserId(szUserName, WXSIZEOF(szUserName)) )
return FALSE; return false;
// TODO how to get the domain name? // TODO how to get the domain name?
CHAR *szDomain = ""; CHAR *szDomain = "";
@ -469,10 +469,10 @@ bool wxDirExists(const wxString& dir)
bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return FALSE; return false;
#else #else
if ( path.empty() ) if ( path.empty() )
return FALSE; return false;
// old w32api don't have ULARGE_INTEGER // old w32api don't have ULARGE_INTEGER
#if defined(__WIN32__) && \ #if defined(__WIN32__) && \
@ -817,14 +817,15 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc)
// Execute a program in an Interactive Shell // Execute a program in an Interactive Shell
bool wxShell(const wxString& command) bool wxShell(const wxString& command)
{ {
wxString cmd;
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return FALSE; cmd = command;
#else #else
wxChar *shell = wxGetenv(wxT("COMSPEC")); wxChar *shell = wxGetenv(wxT("COMSPEC"));
if ( !shell ) if ( !shell )
shell = (wxChar*) wxT("\\COMMAND.COM"); shell = (wxChar*) wxT("\\COMMAND.COM");
wxString cmd;
if ( !command ) if ( !command )
{ {
// just the shell // just the shell
@ -835,9 +836,9 @@ bool wxShell(const wxString& command)
// pass the command to execute to the command processor // pass the command to execute to the command processor
cmd.Printf(wxT("%s /c %s"), shell, command.c_str()); cmd.Printf(wxT("%s /c %s"), shell, command.c_str());
} }
#endif
return wxExecute(cmd, wxEXEC_SYNC) == 0; return wxExecute(cmd, wxEXEC_SYNC) == 0;
#endif
} }
// Shutdown or reboot the PC // Shutdown or reboot the PC

View File

@ -575,8 +575,6 @@ bool wxToolBar::Realize()
return TRUE; return TRUE;
} }
const bool isVertical = HasFlag(wxTB_VERTICAL);
#if 0 #if 0
// delete all old buttons, if any // delete all old buttons, if any
for ( size_t pos = 0; pos < m_nButtons; pos++ ) for ( size_t pos = 0; pos < m_nButtons; pos++ )
@ -586,7 +584,7 @@ bool wxToolBar::Realize()
wxLogDebug(wxT("TB_DELETEBUTTON failed")); wxLogDebug(wxT("TB_DELETEBUTTON failed"));
} }
} }
#endif #endif // 0
// add the buttons and separators // add the buttons and separators
// ------------------------------ // ------------------------------
@ -702,6 +700,9 @@ bool wxToolBar::Realize()
delete [] buttons; delete [] buttons;
#if 0 #if 0
const bool isVertical = HasFlag(wxTB_VERTICAL);
// Deal with the controls finally // Deal with the controls finally
// ------------------------------ // ------------------------------
@ -846,9 +847,9 @@ bool wxToolBar::Realize()
SetRows(m_nButtons); SetRows(m_nButtons);
} }
} }
#endif #endif // 0
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -4180,6 +4180,7 @@ bool wxWindowMSW::HandleSizing(wxRect& rect)
bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo) bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo)
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(mmInfo);
return false; return false;
#else #else
MINMAXINFO *info = (MINMAXINFO *)mmInfo; MINMAXINFO *info = (MINMAXINFO *)mmInfo;