1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobox.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-05-20 14:01:55 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKRADIOBOXH__
|
|
|
|
#define __GTKRADIOBOXH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxRadioBox;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char *wxRadioBoxNameStr;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxRadioBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxRadioBox: public wxControl
|
|
|
|
{
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxRadioBox(void);
|
1998-08-14 10:07:38 +00:00
|
|
|
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-08-23 03:22:56 +00:00
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
1998-08-14 10:07:38 +00:00
|
|
|
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 );
|
|
|
|
}
|
1998-09-08 00:27:29 +00:00
|
|
|
~wxRadioBox(void);
|
1998-07-04 15:17:59 +00:00
|
|
|
bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
1998-08-14 10:07:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-08-23 03:22:56 +00:00
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
1998-08-14 10:07:38 +00:00
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioBoxNameStr );
|
1998-05-20 14:01:55 +00:00
|
|
|
int FindString( const wxString& s) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetSelection( int n );
|
1998-05-20 14:01:55 +00:00
|
|
|
int GetSelection(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
wxString GetString( int n ) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
void SetLabel( const wxString& label );
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetLabel( int item, const wxString& label );
|
|
|
|
void SetLabel( int item, wxBitmap *bitmap );
|
|
|
|
wxString GetLabel( int item ) const;
|
|
|
|
bool Show( bool show );
|
|
|
|
void Enable( bool enable );
|
|
|
|
void Enable( int item, bool enable );
|
|
|
|
void Show( int item, bool show );
|
1998-05-20 14:01:55 +00:00
|
|
|
virtual wxString GetStringSelection(void) const;
|
|
|
|
virtual bool SetStringSelection( const wxString& s );
|
|
|
|
virtual int Number(void) const;
|
|
|
|
int GetNumberOfRowsOrCols(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetNumberOfRowsOrCols( int n );
|
1998-09-06 20:27:21 +00:00
|
|
|
|
1998-09-06 18:34:18 +00:00
|
|
|
void OnSize( wxSizeEvent &event );
|
1998-12-17 08:40:34 +00:00
|
|
|
void SetFocus();
|
1998-09-06 18:34:18 +00:00
|
|
|
|
1998-09-06 13:46:50 +00:00
|
|
|
// implementation
|
|
|
|
|
1998-09-07 12:29:07 +00:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
1998-10-29 18:03:18 +00:00
|
|
|
void ApplyWidgetStyle();
|
1998-12-19 12:38:52 +00:00
|
|
|
wxSize LayoutItems();
|
1998-09-07 12:29:07 +00:00
|
|
|
|
1998-09-08 00:27:29 +00:00
|
|
|
bool m_alreadySent;
|
1998-12-19 12:38:52 +00:00
|
|
|
int m_majorDim;
|
1998-09-08 00:27:29 +00:00
|
|
|
wxList m_boxes;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-09-06 18:34:18 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKRADIOBOXH__
|