1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-09-27 12:54:43 -04:00
|
|
|
// Name: wx/motif/radiobox.h
|
1998-09-18 06:19:10 -04:00
|
|
|
// Purpose: wxRadioBox class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2005-02-16 05:14:42 -05:00
|
|
|
#ifndef _WX_MOTIF_RADIOBOX_H_
|
|
|
|
#define _WX_MOTIF_RADIOBOX_H_
|
1998-09-18 06:19:10 -04:00
|
|
|
|
2003-09-11 17:05:19 -04:00
|
|
|
#ifndef wxWIDGET_ARRAY_DEFINED
|
|
|
|
#define wxWIDGET_ARRAY_DEFINED
|
1998-09-18 06:19:10 -04:00
|
|
|
|
2003-09-11 17:05:19 -04:00
|
|
|
#include "wx/dynarray.h"
|
2005-02-16 05:14:42 -05:00
|
|
|
WX_DEFINE_ARRAY_PTR(WXWidget, wxWidgetArray);
|
|
|
|
#endif // wxWIDGET_ARRAY_DEFINED
|
2003-09-11 17:05:19 -04:00
|
|
|
|
|
|
|
#include "wx/arrstr.h"
|
1998-09-18 06:19:10 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, public wxRadioBoxBase
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
|
|
|
public:
|
2003-09-11 17:05:19 -04:00
|
|
|
wxRadioBox() { Init(); }
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
2003-09-11 17:05:19 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
2009-06-03 18:33:32 -04:00
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
2003-09-11 17:05:19 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
1999-02-22 06:01:13 -05:00
|
|
|
{
|
2003-09-11 17:05:19 -04:00
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, title, pos, size, n, choices,
|
|
|
|
majorDim, style, val, name);
|
1999-02-22 06:01:13 -05:00
|
|
|
}
|
2002-06-04 14:09:20 -04: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,
|
2009-06-03 18:33:32 -04:00
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
2004-01-31 13:21:45 -05:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, title, pos, size, choices,
|
|
|
|
majorDim, style, val, name);
|
|
|
|
}
|
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxRadioBox();
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
2003-09-11 17:05:19 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
2009-06-03 18:33:32 -04:00
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
2003-09-11 17:05:19 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
2002-06-04 14:09:20 -04:00
|
|
|
|
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,
|
2009-06-03 18:33:32 -04:00
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
2004-01-31 13:21:45 -05:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
|
|
|
|
2006-03-24 17:50:51 -05:00
|
|
|
// Enabling
|
|
|
|
virtual bool Enable(bool enable = true);
|
|
|
|
virtual bool Enable(unsigned int item, bool enable = true);
|
|
|
|
virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const
|
|
|
|
{
|
|
|
|
/* TODO */
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Showing
|
|
|
|
virtual bool Show(bool show = true);
|
|
|
|
virtual bool Show(unsigned int item, bool show = true);
|
|
|
|
virtual bool IsItemShown(unsigned int WXUNUSED(n)) const
|
|
|
|
{
|
|
|
|
/* TODO */
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual void SetSelection(int n);
|
1999-02-22 06:01:13 -05:00
|
|
|
int GetSelection() const;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual void SetString(unsigned int item, const wxString& label);
|
|
|
|
virtual wxString GetString(unsigned int item) const;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual wxString GetStringSelection() const;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual unsigned int GetCount() const { return m_noItems; } ;
|
1999-02-22 06:01:13 -05:00
|
|
|
void Command(wxCommandEvent& event);
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
|
|
|
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
// Implementation
|
2005-02-06 12:38:33 -05:00
|
|
|
virtual void ChangeFont(bool keepOriginalSize = true);
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual void ChangeBackgroundColour();
|
|
|
|
virtual void ChangeForegroundColour();
|
2003-09-11 17:05:19 -04:00
|
|
|
const wxWidgetArray& GetRadioButtons() const { return m_radioButtons; }
|
2003-03-27 15:17:27 -05:00
|
|
|
void SetSel(int i) { m_selectedButton = i; }
|
|
|
|
virtual WXWidget GetLabelWidget() const { return m_labelWidget; }
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
protected:
|
2007-11-14 09:44:13 -05:00
|
|
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
2005-02-16 05:14:42 -05:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
|
2006-03-23 17:05:23 -05:00
|
|
|
unsigned int m_noItems;
|
1999-02-22 06:01:13 -05:00
|
|
|
int m_noRowsOrCols;
|
|
|
|
int m_selectedButton;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
2003-09-11 17:05:19 -04:00
|
|
|
wxWidgetArray m_radioButtons;
|
2003-03-27 15:17:27 -05:00
|
|
|
WXWidget m_labelWidget;
|
2003-09-11 17:05:19 -04:00
|
|
|
wxArrayString m_radioButtonLabels;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
2005-02-16 05:14:42 -05:00
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
2005-02-16 05:14:42 -05:00
|
|
|
#endif // _WX_MOTIF_RADIOBOX_H_
|