]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: control.h | |
3 | // Purpose: wxControl class | |
a31a5f85 | 4 | // Author: Stefan Csomor |
0dbd6262 | 5 | // Modified by: |
a31a5f85 | 6 | // Created: 1998-01-01 |
0dbd6262 | 7 | // RCS-ID: $Id$ |
a31a5f85 | 8 | // Copyright: (c) Stefan Csomor |
d921af51 | 9 | // Licence: wxWindows licence |
0dbd6262 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CONTROL_H_ | |
13 | #define _WX_CONTROL_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
0dbd6262 SC |
16 | #pragma interface "control.h" |
17 | #endif | |
18 | ||
4765d335 SC |
19 | WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr; |
20 | ||
0dbd6262 | 21 | // General item class |
519cb848 | 22 | class WXDLLEXPORT wxControl : public wxControlBase |
0dbd6262 | 23 | { |
519cb848 SC |
24 | DECLARE_ABSTRACT_CLASS(wxControl) |
25 | ||
0dbd6262 SC |
26 | public: |
27 | wxControl(); | |
05adb9d2 SC |
28 | wxControl(wxWindow *parent, wxWindowID id, |
29 | const wxPoint& pos = wxDefaultPosition, | |
30 | const wxSize& size = wxDefaultSize, long style = 0, | |
31 | const wxValidator& validator = wxDefaultValidator, | |
32 | const wxString& name = wxControlNameStr) | |
33 | { | |
34 | Create(parent, id, pos, size, style, validator, name); | |
35 | } | |
519cb848 | 36 | |
4765d335 SC |
37 | bool Create(wxWindow *parent, wxWindowID id, |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, long style = 0, | |
40 | const wxValidator& validator = wxDefaultValidator, | |
41 | const wxString& name = wxControlNameStr); | |
05adb9d2 | 42 | virtual ~wxControl(); |
4765d335 | 43 | |
519cb848 SC |
44 | // Simulates an event |
45 | virtual void Command(wxCommandEvent& event) { ProcessCommand(event); } | |
46 | ||
47 | // implementation from now on | |
48 | // -------------------------- | |
49 | ||
50 | // Calls the callback and appropriate event handlers | |
51 | bool ProcessCommand(wxCommandEvent& event); | |
e7549107 | 52 | virtual void SetLabel(const wxString& title) ; |
519cb848 SC |
53 | |
54 | wxList& GetSubcontrols() { return m_subControls; } | |
03e11df5 | 55 | |
519cb848 | 56 | void OnEraseBackground(wxEraseEvent& event); |
03e11df5 | 57 | |
d921af51 JS |
58 | virtual bool Enable(bool enable = TRUE) ; |
59 | virtual bool Show(bool show = TRUE) ; | |
69d90995 SC |
60 | virtual void DoSetWindowVariant( wxWindowVariant variant ) ; |
61 | ||
d921af51 | 62 | virtual void MacRedrawControl () ; |
69b85ca4 | 63 | virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; |
d921af51 JS |
64 | virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label , |
65 | const wxPoint& pos, | |
66 | const wxSize& size, long style, | |
67 | const wxValidator& validator, | |
68 | const wxString& name , | |
69 | WXRECTPTR outBounds , | |
70 | unsigned char* maclabel ) ; | |
71 | virtual void MacPostControlCreate() ; | |
72 | virtual void MacAdjustControlRect() ; | |
5273bf2f | 73 | virtual WXWidget MacGetContainerForEmbedding() ; |
d921af51 JS |
74 | virtual void MacSuperChangedPosition() ; |
75 | virtual void MacSuperEnabled( bool enabled ) ; | |
76 | virtual void MacSuperShown( bool show ) ; | |
77 | virtual bool MacCanFocus() const ; | |
78 | virtual void MacUpdateDimensions() ; | |
08a88c33 | 79 | void* MacGetControlAction() { return m_macControlAction ; } |
03e11df5 | 80 | |
d921af51 JS |
81 | virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; |
82 | void OnKeyDown( wxKeyEvent &event ) ; | |
83 | void OnMouseEvent( wxMouseEvent &event ) ; | |
84 | void OnPaint(wxPaintEvent& event) ; | |
85 | virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ; | |
86 | WXWidget GetMacControl() { return m_macControl ;} | |
e7549107 | 87 | |
519cb848 SC |
88 | protected: |
89 | // For controls like radiobuttons which are really composite | |
d84afea9 | 90 | WXWidget m_macControl ; |
08a88c33 | 91 | void* m_macControlAction ; |
d84afea9 GD |
92 | bool m_macControlIsShown ; |
93 | wxList m_subControls; | |
94 | int m_macHorizontalBorder ; | |
95 | int m_macVerticalBorder ; | |
519cb848 | 96 | |
05adb9d2 | 97 | virtual wxSize DoGetBestSize() const; |
519cb848 | 98 | |
519cb848 SC |
99 | private: |
100 | DECLARE_EVENT_TABLE() | |
0dbd6262 SC |
101 | }; |
102 | ||
519cb848 | 103 | |
5273bf2f SC |
104 | wxControl *wxFindControlFromMacControl(WXWidget inControl ) ; |
105 | void wxAssociateControlWithMacControl(WXWidget inControl, wxControl *control) ; | |
519cb848 SC |
106 | void wxRemoveMacControlAssociation(wxControl *control) ; |
107 | ||
0dbd6262 SC |
108 | #endif |
109 | // _WX_CONTROL_H_ |