1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-07-15 19:51:35 +00:00
|
|
|
// Name: wx/msw/combobox.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxComboBox class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_COMBOBOX_H_
|
|
|
|
#define _WX_COMBOBOX_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#include "wx/choice.h"
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_COMBOBOX
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-07-02 22:02:05 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Combobox control
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
class WXDLLEXPORT wxComboBox: public wxChoice
|
|
|
|
{
|
1999-07-02 22:02:05 +00:00
|
|
|
public:
|
2006-03-12 20:53:27 +00:00
|
|
|
wxComboBox() { }
|
1999-07-02 22:02:05 +00:00
|
|
|
|
|
|
|
wxComboBox(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,
|
2004-01-15 13:49:22 +00:00
|
|
|
const wxString& name = wxComboBoxNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
|
|
|
}
|
2004-01-31 18:21:45 +00:00
|
|
|
wxComboBox(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)
|
|
|
|
{
|
|
|
|
Create(parent, id, value, pos, size, choices, style, validator, name);
|
|
|
|
}
|
1999-07-02 22:02:05 +00:00
|
|
|
|
2000-07-15 19:51:35 +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);
|
2004-01-31 18:21:45 +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);
|
1999-07-02 22:02:05 +00:00
|
|
|
|
|
|
|
// List functions: see wxChoice
|
|
|
|
|
|
|
|
// Text field functions
|
2006-03-12 20:53:27 +00:00
|
|
|
virtual wxString GetValue() const;
|
1999-07-02 22:02:05 +00:00
|
|
|
virtual void SetValue(const wxString& value);
|
|
|
|
|
|
|
|
// Clipboard operations
|
|
|
|
virtual void Copy();
|
|
|
|
virtual void Cut();
|
|
|
|
virtual void Paste();
|
2004-12-09 15:16:51 +00:00
|
|
|
virtual bool CanCopy() const;
|
|
|
|
virtual bool CanCut() const;
|
|
|
|
virtual bool CanPaste() const;
|
1999-07-02 22:02:05 +00:00
|
|
|
virtual void SetInsertionPoint(long pos);
|
|
|
|
virtual void SetInsertionPointEnd();
|
|
|
|
virtual long GetInsertionPoint() const;
|
2005-01-19 16:25:34 +00:00
|
|
|
virtual wxTextPos GetLastPosition() const;
|
1999-07-02 22:02:05 +00:00
|
|
|
virtual void Replace(long from, long to, const wxString& value);
|
|
|
|
virtual void Remove(long from, long to);
|
2006-03-12 20:53:27 +00:00
|
|
|
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
|
1999-07-02 22:02:05 +00:00
|
|
|
virtual void SetSelection(long from, long to);
|
2006-03-12 20:53:27 +00:00
|
|
|
virtual int GetSelection() const { return wxChoice::GetSelection(); }
|
2004-11-19 07:46:34 +00:00
|
|
|
virtual void GetSelection(long* from, long* to) const;
|
1999-07-02 22:02:05 +00:00
|
|
|
virtual void SetEditable(bool editable);
|
|
|
|
|
2006-03-12 20:53:27 +00:00
|
|
|
virtual void Undo();
|
|
|
|
virtual void Redo();
|
2004-12-09 15:16:51 +00:00
|
|
|
virtual bool CanUndo() const;
|
|
|
|
virtual bool CanRedo() const;
|
|
|
|
virtual void SelectAll();
|
2006-03-12 20:53:27 +00:00
|
|
|
virtual bool IsEditable() const;
|
2004-12-09 15:16:51 +00:00
|
|
|
virtual bool HasSelection() const;
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// implementation only from now on
|
1999-07-02 22:02:05 +00:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
2000-07-15 19:51:35 +00:00
|
|
|
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
|
2004-02-25 10:45:02 +00:00
|
|
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
2004-02-08 00:59:23 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
WXHWND GetEditHWND() const;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
2004-12-09 15:16:51 +00:00
|
|
|
// Standard event handling
|
|
|
|
void OnCut(wxCommandEvent& event);
|
|
|
|
void OnCopy(wxCommandEvent& event);
|
|
|
|
void OnPaste(wxCommandEvent& event);
|
|
|
|
void OnUndo(wxCommandEvent& event);
|
|
|
|
void OnRedo(wxCommandEvent& event);
|
|
|
|
void OnDelete(wxCommandEvent& event);
|
|
|
|
void OnSelectAll(wxCommandEvent& event);
|
|
|
|
|
|
|
|
void OnUpdateCut(wxUpdateUIEvent& event);
|
|
|
|
void OnUpdateCopy(wxUpdateUIEvent& event);
|
|
|
|
void OnUpdatePaste(wxUpdateUIEvent& event);
|
|
|
|
void OnUpdateUndo(wxUpdateUIEvent& event);
|
|
|
|
void OnUpdateRedo(wxUpdateUIEvent& event);
|
|
|
|
void OnUpdateDelete(wxUpdateUIEvent& event);
|
|
|
|
void OnUpdateSelectAll(wxUpdateUIEvent& event);
|
|
|
|
|
2004-02-07 19:26:22 +00:00
|
|
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
|
|
|
|
2003-07-22 00:24:07 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
|
2004-12-09 15:16:51 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#endif // wxUSE_COMBOBOX
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_COMBOBOX_H_
|