added IsEmpty()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-07 23:04:15 +00:00
parent 80442e9470
commit f718689984
2 changed files with 19 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ see also \helpref{wxDialog::SetIcons}{wxdialogseticons} and
\latexignore{\rtfignore{\wxheading{Members}}} \latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxIconBundle::wxIconBundle}\label{wxiconbundlewxiconbundle} \membersection{wxIconBundle::wxIconBundle}\label{wxiconbundlewxiconbundle}
\func{}{wxIconBundle}{\void} \func{}{wxIconBundle}{\void}
@@ -33,12 +34,14 @@ Initializes the bundle with a single icon.
Copy constructor. Copy constructor.
\membersection{wxIconBundle::\destruct{wxIconBundle}}\label{wxiconbundledtor} \membersection{wxIconBundle::\destruct{wxIconBundle}}\label{wxiconbundledtor}
\func{}{\destruct{wxIconBundle}}{\void} \func{}{\destruct{wxIconBundle}}{\void}
Destructor. Destructor.
\membersection{wxIconBundle::AddIcon}\label{wxiconbundleaddicon} \membersection{wxIconBundle::AddIcon}\label{wxiconbundleaddicon}
\func{void}{AddIcon}{\param{const wxString\& }{file}, \param{long }{type}} \func{void}{AddIcon}{\param{const wxString\& }{file}, \param{long }{type}}
@@ -53,6 +56,7 @@ Adds the icon to the collection; if the collection already
contains an icon with the same width and height, it is contains an icon with the same width and height, it is
replaced by the new one. replaced by the new one.
\membersection{wxIconBundle::GetIcon}\label{wxiconbundlegeticon} \membersection{wxIconBundle::GetIcon}\label{wxiconbundlegeticon}
\constfunc{wxIcon}{GetIcon}{\param{const wxSize\& }{size}} \constfunc{wxIcon}{GetIcon}{\param{const wxSize\& }{size}}
@@ -67,18 +71,30 @@ returns the icon with size wxSYS\_ICON\_X/wxSYS\_ICON\_Y.
Same as GetIcon( wxSize( size, size ) ). Same as GetIcon( wxSize( size, size ) ).
\membersection{wxIconBundle::IsEmpty}\label{wxiconbundleisempty}
\constfunc{bool}{IsEmpty}{\void}
Returns \true if the bundle doesn't contain any icons, \false otherwise (in
which case a call to \helpref{GetIcon()}{wxiconbundlegeticon} with default
parameter should return a valid icon).
\membersection{wxIconBundle::operator $=$}\label{wxiconbundleoperatorassign} \membersection{wxIconBundle::operator $=$}\label{wxiconbundleoperatorassign}
\func{wxIconBundle\&}{operator $=$}{\param{const wxIconBundle\& }{ic}} \func{wxIconBundle\&}{operator $=$}{\param{const wxIconBundle\& }{ic}}
Assignment operator, using \helpref{reference counting}{trefcount}. Assignment operator, using \helpref{reference counting}{trefcount}.
\membersection{wxIconBundle::operator $==$}\label{wxiconbundleoperatorequals} \membersection{wxIconBundle::operator $==$}\label{wxiconbundleoperatorequals}
\func{bool}{operator $==$}{\param{const wxIconBundle\& }{ic}} \func{bool}{operator $==$}{\param{const wxIconBundle\& }{ic}}
Equality operator. This returns \true if two icon bundles are equal. Equality operator. This returns \true if two icon bundles are equal.
\membersection{wxIconBundle::operator $!=$}\label{wxiconbundleoperatornotequals} \membersection{wxIconBundle::operator $!=$}\label{wxiconbundleoperatornotequals}
\func{bool}{operator $!=$}{\param{const wxIconBundle\& }{ic}} \func{bool}{operator $!=$}{\param{const wxIconBundle\& }{ic}}

View File

@@ -78,6 +78,9 @@ public:
// return the icon at index (must be < GetIconCount()) // return the icon at index (must be < GetIconCount())
wxIcon GetIconByIndex(size_t n) const; wxIcon GetIconByIndex(size_t n) const;
// check if we have any icons at all
bool IsEmpty() const { return GetIconCount() == 0; }
protected: protected:
virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;