2003-06-21 13:39:40 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/iconloc.h
|
|
|
|
// Purpose: declaration of wxIconLocation class
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 21.06.2003
|
2004-05-23 14:56:36 +00:00
|
|
|
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2003-06-21 13:39:40 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ICONLOC_H_
|
|
|
|
#define _WX_ICONLOC_H_
|
|
|
|
|
|
|
|
#include "wx/string.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxIconLocation: describes the location of an icon
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxIconLocationBase
|
2003-06-21 13:39:40 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctor takes the name of the file where the icon is
|
2016-08-30 08:44:32 +00:00
|
|
|
explicit wxIconLocationBase(const wxString& filename = wxEmptyString)
|
2003-06-22 00:19:38 +00:00
|
|
|
: m_filename(filename) { }
|
2003-06-21 13:39:40 +00:00
|
|
|
|
|
|
|
// default copy ctor, assignment operator and dtor are ok
|
|
|
|
|
|
|
|
|
|
|
|
// returns true if this object is valid/initialized
|
|
|
|
bool IsOk() const { return !m_filename.empty(); }
|
|
|
|
|
|
|
|
// set/get the icon file name
|
2003-06-22 00:19:38 +00:00
|
|
|
void SetFileName(const wxString& filename) { m_filename = filename; }
|
2003-06-21 13:39:40 +00:00
|
|
|
const wxString& GetFileName() const { return m_filename; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_filename;
|
|
|
|
};
|
|
|
|
|
2012-03-04 20:31:42 +00:00
|
|
|
// under Windows the same file may contain several icons so we also store the
|
2003-06-21 13:39:40 +00:00
|
|
|
// index of the icon
|
2012-03-04 20:31:42 +00:00
|
|
|
#if defined(__WINDOWS__)
|
2003-06-21 13:39:40 +00:00
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase
|
2003-06-21 13:39:40 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctor takes the name of the file where the icon is and the icons index in
|
|
|
|
// the file
|
2016-08-30 08:44:32 +00:00
|
|
|
explicit wxIconLocation(const wxString& file = wxEmptyString, int num = 0);
|
2003-06-21 13:39:40 +00:00
|
|
|
|
|
|
|
// set/get the icon index
|
|
|
|
void SetIndex(int num) { m_index = num; }
|
|
|
|
int GetIndex() const { return m_index; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
int m_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline
|
|
|
|
wxIconLocation::wxIconLocation(const wxString& file, int num)
|
|
|
|
: wxIconLocationBase(file)
|
|
|
|
{
|
|
|
|
SetIndex(num);
|
|
|
|
}
|
|
|
|
|
2012-03-04 20:31:42 +00:00
|
|
|
#else // !__WINDOWS__
|
2003-06-21 13:39:40 +00:00
|
|
|
|
2003-07-02 01:41:23 +00:00
|
|
|
// must be a class because we forward declare it as class
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase
|
2003-07-02 01:41:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-08-30 08:44:32 +00:00
|
|
|
explicit wxIconLocation(const wxString& filename = wxEmptyString)
|
2003-07-02 01:41:23 +00:00
|
|
|
: wxIconLocationBase(filename) { }
|
|
|
|
};
|
2003-06-21 13:39:40 +00:00
|
|
|
|
|
|
|
#endif // platform
|
|
|
|
|
|
|
|
#endif // _WX_ICONLOC_H_
|
|
|
|
|