1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: listbox.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
|
|
|
// Id:
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKLISTBOXH__
|
|
|
|
#define __GTKLISTBOXH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxListBox;
|
1998-08-07 11:09:04 -04:00
|
|
|
class wxArrayInt;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char *wxListBoxNameStr;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxListBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxListBox: public wxControl
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxListBox)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxListBox(void);
|
1998-08-14 06:07:38 -04:00
|
|
|
inline wxListBox( wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxListBoxNameStr )
|
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
|
|
|
}
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Create( wxWindow *parent, wxWindowID id,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxListBoxNameStr );
|
1998-05-20 10:01:55 -04:00
|
|
|
void Append( const wxString &item );
|
|
|
|
void Append( const wxString &item, char *clientData );
|
|
|
|
void Clear(void);
|
|
|
|
void Delete( int n );
|
|
|
|
void Deselect( int n );
|
|
|
|
int FindString( const wxString &item ) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
char *GetClientData( int n ) const;
|
1998-05-20 10:01:55 -04:00
|
|
|
int GetSelection(void) const;
|
1998-06-15 08:06:39 -04:00
|
|
|
int GetSelections( class wxArrayInt &) const;
|
1998-05-20 10:01:55 -04:00
|
|
|
wxString GetString( int n ) const;
|
|
|
|
wxString GetStringSelection(void) const;
|
|
|
|
int Number(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Selected( int n );
|
|
|
|
void Set( int n, const wxString *choices );
|
|
|
|
void SetClientData( int n, char *clientData );
|
1998-05-20 10:01:55 -04:00
|
|
|
void SetFirstItem( int n );
|
|
|
|
void SetFirstItem( const wxString &item );
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection( int n, bool select = TRUE );
|
|
|
|
void SetString( int n, const wxString &string );
|
|
|
|
void SetStringSelection( const wxString &string, bool select = TRUE );
|
|
|
|
|
1998-08-09 09:06:25 -04:00
|
|
|
virtual GtkWidget *GetConnectWidget(void);
|
1998-07-27 16:50:48 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
private:
|
|
|
|
|
|
|
|
GtkList *m_list;
|
1998-07-20 14:05:48 -04:00
|
|
|
wxList m_clientData;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
int GetIndex( GtkWidget *item ) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKLISTBOXH__
|