]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/control.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: Julian Smart
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"
19 #include "wx/window.h"
21 #include "wx/validate.h"
23 #define wxControlNameStr _T("control")
26 class WXDLLEXPORT wxControl
: public wxControlBase
28 DECLARE_ABSTRACT_CLASS(wxControl
)
32 wxControl( wxWindow
*parent
,
34 const wxPoint
&pos
= wxDefaultPosition
,
35 const wxSize
&size
= wxDefaultSize
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
&name
= wxControlNameStr
)
40 Create(parent
, id
, pos
, size
, style
, validator
, name
);
43 bool Create(wxWindow
*parent
, wxWindowID id
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
, long style
= 0,
46 const wxValidator
& validator
= wxDefaultValidator
,
47 const wxString
& name
= wxControlNameStr
);
49 // simulates the event, returns TRUE if the event was processed
50 virtual void Command(wxCommandEvent
& WXUNUSED(event
)) { }
52 // calls the callback and appropriate event handlers, returns TRUE if
53 // event was processed
54 virtual bool ProcessCommand(wxCommandEvent
& event
);
56 virtual void SetLabel(const wxString
& label
);
57 virtual wxString
GetLabel() const ;
59 #if WXWIN_COMPATIBILITY
60 void Callback(const wxFunction function
) { m_callback
= function
; }; // Adds callback
62 wxFunction
GetCallback() { return m_callback
; }
63 #endif // WXWIN_COMPATIBILITY
65 bool InSetValue() const { return m_inSetValue
; }
68 // calls wxControlBase::CreateControl, also sets foreground, background and
69 // font to parent's values
70 bool CreateControl(wxWindow
*parent
,
75 const wxValidator
& validator
,
76 const wxString
& name
);
78 #if WXWIN_COMPATIBILITY
79 wxFunction m_callback
; // Callback associated with the window
80 #endif // WXWIN_COMPATIBILITY
82 bool m_inSetValue
; // Motif: prevent callbacks being called while