1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 16:59:19 -04:00
|
|
|
// Name: wx/msw/radiobox.h
|
1998-05-20 10:12:05 -04:00
|
|
|
// 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
|
1999-07-22 19:39:47 -04:00
|
|
|
// 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__
|
1999-07-22 19:39:47 -04:00
|
|
|
#pragma interface "radiobox.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
1999-02-27 18:52:48 -05:00
|
|
|
class WXDLLEXPORT wxBitmap;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxRadioBox
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-02-22 06:01:13 -05:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
class WXDLLEXPORT wxRadioBox : public wxControl, public wxRadioBoxBase
|
|
|
|
{
|
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
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
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)
|
1999-02-22 06:01:13 -05:00
|
|
|
{
|
2001-06-26 16:59:19 -04:00
|
|
|
(void)Create(parent, id, title, pos, size, n, choices, majorDim,
|
|
|
|
style, val, name);
|
1999-02-22 06:01:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
~wxRadioBox();
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
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);
|
|
|
|
|
|
|
|
// implement the radiobox interface
|
|
|
|
virtual void SetSelection(int n);
|
|
|
|
virtual int GetSelection() const;
|
|
|
|
virtual int GetCount() const;
|
|
|
|
virtual wxString GetString(int n) const;
|
|
|
|
virtual void SetString(int n, const wxString& label);
|
|
|
|
virtual void Enable(int n, bool enable = TRUE);
|
|
|
|
virtual void Show(int n, bool show = TRUE);
|
|
|
|
virtual int GetColumnCount() const;
|
|
|
|
virtual int GetRowCount() const;
|
1999-02-22 06:01:13 -05:00
|
|
|
|
|
|
|
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 SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
|
|
|
void SetButtonFont(const wxFont& font) { SetFont(font); }
|
|
|
|
|
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
|
|
|
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
|
|
|
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
|
|
|
|
1999-07-22 19:39:47 -04:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
|
|
|
|
// FIXME: are they used? missing "Do" prefix?
|
|
|
|
void GetSize(int *x, int *y) const;
|
|
|
|
void GetPosition(int *x, int *y) const;
|
|
|
|
|
1999-12-10 19:43:59 -05:00
|
|
|
virtual bool SetFont(const wxFont& font);
|
|
|
|
|
1999-12-06 07:12:36 -05:00
|
|
|
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
2000-07-15 15:51:35 -04:00
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
2001-06-26 16:59:19 -04:00
|
|
|
WXUINT message,
|
|
|
|
WXWPARAM wParam, WXLPARAM lParam);
|
1999-02-22 06:01:13 -05:00
|
|
|
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
|
|
|
|
1999-02-27 18:52:48 -05:00
|
|
|
// get the number of buttons per column/row
|
1999-07-22 19:39:47 -04:00
|
|
|
int GetNumVer() const;
|
|
|
|
int GetNumHor() const;
|
|
|
|
|
2000-01-23 18:23:46 -05:00
|
|
|
// compatibility ctor
|
1999-07-22 19:39:47 -04:00
|
|
|
#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-02-27 18:52:48 -05:00
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
protected:
|
2000-08-08 02:11:51 -04:00
|
|
|
// subclass one radio button
|
1999-02-27 18:52:48 -05:00
|
|
|
void SubclassRadioButton(WXHWND hWndBtn);
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
// get the max size of radio buttons
|
|
|
|
wxSize GetMaxButtonSize() const;
|
|
|
|
|
|
|
|
// get the total size occupied by the radio box buttons
|
|
|
|
wxSize GetTotalButtonSize(const wxSize& sizeBtn) const;
|
|
|
|
|
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);
|
2000-08-08 02:11:51 -04:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2001-06-26 16:59:19 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_RADIOBOX_H_
|