1999-07-26 23:02:32 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/control.h
|
|
|
|
// Purpose: wxControl common interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 26.07.99
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) wxWindows team
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_CONTROL_H_BASE_
|
|
|
|
#define _WX_CONTROL_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-10-12 21:52:17 +00:00
|
|
|
#pragma interface "controlbase.h"
|
1999-07-26 23:02:32 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if wxUSE_CONTROLS
|
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/window.h" // base class
|
|
|
|
|
2001-07-02 15:19:03 +00:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxControl is the base class for all controls
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxControlBase : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
2001-06-26 20:59:19 +00:00
|
|
|
// Create() function adds the validator parameter
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxControlNameStr);
|
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
// simulates the event of given type (i.e. wxButton::Command() is just as
|
|
|
|
// if the button was clicked)
|
|
|
|
virtual void Command(wxCommandEvent &event);
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
// get the control alignment (left/right/centre, top/bottom/centre)
|
|
|
|
int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
|
|
|
|
|
2001-07-15 18:47:13 +00:00
|
|
|
#ifdef __DARWIN__
|
|
|
|
virtual ~wxControlBase() { }
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif
|
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
protected:
|
1999-11-11 00:25:57 +00:00
|
|
|
// creates the control (calls wxWindowBase::CreateBase inside) and adds it
|
|
|
|
// to the list of parents children
|
1999-07-26 23:02:32 +00:00
|
|
|
bool CreateControl(wxWindowBase *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
long style,
|
|
|
|
const wxValidator& validator,
|
|
|
|
const wxString& name);
|
|
|
|
|
|
|
|
// inherit colour and font settings from the parent window
|
|
|
|
void InheritAttributes();
|
2000-02-25 23:49:41 +00:00
|
|
|
|
|
|
|
// initialize the common fields of wxCommandEvent
|
|
|
|
void InitCommandEvent(wxCommandEvent& event) const;
|
1999-07-26 23:02:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// include platform-dependent wxControl declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-05-09 22:17:03 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/control.h"
|
|
|
|
#elif defined(__WXMSW__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/msw/control.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/motif/control.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXGTK__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/gtk/control.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/mac/control.h"
|
1999-07-28 03:38:12 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/control.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXSTUBS__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/stubs/control.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_CONTROLS
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_CONTROL_H_BASE_
|