1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-09-27 16:54:43 +00:00
|
|
|
// Name: wx/gtk/listbox.h
|
1999-02-01 14:40:53 +00:00
|
|
|
// Purpose: wxListBox class declaration
|
1998-05-20 14:01:55 +00:00
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKLISTBOXH__
|
|
|
|
#define __GTKLISTBOXH__
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxListBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1998-11-06 08:50:52 +00:00
|
|
|
public:
|
1999-10-22 15:55:27 +00:00
|
|
|
// ctors and such
|
2006-03-11 13:24:07 +00:00
|
|
|
wxListBox()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
1999-02-01 14:40:53 +00:00
|
|
|
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 )
|
|
|
|
{
|
2006-03-11 13:24:07 +00:00
|
|
|
Init();
|
1999-02-01 14:40:53 +00:00
|
|
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
|
|
|
}
|
2004-01-31 18:21:45 +00:00
|
|
|
wxListBox( wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxListBoxNameStr )
|
|
|
|
{
|
2006-03-11 13:24:07 +00:00
|
|
|
Init();
|
2004-01-31 18:21:45 +00:00
|
|
|
Create(parent, id, pos, size, choices, style, validator, name);
|
|
|
|
}
|
1999-02-01 14:40:53 +00:00
|
|
|
virtual ~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);
|
2004-01-31 18:21:45 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxListBoxNameStr);
|
1999-02-01 14:40:53 +00:00
|
|
|
|
1999-10-22 15:55:27 +00:00
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual void Clear();
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual void Delete(unsigned int n);
|
1999-10-22 15:55:27 +00:00
|
|
|
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual unsigned int GetCount() const;
|
|
|
|
virtual wxString GetString(unsigned int n) const;
|
|
|
|
virtual void SetString(unsigned int n, const wxString& s);
|
2005-09-27 16:54:43 +00:00
|
|
|
virtual int FindString(const wxString& s, bool bCase = false) const;
|
1999-10-22 15:55:27 +00:00
|
|
|
|
|
|
|
virtual bool IsSelected(int n) const;
|
|
|
|
virtual int GetSelection() const;
|
|
|
|
virtual int GetSelections(wxArrayInt& aSelections) const;
|
|
|
|
|
2004-05-06 17:26:25 +00:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
2005-09-27 16:54:43 +00:00
|
|
|
|
1999-10-22 15:55:27 +00:00
|
|
|
// implementation from now on
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-01 14:40:53 +00:00
|
|
|
GtkWidget *GetConnectWidget();
|
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
1999-09-30 22:13:45 +00:00
|
|
|
void OnInternalIdle();
|
1999-02-01 14:40:53 +00:00
|
|
|
|
|
|
|
#if wxUSE_TOOLTIPS
|
1999-04-21 21:46:02 +00:00
|
|
|
void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
1999-02-01 14:40:53 +00:00
|
|
|
#endif // wxUSE_TOOLTIPS
|
|
|
|
|
2006-03-01 21:51:42 +00:00
|
|
|
struct _GtkTreeView *m_treeview;
|
|
|
|
struct _GtkListStore *m_liststore;
|
1999-06-01 15:32:12 +00:00
|
|
|
|
|
|
|
#if wxUSE_CHECKLISTBOX
|
1999-02-01 14:40:53 +00:00
|
|
|
bool m_hasCheckBoxes;
|
1999-06-01 15:32:12 +00:00
|
|
|
#endif // wxUSE_CHECKLISTBOX
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-17 22:32:15 +00:00
|
|
|
bool m_blockEvent;
|
2006-03-01 21:51:42 +00:00
|
|
|
bool m_spacePressed;
|
2002-09-04 13:45:39 +00:00
|
|
|
|
2006-03-01 21:51:42 +00:00
|
|
|
struct _GtkTreeEntry* GtkGetEntry(int pos) const;
|
2006-03-14 19:44:45 +00:00
|
|
|
void GtkInsertItems(const wxArrayString& items,
|
2006-03-23 22:05:23 +00:00
|
|
|
void** clientData, unsigned int pos);
|
2006-06-26 00:46:32 +00:00
|
|
|
void GtkDeselectAll();
|
2006-03-01 21:51:42 +00:00
|
|
|
void GtkSetSelection(int n, const bool select, const bool blockEvent);
|
2002-05-31 14:00:01 +00:00
|
|
|
|
1999-11-19 21:01:20 +00:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
2006-02-08 21:47:09 +00:00
|
|
|
virtual void DoSetSelection(int n, bool select);
|
|
|
|
virtual int DoAppend(const wxString& item);
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
2006-02-08 21:47:09 +00:00
|
|
|
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
|
|
|
virtual void DoSetFirstItem(int n);
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
|
|
|
virtual void* DoGetItemClientData(unsigned int n) const;
|
|
|
|
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
|
|
|
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
2006-03-09 12:48:52 +00:00
|
|
|
virtual int DoListHitTest(const wxPoint& point) const;
|
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
void DoApplyWidgetStyle(GtkRcStyle *style);
|
1999-11-19 21:01:20 +00:00
|
|
|
|
1999-10-22 15:55:27 +00:00
|
|
|
private:
|
2006-03-13 09:37:23 +00:00
|
|
|
void Init(); //common construction
|
|
|
|
|
1999-10-22 15:55:27 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxListBox)
|
|
|
|
};
|
1999-06-14 23:04:05 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif // __GTKLISTBOXH__
|