1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: button.h
|
|
|
|
// Purpose: wxButton class
|
1999-10-13 18:34:18 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-13 18:34:18 -04:00
|
|
|
// Created: 10/13/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-13 18:34:18 -04:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_BUTTON_H_
|
|
|
|
#define _WX_BUTTON_H_
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
// Pushbutton
|
2001-07-06 17:45:11 -04:00
|
|
|
class WXDLLEXPORT wxButton: public wxButtonBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2001-10-22 01:11:09 -04:00
|
|
|
inline wxButton() {}
|
|
|
|
inline wxButton( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsLabel
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
2001-10-22 01:11:09 -04:00
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
2001-10-22 01:11:09 -04:00
|
|
|
,const wxString& rsName = wxButtonNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rsLabel
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,lStyle
|
|
|
|
#if wxUSE_VALIDATORS
|
|
|
|
,rValidator
|
|
|
|
#endif
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-10-22 01:11:09 -04:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsLabel
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = 0
|
1999-11-08 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
2001-10-22 01:11:09 -04:00
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
2001-10-22 01:11:09 -04:00
|
|
|
,const wxString& rsName = wxButtonNameStr
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-10-22 01:11:09 -04:00
|
|
|
virtual ~wxButton();
|
1999-08-02 12:39:18 -04:00
|
|
|
|
2001-10-22 01:11:09 -04:00
|
|
|
virtual void SetDefault(void);
|
|
|
|
static wxSize GetDefaultSize(void);
|
|
|
|
virtual void Command(wxCommandEvent& rEvent);
|
|
|
|
virtual bool OS2Command( WXUINT uParam
|
|
|
|
,WXWORD vId
|
|
|
|
);
|
|
|
|
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
|
|
|
,WXHWND hWnd
|
|
|
|
,WXUINT uCtlColor
|
|
|
|
,WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
void MakeOwnerDrawn(void);
|
1999-08-02 12:39:18 -04:00
|
|
|
|
2001-10-22 01:11:09 -04:00
|
|
|
virtual MRESULT WindowProc( WXUINT uMsg
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-08-02 12:39:18 -04:00
|
|
|
|
1999-10-13 18:34:18 -04:00
|
|
|
protected:
|
|
|
|
|
2002-02-22 18:30:31 -05:00
|
|
|
bool SendClickEvent(void);
|
2002-05-13 14:10:59 -04:00
|
|
|
void SetTmpDefault(void);
|
|
|
|
void UnsetTmpDefault(void);
|
|
|
|
|
|
|
|
static void UpdateDefaultStyle( wxWindow* pWinDefault
|
|
|
|
,wxWindow* pWinOldDefault
|
|
|
|
);
|
|
|
|
|
2002-02-22 18:30:31 -05:00
|
|
|
virtual wxSize DoGetBestSize(void) const;
|
|
|
|
virtual WXDWORD OS2GetStyle( long style
|
|
|
|
,WXDWORD* exstyle
|
|
|
|
) const;
|
2001-07-06 17:45:11 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
2001-10-22 01:11:09 -04:00
|
|
|
}; // end of CLASS wxButton
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_BUTTON_H_
|
2001-10-22 01:11:09 -04:00
|
|
|
|