1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobox.h
|
|
|
|
// Purpose: wxRadioBox class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
1999-06-08 15:10:37 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBOX_H_
|
|
|
|
#define _WX_RADIOBOX_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "radiobox.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
|
|
|
|
|
|
|
// List box item
|
|
|
|
class WXDLLEXPORT wxBitmap ;
|
|
|
|
|
2002-07-28 16:50:37 -04:00
|
|
|
class WXDLLEXPORT wxRadioBox : public wxControl, public wxRadioBoxBase
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
2002-02-05 11:34:33 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
public:
|
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
|
|
|
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
2002-02-05 11:34:33 -05: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
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
|
|
|
}
|
2002-06-04 14:09:20 -04:00
|
|
|
|
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,
|
2002-02-05 11:34:33 -05: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
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
int FindString(const wxString& s) const;
|
|
|
|
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;
|
2002-06-04 14:09:20 -04:00
|
|
|
virtual bool Enable(bool enable = TRUE);
|
1999-02-22 06:01:13 -05:00
|
|
|
void Enable(int item, bool enable);
|
|
|
|
void Show(int item, bool show) ;
|
2002-06-04 14:09:20 -04:00
|
|
|
virtual bool Show(bool show = TRUE) ;
|
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual wxString GetStringSelection() const;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
2001-07-23 16:11:12 -04:00
|
|
|
virtual 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
|
|
|
|
2002-07-28 16:50:37 -04:00
|
|
|
int GetColumnCount() const;
|
|
|
|
int GetRowCount() const;
|
|
|
|
|
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
|
|
|
|
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
|
|
|
virtual void ChangeBackgroundColour();
|
|
|
|
virtual void ChangeForegroundColour();
|
|
|
|
inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
|
|
|
|
inline void SetSel(int i) { m_selectedButton = i; }
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
protected:
|
2002-08-08 05:00:54 -04:00
|
|
|
int m_majorDim;
|
1999-02-22 06:01:13 -05:00
|
|
|
int m_noItems;
|
|
|
|
int m_noRowsOrCols;
|
|
|
|
int m_selectedButton;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
WXWidget* m_radioButtons;
|
|
|
|
wxString* m_radioButtonLabels;
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual void DoSetSize(int x, int y,
|
2002-02-05 11:34:33 -05:00
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_RADIOBOX_H_
|