wxIconBundle implementation.

wxTLW::SetIcons() properly implemented for wxMotif, wxGTK, wxMSW, wxX11, wxUniversal
Placeholders that just call SetIcon for wxOS2 and wxMac.
Regenerated makefiles.
Added hardwired wxSYS_ICON_X/Y = 32 for wxGTK.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2002-03-26 21:54:23 +00:00
parent 6b3d51cc35
commit f618020a15
51 changed files with 566 additions and 68 deletions

View File

@@ -104,6 +104,7 @@ ALL_SOURCES = \
common/hashmap.cpp \
common/helpbase.cpp \
common/http.cpp \
common/iconbndl.cpp \
common/imagall.cpp \
common/imagbmp.cpp \
common/image.cpp \
@@ -244,6 +245,7 @@ ALL_SOURCES = \
unix/snglinst.cpp \
unix/threadpsx.cpp \
unix/utilsunx.cpp \
unix/utilsx11.cpp \
html/helpctrl.cpp \
html/helpdata.cpp \
html/helpfrm.cpp \
@@ -367,6 +369,7 @@ ALL_HEADERS = \
helphtml.h \
helpwin.h \
icon.h \
iconbndl.h \
imagbmp.h \
image.h \
imaggif.h \
@@ -604,6 +607,7 @@ ALL_HEADERS = \
unix/fontutil.h \
unix/gsockunx.h \
unix/mimetype.h \
unix/utilsx11.h \
html/forcelnk.h \
html/helpctrl.h \
html/helpdata.h \
@@ -680,6 +684,7 @@ COMMONOBJS = \
hashmap.o \
helpbase.o \
http.o \
iconbndl.o \
imagall.o \
imagbmp.o \
image.o \
@@ -947,7 +952,8 @@ UNIXOBJS = \
mimetype.o \
snglinst.o \
threadpsx.o \
utilsunx.o
utilsunx.o \
utilsx11.o
HTMLOBJS = \
helpctrl.o \

View File

@@ -349,7 +349,9 @@ int wxSystemSettingsNative::GetMetric( wxSystemMetric index )
// VZ: is there any way to get the cursor size with GDK?
case wxSYS_CURSOR_X: return 16;
case wxSYS_CURSOR_Y: return 16;
// MBN: ditto for icons
case wxSYS_ICON_X: return 32;
case wxSYS_ICON_Y: return 32;
default:
wxFAIL_MSG( wxT("wxSystemSettings::GetMetric not fully implemented") );
return 0;

View File

@@ -38,6 +38,8 @@
#include "wx/gtk/win_gtk.h"
#include "wx/unix/utilsx11.h"
// ----------------------------------------------------------------------------
// idle system
// ----------------------------------------------------------------------------
@@ -814,13 +816,9 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title )
gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
}
void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
void wxTopLevelWindowGTK::DoSetIcon( const wxIcon &icon )
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
wxTopLevelWindowBase::SetIcon(icon);
if ( !m_icon.Ok() )
if ( !icon.Ok() )
return;
if (!m_widget->window)
@@ -833,6 +831,24 @@ void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
{
SetIcons( wxIconBundle( icon ) );
}
void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
GdkWindow* window = m_widget->window;
wxCHECK_RET( window, _T("window not created yet - can't set icon") );
wxTopLevelWindowBase::SetIcons( icons );
DoSetIcon( icons.GetIcon( -1 ) );
wxSetIconsX11( (WXDisplay*)GDK_WINDOW_XDISPLAY( window ),
(WXWindow)GDK_WINDOW_XWINDOW( window ), icons );
}
// ----------------------------------------------------------------------------
// frame state: maximized/iconized/normal
// ----------------------------------------------------------------------------