1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobox.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1999-05-09 18:17:03 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKRADIOBOXH__
|
|
|
|
#define __GTKRADIOBOXH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-14 19:04:05 -04:00
|
|
|
|
|
|
|
#if wxUSE_RADIOBOX
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#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
|
|
|
|
{
|
1999-05-12 16:26:54 -04:00
|
|
|
public:
|
|
|
|
wxRadioBox();
|
1998-08-14 06:07:38 -04:00
|
|
|
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
1999-05-05 06:25:38 -04:00
|
|
|
int majorDim = 1, long style = wxRA_HORIZONTAL,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxValidator& val = wxDefaultValidator,
|
1999-05-09 18:17:03 -04:00
|
|
|
const wxString& name = wxRadioBoxNameStr )
|
1998-08-14 06:07:38 -04:00
|
|
|
{
|
|
|
|
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
|
|
|
|
}
|
1998-09-07 20:27:29 -04:00
|
|
|
~wxRadioBox(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
1998-08-14 06:07:38 -04:00
|
|
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
|
|
const wxValidator& val = wxDefaultValidator,
|
1999-05-09 18:17:03 -04:00
|
|
|
const wxString& name = wxRadioBoxNameStr );
|
1999-05-12 16:26:54 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
int FindString( const wxString& s) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection( int n );
|
1999-05-12 16:26:54 -04:00
|
|
|
int GetSelection() const;
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
wxString GetString( int n ) const;
|
1999-05-12 16:26:54 -04:00
|
|
|
|
|
|
|
wxString GetLabel( int item ) const;
|
|
|
|
wxString GetLabel() const { return wxControl::GetLabel(); }
|
1998-05-20 10:01:55 -04:00
|
|
|
void SetLabel( const wxString& label );
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetLabel( int item, const wxString& label );
|
1999-05-12 16:26:54 -04:00
|
|
|
|
|
|
|
/* doesn't work */
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetLabel( int item, wxBitmap *bitmap );
|
1999-05-12 16:26:54 -04:00
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Show( bool show );
|
1999-05-12 16:26:54 -04:00
|
|
|
void Show( int item, bool show );
|
|
|
|
|
1999-05-09 18:17:03 -04:00
|
|
|
bool Enable( bool enable );
|
1998-07-04 11:17:59 -04:00
|
|
|
void Enable( int item, bool enable );
|
1999-05-12 16:26:54 -04:00
|
|
|
|
|
|
|
virtual wxString GetStringSelection() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
virtual bool SetStringSelection( const wxString& s );
|
1999-05-12 16:26:54 -04:00
|
|
|
|
|
|
|
virtual int Number() const;
|
|
|
|
int GetNumberOfRowsOrCols() const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetNumberOfRowsOrCols( int n );
|
1998-09-06 16:27:21 -04:00
|
|
|
|
1998-12-17 03:40:34 -05:00
|
|
|
void SetFocus();
|
1998-09-06 14:34:18 -04:00
|
|
|
|
1998-09-06 09:46:50 -04:00
|
|
|
// implementation
|
|
|
|
|
1999-07-22 19:28:55 -04:00
|
|
|
void DisableEvents();
|
|
|
|
void EnableEvents();
|
1998-09-07 08:29:07 -04:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
1998-10-29 13:03:18 -05:00
|
|
|
void ApplyWidgetStyle();
|
1998-12-19 07:38:52 -05:00
|
|
|
wxSize LayoutItems();
|
1999-10-14 09:09:01 -04:00
|
|
|
void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
|
1998-09-07 08:29:07 -04:00
|
|
|
|
1998-09-07 20:27:29 -04:00
|
|
|
bool m_alreadySent;
|
1998-12-19 07:38:52 -05:00
|
|
|
int m_majorDim;
|
1998-09-07 20:27:29 -04:00
|
|
|
wxList m_boxes;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-10-14 09:09:01 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __GTKRADIOBOXH__
|