]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/control.h
7d8f6d185d3598347c3f0320e8a5e45c6431c730
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CONTROL_H_
13 #define _WX_CONTROL_H_
16 #pragma interface "control.h"
20 class WXDLLEXPORT wxControl
: public wxControlBase
22 DECLARE_ABSTRACT_CLASS(wxControl
)
29 virtual void Command(wxCommandEvent
& event
) { ProcessCommand(event
); }
31 // implementation from now on
32 // --------------------------
34 // Calls the callback and appropriate event handlers
35 bool ProcessCommand(wxCommandEvent
& event
);
38 wxList
& GetSubcontrols() { return m_subControls
; }
40 void OnEraseBackground(wxEraseEvent
& event
);
42 #if WXWIN_COMPATIBILITY
43 virtual void SetButtonColour(const wxColour
& WXUNUSED(col
)) { }
44 wxColour
* GetButtonColour() const { return NULL
; }
46 inline virtual void SetLabelFont(const wxFont
& font
);
47 inline virtual void SetButtonFont(const wxFont
& font
);
48 inline wxFont
& GetLabelFont() const;
49 inline wxFont
& GetButtonFont() const;
52 inline void Callback(const wxFunction function
);
54 wxFunction
GetCallback() { return m_callback
; }
57 wxFunction m_callback
; // Callback associated with the window
58 #endif // WXWIN_COMPATIBILITY
61 // For controls like radiobuttons which are really composite
64 virtual wxSize
DoGetBestSize();
66 // create the control of the given class with the given style, returns FALSE
68 bool MSWCreateControl(const wxChar
*classname
, WXDWORD style
);
70 // determine the extended styles combination for this window (may slightly
71 // modify styl parameter)
72 WXDWORD
GetExStyle(WXDWORD
& style
) const;
79 #if WXWIN_COMPATIBILITY
80 inline void wxControl::Callback(const wxFunction f
) { m_callback
= f
; };
81 inline wxFont
& wxControl::GetLabelFont() const { return GetFont(); }
82 inline wxFont
& wxControl::GetButtonFont() const { return GetFont(); }
83 inline void wxControl::SetLabelFont(const wxFont
& font
) { SetFont(font
); }
84 inline void wxControl::SetButtonFont(const wxFont
& font
) { SetFont(font
); }
85 #endif // WXWIN_COMPATIBILITY
87 wxControl
*wxFindControlFromMacControl(ControlHandle inControl
) ;
88 void wxAssociateControlWithMacControl(ControlHandle inControl
, wxControl
*control
) ;
89 void wxRemoveMacControlAssociation(wxControl
*control
) ;