1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: choice.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 05:56:58 -05:00
|
|
|
// Id: $Id$
|
1998-10-24 13:12:05 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1999-03-16 13:54:24 -05:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKCHOICEH__
|
|
|
|
#define __GTKCHOICEH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-15 16:21:59 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxChoice;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char *wxChoiceNameStr;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxChoice
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-03-16 13:54:24 -05:00
|
|
|
class wxChoice : public wxControl
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-03-16 13:54:24 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
public:
|
1999-03-16 13:54:24 -05:00
|
|
|
wxChoice();
|
|
|
|
wxChoice( wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxChoiceNameStr )
|
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
|
|
|
}
|
|
|
|
~wxChoice();
|
|
|
|
bool Create( wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = (wxString *) NULL,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxChoiceNameStr );
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-16 13:54:24 -05:00
|
|
|
void Append( const wxString &item );
|
|
|
|
void Append( const wxString &item, void* clientData );
|
|
|
|
void Append( const wxString &item, wxClientData* clientData );
|
|
|
|
|
|
|
|
void SetClientData( int n, void* clientData );
|
|
|
|
void* GetClientData( int n );
|
|
|
|
void SetClientObject( int n, wxClientData* clientData );
|
|
|
|
wxClientData* GetClientObject( int n );
|
|
|
|
|
1999-05-12 16:26:54 -04:00
|
|
|
void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); }
|
|
|
|
wxClientData *GetClientObject() const { return wxControl::GetClientObject(); }
|
|
|
|
void SetClientData( void *data ) { wxControl::SetClientData( data ); }
|
|
|
|
void *GetClientData() const { return wxControl::GetClientData(); }
|
|
|
|
|
1999-03-16 13:54:24 -05:00
|
|
|
void Clear();
|
|
|
|
void Delete(int n);
|
|
|
|
|
|
|
|
int FindString( const wxString &string ) const;
|
|
|
|
int GetColumns() const;
|
|
|
|
int GetSelection();
|
|
|
|
wxString GetString( int n ) const;
|
|
|
|
wxString GetStringSelection() const;
|
|
|
|
int Number() const;
|
|
|
|
void SetColumns( int n = 1 );
|
|
|
|
void SetSelection( int n );
|
|
|
|
void SetStringSelection( const wxString &string );
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
|
|
|
wxList m_clientDataList;
|
|
|
|
wxList m_clientObjectList;
|
|
|
|
|
1999-07-22 19:28:55 -04:00
|
|
|
void DisableEvents();
|
|
|
|
void EnableEvents();
|
1999-03-16 13:54:24 -05:00
|
|
|
void AppendCommon( const wxString &item );
|
|
|
|
void ApplyWidgetStyle();
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-06-15 16:21:59 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __GTKCHOICEH__
|