1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 14:31:55 +00:00
|
|
|
// Name: wx/motif/control.h
|
1998-09-18 10:19:10 +00:00
|
|
|
// Purpose: wxControl class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CONTROL_H_
|
|
|
|
#define _WX_CONTROL_H_
|
|
|
|
|
|
|
|
#include "wx/window.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/validate.h"
|
|
|
|
|
|
|
|
// General item class
|
2000-01-07 14:59:14 +00:00
|
|
|
class WXDLLEXPORT wxControl: public wxControlBase
|
1998-09-18 10:19:10 +00:00
|
|
|
{
|
1998-10-18 22:31:48 +00:00
|
|
|
DECLARE_ABSTRACT_CLASS(wxControl)
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
public:
|
1998-10-18 22:31:48 +00:00
|
|
|
wxControl();
|
1999-12-29 19:34:38 +00:00
|
|
|
wxControl( wxWindow *parent,
|
2002-02-05 16:34:33 +00:00
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint &pos = wxDefaultPosition,
|
|
|
|
const wxSize &size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString &name = wxControlNameStr )
|
2000-01-07 14:59:14 +00:00
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, style, validator, name);
|
|
|
|
}
|
2006-07-25 14:31:55 +00:00
|
|
|
|
2000-01-07 14:59:14 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
2002-02-05 16:34:33 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxControlNameStr);
|
2006-07-25 14:31:55 +00:00
|
|
|
|
2004-05-01 17:06:08 +00:00
|
|
|
// simulates the event, returns true if the event was processed
|
1999-07-23 21:03:02 +00:00
|
|
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
|
2006-07-25 14:31:55 +00:00
|
|
|
|
2004-05-01 17:06:08 +00:00
|
|
|
// calls the callback and appropriate event handlers, returns true if
|
1999-07-23 21:03:02 +00:00
|
|
|
// event was processed
|
|
|
|
virtual bool ProcessCommand(wxCommandEvent& event);
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual wxString GetLabel() const ;
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1999-03-30 11:09:48 +00:00
|
|
|
bool InSetValue() const { return m_inSetValue; }
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
protected:
|
2002-12-08 18:48:05 +00:00
|
|
|
// calls wxControlBase::CreateControl, also sets foreground, background and
|
|
|
|
// font to parent's values
|
|
|
|
bool CreateControl(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
long style,
|
|
|
|
const wxValidator& validator,
|
|
|
|
const wxString& name);
|
|
|
|
|
2004-05-01 17:06:08 +00:00
|
|
|
// native implementation using XtQueryGeometry
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
2003-07-01 12:19:10 +00:00
|
|
|
// Motif: prevent callbacks being called while in SetValue
|
|
|
|
bool m_inSetValue;
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
2003-07-01 12:19:10 +00:00
|
|
|
#endif // _WX_CONTROL_H_
|