2004-03-23 17:35:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-09-27 16:54:43 +00:00
|
|
|
// Name: wx/mac/carbon/combobox.h
|
2004-03-23 17:35:05 +00:00
|
|
|
// Purpose: wxComboBox class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Stefan Csomor
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 17:35:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_COMBOBOX_H_
|
|
|
|
#define _WX_COMBOBOX_H_
|
|
|
|
|
2006-02-12 03:11:37 +00:00
|
|
|
#include "wx/containr.h"
|
2004-03-23 17:35:05 +00:00
|
|
|
#include "wx/choice.h"
|
|
|
|
|
2007-11-13 12:49:38 +00:00
|
|
|
WXDLLEXPORT_DATA(extern const char) wxComboBoxNameStr[];
|
2004-03-23 17:35:05 +00:00
|
|
|
|
2004-08-07 05:18:35 +00:00
|
|
|
// forward declaration of private implementation classes
|
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
class wxComboBoxText;
|
|
|
|
class wxComboBoxChoice;
|
2004-08-07 05:18:35 +00:00
|
|
|
|
2004-03-23 17:35:05 +00:00
|
|
|
// Combobox item
|
|
|
|
class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
|
|
|
{
|
2006-02-14 04:41:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
2004-03-23 17:35:05 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~wxComboBox();
|
|
|
|
|
|
|
|
// forward these functions to all subcontrols
|
2005-01-19 16:25:34 +00:00
|
|
|
virtual bool Enable(bool enable = true);
|
|
|
|
virtual bool Show(bool show = true);
|
2004-03-23 17:35:05 +00:00
|
|
|
|
|
|
|
// callback functions
|
|
|
|
virtual void DelegateTextChanged( const wxString& value );
|
|
|
|
virtual void DelegateChoice( const wxString& value );
|
|
|
|
|
2006-02-14 04:00:39 +00:00
|
|
|
wxComboBox() { Init(); }
|
|
|
|
|
|
|
|
wxComboBox(wxWindow *parent, wxWindowID id,
|
2004-03-23 17:35:05 +00:00
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
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 = wxComboBoxNameStr)
|
|
|
|
{
|
2006-02-14 04:00:39 +00:00
|
|
|
Init();
|
|
|
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
2004-03-23 17:35:05 +00:00
|
|
|
}
|
2006-02-14 04:41:07 +00:00
|
|
|
|
2006-02-14 04:00:39 +00:00
|
|
|
wxComboBox(wxWindow *parent, wxWindowID id,
|
2004-03-23 17:35:05 +00:00
|
|
|
const wxString& value,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxComboBoxNameStr)
|
|
|
|
{
|
2006-02-14 04:00:39 +00:00
|
|
|
Init();
|
|
|
|
Create(parent, id, value, pos, size, choices, style, validator, name);
|
2004-03-23 17:35:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
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 = wxComboBoxNameStr);
|
2006-02-14 04:00:39 +00:00
|
|
|
|
2004-03-23 17:35:05 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& value,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxComboBoxNameStr);
|
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
virtual int GetSelection() const;
|
2004-03-23 17:35:05 +00:00
|
|
|
virtual void SetSelection(int n);
|
2005-09-27 16:54:43 +00:00
|
|
|
virtual int FindString(const wxString& s, bool bCase = false) const;
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual wxString GetString(unsigned int n) const;
|
2006-02-14 04:41:07 +00:00
|
|
|
virtual wxString GetStringSelection() const;
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual void SetString(unsigned int n, const wxString& s);
|
2004-03-23 17:35:05 +00:00
|
|
|
|
|
|
|
// Text field functions
|
|
|
|
virtual void SetValue(const wxString& value);
|
2007-09-26 00:30:22 +00:00
|
|
|
virtual wxString GetValue() const;
|
|
|
|
virtual void WriteText(const wxString& text);
|
|
|
|
virtual void GetSelection(long *from, long *to) const;
|
2004-03-23 17:35:05 +00:00
|
|
|
|
|
|
|
// Clipboard operations
|
|
|
|
virtual void Copy();
|
|
|
|
virtual void Cut();
|
|
|
|
virtual void Paste();
|
|
|
|
virtual void SetInsertionPoint(long pos);
|
|
|
|
virtual void SetInsertionPointEnd();
|
2006-02-14 04:41:07 +00:00
|
|
|
virtual long GetInsertionPoint() const;
|
|
|
|
virtual wxTextPos GetLastPosition() const;
|
2004-03-23 17:35:05 +00:00
|
|
|
virtual void Replace(long from, long to, const wxString& value);
|
|
|
|
virtual void Remove(long from, long to);
|
|
|
|
virtual void SetSelection(long from, long to);
|
|
|
|
virtual void SetEditable(bool editable);
|
2006-02-14 04:41:07 +00:00
|
|
|
virtual bool IsEditable() const;
|
2004-12-09 15:16:51 +00:00
|
|
|
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual unsigned int GetCount() const;
|
2004-12-09 15:16:51 +00:00
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
virtual void Undo();
|
|
|
|
virtual void Redo();
|
|
|
|
virtual void SelectAll();
|
2004-12-09 15:16:51 +00:00
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
virtual bool CanCopy() const;
|
|
|
|
virtual bool CanCut() const;
|
|
|
|
virtual bool CanPaste() const;
|
|
|
|
virtual bool CanUndo() const;
|
|
|
|
virtual bool CanRedo() const;
|
2004-12-09 15:16:51 +00:00
|
|
|
|
2007-10-27 18:05:28 +00:00
|
|
|
virtual wxClientDataType GetClientDataType() const;
|
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
wxInt32 MacControlHit( WXEVENTHANDLERREF handler, WXEVENTREF event );
|
2004-03-23 17:35:05 +00:00
|
|
|
|
|
|
|
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
|
|
|
|
|
2006-02-09 15:03:51 +00:00
|
|
|
WX_DECLARE_CONTROL_CONTAINER();
|
2006-02-08 21:47:09 +00:00
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
protected:
|
2006-02-14 04:00:39 +00:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2007-10-27 18:05:28 +00:00
|
|
|
// List functions
|
|
|
|
virtual void DoDeleteOneItem(unsigned int n);
|
|
|
|
virtual void DoClear();
|
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
// override the base class virtuals involved in geometry calculations
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
2004-03-23 17:35:05 +00:00
|
|
|
|
2007-07-26 13:54:14 +00:00
|
|
|
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
|
|
|
unsigned int pos,
|
|
|
|
void **clientData, wxClientDataType type);
|
2004-03-23 17:35:05 +00:00
|
|
|
|
2006-03-23 22:05:23 +00:00
|
|
|
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
|
|
|
virtual void * DoGetItemClientData(unsigned int n) const;
|
2004-03-23 17:35:05 +00:00
|
|
|
|
2007-09-17 00:14:34 +00:00
|
|
|
virtual void SetClientDataType(wxClientDataType clientDataItemsType);
|
|
|
|
|
2004-03-23 17:35:05 +00:00
|
|
|
// the subcontrols
|
2004-08-07 05:18:35 +00:00
|
|
|
wxComboBoxText* m_text;
|
|
|
|
wxComboBoxChoice* m_choice;
|
2006-02-09 15:03:51 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2004-03-23 17:35:05 +00:00
|
|
|
};
|
|
|
|
|
2006-02-14 04:41:07 +00:00
|
|
|
#endif // _WX_COMBOBOX_H_
|