1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 20:59:19 +00:00
|
|
|
// Name: wx/msw/statbmp.h
|
|
|
|
// Purpose: wxStaticBitmap class for wxMSW
|
1998-05-20 14:12:05 +00:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_STATBMP_H_
|
|
|
|
#define _WX_STATBMP_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#include "wx/control.h"
|
1999-08-22 20:16:23 +00:00
|
|
|
#include "wx/icon.h"
|
1999-12-02 14:47:49 +00:00
|
|
|
#include "wx/bitmap.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2006-01-16 14:59:55 +00:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[];
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-03-24 23:35:16 +00:00
|
|
|
// a control showing an icon or a bitmap
|
2001-06-26 20:59:19 +00:00
|
|
|
class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-01-31 23:30:33 +00:00
|
|
|
public:
|
1999-03-24 23:35:16 +00:00
|
|
|
wxStaticBitmap() { Init(); }
|
|
|
|
|
|
|
|
wxStaticBitmap(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
1999-11-24 12:30:56 +00:00
|
|
|
const wxGDIImage& label,
|
1999-03-24 23:35:16 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxStaticBitmapNameStr)
|
1999-01-31 23:30:33 +00:00
|
|
|
{
|
2002-12-21 14:35:18 +00:00
|
|
|
Init();
|
|
|
|
|
1999-01-31 23:30:33 +00:00
|
|
|
Create(parent, id, label, pos, size, style, name);
|
|
|
|
}
|
1999-03-24 23:35:16 +00:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
1999-11-24 12:30:56 +00:00
|
|
|
const wxGDIImage& label,
|
1999-03-24 23:35:16 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxStaticBitmapNameStr);
|
|
|
|
|
|
|
|
virtual ~wxStaticBitmap() { Free(); }
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual void SetIcon(const wxIcon& icon) { SetImage(&icon); }
|
|
|
|
virtual void SetBitmap(const wxBitmap& bitmap) { SetImage(&bitmap); }
|
2005-12-19 13:56:23 +00:00
|
|
|
virtual wxBitmap GetBitmap() const;
|
|
|
|
virtual wxIcon GetIcon() const;
|
2002-12-21 14:35:18 +00:00
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
1999-03-24 23:35:16 +00:00
|
|
|
|
1999-01-31 23:30:33 +00:00
|
|
|
protected:
|
2003-07-06 21:35:32 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const;
|
2004-04-07 22:41:34 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
1999-11-24 12:30:56 +00:00
|
|
|
|
2002-12-21 14:35:18 +00:00
|
|
|
// ctor/dtor helpers
|
2006-01-17 16:08:59 +00:00
|
|
|
void Init() { m_isIcon = true; m_image = NULL; m_currentHandle = 0; }
|
1999-03-24 23:35:16 +00:00
|
|
|
void Free();
|
|
|
|
|
2004-09-04 01:53:42 +00:00
|
|
|
// true if icon/bitmap is valid
|
1999-03-24 23:35:16 +00:00
|
|
|
bool ImageIsOk() const;
|
|
|
|
|
2000-02-02 00:52:06 +00:00
|
|
|
void SetImage(const wxGDIImage* image);
|
2001-11-06 21:16:02 +00:00
|
|
|
void SetImageNoCopy( wxGDIImage* image );
|
1999-11-24 12:30:56 +00:00
|
|
|
|
1999-03-24 23:35:16 +00:00
|
|
|
// we can have either an icon or a bitmap
|
|
|
|
bool m_isIcon;
|
1999-11-24 12:30:56 +00:00
|
|
|
wxGDIImage *m_image;
|
2006-01-19 07:37:18 +00:00
|
|
|
|
2006-01-17 16:08:59 +00:00
|
|
|
// handle used in last call to STM_SETIMAGE
|
2006-01-19 07:37:18 +00:00
|
|
|
WXHANDLE m_currentHandle;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
2003-01-02 23:38:11 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxStaticBitmap)
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_STATBMP_H_
|