]>
Commit | Line | Data |
---|---|---|
b4354db1 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: src/osx/iphone/anybutton.mm | |
3 | // Purpose: wxAnyButton | |
4 | // Author: Stefan Csomor | |
5 | // Created: 1998-01-01 (extracted from button.mm) | |
b4354db1 VZ |
6 | // Copyright: (c) Stefan Csomor |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #include "wx/wxprec.h" | |
11 | ||
12 | #include "wx/anybutton.h" | |
13 | ||
14 | #ifndef WX_PRECOMP | |
15 | #include "wx/panel.h" | |
16 | #include "wx/toplevel.h" | |
17 | #include "wx/dcclient.h" | |
18 | #endif | |
19 | ||
20 | #include "wx/stockitem.h" | |
21 | ||
22 | #include "wx/osx/private.h" | |
23 | ||
24 | wxSize wxAnyButton::DoGetBestSize() const | |
25 | { | |
26 | if ( GetId() == wxID_HELP ) | |
27 | return wxSize( 18 , 18 ) ; | |
28 | ||
29 | wxSize sz = GetDefaultSize() ; | |
30 | ||
31 | wxRect r ; | |
32 | ||
33 | GetPeer()->GetBestRect(&r); | |
34 | ||
35 | if ( r.GetWidth() == 0 && r.GetHeight() == 0 ) | |
36 | { | |
37 | } | |
38 | sz.x = r.GetWidth(); | |
39 | sz.y = r.GetHeight(); | |
40 | ||
41 | int wBtn = 72; | |
42 | ||
43 | if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT)) | |
44 | sz.x = wBtn; | |
45 | ||
46 | return sz ; | |
47 | } | |
48 | ||
49 | wxSize wxAnyButton::GetDefaultSize() | |
50 | { | |
51 | int wBtn = 72 ; | |
52 | int hBtn = 35 ; | |
53 | ||
54 | return wxSize(wBtn, hBtn); | |
55 | } |