2009-01-17 05:43:43 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/osx/button.h
|
2009-01-17 05:43:43 -05:00
|
|
|
// Purpose: wxButton class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2009-06-20 23:01:53 -04:00
|
|
|
#ifndef _WX_OSX_BUTTON_H_
|
|
|
|
#define _WX_OSX_BUTTON_H_
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
|
|
|
|
// Pushbutton
|
2009-06-20 23:01:53 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
|
2009-01-17 05:43:43 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxButton() {}
|
|
|
|
wxButton(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
|
|
|
|
2009-06-19 19:24:51 -04:00
|
|
|
virtual void SetLabel(const wxString& label);
|
2009-01-17 05:43:43 -05:00
|
|
|
virtual wxWindow *SetDefault();
|
|
|
|
virtual void Command(wxCommandEvent& event);
|
|
|
|
|
|
|
|
// osx specific event handling common for all osx-ports
|
2009-06-20 23:01:53 -04:00
|
|
|
|
2009-01-23 03:40:26 -05:00
|
|
|
virtual bool OSXHandleClicked( double timestampsec );
|
2009-01-17 05:43:43 -05:00
|
|
|
|
2012-10-27 21:08:32 -04:00
|
|
|
#if wxOSX_USE_COCOA
|
2012-11-04 18:50:28 -05:00
|
|
|
void OSXUpdateAfterLabelChange(const wxString& label);
|
2012-10-27 21:08:32 -04:00
|
|
|
#endif
|
|
|
|
|
2009-01-17 05:43:43 -05:00
|
|
|
protected:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
|
|
|
};
|
|
|
|
|
2009-06-20 23:01:53 -04:00
|
|
|
// OS X specific class, not part of public wx API
|
|
|
|
class WXDLLIMPEXP_CORE wxDisclosureTriangle : public wxControl
|
2009-01-17 05:43:43 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxDisclosureTriangle(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2009-10-16 12:25:43 -04:00
|
|
|
long style = wxBORDER_NONE,
|
2009-01-17 05:43:43 -05:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2009-10-16 12:25:43 -04:00
|
|
|
long style = wxBORDER_NONE,
|
2009-01-17 05:43:43 -05:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
|
|
|
|
|
|
|
void SetOpen( bool open );
|
|
|
|
bool IsOpen() const;
|
|
|
|
|
|
|
|
// osx specific event handling common for all osx-ports
|
2009-06-20 23:01:53 -04:00
|
|
|
|
2009-01-23 03:40:26 -05:00
|
|
|
virtual bool OSXHandleClicked( double timestampsec );
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const ;
|
|
|
|
};
|
|
|
|
|
2009-06-20 23:01:53 -04:00
|
|
|
#endif // _WX_OSX_BUTTON_H_
|