]> git.saurik.com Git - wxWidgets.git/blame - include/wx/iconloc.h
Better name for wxXmlResource::GetDirection() argument.
[wxWidgets.git] / include / wx / iconloc.h
CommitLineData
aaf7ab43
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/iconloc.h
3// Purpose: declaration of wxIconLocation class
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 21.06.2003
77ffb593 7// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
65571936 8// Licence: wxWindows licence
aaf7ab43
VZ
9///////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_ICONLOC_H_
12#define _WX_ICONLOC_H_
13
14#include "wx/string.h"
15
16// ----------------------------------------------------------------------------
17// wxIconLocation: describes the location of an icon
18// ----------------------------------------------------------------------------
19
bddd7a8d 20class WXDLLIMPEXP_BASE wxIconLocationBase
aaf7ab43
VZ
21{
22public:
23 // ctor takes the name of the file where the icon is
3e3362da
VZ
24 wxEXPLICIT wxIconLocationBase(const wxString& filename = wxEmptyString)
25 : m_filename(filename) { }
aaf7ab43
VZ
26
27 // default copy ctor, assignment operator and dtor are ok
28
29
30 // returns true if this object is valid/initialized
31 bool IsOk() const { return !m_filename.empty(); }
32
33 // set/get the icon file name
3e3362da 34 void SetFileName(const wxString& filename) { m_filename = filename; }
aaf7ab43
VZ
35 const wxString& GetFileName() const { return m_filename; }
36
37private:
38 wxString m_filename;
39};
40
bb5a9514 41// under Windows the same file may contain several icons so we also store the
aaf7ab43 42// index of the icon
bb5a9514 43#if defined(__WINDOWS__)
aaf7ab43 44
bddd7a8d 45class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase
aaf7ab43
VZ
46{
47public:
48 // ctor takes the name of the file where the icon is and the icons index in
49 // the file
3e3362da 50 wxEXPLICIT wxIconLocation(const wxString& file = wxEmptyString, int num = 0);
aaf7ab43
VZ
51
52 // set/get the icon index
53 void SetIndex(int num) { m_index = num; }
54 int GetIndex() const { return m_index; }
55
56private:
57 int m_index;
58};
59
60inline
61wxIconLocation::wxIconLocation(const wxString& file, int num)
62 : wxIconLocationBase(file)
63{
64 SetIndex(num);
65}
66
bb5a9514 67#else // !__WINDOWS__
aaf7ab43 68
886dd7d2 69// must be a class because we forward declare it as class
bddd7a8d 70class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase
886dd7d2
VZ
71{
72public:
73 wxEXPLICIT wxIconLocation(const wxString& filename = wxEmptyString)
74 : wxIconLocationBase(filename) { }
75};
aaf7ab43
VZ
76
77#endif // platform
78
79#endif // _WX_ICONLOC_H_
80