]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/private/button.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/private/button.h
3 // Purpose: helper functions used with native BUTTON control
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_PRIVATE_BUTTON_H_
12 #define _WX_MSW_PRIVATE_BUTTON_H_
14 // define some standard button constants which may be missing in the headers
16 #define BS_PUSHLIKE 0x00001000L
20 #define BST_UNCHECKED 0x0000
24 #define BST_CHECKED 0x0001
27 #ifndef BST_INDETERMINATE
28 #define BST_INDETERMINATE 0x0002
32 #define DT_HIDEPREFIX 0x00100000
38 // returns BS_MULTILINE if the label contains new lines or 0 otherwise
39 inline int GetMultilineStyle(const wxString
& label
)
41 return label
.find(wxT('\n')) == wxString::npos
? 0 : BS_MULTILINE
;
44 // update the style of the specified HWND to include or exclude BS_MULTILINE
45 // depending on whether the label contains the new lines
46 void UpdateMultilineStyle(HWND hwnd
, const wxString
& label
);
48 // flags for ComputeBestSize() and GetFittingSize()
54 // common implementation of wxButton and wxToggleButton::DoGetBestSize()
55 // (implemented in src/msw/button.cpp)
56 wxSize
ComputeBestSize(wxControl
*btn
, int flags
= 0);
58 // compute the button size (as if wxBU_EXACTFIT were specified, i.e. without
59 // adjusting it to be of default size if it's smaller) for the given label size
60 wxSize
GetFittingSize(wxWindow
*win
, const wxSize
& sizeLabel
, int flags
= 0);
62 } // namespace wxMSWButton
64 #endif // _WX_MSW_PRIVATE_BUTTON_H_