1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: combobox.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
1998-06-22 10:40:59 -04:00
|
|
|
// Id: $Id$
|
1998-05-20 10:01:55 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKCOMBOBOXH__
|
|
|
|
#define __GTKCOMBOBOXH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1998-06-22 10:40:59 -04:00
|
|
|
#pragma interface "combobox.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxComboBox;
|
|
|
|
|
1998-05-30 13:11:51 -04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char* wxComboBoxNameStr;
|
|
|
|
extern const char* wxEmptyString;
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxComboBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-05-30 13:11:51 -04:00
|
|
|
class wxComboBox: public wxControl
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline wxComboBox(void) {}
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
1998-05-30 13:11:51 -04:00
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
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-07-04 11:17:59 -04:00
|
|
|
long style = 0,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1998-05-30 13:11:51 -04:00
|
|
|
const wxString& name = wxComboBoxNameStr)
|
|
|
|
{
|
1998-08-14 06:07:38 -04:00
|
|
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
1998-05-30 13:11:51 -04:00
|
|
|
}
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
1998-05-30 13:11:51 -04:00
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
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-07-04 11:17:59 -04:00
|
|
|
long style = 0,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1998-05-30 13:11:51 -04:00
|
|
|
const wxString& name = wxComboBoxNameStr);
|
|
|
|
|
|
|
|
void Clear(void);
|
|
|
|
void Append( const wxString &item );
|
|
|
|
void Append( const wxString &item, char* clientData );
|
1998-07-04 11:17:59 -04:00
|
|
|
void Delete( int n );
|
1998-05-30 13:11:51 -04:00
|
|
|
int FindString( const wxString &item );
|
1998-07-04 11:17:59 -04:00
|
|
|
char* GetClientData( int n );
|
|
|
|
void SetClientData( int n, char * clientData );
|
1998-05-30 13:11:51 -04:00
|
|
|
int GetSelection(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
wxString GetString( int n ) const;
|
1998-05-30 13:11:51 -04:00
|
|
|
wxString GetStringSelection(void) const;
|
|
|
|
int Number(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection( int n );
|
1998-07-31 16:04:04 -04:00
|
|
|
void SetStringSelection( const wxString &string );
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1998-05-30 13:11:51 -04:00
|
|
|
wxString GetValue(void) const ;
|
|
|
|
void SetValue(const wxString& value);
|
|
|
|
|
|
|
|
void Copy(void);
|
|
|
|
void Cut(void);
|
|
|
|
void Paste(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetInsertionPoint(long pos);
|
1998-05-30 13:11:51 -04:00
|
|
|
void SetInsertionPointEnd(void);
|
|
|
|
long GetInsertionPoint(void) const ;
|
|
|
|
long GetLastPosition(void) const ;
|
1998-07-04 11:17:59 -04:00
|
|
|
void Replace(long from, long to, const wxString& value);
|
|
|
|
void Remove(long from, long to);
|
|
|
|
void SetSelection(long from, long to);
|
|
|
|
void SetEditable(bool editable);
|
1998-09-06 09:46:50 -04:00
|
|
|
|
|
|
|
void SetFont( const wxFont &font );
|
|
|
|
|
|
|
|
// implementation
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1998-09-06 09:46:50 -04:00
|
|
|
bool m_alreadySent;
|
|
|
|
|
1998-05-30 13:11:51 -04:00
|
|
|
private:
|
|
|
|
|
1998-07-31 16:04:04 -04:00
|
|
|
wxList m_clientData;
|
|
|
|
|
1998-09-07 05:17:58 -04:00
|
|
|
GtkWidget* GetConnectWidget(void);
|
1998-05-30 13:11:51 -04:00
|
|
|
};
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __GTKCOMBOBOXH__
|