1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobox.h
|
|
|
|
// Purpose: wxRadioBox class
|
1999-10-12 22:49:24 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-12 22:49:24 +00:00
|
|
|
// Created: 10/12/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 22:49:24 +00:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBOX_H_
|
|
|
|
#define _WX_RADIOBOX_H_
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// List box item
|
1999-08-02 04:44:01 +00:00
|
|
|
class WXDLLEXPORT wxBitmap ;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-08-02 04:44:01 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
1999-07-29 05:11:30 +00:00
|
|
|
public:
|
1999-08-02 04:44:01 +00:00
|
|
|
wxRadioBox();
|
|
|
|
|
|
|
|
inline wxRadioBox(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_HORIZONTAL,
|
1999-11-08 05:18:15 +00:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-08-02 04:44:01 +00:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
1999-11-08 05:18:15 +00:00
|
|
|
#endif
|
1999-08-02 04:44:01 +00:00
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
~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_HORIZONTAL,
|
1999-11-08 05:18:15 +00:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-08-02 04:44:01 +00:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
1999-11-08 05:18:15 +00:00
|
|
|
#endif
|
1999-08-02 04:44:01 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
virtual bool OS2Command(WXUINT param, WXWORD id);
|
1999-10-15 04:07:54 +00:00
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1999-10-12 22:49:24 +00:00
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
int FindString(const wxString& s) const;
|
|
|
|
void SetSelection(int N);
|
|
|
|
int GetSelection() const;
|
2001-07-06 21:45:11 +00:00
|
|
|
virtual int GetCount() const;
|
1999-08-02 04:44:01 +00:00
|
|
|
wxString GetString(int N) const;
|
2001-07-06 21:45:11 +00:00
|
|
|
virtual void SetString(int n, const wxString& label);
|
|
|
|
virtual int GetColumnCount() const;
|
|
|
|
virtual int GetRowCount() const;
|
1999-10-12 22:49:24 +00:00
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
void GetSize(int *x, int *y) const;
|
|
|
|
void GetPosition(int *x, int *y) const;
|
1999-10-12 22:49:24 +00:00
|
|
|
|
1999-10-15 04:07:54 +00:00
|
|
|
void SetLabel(int item, const wxString& label);
|
|
|
|
void SetLabel(int item, wxBitmap *bitmap);
|
1999-08-02 04:44:01 +00:00
|
|
|
wxString GetLabel(int item) const;
|
|
|
|
bool Show(bool show);
|
|
|
|
void SetFocus();
|
|
|
|
bool Enable(bool enable);
|
|
|
|
void Enable(int item, bool enable);
|
|
|
|
void Show(int item, bool show) ;
|
|
|
|
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
|
|
|
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
|
|
|
|
|
|
|
virtual wxString GetStringSelection() const;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
|
|
|
inline virtual int Number() const { return m_noItems; } ;
|
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
|
|
|
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
|
|
|
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-15 04:07:54 +00:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
WXHWND *GetRadioButtons() const { return m_radioButtons; }
|
|
|
|
bool ContainsHWND(WXHWND hWnd) const;
|
|
|
|
void SendNotificationEvent();
|
|
|
|
|
|
|
|
// get the number of buttons per column/row
|
|
|
|
int GetNumVer() const;
|
|
|
|
int GetNumHor() const;
|
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY
|
|
|
|
wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
|
|
|
int x = -1, int y = -1, int width = -1, int height = -1,
|
|
|
|
int n = 0, char **choices = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
|
|
|
|
#endif // WXWIN_COMPATIBILITY
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
protected:
|
1999-10-12 22:49:24 +00:00
|
|
|
void SubclassRadioButton(WXHWND hWndBtn);
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
WXHWND * m_radioButtons;
|
|
|
|
int m_majorDim ;
|
1999-10-12 22:49:24 +00:00
|
|
|
int * m_radioWidth; // for bitmaps
|
|
|
|
int * m_radioHeight;
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
int m_noItems;
|
|
|
|
int m_noRowsOrCols;
|
|
|
|
int m_selectedButton;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-12 22:49:24 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1999-10-15 04:07:54 +00:00
|
|
|
private:
|
|
|
|
virtual void SetLabel(const wxString& label)
|
|
|
|
{ wxWindowBase::SetLabel(label); }
|
|
|
|
wxString GetLabel() const
|
|
|
|
{ return(wxWindowBase::GetLabel()); }
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_RADIOBOX_H_
|