1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: listbox.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-05-20 10:01:55 -04:00
|
|
|
// 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
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
class wxListBox : public wxControl
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxListBox)
|
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
public:
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
wxListBox();
|
|
|
|
inline wxListBox( 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 = wxListBoxNameStr )
|
|
|
|
{
|
1998-08-14 06:07:38 -04:00
|
|
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
1998-11-06 03:50:52 -05:00
|
|
|
}
|
|
|
|
~wxListBox();
|
|
|
|
bool Create( 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 = wxListBoxNameStr );
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
void Delete( int n );
|
|
|
|
|
|
|
|
void Deselect( int n );
|
|
|
|
int FindString( const wxString &item ) const;
|
|
|
|
int GetSelection(void) const;
|
|
|
|
int GetSelections( class wxArrayInt &) const;
|
|
|
|
wxString GetString( int n ) const;
|
|
|
|
wxString GetStringSelection(void) const;
|
|
|
|
int Number();
|
|
|
|
bool Selected( int n );
|
|
|
|
void Set( int n, const wxString *choices );
|
|
|
|
void SetFirstItem( int n );
|
|
|
|
void SetFirstItem( const wxString &item );
|
|
|
|
void SetSelection( int n, bool select = TRUE );
|
|
|
|
void SetString( int n, const wxString &string );
|
|
|
|
void SetStringSelection( const wxString &string, bool select = TRUE );
|
1998-09-07 13:23:29 -04:00
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
void SetDropTarget( wxDropTarget *dropTarget );
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
// implementation
|
1998-09-07 08:29:07 -04:00
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
void AppendCommon( const wxString &item );
|
|
|
|
int GetIndex( GtkWidget *item ) const;
|
|
|
|
GtkWidget *GetConnectWidget();
|
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
|
|
|
void ApplyWidgetStyle();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-06 03:50:52 -05:00
|
|
|
GtkList *m_list;
|
1998-11-06 08:13:43 -05:00
|
|
|
wxList m_clientDataList;
|
|
|
|
wxList m_clientObjectList;
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKLISTBOXH__
|