1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declaration of wxIconLocation class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_ICONLOC_H_
13 #define _WX_ICONLOC_H_
15 #include "wx/string.h"
17 // ----------------------------------------------------------------------------
18 // wxIconLocation: describes the location of an icon
19 // ----------------------------------------------------------------------------
21 class WXDLLEXPORT wxIconLocationBase
24 // ctor takes the name of the file where the icon is
25 wxEXPLICIT
wxIconLocationBase(const wxString
& file
) : m_filename(file
) { }
27 // default copy ctor, assignment operator and dtor are ok
30 // returns true if this object is valid/initialized
31 bool IsOk() const { return !m_filename
.empty(); }
33 // set/get the icon file name
34 void SetFileName(const wxString
& file
) { m_filename
= file
; }
35 const wxString
& GetFileName() const { return m_filename
; }
41 // under MSW the same file may contain several icons so we also store the
43 #if defined(__WXMSW__)
45 class WXDLLEXPORT wxIconLocation
: public wxIconLocationBase
48 // ctor takes the name of the file where the icon is and the icons index in
50 wxEXPLICIT
wxIconLocation(const wxString
& file
, int num
= 0);
52 // set/get the icon index
53 void SetIndex(int num
) { m_index
= num
; }
54 int GetIndex() const { return m_index
; }
61 wxIconLocation::wxIconLocation(const wxString
& file
, int num
)
62 : wxIconLocationBase(file
)
69 typedef wxIconLocationBase wxIconLocation
;
73 #endif // _WX_ICONLOC_H_