]>
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 #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 virtual bool OS2OnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
);
40 // For ownerdraw items
41 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT
*WXUNUSED(item
)) { return FALSE
; };
42 virtual bool OS2OnMeasure(WXMEASUREITEMSTRUCT
*WXUNUSED(item
)) { return FALSE
; };
44 wxList
& GetSubcontrols() { return m_subControls
; }
46 void OnEraseBackground(wxEraseEvent
& event
);
48 #if WXWIN_COMPATIBILITY
49 virtual void SetButtonColour(const wxColour
& WXUNUSED(col
)) { }
50 wxColour
* GetButtonColour() const { return NULL
; }
52 inline virtual void SetLabelFont(const wxFont
& font
);
53 inline virtual void SetButtonFont(const wxFont
& font
);
54 inline wxFont
& GetLabelFont() const;
55 inline wxFont
& GetButtonFont() const;
58 inline void Callback(const wxFunction function
);
60 wxFunction
GetCallback() { return m_callback
; }
63 wxFunction m_callback
; // Callback associated with the window
64 #endif // WXWIN_COMPATIBILITY
67 // For controls like radiobuttons which are really composite
70 virtual wxSize
DoGetBestSize();
72 // create the control of the given class with the given style, returns FALSE
74 bool OS2CreateControl(const wxChar
*classname
, WXDWORD style
);
76 // determine the extended styles combination for this window (may slightly
77 // modify styl parameter)
78 WXDWORD
GetExStyle(WXDWORD
& style
) const;
85 #if WXWIN_COMPATIBILITY
86 inline void wxControl::Callback(const wxFunction f
) { m_callback
= f
; };
87 inline wxFont
& wxControl::GetLabelFont() const { return GetFont(); }
88 inline wxFont
& wxControl::GetButtonFont() const { return GetFont(); }
89 inline void wxControl::SetLabelFont(const wxFont
& font
) { SetFont(font
); }
90 inline void wxControl::SetButtonFont(const wxFont
& font
) { SetFont(font
); }
91 #endif // WXWIN_COMPATIBILITY