X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..97929f6bd992c185834656b5e3fff5a50ba7360a:/interface/wx/combobox.h?ds=sidebyside diff --git a/interface/wx/combobox.h b/interface/wx/combobox.h index adf9ec3ddb..931d495294 100644 --- a/interface/wx/combobox.h +++ b/interface/wx/combobox.h @@ -53,7 +53,7 @@ @library{wxcore} @category{ctrl} - + @appearance{combobox.png} @see wxListBox, wxTextCtrl, wxChoice, wxCommandEvent */ @@ -99,14 +99,44 @@ public: @see Create(), wxValidator */ wxComboBox(wxWindow* parent, wxWindowID id, - const wxString& value = "", + 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 = "comboBox"); + const wxString& name = wxComboBoxNameStr); + /** + Constructor, creating and showing a combobox. + + @param parent + Parent window. Must not be @NULL. + @param id + Window identifier. The value wxID_ANY indicates a default value. + @param value + Initial selection string. An empty string indicates no selection. + @param pos + Window position. + @param size + Window size. If wxDefaultSize is specified then the window is sized + appropriately. + @param choices + An array of strings with which to initialise the control. + @param style + Window style. See wxComboBox. + @param validator + Window validator. + @param name + Window name. + + @beginWxPythonOnly + The wxComboBox constructor in wxPython reduces the @a n and @a choices + arguments are to a single argument, which is a list of strings. + @endWxPythonOnly + + @see Create(), wxValidator + */ wxComboBox(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, @@ -114,84 +144,84 @@ public: const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "comboBox"); + const wxString& name = wxComboBoxNameStr); //@} /** Destructor, destroying the combobox. */ - ~wxComboBox(); + virtual ~wxComboBox(); //@{ /** Creates the combobox for two-step construction. Derived classes should call or replace this function. See wxComboBox() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, - const wxString& value = "", + bool Create(wxWindow *parent, wxWindowID id, + const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n, const wxString choices[], + int n = 0, const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "comboBox"); - bool Create(wxWindow* parent, wxWindowID id, + const wxString& name = wxComboBoxNameStr); + 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 = "comboBox"); + const wxString& name = wxComboBoxNameStr); //@} /** Returns @true if the combobox is editable and there is a text selection to copy to the clipboard. Only available on Windows. */ - bool CanCopy() const; + virtual bool CanCopy() const; /** Returns @true if the combobox is editable and there is a text selection to copy to the clipboard. Only available on Windows. */ - bool CanCut() const; + virtual bool CanCut() const; /** Returns @true if the combobox is editable and there is text on the clipboard that can be pasted into the text field. Only available on Windows. */ - bool CanPaste() const; + virtual bool CanPaste() const; /** Returns @true if the combobox is editable and the last undo can be redone. Only available on Windows. */ - bool CanRedo() const; + virtual bool CanRedo() const; /** Returns @true if the combobox is editable and the last edit can be undone. Only available on Windows. */ - bool CanUndo() const; + virtual bool CanUndo() const; /** Copies the selected text to the clipboard. */ - void Copy(); + virtual void Copy(); /** Copies the selected text to the clipboard and removes the selection. */ - void Cut(); + virtual void Cut(); /** This function does the same things as wxChoice::GetCurrentSelection() and returns the item currently selected in the dropdown list if it's open or the same thing as wxControlWithItems::GetSelection() otherwise. */ - int GetCurrentSelection() const; + virtual int GetCurrentSelection() const; /** Returns the insertion point for the combobox's text field. @@ -199,12 +229,12 @@ public: @note Under wxMSW, this function always returns 0 if the combobox doesn't have the focus. */ - long GetInsertionPoint() const; + virtual long GetInsertionPoint() const; /** Returns the last position in the combobox text field. */ - virtual wxTextPos GetLastPosition() const; + virtual long GetLastPosition() const; /** This is the same as wxTextCtrl::GetSelection() for the text control @@ -213,22 +243,22 @@ public: Currently this method is only implemented in wxMSW and wxGTK. */ - void GetSelection(long* from, long* to) const; + virtual void GetSelection(long* from, long* to) const; /** Returns the current value in the combobox text field. */ - wxString GetValue() const; + virtual wxString GetValue() const; /** Pastes text from the clipboard to the text field. */ - void Paste(); + virtual void Paste(); /** Redoes the last undo in the text field. Windows only. */ - void Redo(); + virtual void Redo(); /** Removes the text between the two positions in the combobox text field. @@ -238,7 +268,7 @@ public: @param to The last position. */ - void Remove(long from, long to); + virtual void Remove(long from, long to); /** Replaces the text between two positions with the given text, in the @@ -251,7 +281,7 @@ public: @param text The text to insert. */ - void Replace(long from, long to, const wxString& text); + virtual void Replace(long from, long to, const wxString& text); /** Sets the insertion point in the combobox text field. @@ -259,12 +289,12 @@ public: @param pos The new insertion point. */ - void SetInsertionPoint(long pos); + virtual void SetInsertionPoint(long pos); /** Sets the insertion point at the end of the combobox text field. */ - void SetInsertionPointEnd(); + virtual void SetInsertionPointEnd(); /** Selects the text between the two positions, in the combobox text field. @@ -279,7 +309,7 @@ public: wxControlWithItems::SetSelection(). @endWxPythonOnly */ - void SetSelection(long from, long to); + virtual void SetSelection(long from, long to); /** Sets the text for the combobox text field. @@ -291,11 +321,11 @@ public: @param text The text to set. */ - void SetValue(const wxString& text); + virtual void SetValue(const wxString& text); /** Undoes the last edit in the text field. Windows only. */ - void Undo(); + virtual void Undo(); };