1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-04 18:09:20 +00:00
|
|
|
// Name: wx/gtk/radiobox.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2005-11-30 16:39:23 +00:00
|
|
|
#ifndef _WX_GTK_RADIOBOX_H_
|
|
|
|
#define _WX_GTK_RADIOBOX_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxGTKRadioButtonInfo;
|
2006-06-11 21:13:13 +00:00
|
|
|
|
|
|
|
#include "wx/list.h"
|
|
|
|
|
2006-07-16 18:38:11 +00:00
|
|
|
WX_DECLARE_EXPORTED_LIST(wxGTKRadioButtonInfo, wxRadioBoxButtonsInfoList);
|
2006-06-11 21:13:13 +00:00
|
|
|
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxRadioBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-11-30 16:39:23 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxRadioBox : public wxControl,
|
|
|
|
public wxRadioBoxBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-05-12 20:26:54 +00:00
|
|
|
public:
|
2005-11-30 16:39:23 +00:00
|
|
|
// ctors and dtor
|
2012-09-30 16:55:40 +00:00
|
|
|
wxRadioBox() { }
|
2000-07-15 19:51:35 +00:00
|
|
|
wxRadioBox(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0,
|
|
|
|
const wxString choices[] = (const wxString *) NULL,
|
2009-06-03 22:28:26 +00:00
|
|
|
int majorDim = 0,
|
2009-06-03 22:33:32 +00:00
|
|
|
long style = wxRA_SPECIFY_COLS,
|
2002-02-17 22:45:08 +00:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
2000-07-15 19:51:35 +00:00
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
1998-08-14 10:07:38 +00:00
|
|
|
{
|
2000-07-15 19:51:35 +00:00
|
|
|
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
|
1998-08-14 10:07:38 +00:00
|
|
|
}
|
2005-11-30 16:39:23 +00:00
|
|
|
|
2004-01-31 18:21:45 +00:00
|
|
|
wxRadioBox(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
2009-06-03 22:28:26 +00:00
|
|
|
int majorDim = 0,
|
2009-06-03 22:33:32 +00:00
|
|
|
long style = wxRA_SPECIFY_COLS,
|
2004-01-31 18:21:45 +00:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
|
|
|
|
}
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0,
|
|
|
|
const wxString choices[] = (const wxString *) NULL,
|
|
|
|
int majorDim = 0,
|
2009-06-03 22:33:32 +00:00
|
|
|
long style = wxRA_SPECIFY_COLS,
|
2002-02-17 22:45:08 +00:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
2000-07-15 19:51:35 +00:00
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
2004-01-31 18:21:45 +00:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
int majorDim = 0,
|
2009-06-03 22:33:32 +00:00
|
|
|
long style = wxRA_SPECIFY_COLS,
|
2004-01-31 18:21:45 +00:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
2000-07-15 19:51:35 +00:00
|
|
|
|
2005-11-30 16:39:23 +00:00
|
|
|
virtual ~wxRadioBox();
|
|
|
|
|
2002-02-17 22:45:08 +00:00
|
|
|
|
2005-11-30 16:39:23 +00:00
|
|
|
// implement wxItemContainerImmutable methods
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual unsigned int GetCount() const wxOVERRIDE;
|
2002-02-17 22:45:08 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
|
|
|
|
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
|
2002-02-17 22:45:08 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetSelection(int n) wxOVERRIDE;
|
|
|
|
virtual int GetSelection() const wxOVERRIDE;
|
2002-02-17 22:45:08 +00:00
|
|
|
|
|
|
|
|
2005-11-30 16:39:23 +00:00
|
|
|
// implement wxRadioBoxBase methods
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool Show(unsigned int n, bool show = true) wxOVERRIDE;
|
|
|
|
virtual bool Enable(unsigned int n, bool enable = true) wxOVERRIDE;
|
2005-11-30 16:39:23 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool IsItemEnabled(unsigned int n) const wxOVERRIDE;
|
|
|
|
virtual bool IsItemShown(unsigned int n) const wxOVERRIDE;
|
2005-11-30 16:39:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
// override some base class methods to operate on radiobox itself too
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool Show( bool show = true ) wxOVERRIDE;
|
|
|
|
virtual bool Enable( bool enable = true ) wxOVERRIDE;
|
2002-02-17 22:45:08 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetLabel( const wxString& label ) wxOVERRIDE;
|
2005-11-30 16:39:23 +00:00
|
|
|
|
2004-05-06 17:26:25 +00:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual int GetItemFromPoint( const wxPoint& pt ) const wxOVERRIDE;
|
2006-06-11 21:13:13 +00:00
|
|
|
#if wxUSE_HELP
|
|
|
|
// override virtual wxWindow::GetHelpTextAtPoint to use common platform independent
|
|
|
|
// wxRadioBoxBase::DoGetHelpTextAtPoint from the platform independent
|
|
|
|
// base class-interface wxRadioBoxBase.
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxString GetHelpTextAtPoint(const wxPoint & pt, wxHelpEvent::Origin origin) const wxOVERRIDE
|
2006-06-11 21:13:13 +00:00
|
|
|
{
|
|
|
|
return wxRadioBoxBase::DoGetHelpTextAtPoint( this, pt, origin );
|
|
|
|
}
|
|
|
|
#endif // wxUSE_HELP
|
|
|
|
|
1999-11-26 17:41:20 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2002-02-17 22:45:08 +00:00
|
|
|
|
1999-11-26 17:41:20 +00:00
|
|
|
void GtkDisableEvents();
|
|
|
|
void GtkEnableEvents();
|
|
|
|
#if wxUSE_TOOLTIPS
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void GTKApplyToolTip(const char* tip) wxOVERRIDE;
|
1999-11-26 17:41:20 +00:00
|
|
|
#endif // wxUSE_TOOLTIPS
|
2004-04-01 13:55:21 +00:00
|
|
|
|
2006-06-11 21:13:13 +00:00
|
|
|
wxRadioBoxButtonsInfoList m_buttonsInfo;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
protected:
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
|
2007-11-14 14:44:13 +00:00
|
|
|
|
2006-05-04 23:40:06 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoSetItemToolTip(unsigned int n, wxToolTip *tooltip) wxOVERRIDE;
|
2006-05-04 23:40:06 +00:00
|
|
|
#endif
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
|
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
2006-02-08 21:47:09 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool GTKNeedsToFilterSameWindowFocus() const wxOVERRIDE { return true; }
|
2008-03-14 01:10:43 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool GTKWidgetNeedsMnemonic() const wxOVERRIDE;
|
|
|
|
virtual void GTKWidgetDoSetMnemonic(GtkWidget* w) wxOVERRIDE;
|
2006-03-12 14:21:19 +00:00
|
|
|
|
1999-10-14 13:09:01 +00:00
|
|
|
private:
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxRadioBox);
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2005-11-30 16:39:23 +00:00
|
|
|
#endif // _WX_GTK_RADIOBOX_H_
|