1 ///////////////////////////////////////////////////////////////////////////// 
   2 // Name:        wx/gtk/radiobox.h 
   4 // Author:      Robert Roebling 
   6 // Copyright:   (c) 1998 Robert Roebling 
   7 // Licence:     wxWindows licence 
   8 ///////////////////////////////////////////////////////////////////////////// 
  10 #ifndef _WX_GTK_RADIOBOX_H_ 
  11 #define _WX_GTK_RADIOBOX_H_ 
  13 #include "wx/bitmap.h" 
  15 class WXDLLIMPEXP_FWD_CORE wxGTKRadioButtonInfo
; 
  19 WX_DECLARE_EXPORTED_LIST(wxGTKRadioButtonInfo
, wxRadioBoxButtonsInfoList
); 
  22 //----------------------------------------------------------------------------- 
  24 //----------------------------------------------------------------------------- 
  26 class WXDLLIMPEXP_CORE wxRadioBox 
: public wxControl
, 
  31     wxRadioBox() { Init(); } 
  32     wxRadioBox(wxWindow 
*parent
, 
  34                const wxString
& title
, 
  35                const wxPoint
& pos 
= wxDefaultPosition
, 
  36                const wxSize
& size 
= wxDefaultSize
, 
  38                const wxString choices
[] = (const wxString 
*) NULL
, 
  40                long style 
= wxRA_HORIZONTAL
, 
  41                const wxValidator
& val 
= wxDefaultValidator
, 
  42                const wxString
& name 
= wxRadioBoxNameStr
) 
  46         Create( parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name 
); 
  49     wxRadioBox(wxWindow 
*parent
, 
  51                const wxString
& title
, 
  54                const wxArrayString
& choices
, 
  56                long style 
= wxRA_HORIZONTAL
, 
  57                const wxValidator
& val 
= wxDefaultValidator
, 
  58                const wxString
& name 
= wxRadioBoxNameStr
) 
  62         Create( parent
, id
, title
, pos
, size
, choices
, majorDim
, style
, val
, name 
); 
  65     bool Create(wxWindow 
*parent
, 
  67                 const wxString
& title
, 
  68                 const wxPoint
& pos 
= wxDefaultPosition
, 
  69                 const wxSize
& size 
= wxDefaultSize
, 
  71                 const wxString choices
[] = (const wxString 
*) NULL
, 
  73                 long style 
= wxRA_HORIZONTAL
, 
  74                 const wxValidator
& val 
= wxDefaultValidator
, 
  75                 const wxString
& name 
= wxRadioBoxNameStr
); 
  76     bool Create(wxWindow 
*parent
, 
  78                 const wxString
& title
, 
  81                 const wxArrayString
& choices
, 
  83                 long style 
= wxRA_HORIZONTAL
, 
  84                 const wxValidator
& val 
= wxDefaultValidator
, 
  85                 const wxString
& name 
= wxRadioBoxNameStr
); 
  87     virtual ~wxRadioBox(); 
  90     // implement wxItemContainerImmutable methods 
  91     virtual unsigned int GetCount() const; 
  93     virtual wxString 
GetString(unsigned int n
) const; 
  94     virtual void SetString(unsigned int n
, const wxString
& s
); 
  96     virtual void SetSelection(int n
); 
  97     virtual int GetSelection() const; 
 100     // implement wxRadioBoxBase methods 
 101     virtual bool Show(unsigned int n
, bool show 
= true); 
 102     virtual bool Enable(unsigned int n
, bool enable 
= true); 
 104     virtual bool IsItemEnabled(unsigned int n
) const; 
 105     virtual bool IsItemShown(unsigned int n
) const; 
 108     // override some base class methods to operate on radiobox itself too 
 109     virtual bool Show( bool show 
= true ); 
 110     virtual bool Enable( bool enable 
= true ); 
 112     virtual void SetLabel( const wxString
& label 
); 
 114     static wxVisualAttributes
 
 115     GetClassDefaultAttributes(wxWindowVariant variant 
= wxWINDOW_VARIANT_NORMAL
); 
 117     virtual int GetItemFromPoint( const wxPoint
& pt 
) const; 
 119     // override virtual wxWindow::GetHelpTextAtPoint to use common platform independent 
 120     // wxRadioBoxBase::DoGetHelpTextAtPoint from the platform independent 
 121     // base class-interface wxRadioBoxBase. 
 122     virtual wxString 
GetHelpTextAtPoint(const wxPoint 
& pt
, wxHelpEvent::Origin origin
) const 
 124         return wxRadioBoxBase::DoGetHelpTextAtPoint( this, pt
, origin 
); 
 131     void GtkDisableEvents(); 
 132     void GtkEnableEvents(); 
 134     void ApplyToolTip( GtkTooltips 
*tips
, const gchar 
*tip 
); 
 135 #endif // wxUSE_TOOLTIPS 
 137     wxRadioBoxButtonsInfoList   m_buttonsInfo
; 
 140     virtual wxBorder 
GetDefaultBorder() const { return wxBORDER_NONE
; } 
 143     virtual void DoSetItemToolTip(unsigned int n
, wxToolTip 
*tooltip
); 
 146     virtual void DoApplyWidgetStyle(GtkRcStyle 
*style
); 
 147     virtual GdkWindow 
*GTKGetWindow(wxArrayGdkWindows
& windows
) const; 
 149     virtual bool GTKNeedsToFilterSameWindowFocus() const { return true; } 
 151     virtual bool GTKWidgetNeedsMnemonic() const; 
 152     virtual void GTKWidgetDoSetMnemonic(GtkWidget
* w
); 
 155     DECLARE_DYNAMIC_CLASS(wxRadioBox
) 
 158 #endif // _WX_GTK_RADIOBOX_H_