1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobox.h
|
|
|
|
// Purpose: wxRadioBox class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_RADIOBOX_H_
|
|
|
|
#define _WX_RADIOBOX_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "radiobox.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
|
|
|
|
|
|
|
// List box item
|
|
|
|
class WXDLLEXPORT wxBitmap ;
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxRadioBox: public wxControl
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
|
|
|
public:
|
|
|
|
wxRadioBox(void);
|
|
|
|
|
|
|
|
#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);
|
|
|
|
|
|
|
|
/*
|
|
|
|
inline wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
|
|
|
int x, int y, int width, int height,
|
|
|
|
int n, wxBitmap **choices,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, (const wxBitmap **)choices, majorDim, style,
|
|
|
|
wxDefaultValidator, name);
|
|
|
|
Callback(func);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
1998-07-04 11:17:59 -04:00
|
|
|
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n = 0, const wxBitmap *choices[] = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
~wxRadioBox(void);
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
|
|
|
|
|
|
|
/*
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n = 0, const wxBitmap *choices[] = NULL,
|
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
1998-05-20 10:12:05 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
|
|
|
*/
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
1998-05-20 10:12:05 -04:00
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
|
|
|
int FindString(const wxString& s) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection(int N);
|
1998-05-20 10:12:05 -04:00
|
|
|
int GetSelection(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
wxString GetString(int N) const;
|
1998-11-28 08:38:40 -05:00
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
1998-11-28 08:38:40 -05:00
|
|
|
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
|
|
|
{ wxWindow::SetSize(rect, sizeFlags); }
|
|
|
|
void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
void GetSize(int *x, int *y) const;
|
1998-11-28 08:38:40 -05:00
|
|
|
wxSize GetSize() const { return wxWindow::GetSize(); }
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
void GetPosition(int *x, int *y) const;
|
1998-11-28 08:38:40 -05:00
|
|
|
wxPoint GetPosition() const { return wxWindow::GetPosition(); }
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
wxString GetLabel(void) const;
|
|
|
|
void SetLabel(const wxString& label);
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetLabel(int item, const wxString& label) ;
|
|
|
|
void SetLabel(int item, wxBitmap *bitmap) ;
|
|
|
|
wxString GetLabel(int item) const;
|
|
|
|
bool Show(bool show);
|
1998-05-20 10:12:05 -04:00
|
|
|
void SetFocus(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
void Enable(bool enable);
|
|
|
|
void Enable(int item, bool enable);
|
|
|
|
void Show(int item, bool show) ;
|
1998-05-20 10:12:05 -04:00
|
|
|
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
|
|
|
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
|
|
|
|
|
|
|
virtual wxString GetStringSelection(void) const;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
|
|
|
inline virtual int Number(void) const { return m_noItems; } ;
|
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
|
|
|
inline int GetNumberOfRowsOrCols(void) const { return m_noRowsOrCols; }
|
1998-07-04 11:17:59 -04:00
|
|
|
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
// Implementation
|
|
|
|
inline WXHWND *GetRadioButtons(void) const { return m_radioButtons; }
|
|
|
|
bool ContainsHWND(WXHWND hWnd) const ;
|
|
|
|
|
1998-08-10 09:48:12 -04:00
|
|
|
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
protected:
|
|
|
|
WXHWND * m_radioButtons;
|
|
|
|
int m_majorDim ;
|
|
|
|
int * m_radioWidth ; // for bitmaps
|
|
|
|
int * m_radioHeight ;
|
|
|
|
|
|
|
|
int m_noItems;
|
|
|
|
int m_noRowsOrCols;
|
|
|
|
int m_selectedButton;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_RADIOBOX_H_
|