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
|
1999-02-27 18:52:48 -05:00
|
|
|
class WXDLLEXPORT wxBitmap;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
class WXDLLEXPORT wxRadioBox : public wxControl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-02-22 06:01:13 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
public:
|
1999-02-22 06:01:13 -05:00
|
|
|
wxRadioBox();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY
|
1999-02-22 06:01:13 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
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,
|
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
|
|
|
|
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
1999-02-27 18:52:48 -05:00
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1999-02-22 06:01:13 -05:00
|
|
|
|
|
|
|
int FindString(const wxString& s) const;
|
|
|
|
void SetSelection(int N);
|
|
|
|
int GetSelection() const;
|
|
|
|
wxString GetString(int N) const;
|
|
|
|
|
|
|
|
void GetSize(int *x, int *y) const;
|
|
|
|
void GetPosition(int *x, int *y) const;
|
|
|
|
|
1999-02-27 18:52:48 -05:00
|
|
|
void SetLabel(int item, const wxString& label);
|
|
|
|
void SetLabel(int item, wxBitmap *bitmap);
|
1999-02-22 06:01:13 -05:00
|
|
|
wxString GetLabel(int item) const;
|
|
|
|
bool Show(bool show);
|
|
|
|
void SetFocus();
|
1999-05-09 20:42:57 -04:00
|
|
|
bool Enable(bool enable);
|
1999-02-22 06:01:13 -05:00
|
|
|
void Enable(int item, bool enable);
|
1999-02-27 18:52:48 -05:00
|
|
|
void Show(int item, bool show);
|
1999-02-22 06:01:13 -05:00
|
|
|
void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
|
|
|
void SetButtonFont(const wxFont& font) { SetFont(font); }
|
|
|
|
|
|
|
|
virtual wxString GetStringSelection() const;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
1999-02-27 18:52:48 -05:00
|
|
|
virtual int Number() const { return m_noItems; };
|
1999-02-22 06:01:13 -05:00
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
|
|
|
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
|
|
|
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
|
|
|
|
|
|
|
// Implementation
|
|
|
|
WXHWND *GetRadioButtons() const { return m_radioButtons; }
|
1999-02-27 18:52:48 -05:00
|
|
|
bool ContainsHWND(WXHWND hWnd) const;
|
1999-04-17 16:29:40 -04:00
|
|
|
void SendNotificationEvent();
|
1999-02-22 06:01:13 -05:00
|
|
|
|
|
|
|
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
1998-08-10 09:48:12 -04:00
|
|
|
|
1999-02-27 18:52:48 -05:00
|
|
|
// get the number of buttons per column/row
|
|
|
|
inline int GetNumVer() const;
|
|
|
|
inline int GetNumHor() const;
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
protected:
|
1999-02-27 18:52:48 -05:00
|
|
|
void SubclassRadioButton(WXHWND hWndBtn);
|
|
|
|
|
1999-02-22 06:01:13 -05:00
|
|
|
WXHWND * m_radioButtons;
|
1999-02-27 18:52:48 -05:00
|
|
|
int m_majorDim;
|
|
|
|
int * m_radioWidth; // for bitmaps
|
|
|
|
int * m_radioHeight;
|
1999-02-22 06:01:13 -05:00
|
|
|
|
|
|
|
int m_noItems;
|
|
|
|
int m_noRowsOrCols;
|
|
|
|
int m_selectedButton;
|
|
|
|
|
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_RADIOBOX_H_
|