1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-11-04 21:13:03 +00:00
|
|
|
// Name: wx/os2/control.h
|
1999-07-29 05:11:30 +00:00
|
|
|
// Purpose: wxControl class
|
1999-09-20 04:49:19 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-09-20 04:49:19 +00:00
|
|
|
// Created: 09/17/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-09-20 04:49:19 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CONTROL_H_
|
|
|
|
#define _WX_CONTROL_H_
|
|
|
|
|
2000-02-25 04:16:19 +00:00
|
|
|
#include "wx/dynarray.h"
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
// General item class
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-09-20 04:49:19 +00:00
|
|
|
DECLARE_ABSTRACT_CLASS(wxControl)
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
public:
|
|
|
|
wxControl();
|
2001-04-18 20:46:23 +00:00
|
|
|
wxControl( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxControlNameStr
|
|
|
|
)
|
2000-01-05 14:07:15 +00:00
|
|
|
{
|
2005-11-04 21:13:03 +00:00
|
|
|
Create( pParent, vId, rPos, rSize, lStyle, rValidator, rsName );
|
2000-01-05 14:07:15 +00:00
|
|
|
}
|
|
|
|
|
2001-04-18 20:46:23 +00:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxControlNameStr
|
|
|
|
);
|
|
|
|
|
2004-02-15 18:00:27 +00:00
|
|
|
virtual void SetLabel(const wxString& rsLabel);
|
2005-11-04 21:13:03 +00:00
|
|
|
virtual wxString GetLabel() const { return m_label; }
|
2004-02-15 18:00:27 +00:00
|
|
|
|
2001-04-18 20:46:23 +00:00
|
|
|
//
|
|
|
|
// Simulates an event
|
|
|
|
//
|
|
|
|
virtual void Command(wxCommandEvent& rEvent) { ProcessCommand(rEvent); }
|
|
|
|
|
|
|
|
//
|
|
|
|
// Implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
// Calls the callback and appropriate event handlers
|
|
|
|
//
|
|
|
|
bool ProcessCommand(wxCommandEvent& rEvent);
|
|
|
|
|
|
|
|
//
|
|
|
|
// For ownerdraw items
|
|
|
|
//
|
2005-11-04 21:13:03 +00:00
|
|
|
virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* WXUNUSED(pItem)) { return false; };
|
2002-09-03 22:26:53 +00:00
|
|
|
virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT* WXUNUSED(pItem)) { return 0L; };
|
2001-04-18 20:46:23 +00:00
|
|
|
|
|
|
|
wxArrayLong& GetSubcontrols() { return m_aSubControls; }
|
|
|
|
void OnEraseBackground(wxEraseEvent& rEvent);
|
|
|
|
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
|
|
|
,WXHWND pWnd
|
|
|
|
,WXUINT nCtlColor
|
|
|
|
,WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-10-22 05:11:09 +00:00
|
|
|
public:
|
2001-04-18 20:46:23 +00:00
|
|
|
//
|
|
|
|
// For controls like radiobuttons which are really composite
|
|
|
|
//
|
|
|
|
wxArrayLong m_aSubControls;
|
|
|
|
|
|
|
|
virtual wxSize DoGetBestSize(void) const;
|
|
|
|
|
2002-02-22 23:30:31 +00:00
|
|
|
//
|
|
|
|
// Create the control of the given PM class
|
|
|
|
//
|
|
|
|
bool OS2CreateControl( const wxChar* zClassname
|
|
|
|
,const wxString& rsLabel
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,long lStyle
|
2001-11-16 18:40:45 +00:00
|
|
|
);
|
2001-04-18 20:46:23 +00:00
|
|
|
//
|
2005-11-04 21:13:03 +00:00
|
|
|
// Create the control of the given class with the given style, returns false
|
2001-04-18 20:46:23 +00:00
|
|
|
// if creation failed.
|
|
|
|
//
|
|
|
|
bool OS2CreateControl( const wxChar* zClassname
|
|
|
|
,WXDWORD dwStyle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,const wxString& rsLabel = wxEmptyString
|
|
|
|
,WXDWORD dwExstyle = (WXDWORD)-1
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
2002-02-22 23:30:31 +00:00
|
|
|
// Default style for the control include WS_TABSTOP if it AcceptsFocus()
|
2001-04-18 20:46:23 +00:00
|
|
|
//
|
2002-02-22 23:30:31 +00:00
|
|
|
virtual WXDWORD OS2GetStyle( long lStyle
|
|
|
|
,WXDWORD* pdwExstyle
|
|
|
|
) const;
|
1999-09-20 04:49:19 +00:00
|
|
|
|
2001-10-22 05:11:09 +00:00
|
|
|
inline int GetXComp(void) const {return m_nXComp;}
|
|
|
|
inline int GetYComp(void) const {return m_nYComp;}
|
|
|
|
inline void SetXComp(const int nXComp) {m_nXComp = nXComp;}
|
|
|
|
inline void SetYComp(const int nYComp) {m_nYComp = nYComp;}
|
|
|
|
|
1999-09-20 04:49:19 +00:00
|
|
|
private:
|
2005-11-04 21:13:03 +00:00
|
|
|
int m_nXComp;
|
|
|
|
int m_nYComp;
|
|
|
|
|
|
|
|
wxString m_label;
|
2006-01-04 22:46:06 +00:00
|
|
|
WXDWORD m_dwStyle;
|
2005-11-04 21:13:03 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2001-04-18 20:46:23 +00:00
|
|
|
}; // end of wxControl
|
1999-09-20 04:49:19 +00:00
|
|
|
|
2001-04-18 20:46:23 +00:00
|
|
|
#endif // _WX_CONTROL_H_
|