]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 619539 ] patch to get small icon via geticon
authorJulian Smart <julian@anthemion.co.uk>
Sun, 1 Jun 2003 13:57:23 +0000 (13:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 1 Jun 2003 13:57:23 +0000 (13:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/filetype.tex
docs/toback24.txt
docs/todo30.txt
include/wx/mimetype.h
include/wx/msw/mimetype.h
src/common/mimecmn.cpp
src/msw/mimetype.cpp

index 22673a5a2fbba973ed923e177faf16aed062a61f..30d87dd9418f68e55232f1a72fbdd4dec2c23bb8 100644 (file)
@@ -152,10 +152,13 @@ function in the first place.
 
 \membersection{wxFileType::GetIcon}\label{wxfiletypegeticon}
 
-\func{bool}{GetIcon}{\param{wxIcon*}{ icon}}
+\func{bool}{GetIcon}{\param{wxIcon*}{ icon}, \param{wxString*}{ iconFile = NULL}, \param{int*}{ iconIndex = NULL}, \param{int}{ iconSize = wxICON\_LARGE}}
 
-If the function returns {\tt true}, the icon associated with this file type will be
-created and assigned to the {\it icon} parameter.
+If the function returns {\tt TRUE}, the icon associated with this file type will be
+created and assigned to the {\it icon} parameter. {\it iconFile} is assigned the file name
+that contains the icon and {\it iconIndex} is assigned the index of the icon
+(windows and unix only). A 32x32 icon is assigned if {\it iconSize} is wxICON\_LARGE
+and a 16x16 icon is assigned if {\it iconSize} is wxICON\_SMALL (windows only).
 
 {\bf Unix:} MIME manager gathers information about icons from GNOME
 and KDE settings and thus GetIcon's success depends on availability
index 0bddb9270ea4d1624625a715f8e1e694f44cce1f..3b76ea27e2a69416883c8728ce556bf0a092c368 100644 (file)
@@ -183,3 +183,11 @@ Checking in dcclient.cpp;
 new revision: 1.170; previous revision: 1.169
 done
 
+
+22. patch [ 619705 ] Fixes wxApp::GetComCtl32Version
+
+Checking in wxWindows/src/msw/app.cpp;
+/pack/cvsroots/wxwindows/wxWindows/src/msw/app.cpp,v  <--  app.cpp
+new revision: 1.186; previous revision: 1.185
+done
+
index 12e9ad0675563489710b3bbf5b2cfadb120106f0..031831d54928c6e1c355aad865f71d73a6841fad 100644 (file)
@@ -210,5 +210,6 @@ wxMiscellaneous
   (extend editor API) to work around bad checkbox
   behaviour (click, click, click, click away...) and
   reduce checkbox size on non-Windows platforms.
+- Add wxNotebook::HitTest for non-Windows platforms.
 
 Version:      $Id$
index b8aefeb5ec04be894e6ff8fdcc0c6544ea9615ab..ee204f6de5ea57781e8ca39001330ac6f472fdc8 100644 (file)
@@ -46,6 +46,9 @@ enum wxMailcapStyle
     wxMAILCAP_ALL = 15
 };
 
+#define wxICON_LARGE 0
+#define wxICON_SMALL 1
+
 /*
     TODO: would it be more convenient to have this class?
 
@@ -214,7 +217,8 @@ public:
         // in this file (Win-only) is in iconIndex
     bool GetIcon(wxIcon *icon,
                  wxString *iconFile = NULL,
-                 int *iconIndex = NULL) const;
+                 int *iconIndex = NULL,
+                 int iconSize = wxICON_LARGE) const;
         // get a brief file type description ("*.txt" => "text document")
     bool GetDescription(wxString *desc) const;
 
index 299b4462bf380c617597af81a0c334e6f5c14c4c..5170b63618e5c81301fd0d5b17df33f908a10830 100644 (file)
@@ -44,7 +44,8 @@ public:
     bool GetExtensions(wxArrayString& extensions);
     bool GetMimeType(wxString *mimeType) const;
     bool GetMimeTypes(wxArrayString& mimeTypes) const;
-    bool GetIcon(wxIcon *icon, wxString *sCommand = NULL, int *iIndex = NULL) const;
+    bool GetIcon(wxIcon *icon, wxString *sCommand = NULL, int *iIndex = NULL,
+                 int iconSize = wxICON_LARGE) const;
     bool GetDescription(wxString *desc) const;
     bool GetOpenCommand(wxString *openCmd,
                         const wxFileType::MessageParameters& params) const;
index 6523cce38272276b5123d75a8bb341a1a0d48180..9b4f0ff3fabe86d2a0086779313ff306b8ab251a 100644 (file)
@@ -271,7 +271,8 @@ bool wxFileType::GetMimeTypes(wxArrayString& mimeTypes) const
 
 bool wxFileType::GetIcon(wxIcon *icon,
                          wxString *iconFile,
-                         int *iconIndex) const
+                         int *iconIndex,
+                         int iconSize) const
 {
     if ( m_info )
     {
@@ -291,7 +292,9 @@ bool wxFileType::GetIcon(wxIcon *icon,
         return TRUE;
     }
 
-#if defined(__WXMSW__) || defined(__UNIX__)
+#if defined(__WXMSW__)
+    return m_impl->GetIcon(icon, iconFile, iconIndex, iconSize);
+#elif defined(__UNIX__)
     return m_impl->GetIcon(icon, iconFile, iconIndex);
 #else
     return m_impl->GetIcon(icon);
index 6ce8557e4e73a35aa9ddc3c80bdf1c5ca339d0a3..6f488946c587ddfc4528c1782709b25688188f7e 100644 (file)
@@ -336,7 +336,8 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
 
 bool wxFileTypeImpl::GetIcon(wxIcon *icon,
                              wxString *iconFile,
-                             int *iconIndex) const
+                             int *iconIndex,
+                             int iconSize) const
 {
 #if wxUSE_GUI
     wxString strIconKey;
@@ -367,7 +368,11 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon,
             // here we need C based counting!
             int nIndex = wxAtoi(strIndex);
 
-            HICON hIcon = ExtractIcon(GetModuleHandle(NULL), strExpPath, nIndex);
+            HICON hIcon, hIconLarge, hIconSmall;
+            ExtractIconEx(strExpPath, nIndex, &hIconLarge, &hIconSmall, 1);
+
+            hIcon = (iconSize == wxICON_LARGE) ? hIconLarge : hIconSmall;
+
 
             switch ( (int)hIcon ) {
                 case 0: // means no icons were found