1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-09-27 12:54:43 -04:00
|
|
|
// Name: wx/os2/radiobox.h
|
1999-07-29 01:11:30 -04:00
|
|
|
// 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
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBOX_H_
|
|
|
|
#define _WX_RADIOBOX_H_
|
|
|
|
|
|
|
|
// List box item
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBitmap ;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-07-06 17:45:11 -04:00
|
|
|
class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2001-12-17 17:56:41 -05:00
|
|
|
wxRadioBox();
|
|
|
|
|
|
|
|
inline wxRadioBox( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,int nNum = 0
|
|
|
|
,const wxString asChoices[] = NULL
|
|
|
|
,int nMajorDim = 0
|
|
|
|
,long lStyle = wxRA_HORIZONTAL
|
|
|
|
,const wxValidator& rVal = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxRadioBoxNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rsTitle
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,nNum
|
|
|
|
,asChoices
|
|
|
|
,nMajorDim
|
|
|
|
,lStyle
|
|
|
|
,rVal
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2004-01-31 13:21:45 -05:00
|
|
|
inline wxRadioBox( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,const wxArrayString& asChoices
|
|
|
|
,int nMajorDim = 0
|
|
|
|
,long lStyle = wxRA_HORIZONTAL
|
|
|
|
,const wxValidator& rVal = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxRadioBoxNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rsTitle
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,asChoices
|
|
|
|
,nMajorDim
|
|
|
|
,lStyle
|
|
|
|
,rVal
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxRadioBox();
|
2001-12-17 17:56:41 -05:00
|
|
|
|
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,int nNum = 0
|
|
|
|
,const wxString asChoices[] = NULL
|
|
|
|
,int nMajorDim = 0
|
|
|
|
,long lStyle = wxRA_HORIZONTAL
|
|
|
|
,const wxValidator& rVal = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxRadioBoxNameStr
|
|
|
|
);
|
|
|
|
|
2004-01-31 13:21:45 -05:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,const wxArrayString& asChoices
|
|
|
|
,int nMajorDim = 0
|
|
|
|
,long lStyle = wxRA_HORIZONTAL
|
|
|
|
,const wxValidator& rVal = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxRadioBoxNameStr
|
|
|
|
);
|
|
|
|
|
2006-03-24 17:50:51 -05:00
|
|
|
// Enabling
|
2005-09-27 12:54:43 -04:00
|
|
|
virtual bool Enable(bool bEnable = true);
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual bool Enable(unsigned int nItem, bool bEnable = true);
|
2006-03-24 17:50:51 -05:00
|
|
|
virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const
|
|
|
|
{
|
|
|
|
/* TODO */
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Showing
|
|
|
|
virtual bool Show(bool bShow = true);
|
|
|
|
virtual bool Show(unsigned int nItem, bool bShow = true);
|
|
|
|
virtual bool IsItemShown(unsigned int WXUNUSED(n)) const
|
|
|
|
{
|
|
|
|
/* TODO */
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Command(wxCommandEvent& rEvent);
|
|
|
|
bool ContainsHWND(WXHWND hWnd) const;
|
2001-12-17 17:56:41 -05:00
|
|
|
|
|
|
|
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
|
|
|
,WXHWND hWnd
|
|
|
|
,WXUINT uCtlColor
|
|
|
|
,WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
virtual bool OS2Command( WXUINT uParam
|
|
|
|
,WXWORD wId
|
|
|
|
);
|
|
|
|
void SendNotificationEvent(void);
|
|
|
|
MRESULT WindowProc( WXUINT uMsg
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual unsigned int GetCount() const;
|
2001-12-17 17:56:41 -05:00
|
|
|
inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
|
|
|
|
int GetSelection(void) const;
|
2006-03-23 17:05:23 -05:00
|
|
|
void GetSize(int* pnX, int* pnY) const;
|
2001-12-21 13:09:02 -05:00
|
|
|
inline int GetSizeFlags(void) const { return m_nSizeFlags; }
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual wxString GetString(unsigned int nIndex) const;
|
2001-12-17 17:56:41 -05:00
|
|
|
virtual wxString GetStringSelection(void) const;
|
|
|
|
|
|
|
|
inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
|
|
|
|
void SetFocus(void);
|
|
|
|
virtual bool SetFont(const wxFont& rFont);
|
|
|
|
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
2006-03-23 17:05:23 -05:00
|
|
|
virtual void SetSelection(int nIndex);
|
|
|
|
virtual void SetString(unsigned int nNum, const wxString& rsLabel);
|
2005-11-04 16:13:03 -05:00
|
|
|
virtual bool SetStringSelection(const wxString& rsStr);
|
2001-12-17 17:56:41 -05:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
virtual void SetLabel(const wxString& rsLabel)
|
|
|
|
{ wxControl::SetLabel(rsLabel); }
|
|
|
|
virtual wxString GetLabel() const
|
|
|
|
{ return wxControl::GetLabel(); }
|
1999-08-02 00:44:01 -04:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
void SetLabel( int nItem, const wxString& rsLabel );
|
|
|
|
void SetLabel( int item, wxBitmap* pBitmap );
|
|
|
|
wxString GetLabel(int nItem) const;
|
1999-10-15 00:07:54 -04:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
protected:
|
2007-11-14 09:44:13 -05:00
|
|
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
2001-12-17 17:56:41 -05:00
|
|
|
virtual wxSize DoGetBestSize(void) const;
|
|
|
|
virtual void DoSetSize( int nX
|
|
|
|
,int nY
|
|
|
|
,int nWidth
|
|
|
|
,int nHeight
|
|
|
|
,int nSizeFlags = wxSIZE_AUTO
|
|
|
|
);
|
2005-11-04 16:13:03 -05:00
|
|
|
wxSize GetMaxButtonSize(void) const;
|
|
|
|
wxSize GetTotalButtonSize(const wxSize& rSizeBtn) const;
|
|
|
|
void SubclassRadioButton(WXHWND hWndBtn);
|
2001-12-17 17:56:41 -05:00
|
|
|
|
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
WXHWND* m_ahRadioButtons;
|
|
|
|
int* m_pnRadioWidth; // for bitmaps
|
|
|
|
int* m_pnRadioHeight;
|
|
|
|
int m_nSelectedButton;
|
|
|
|
int m_nSizeFlags;
|
1999-10-12 18:49:24 -04:00
|
|
|
|
1999-10-15 00:07:54 -04:00
|
|
|
private:
|
2001-12-17 17:56:41 -05:00
|
|
|
|
2006-03-23 17:05:23 -05:00
|
|
|
unsigned int m_nNoItems;
|
2006-03-14 14:44:45 -05:00
|
|
|
|
2001-12-17 17:56:41 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
|
|
|
}; // end of wxRadioBox
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2005-11-04 16:13:03 -05:00
|
|
|
#endif // _WX_RADIOBOX_H_
|