From a44fb285c5ba855d135090567eaa671df4462637 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Dec 2005 13:56:23 +0000 Subject: [PATCH] documented Set/GetIcon(), added (not quite pure) virtual GetIcon() in the base class git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/statbmp.tex | 34 ++++++++++++++++++++++++++++++++-- include/wx/msw/statbmp.h | 8 ++------ include/wx/statbmp.h | 10 +++++++--- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/docs/latex/wx/statbmp.tex b/docs/latex/wx/statbmp.tex index 7c24e75214..2b88fd8506 100644 --- a/docs/latex/wx/statbmp.tex +++ b/docs/latex/wx/statbmp.tex @@ -79,15 +79,30 @@ Creation function, for two-step construction. For details see \helpref{wxStaticB \membersection{wxStaticBitmap::GetBitmap}\label{wxstaticbitmapgetbitmap} -\constfunc{wxBitmap\&}{GetBitmap}{\void} +\constfunc{wxBitmap}{GetBitmap}{\void} -Returns a reference to the label bitmap. +Returns the bitmap currently used in the control. Notice that this method can +be called even if \helpref{SetIcon}{wxstaticbitmapseticon} had been used. \wxheading{See also} \helpref{wxStaticBitmap::SetBitmap}{wxstaticbitmapsetbitmap} +\membersection{wxStaticIcon::GetIcon}\label{wxstaticbitmapgeticon} + +\constfunc{wxIcon}{GetIcon}{\void} + +Returns the icon currently used in the control. Notice that this method can +only be called if \helpref{SetIcon}{wxstaticbitmapseticon} had been used: an icon +can't be retrieved from the control if a bitmap had been set (using +\helpref{SetBitmap}{wxstaticbitmapsetbitmap}). + +\wxheading{See also} + +\helpref{wxStaticIcon::SetIcon}{wxstaticbitmapseticon} + + \membersection{wxStaticBitmap::SetBitmap}\label{wxstaticbitmapsetbitmap} \func{virtual void}{SetBitmap}{\param{const wxBitmap\& }{ label}} @@ -102,3 +117,18 @@ Sets the bitmap label. \helpref{wxStaticBitmap::GetBitmap}{wxstaticbitmapgetbitmap} + +\membersection{wxStaticIcon::SetIcon}\label{wxstaticbitmapseticon} + +\func{virtual void}{SetIcon}{\param{const wxIcon\& }{ label}} + +Sets the label to the given icon. + +\wxheading{Parameters} + +\docparam{label}{The new icon.} + +\wxheading{See also} + +\helpref{wxStaticIcon::GetIcon}{wxstaticbitmapgeticon} + diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index 82b1a921a1..d580d8a731 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -49,12 +49,8 @@ public: virtual void SetIcon(const wxIcon& icon) { SetImage(&icon); } virtual void SetBitmap(const wxBitmap& bitmap) { SetImage(&bitmap); } - - // can always be used, whether we have a bitmap or an icon in reality - wxBitmap GetBitmap() const; - - // can only be used if an icon had been originally used - wxIcon GetIcon() const; + virtual wxBitmap GetBitmap() const; + virtual wxIcon GetIcon() const; protected: diff --git a/include/wx/statbmp.h b/include/wx/statbmp.h index d215bc3bda..80b4d2dcf8 100644 --- a/include/wx/statbmp.h +++ b/include/wx/statbmp.h @@ -18,9 +18,7 @@ #include "wx/control.h" #include "wx/bitmap.h" - -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxBitmap; +#include "wx/icon.h" extern WXDLLEXPORT_DATA(const wxChar*) wxStaticBitmapNameStr; @@ -35,6 +33,12 @@ public: virtual void SetIcon(const wxIcon& icon) = 0; virtual void SetBitmap(const wxBitmap& bitmap) = 0; virtual wxBitmap GetBitmap() const = 0; + virtual wxIcon GetIcon() const /* = 0 -- should be pure virtual */ + { + // stub it out here for now as not all ports implement it (but they + // should) + return wxIcon(); + } // overriden base class virtuals virtual bool AcceptsFocus() const { return false; } -- 2.45.2