]> git.saurik.com Git - wxWidgets.git/blame - include/wx/qt/bmpbuttn.h
Rewrote wxNotebook, incl. PAGE_CHANGING event
[wxWidgets.git] / include / wx / qt / bmpbuttn.h
CommitLineData
7c78e7c7 1/////////////////////////////////////////////////////////////////////////////
01b2eeec
KB
2// Name: bmpbuttn.h
3// Purpose: wxBitmapButton class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
7c78e7c7
RR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
01b2eeec
KB
12#ifndef _WX_BMPBUTTN_H_
13#define _WX_BMPBUTTN_H_
7c78e7c7
RR
14
15#ifdef __GNUG__
01b2eeec 16#pragma interface "bmpbuttn.h"
7c78e7c7
RR
17#endif
18
01b2eeec
KB
19#include "wx/button.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
7c78e7c7 22
01b2eeec 23#define wxDEFAULT_BUTTON_MARGIN 4
7c78e7c7 24
01b2eeec
KB
25class WXDLLEXPORT wxBitmapButton: public wxButton
26{
27 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
28 public:
29 inline wxBitmapButton() { m_marginX = wxDEFAULT_BUTTON_MARGIN; m_marginY = wxDEFAULT_BUTTON_MARGIN; }
30 inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
33 const wxValidator& validator = wxDefaultValidator,
34 const wxString& name = wxButtonNameStr)
35 {
36 Create(parent, id, bitmap, pos, size, style, validator, name);
37 }
7c78e7c7 38
01b2eeec
KB
39 bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxButtonNameStr);
7c78e7c7 44
01b2eeec
KB
45 virtual void SetLabel(const wxBitmap& bitmap)
46 {
47 SetBitmapLabel(bitmap);
48 }
7c78e7c7 49
01b2eeec 50 virtual void SetBitmapLabel(const wxBitmap& bitmap);
7c78e7c7 51
01b2eeec
KB
52 inline wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_buttonBitmap; }
53 inline wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_buttonBitmapSelected; }
54 inline wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_buttonBitmapFocus; }
55 inline wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_buttonBitmapDisabled; }
7c78e7c7 56
01b2eeec
KB
57 inline void SetBitmapSelected(const wxBitmap& sel) { m_buttonBitmapSelected = sel; };
58 inline void SetBitmapFocus(const wxBitmap& focus) { m_buttonBitmapFocus = focus; };
59 inline void SetBitmapDisabled(const wxBitmap& disabled) { m_buttonBitmapDisabled = disabled; };
60
61 inline void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
62 inline int GetMarginX() { return m_marginX; }
63 inline int GetMarginY() { return m_marginY; }
64
65/*
66 // TODO: Implementation
67 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
68 virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
69 virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
70 virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
71*/
72
73 protected:
74 wxBitmap m_buttonBitmap;
75 wxBitmap m_buttonBitmapSelected;
76 wxBitmap m_buttonBitmapFocus;
77 wxBitmap m_buttonBitmapDisabled;
78 int m_marginX;
79 int m_marginY;
7c78e7c7 80};
01b2eeec
KB
81
82#endif
83 // _WX_BMPBUTTN_H_