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
|
|
|
|
2002-07-28 16:50:37 -04:00
|
|
|
class WXDLLEXPORT 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,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
|
|
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,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, title, pos, size, choices,
|
|
|
|
majorDim, style, val, name);
|
|
|
|
}
|
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
~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,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
|
|
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,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
void SetSelection(int N);
|
|
|
|
int GetSelection() const;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
2002-07-28 16:50:37 -04:00
|
|
|
void SetString(int item, const wxString& label) ;
|
|
|
|
wxString GetString(int item) const;
|
2005-02-06 12:38:33 -05:00
|
|
|
virtual bool Enable(bool enable = true);
|
2005-02-21 16:02:41 -05:00
|
|
|
virtual bool Enable(int item, bool enable = true);
|
2005-02-23 11:39:25 -05:00
|
|
|
virtual bool Show(int item, bool show = true);
|
|
|
|
virtual bool Show(bool show = true);
|
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-14 14:44:45 -05:00
|
|
|
virtual size_t 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:
|
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-14 14:44:45 -05:00
|
|
|
size_t 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_
|