]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/control.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: David Webster
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CONTROL_H_
13 #define _WX_CONTROL_H_
16 class WXDLLEXPORT wxControl
: public wxControlBase
18 DECLARE_ABSTRACT_CLASS(wxControl
)
25 virtual void Command(wxCommandEvent
& event
) { ProcessCommand(event
); }
27 // implementation from now on
28 // --------------------------
30 // Calls the callback and appropriate event handlers
31 bool ProcessCommand(wxCommandEvent
& event
);
34 virtual bool OS2OnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
);
36 // For ownerdraw items
37 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT
*WXUNUSED(item
)) { return FALSE
; };
38 virtual bool OS2OnMeasure(WXMEASUREITEMSTRUCT
*WXUNUSED(item
)) { return FALSE
; };
40 wxList
& GetSubcontrols() { return m_subControls
; }
42 void OnEraseBackground(wxEraseEvent
& event
);
44 #if WXWIN_COMPATIBILITY
45 virtual void SetButtonColour(const wxColour
& WXUNUSED(col
)) { }
46 wxColour
* GetButtonColour() const { return NULL
; }
48 inline virtual void SetLabelFont(const wxFont
& font
);
49 inline virtual void SetButtonFont(const wxFont
& font
);
50 inline wxFont
& GetLabelFont() const;
51 inline wxFont
& GetButtonFont() const;
54 inline void Callback(const wxFunction function
);
56 wxFunction
GetCallback() { return m_callback
; }
59 wxFunction m_callback
; // Callback associated with the window
60 #endif // WXWIN_COMPATIBILITY
63 // For controls like radiobuttons which are really composite
66 virtual wxSize
DoGetBestSize() const;
68 // create the control of the given class with the given style, returns FALSE
70 bool OS2CreateControl(const wxChar
*classname
, WXDWORD style
);
72 // determine the extended styles combination for this window (may slightly
73 // modify styl parameter)
74 WXDWORD
GetExStyle(WXDWORD
& style
) const;
81 #if WXWIN_COMPATIBILITY
82 inline void wxControl::Callback(const wxFunction f
) { m_callback
= f
; };
83 inline wxFont
& wxControl::GetLabelFont() const { return GetFont(); }
84 inline wxFont
& wxControl::GetButtonFont() const { return GetFont(); }
85 inline void wxControl::SetLabelFont(const wxFont
& font
) { SetFont(font
); }
86 inline void wxControl::SetButtonFont(const wxFont
& font
) { SetFont(font
); }
87 #endif // WXWIN_COMPATIBILITY