]> git.saurik.com Git - wxWidgets.git/commitdiff
WinCE fixes.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 20 Jul 2004 11:11:46 +0000 (11:11 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 20 Jul 2004 11:11:46 +0000 (11:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/bitmap.cpp
src/msw/dc.cpp
src/msw/gdiimage.cpp
src/msw/registry.cpp
src/msw/thread.cpp
src/msw/utils.cpp
src/msw/wince/tbarwce.cpp
src/msw/window.cpp

index f0c834bb24d19958eb2bf1d95687e426d30ffb1f..99cad6f68179b297434a5f14ad2fb20d24622bb5 100644 (file)
@@ -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
 }
 
index ea8b0d55c014dbf1d2034fd872c5683dd0db5461..619844b2ec16debff6a2c30c025fe166afdf2b53 100644 (file)
@@ -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)
index 26cabaa71c197710b2bb639a90f129f46e1de1a5..3df7a179793a5ca70bed40a791b80842dfc465da 100644 (file)
@@ -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;
 }
index be83d9d14ef57fb38368d6b4cc20217513143d1d..7d451eaab8f139b156aaa37ef7ee9533cb6bd104 100644 (file)
@@ -937,6 +937,8 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
                     wxLogLastError(_T("ExpandEnvironmentStrings"));
                 }
             }
+#else
+  wxUnusedVar(raw);
 #endif
             // __WXWINCE__
         }
index 6a8e87350c2624ba938c79b26dd73aa6a2e3b331..0a1d611ca4c8ecc48d0ba8e3b17afc0888fa180f 100644 (file)
@@ -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
index 696fdc5fa83dbf57dde14075abcecb940246155e..9d83179e0aeade6a99b3c5ef4bdf0be620614d38 100644 (file)
@@ -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
index 5682d2a5ecd9defd171813df8fc29b1d0971d8d3..4cb447f393aff7146a7a0dced896ef1ad948eacb 100644 (file)
@@ -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;
 }
 
 // ----------------------------------------------------------------------------
index 07f324b547a109a243205c33027ca2efe7ad8e81..223ae9ef0a37d224fded289e939a31ea93299d11 100644 (file)
@@ -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;