1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declaration of wxIconLocation class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.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 WXDLLIMPEXP_BASE wxIconLocationBase
24 // ctor takes the name of the file where the icon is
25 wxEXPLICIT
wxIconLocationBase(const wxString
& filename
= wxEmptyString
)
26 : m_filename(filename
) { }
28 // default copy ctor, assignment operator and dtor are ok
31 // returns true if this object is valid/initialized
32 bool IsOk() const { return !m_filename
.empty(); }
34 // set/get the icon file name
35 void SetFileName(const wxString
& filename
) { m_filename
= filename
; }
36 const wxString
& GetFileName() const { return m_filename
; }
42 // under MSW the same file may contain several icons so we also store the
44 #if defined(__WXMSW__)
46 class WXDLLIMPEXP_BASE wxIconLocation
: public wxIconLocationBase
49 // ctor takes the name of the file where the icon is and the icons index in
51 wxEXPLICIT
wxIconLocation(const wxString
& file
= wxEmptyString
, int num
= 0);
53 // set/get the icon index
54 void SetIndex(int num
) { m_index
= num
; }
55 int GetIndex() const { return m_index
; }
62 wxIconLocation::wxIconLocation(const wxString
& file
, int num
)
63 : wxIconLocationBase(file
)
70 // must be a class because we forward declare it as class
71 class WXDLLIMPEXP_BASE wxIconLocation
: public wxIconLocationBase
74 wxEXPLICIT
wxIconLocation(const wxString
& filename
= wxEmptyString
)
75 : wxIconLocationBase(filename
) { }
80 #endif // _WX_ICONLOC_H_