1998-08-07 21:32:13 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: control.h
|
1998-08-12 09:16:21 +00:00
|
|
|
// Purpose: wxControl class
|
|
|
|
// Author: AUTHOR
|
|
|
|
// Modified by:
|
|
|
|
// Created: ??/??/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) AUTHOR
|
1998-08-07 21:32:13 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-12 09:16:21 +00:00
|
|
|
#ifndef _WX_CONTROL_H_
|
|
|
|
#define _WX_CONTROL_H_
|
1998-08-07 21:32:13 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1998-08-12 09:16:21 +00:00
|
|
|
#pragma interface "control.h"
|
1998-08-07 21:32:13 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/window.h"
|
1998-08-12 09:16:21 +00:00
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/validate.h"
|
1998-08-07 21:32:13 +00:00
|
|
|
|
1998-08-12 09:16:21 +00:00
|
|
|
// General item class
|
|
|
|
class WXDLLEXPORT wxControl: public wxWindow
|
|
|
|
{
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxControl)
|
|
|
|
public:
|
|
|
|
wxControl();
|
|
|
|
~wxControl();
|
1998-08-07 21:32:13 +00:00
|
|
|
|
1998-08-12 09:16:21 +00:00
|
|
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) = 0; // Simulates an event
|
|
|
|
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
|
|
|
|
// appropriate event handlers
|
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual wxString GetLabel() const ;
|
1998-08-07 21:32:13 +00:00
|
|
|
|
1998-08-12 09:16:21 +00:00
|
|
|
// Places item in centre of panel - so can't be used BEFORE panel->Fit()
|
|
|
|
void Centre(int direction = wxHORIZONTAL);
|
|
|
|
inline void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
|
1998-08-07 21:32:13 +00:00
|
|
|
|
1998-08-12 09:16:21 +00:00
|
|
|
inline wxFunction GetCallback() { return m_callback; }
|
1998-08-07 21:32:13 +00:00
|
|
|
|
|
|
|
protected:
|
1998-08-12 09:16:21 +00:00
|
|
|
wxFunction m_callback; // Callback associated with the window
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-08-07 21:32:13 +00:00
|
|
|
};
|
|
|
|
|
1998-08-12 09:16:21 +00:00
|
|
|
#endif
|
|
|
|
// _WX_CONTROL_H_
|