]> git.saurik.com Git - wxWidgets.git/blob - src/gtk/bmpbuttn.cpp
set the initial size of bitmap buttons correctly again after it was broken by r61081...
[wxWidgets.git] / src / gtk / bmpbuttn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/bmpbuttn.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #if wxUSE_BMPBUTTON
14
15 #include "wx/bmpbuttn.h"
16
17 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
18
19 bool wxBitmapButton::Create(wxWindow *parent,
20 wxWindowID id,
21 const wxBitmap& bitmap,
22 const wxPoint& pos,
23 const wxSize& size,
24 long style,
25 const wxValidator& validator,
26 const wxString& name)
27 {
28 if ( !wxBitmapButtonBase::Create(parent, id, "",
29 pos, size,
30 style | wxBU_NOTEXT,
31 validator, name) )
32 return false;
33
34 if ( bitmap.IsOk() )
35 {
36 SetBitmapLabel(bitmap);
37
38 // we need to adjust the size after setting the bitmap as it may be too
39 // big for the default button size
40 SetInitialSize(size);
41 }
42
43 return true;
44 }
45 #endif // wxUSE_BMPBUTTON