1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 20:59:19 +00:00
|
|
|
// Name: wx/msw/button.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-06-14 13:00:42 +00:00
|
|
|
#ifndef _WX_MSW_BUTTON_H_
|
|
|
|
#define _WX_MSW_BUTTON_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-17 21:21:52 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 14:12:05 +00:00
|
|
|
// Pushbutton
|
1999-06-17 21:21:52 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-02-22 11:01:13 +00:00
|
|
|
public:
|
2011-02-27 12:47:36 +00:00
|
|
|
wxButton() { Init(); }
|
2001-06-26 20:59:19 +00:00
|
|
|
wxButton(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
2004-08-30 14:42:51 +00:00
|
|
|
const wxString& label = wxEmptyString,
|
2001-06-26 20:59:19 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
1999-02-22 11:01:13 +00:00
|
|
|
{
|
2011-02-27 12:47:36 +00:00
|
|
|
Init();
|
2009-06-15 04:23:54 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
2004-08-19 17:39:28 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
2004-08-30 14:42:51 +00:00
|
|
|
const wxString& label = wxEmptyString,
|
2001-06-26 20:59:19 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-06-17 21:21:52 +00:00
|
|
|
virtual ~wxButton();
|
|
|
|
|
2007-04-08 22:18:35 +00:00
|
|
|
virtual wxWindow *SetDefault();
|
1999-06-17 21:21:52 +00:00
|
|
|
|
|
|
|
// implementation from now on
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void Command(wxCommandEvent& event);
|
2004-02-25 10:45:02 +00:00
|
|
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
1999-12-21 01:44:45 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
protected:
|
2004-08-19 17:39:28 +00:00
|
|
|
// send a notification event, return true if processed
|
1999-06-17 21:21:52 +00:00
|
|
|
bool SendClickEvent();
|
|
|
|
|
2002-05-11 22:31:05 +00:00
|
|
|
// default button handling
|
|
|
|
void SetTmpDefault();
|
|
|
|
void UnsetTmpDefault();
|
|
|
|
|
2002-08-22 20:34:29 +00:00
|
|
|
// set or unset BS_DEFPUSHBUTTON style
|
|
|
|
static void SetDefaultStyle(wxButton *btn, bool on);
|
2002-05-11 22:31:05 +00:00
|
|
|
|
2010-02-08 19:52:00 +00:00
|
|
|
virtual bool DoGetAuthNeeded() const;
|
|
|
|
virtual void DoSetAuthNeeded(bool show);
|
2011-02-27 12:48:26 +00:00
|
|
|
|
2010-02-08 19:52:00 +00:00
|
|
|
// true if the UAC symbol is shown
|
|
|
|
bool m_authNeeded;
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
private:
|
2011-02-27 12:47:36 +00:00
|
|
|
void Init()
|
|
|
|
{
|
2011-02-27 12:47:43 +00:00
|
|
|
m_authNeeded = false;
|
2011-02-27 12:47:36 +00:00
|
|
|
}
|
|
|
|
|
2011-12-11 17:03:56 +00:00
|
|
|
void OnCharHook(wxKeyEvent& event);
|
|
|
|
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
2010-08-17 14:48:50 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2011-06-14 13:00:42 +00:00
|
|
|
#endif // _WX_MSW_BUTTON_H_
|