1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobox.h
|
|
|
|
// Purpose: wxRadioBox class
|
1999-10-12 18:49:24 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-12 18:49:24 -04:00
|
|
|
// Created: 10/12/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 18:49:24 -04:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBOX_H_
|
|
|
|
#define _WX_RADIOBOX_H_
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
// List box item
|
1999-08-02 00:44:01 -04:00
|
|
|
class WXDLLEXPORT wxBitmap ;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
class WXDLLEXPORT wxRadioBox: public wxControl
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
1999-08-02 00:44:01 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
1999-07-29 01:11:30 -04:00
|
|
|
public:
|
1999-08-02 00:44:01 -04: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 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-08-02 00:44:01 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
1999-08-02 00:44:01 -04: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 00:18:15 -05:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-08-02 00:44:01 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
1999-11-08 00:18:15 -05:00
|
|
|
#endif
|
1999-08-02 00:44:01 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
virtual bool OS2Command(WXUINT param, WXWORD id);
|
1999-10-15 00:07:54 -04:00
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1999-10-12 18:49:24 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
int FindString(const wxString& s) const;
|
|
|
|
void SetSelection(int N);
|
|
|
|
int GetSelection() const;
|
|
|
|
wxString GetString(int N) const;
|
1999-10-12 18:49:24 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
void GetSize(int *x, int *y) const;
|
|
|
|
void GetPosition(int *x, int *y) const;
|
1999-10-12 18:49:24 -04:00
|
|
|
|
1999-10-15 00:07:54 -04:00
|
|
|
void SetLabel(int item, const wxString& label);
|
|
|
|
void SetLabel(int item, wxBitmap *bitmap);
|
1999-08-02 00:44:01 -04: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 01:11:30 -04:00
|
|
|
|
1999-10-15 00:07:54 -04: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 01:11:30 -04:00
|
|
|
protected:
|
1999-10-12 18:49:24 -04:00
|
|
|
void SubclassRadioButton(WXHWND hWndBtn);
|
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
WXHWND * m_radioButtons;
|
|
|
|
int m_majorDim ;
|
1999-10-12 18:49:24 -04:00
|
|
|
int * m_radioWidth; // for bitmaps
|
|
|
|
int * m_radioHeight;
|
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
int m_noItems;
|
|
|
|
int m_noRowsOrCols;
|
|
|
|
int m_selectedButton;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1999-10-15 00:07:54 -04:00
|
|
|
private:
|
|
|
|
virtual void SetLabel(const wxString& label)
|
|
|
|
{ wxWindowBase::SetLabel(label); }
|
|
|
|
wxString GetLabel() const
|
|
|
|
{ return(wxWindowBase::GetLabel()); }
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_RADIOBOX_H_
|