1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: control.h
|
|
|
|
// Purpose: wxControl class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
1999-03-30 11:09:48 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CONTROL_H_
|
|
|
|
#define _WX_CONTROL_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "control.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/window.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/validate.h"
|
|
|
|
|
|
|
|
// General item class
|
|
|
|
class WXDLLEXPORT wxControl: public wxWindow
|
|
|
|
{
|
1998-10-18 22:31:48 +00:00
|
|
|
DECLARE_ABSTRACT_CLASS(wxControl)
|
1999-03-30 11:09:48 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
public:
|
1998-10-18 22:31:48 +00:00
|
|
|
wxControl();
|
|
|
|
~wxControl();
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; // Simulates an event
|
|
|
|
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
|
1998-09-18 10:19:10 +00:00
|
|
|
// appropriate event handlers
|
1998-10-18 22:31:48 +00:00
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual wxString GetLabel() const ;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
// Places item in centre of panel - so can't be used BEFORE panel->Fit()
|
|
|
|
void Centre(int direction = wxHORIZONTAL);
|
1999-03-30 11:09:48 +00:00
|
|
|
void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
|
|
|
|
|
|
|
|
wxFunction GetCallback() { return m_callback; }
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-03-30 11:09:48 +00:00
|
|
|
bool InSetValue() const { return m_inSetValue; }
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
protected:
|
1998-10-18 22:31:48 +00:00
|
|
|
wxFunction m_callback; // Callback associated with the window
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
bool m_inSetValue; // Motif: prevent callbacks being called while
|
|
|
|
// in SetValue
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_CONTROL_H_
|