1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: combobox.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
1998-06-22 14:40:59 +00:00
|
|
|
// Id: $Id$
|
1998-05-20 14:01:55 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKCOMBOBOXH__
|
|
|
|
#define __GTKCOMBOBOXH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1998-06-22 14:40:59 +00:00
|
|
|
#pragma interface "combobox.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxComboBox;
|
|
|
|
|
1998-05-30 17:11:51 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char* wxComboBoxNameStr;
|
|
|
|
extern const char* wxEmptyString;
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxComboBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-05-30 17:11:51 +00:00
|
|
|
class wxComboBox: public wxControl
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline wxComboBox(void) {}
|
|
|
|
|
1998-07-04 15:17:59 +00:00
|
|
|
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
1998-05-30 17:11:51 +00:00
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-08-23 03:22:56 +00:00
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
1998-07-04 15:17:59 +00:00
|
|
|
long style = 0,
|
1998-08-14 10:07:38 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1998-05-30 17:11:51 +00:00
|
|
|
const wxString& name = wxComboBoxNameStr)
|
|
|
|
{
|
1998-08-14 10:07:38 +00:00
|
|
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
1998-05-30 17:11:51 +00:00
|
|
|
}
|
1998-07-04 15:17:59 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
1998-05-30 17:11:51 +00:00
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-08-23 03:22:56 +00:00
|
|
|
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
1998-07-04 15:17:59 +00:00
|
|
|
long style = 0,
|
1998-08-14 10:07:38 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1998-05-30 17:11:51 +00:00
|
|
|
const wxString& name = wxComboBoxNameStr);
|
|
|
|
|
|
|
|
// List functions
|
|
|
|
void Clear(void);
|
|
|
|
void Append( const wxString &item );
|
|
|
|
void Append( const wxString &item, char* clientData );
|
1998-07-04 15:17:59 +00:00
|
|
|
void Delete( int n );
|
1998-05-30 17:11:51 +00:00
|
|
|
int FindString( const wxString &item );
|
1998-07-04 15:17:59 +00:00
|
|
|
char* GetClientData( int n );
|
|
|
|
void SetClientData( int n, char * clientData );
|
1998-05-30 17:11:51 +00:00
|
|
|
int GetSelection(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
wxString GetString( int n ) const;
|
1998-05-30 17:11:51 +00:00
|
|
|
wxString GetStringSelection(void) const;
|
|
|
|
int Number(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetSelection( int n );
|
1998-07-31 20:04:04 +00:00
|
|
|
void SetStringSelection( const wxString &string );
|
1998-07-04 15:17:59 +00:00
|
|
|
|
1998-05-30 17:11:51 +00:00
|
|
|
// Text field functions
|
|
|
|
wxString GetValue(void) const ;
|
|
|
|
void SetValue(const wxString& value);
|
|
|
|
|
|
|
|
// Clipboard operations
|
|
|
|
void Copy(void);
|
|
|
|
void Cut(void);
|
|
|
|
void Paste(void);
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetInsertionPoint(long pos);
|
1998-05-30 17:11:51 +00:00
|
|
|
void SetInsertionPointEnd(void);
|
|
|
|
long GetInsertionPoint(void) const ;
|
|
|
|
long GetLastPosition(void) const ;
|
1998-07-04 15:17:59 +00: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-05-30 17:11:51 +00:00
|
|
|
private:
|
|
|
|
|
1998-07-31 20:04:04 +00:00
|
|
|
wxList m_clientData;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
bool m_alreadySent;
|
1998-05-30 17:11:51 +00:00
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif // __GTKCOMBOBOXH__
|