]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/control.h
use base class implementation
[wxWidgets.git] / include / wx / motif / control.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: control.h
3// Purpose: wxControl class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
7491d644 9// Licence: wxWindows licence
9b6dbb09
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_CONTROL_H_
13#define _WX_CONTROL_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
9b6dbb09
JS
16#pragma interface "control.h"
17#endif
18
19#include "wx/window.h"
20#include "wx/list.h"
21#include "wx/validate.h"
22
23// General item class
5a2155ef 24class WXDLLEXPORT wxControl: public wxControlBase
9b6dbb09 25{
a4294b78 26 DECLARE_ABSTRACT_CLASS(wxControl)
83df96d6 27
9b6dbb09 28public:
a4294b78 29 wxControl();
0148fe1e 30 wxControl( wxWindow *parent,
83df96d6
JS
31 wxWindowID id,
32 const wxPoint &pos = wxDefaultPosition,
33 const wxSize &size = wxDefaultSize,
34 long style = 0,
35 const wxValidator& validator = wxDefaultValidator,
36 const wxString &name = wxControlNameStr )
5a2155ef
BJ
37 {
38 Create(parent, id, pos, size, style, validator, name);
39 }
83df96d6 40
5a2155ef 41 bool Create(wxWindow *parent, wxWindowID id,
83df96d6
JS
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize, long style = 0,
44 const wxValidator& validator = wxDefaultValidator,
45 const wxString& name = wxControlNameStr);
46
31528cd3
VZ
47 // simulates the event, returns TRUE if the event was processed
48 virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
83df96d6 49
31528cd3
VZ
50 // calls the callback and appropriate event handlers, returns TRUE if
51 // event was processed
52 virtual bool ProcessCommand(wxCommandEvent& event);
83df96d6 53
a4294b78
JS
54 virtual void SetLabel(const wxString& label);
55 virtual wxString GetLabel() const ;
83df96d6 56
7491d644 57 bool InSetValue() const { return m_inSetValue; }
83df96d6 58
9b6dbb09 59protected:
ec75d791
MB
60 // calls wxControlBase::CreateControl, also sets foreground, background and
61 // font to parent's values
62 bool CreateControl(wxWindow *parent,
63 wxWindowID id,
64 const wxPoint& pos,
65 const wxSize& size,
66 long style,
67 const wxValidator& validator,
68 const wxString& name);
69
70dc287a
VZ
70 // Motif: prevent callbacks being called while in SetValue
71 bool m_inSetValue;
83df96d6 72
a4294b78 73 DECLARE_EVENT_TABLE()
9b6dbb09
JS
74};
75
70dc287a
VZ
76#endif // _WX_CONTROL_H_
77