1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-04 14:09:20 -04:00
|
|
|
// Name: wx/gtk/radiobox.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
#ifndef _WX_GTK_RADIOBOX_H_
|
|
|
|
#define _WX_GTK_RADIOBOX_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxRadioBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
class WXDLLIMPEXP_CORE wxRadioBox : public wxControl,
|
|
|
|
public wxRadioBoxBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-05-12 16:26:54 -04:00
|
|
|
public:
|
2005-11-30 11:39:23 -05:00
|
|
|
// ctors and dtor
|
2000-07-15 15:51:35 -04:00
|
|
|
wxRadioBox() { Init(); }
|
|
|
|
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,
|
|
|
|
int majorDim = 1,
|
|
|
|
long style = wxRA_HORIZONTAL,
|
2002-02-17 17:45:08 -05:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
2000-07-15 15:51:35 -04:00
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
1998-08-14 06:07:38 -04:00
|
|
|
{
|
2000-07-15 15:51:35 -04:00
|
|
|
Init();
|
|
|
|
|
|
|
|
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
|
1998-08-14 06:07:38 -04:00
|
|
|
}
|
2005-11-30 11:39:23 -05:00
|
|
|
|
2004-01-31 13:21:45 -05:00
|
|
|
wxRadioBox(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
int majorDim = 1,
|
|
|
|
long style = wxRA_HORIZONTAL,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
|
|
|
|
}
|
2000-07-15 15:51:35 -04: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,
|
|
|
|
long style = wxRA_HORIZONTAL,
|
2002-02-17 17:45:08 -05:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
2000-07-15 15:51:35 -04:00
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
2004-01-31 13:21:45 -05:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
int majorDim = 0,
|
|
|
|
long style = wxRA_HORIZONTAL,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
virtual ~wxRadioBox();
|
|
|
|
|
2002-02-17 17:45:08 -05:00
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
// implement wxItemContainerImmutable methods
|
|
|
|
virtual int GetCount() const;
|
2002-02-17 17:45:08 -05:00
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
virtual wxString GetString(int n) const;
|
|
|
|
virtual void SetString(int n, const wxString& s);
|
2002-02-17 17:45:08 -05:00
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
virtual void SetSelection(int n);
|
|
|
|
virtual int GetSelection() const;
|
2002-02-17 17:45:08 -05:00
|
|
|
|
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
// implement wxRadioBoxBase methods
|
|
|
|
virtual bool Show(int n, bool show = true);
|
|
|
|
virtual bool Enable(int n, bool enable = true);
|
|
|
|
|
|
|
|
virtual bool IsItemEnabled(int n) const;
|
|
|
|
virtual bool IsItemShown(int n) const;
|
|
|
|
|
|
|
|
|
|
|
|
// override some base class methods to operate on radiobox itself too
|
2005-01-06 07:41:27 -05:00
|
|
|
virtual bool Show( bool show = true );
|
|
|
|
virtual bool Enable( bool enable = true );
|
2002-02-17 17:45:08 -05:00
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
virtual void SetLabel( const wxString& label );
|
|
|
|
|
2004-05-06 13:26:25 -04:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
1999-11-26 12:41:20 -05:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2002-02-17 17:45:08 -05:00
|
|
|
|
1999-11-26 12:41:20 -05:00
|
|
|
void SetFocus();
|
|
|
|
void GtkDisableEvents();
|
|
|
|
void GtkEnableEvents();
|
1998-09-07 08:29:07 -04:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
2004-06-14 13:34:00 -04:00
|
|
|
void DoApplyWidgetStyle(GtkRcStyle *style);
|
1999-11-26 12:41:20 -05:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
|
|
|
#endif // wxUSE_TOOLTIPS
|
2004-04-01 08:55:21 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
virtual void OnInternalIdle();
|
2002-02-17 17:45:08 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
bool m_hasFocus,
|
|
|
|
m_lostFocus;
|
1998-09-07 20:27:29 -04:00
|
|
|
wxList m_boxes;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2005-02-23 11:39:25 -05:00
|
|
|
// check that the index is valid
|
|
|
|
// FIXME: remove once GTK will derive from wxRadioBoxBase
|
|
|
|
inline bool IsValid(int n) const { return n >= 0 && n < GetCount(); }
|
|
|
|
|
1999-10-14 09:09:01 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2005-11-30 11:39:23 -05:00
|
|
|
#endif // _WX_GTK_RADIOBOX_H_
|
|
|
|
|