Applied patch [ 619539 ] patch to get small icon via geticon

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-06-01 13:57:23 +00:00
parent ef094fa075
commit 5c5428f913
7 changed files with 34 additions and 9 deletions

View File

@@ -152,10 +152,13 @@ function in the first place.
\membersection{wxFileType::GetIcon}\label{wxfiletypegeticon} \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 If the function returns {\tt TRUE}, the icon associated with this file type will be
created and assigned to the {\it icon} parameter. 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 {\bf Unix:} MIME manager gathers information about icons from GNOME
and KDE settings and thus GetIcon's success depends on availability and KDE settings and thus GetIcon's success depends on availability

View File

@@ -183,3 +183,11 @@ Checking in dcclient.cpp;
new revision: 1.170; previous revision: 1.169 new revision: 1.170; previous revision: 1.169
done 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

View File

@@ -210,5 +210,6 @@ wxMiscellaneous
(extend editor API) to work around bad checkbox (extend editor API) to work around bad checkbox
behaviour (click, click, click, click away...) and behaviour (click, click, click, click away...) and
reduce checkbox size on non-Windows platforms. reduce checkbox size on non-Windows platforms.
- Add wxNotebook::HitTest for non-Windows platforms.
Version: $Id$ Version: $Id$

View File

@@ -46,6 +46,9 @@ enum wxMailcapStyle
wxMAILCAP_ALL = 15 wxMAILCAP_ALL = 15
}; };
#define wxICON_LARGE 0
#define wxICON_SMALL 1
/* /*
TODO: would it be more convenient to have this class? TODO: would it be more convenient to have this class?
@@ -214,7 +217,8 @@ public:
// in this file (Win-only) is in iconIndex // in this file (Win-only) is in iconIndex
bool GetIcon(wxIcon *icon, bool GetIcon(wxIcon *icon,
wxString *iconFile = NULL, wxString *iconFile = NULL,
int *iconIndex = NULL) const; int *iconIndex = NULL,
int iconSize = wxICON_LARGE) const;
// get a brief file type description ("*.txt" => "text document") // get a brief file type description ("*.txt" => "text document")
bool GetDescription(wxString *desc) const; bool GetDescription(wxString *desc) const;

View File

@@ -44,7 +44,8 @@ public:
bool GetExtensions(wxArrayString& extensions); bool GetExtensions(wxArrayString& extensions);
bool GetMimeType(wxString *mimeType) const; bool GetMimeType(wxString *mimeType) const;
bool GetMimeTypes(wxArrayString& mimeTypes) 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 GetDescription(wxString *desc) const;
bool GetOpenCommand(wxString *openCmd, bool GetOpenCommand(wxString *openCmd,
const wxFileType::MessageParameters& params) const; const wxFileType::MessageParameters& params) const;

View File

@@ -271,7 +271,8 @@ bool wxFileType::GetMimeTypes(wxArrayString& mimeTypes) const
bool wxFileType::GetIcon(wxIcon *icon, bool wxFileType::GetIcon(wxIcon *icon,
wxString *iconFile, wxString *iconFile,
int *iconIndex) const int *iconIndex,
int iconSize) const
{ {
if ( m_info ) if ( m_info )
{ {
@@ -291,7 +292,9 @@ bool wxFileType::GetIcon(wxIcon *icon,
return TRUE; 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); return m_impl->GetIcon(icon, iconFile, iconIndex);
#else #else
return m_impl->GetIcon(icon); return m_impl->GetIcon(icon);

View File

@@ -336,7 +336,8 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
bool wxFileTypeImpl::GetIcon(wxIcon *icon, bool wxFileTypeImpl::GetIcon(wxIcon *icon,
wxString *iconFile, wxString *iconFile,
int *iconIndex) const int *iconIndex,
int iconSize) const
{ {
#if wxUSE_GUI #if wxUSE_GUI
wxString strIconKey; wxString strIconKey;
@@ -367,7 +368,11 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon,
// here we need C based counting! // here we need C based counting!
int nIndex = wxAtoi(strIndex); 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 ) { switch ( (int)hIcon ) {
case 0: // means no icons were found case 0: // means no icons were found