]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/control.h
Doesn't reset the stream pos to 0 in CanRead().
[wxWidgets.git] / include / wx / os2 / control.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: control.h
3 // Purpose: wxControl class
4 // Author: David Webster
5 // Modified by:
6 // Created: 09/17/99
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CONTROL_H_
13 #define _WX_CONTROL_H_
14
15 // General item class
16 class WXDLLEXPORT wxControl : public wxControlBase
17 {
18 DECLARE_ABSTRACT_CLASS(wxControl)
19
20 public:
21 wxControl();
22 virtual ~wxControl();
23
24 // Simulates an event
25 virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
26
27 // implementation from now on
28 // --------------------------
29
30 // Calls the callback and appropriate event handlers
31 bool ProcessCommand(wxCommandEvent& event);
32
33 // OS2-specific
34 virtual bool OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
35
36 // For ownerdraw items
37 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
38 virtual bool OS2OnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
39
40 wxList& GetSubcontrols() { return m_subControls; }
41
42 void OnEraseBackground(wxEraseEvent& event);
43
44 #if WXWIN_COMPATIBILITY
45 virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
46 wxColour* GetButtonColour() const { return NULL; }
47
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;
52
53 // Adds callback
54 inline void Callback(const wxFunction function);
55
56 wxFunction GetCallback() { return m_callback; }
57
58 protected:
59 wxFunction m_callback; // Callback associated with the window
60 #endif // WXWIN_COMPATIBILITY
61
62 protected:
63 // For controls like radiobuttons which are really composite
64 wxList m_subControls;
65
66 virtual wxSize DoGetBestSize() const;
67
68 // create the control of the given class with the given style, returns FALSE
69 // if creation failed
70 bool OS2CreateControl(const wxChar *classname, WXDWORD style);
71
72 // determine the extended styles combination for this window (may slightly
73 // modify styl parameter)
74 WXDWORD GetExStyle(WXDWORD& style) const;
75
76 private:
77 DECLARE_EVENT_TABLE()
78 };
79
80
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
88
89 #endif
90 // _WX_CONTROL_H_