]> git.saurik.com Git - wxWidgets.git/blob - src/osx/iphone/anybutton.mm
re-enable drawing our own resize grip with GTK3, themes can (and do) disable the...
[wxWidgets.git] / src / osx / iphone / anybutton.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/iphone/anybutton.mm
3 // Purpose: wxAnyButton
4 // Author: Stefan Csomor
5 // Created: 1998-01-01 (extracted from button.mm)
6 // RCS-ID: $Id: anybutton.mm 67232 2011-03-18 15:10:15Z DS $
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #include "wx/wxprec.h"
12
13 #include "wx/anybutton.h"
14
15 #ifndef WX_PRECOMP
16 #include "wx/panel.h"
17 #include "wx/toplevel.h"
18 #include "wx/dcclient.h"
19 #endif
20
21 #include "wx/stockitem.h"
22
23 #include "wx/osx/private.h"
24
25 wxSize wxAnyButton::DoGetBestSize() const
26 {
27 if ( GetId() == wxID_HELP )
28 return wxSize( 18 , 18 ) ;
29
30 wxSize sz = GetDefaultSize() ;
31
32 wxRect r ;
33
34 GetPeer()->GetBestRect(&r);
35
36 if ( r.GetWidth() == 0 && r.GetHeight() == 0 )
37 {
38 }
39 sz.x = r.GetWidth();
40 sz.y = r.GetHeight();
41
42 int wBtn = 72;
43
44 if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT))
45 sz.x = wBtn;
46
47 return sz ;
48 }
49
50 wxSize wxAnyButton::GetDefaultSize()
51 {
52 int wBtn = 72 ;
53 int hBtn = 35 ;
54
55 return wxSize(wBtn, hBtn);
56 }