2011-03-20 18:05:19 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/osx/radiobox.h
|
|
|
|
// Purpose: wxRadioBox class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBOX_H_
|
|
|
|
#define _WX_RADIOBOX_H_
|
|
|
|
|
|
|
|
// List box item
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBitmap ;
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxRadioButton ;
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxRadioBox: public wxControl, public wxRadioBoxBase
|
|
|
|
{
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxRadioBox);
|
2011-03-20 18:05:19 +00:00
|
|
|
public:
|
|
|
|
// Constructors & destructor
|
|
|
|
wxRadioBox();
|
2016-06-26 05:25:29 +00:00
|
|
|
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
2011-03-20 18:05:19 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
|
|
|
}
|
2016-06-26 05:25:29 +00:00
|
|
|
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
2011-03-20 18:05:19 +00:00
|
|
|
const wxPoint& pos, const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, choices,
|
|
|
|
majorDim, style, val, name);
|
|
|
|
}
|
|
|
|
virtual ~wxRadioBox();
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr);
|
|
|
|
|
|
|
|
// Enabling
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual bool Enable(bool enable = true) wxOVERRIDE;
|
|
|
|
virtual bool Enable(unsigned int item, bool enable = true) wxOVERRIDE;
|
|
|
|
virtual bool IsItemEnabled(unsigned int item) const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// Showing
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual bool Show(bool show = true) wxOVERRIDE;
|
|
|
|
virtual bool Show(unsigned int item, bool show = true) wxOVERRIDE;
|
|
|
|
virtual bool IsItemShown(unsigned int item) const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// Specific functions (in wxWidgets2 reference)
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual void SetSelection(int item) wxOVERRIDE;
|
|
|
|
virtual int GetSelection() const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual unsigned int GetCount() const wxOVERRIDE { return m_noItems; }
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxString GetString(unsigned int item) const wxOVERRIDE;
|
|
|
|
virtual void SetString(unsigned int item, const wxString& label) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxString GetLabel() const wxOVERRIDE;
|
|
|
|
virtual void SetLabel(const wxString& label) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// protect native font of box
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual bool SetFont( const wxFont &font ) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
// Other external functions
|
2016-06-26 05:25:29 +00:00
|
|
|
void Command(wxCommandEvent& event) wxOVERRIDE;
|
|
|
|
void SetFocus() wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// Other variable access functions
|
2016-06-26 05:25:29 +00:00
|
|
|
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
|
|
|
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
void OnRadioButton( wxCommandEvent& event ) ;
|
|
|
|
|
|
|
|
protected:
|
2012-03-18 01:12:27 +00:00
|
|
|
// resolve ambiguity in base classes
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxRadioBoxBase::GetDefaultBorder(); }
|
2012-03-18 01:12:27 +00:00
|
|
|
|
2011-03-20 18:05:19 +00:00
|
|
|
wxRadioButton *m_radioButtonCycle;
|
|
|
|
|
|
|
|
unsigned int m_noItems;
|
|
|
|
int m_noRowsOrCols;
|
|
|
|
|
|
|
|
// Internal functions
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
2016-06-26 05:25:29 +00:00
|
|
|
int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2011-03-20 18:05:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_RADIOBOX_H_
|