]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/control.h
1. wxMSW seems to work (please test and send your bug reports!)
[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
15#ifdef __GNUG__
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
24class WXDLLEXPORT wxControl: public wxWindow
25{
a4294b78 26 DECLARE_ABSTRACT_CLASS(wxControl)
7491d644 27
9b6dbb09 28public:
a4294b78
JS
29 wxControl();
30 ~wxControl();
9b6dbb09 31
a4294b78
JS
32 virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; // Simulates an event
33 virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
9b6dbb09 34 // appropriate event handlers
a4294b78
JS
35 virtual void SetLabel(const wxString& label);
36 virtual wxString GetLabel() const ;
9b6dbb09 37
a4294b78
JS
38 // Places item in centre of panel - so can't be used BEFORE panel->Fit()
39 void Centre(int direction = wxHORIZONTAL);
7491d644
VZ
40 void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
41
42 wxFunction GetCallback() { return m_callback; }
9b6dbb09 43
7491d644 44 bool InSetValue() const { return m_inSetValue; }
9b6dbb09
JS
45
46protected:
a4294b78 47 wxFunction m_callback; // Callback associated with the window
9b6dbb09 48
a4294b78
JS
49 bool m_inSetValue; // Motif: prevent callbacks being called while
50 // in SetValue
51
52 DECLARE_EVENT_TABLE()
9b6dbb09
JS
53};
54
55#endif
56 // _WX_CONTROL_H_