wxWidgets: wxControlWithItems Class Reference

| Version: 3.0.2

- Main Page
- Related Pages
- Categories
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members
wxControlWithItems Class Reference
Controls

`#include <wx/ctrlsub.h>`

Inheritance diagram for wxControlWithItems:
[legend]

## Detailed Description

This is convenience class that derives from both wxControl and wxItemContainer.

It is used as basis for some wxWidgets controls (wxChoice and wxListBox).

##

Library: wxCore
Category: Controls

See Also
  wxItemContainer, wxItemContainerImmutable

## Additional Inherited Members
Public Member Functions inherited from wxControl
| wxControl (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxControlNameStr)
| Constructs a control.
| wxControl ()
| Default constructor to allow 2-phase creation.
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxControlNameStr)
virtual void | Command (wxCommandEvent &event)
| Simulates the effect of the user issuing a command to the item.
wxString | GetLabel () const
| Returns the control's label, as it was passed to SetLabel().
wxString | GetLabelText () const
| Returns the control's label without mnemonics.
wxSize | GetSizeFromTextSize (int xlen, int ylen=-1) const
| Determine the size needed by the control to leave the given area for its text.
wxSize | GetSizeFromTextSize (const wxSize &tsize) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void | SetLabel (const wxString &label)
| Sets the control's label.
void | SetLabelText (const wxString &text)
| Sets the control's label to exactly the given string.
bool | SetLabelMarkup (const wxString &markup)
| Sets the controls label to a string using markup.
Public Member Functions inherited from wxItemContainer
void | Clear ()
| Removes all items from the control.
void | Delete (unsigned int n)
| Deletes an item from the control.
wxClientData * | DetachClientObject (unsigned int n)
| Returns the client object associated with the given item and transfers its ownership to the caller.
bool | HasClientData () const
| Returns true, if either untyped data (`void*`) or object data (wxClientData*) is associated with the items of the control.
bool | HasClientObjectData () const
| Returns true, if object data is associated with the items of the control.
bool | HasClientUntypedData () const
| Returns true, if untyped data (`void*`) is associated with the items of the control.
int | Append (const wxString &item)
| Appends item into the control.
int | Append (const wxString &item, void *clientData)
| Appends item into the control.
int | Append (const wxString &item, wxClientData *clientData)
| Appends item into the control.
int | Append (const wxArrayString &items)
| Appends several items at once into the control.
int | Append (const wxArrayString &items, void **clientData)
| Appends several items at once into the control.
int | Append (const wxArrayString &items, wxClientData **clientData)
| Appends several items at once into the control.
int | Append (unsigned int n, const wxString *items)
| Appends several items at once into the control.
int | Append (unsigned int n, const wxString *items, void **clientData)
| Appends several items at once into the control.
int | Append (unsigned int n, const wxString *items, wxClientData **clientData)
| Appends several items at once into the control.
void * | GetClientData (unsigned int n) const
| Returns a pointer to the client data associated with the given item (if any).
wxClientData * | GetClientObject (unsigned int n) const
| Returns a pointer to the client data associated with the given item (if any).
void | SetClientData (unsigned int n, void *data)
| Associates the given untyped client data pointer with the given item.
void | SetClientObject (unsigned int n, wxClientData *data)
| Associates the given typed client data pointer with the given item: the data object will be deleted when the item is deleted (either explicitly by using Delete() or implicitly when the control itself is destroyed).
int | Insert (const wxString &item, unsigned int pos)
| Inserts item into the control.
int | Insert (const wxString &item, unsigned int pos, void *clientData)
| Inserts item into the control.
int | Insert (const wxString &item, unsigned int pos, wxClientData *clientData)
| Inserts item into the control.
int | Insert (const wxArrayString &items, unsigned int pos)
| Inserts several items at once into the control.
int | Insert (const wxArrayString &items, unsigned int pos, void **clientData)
| Inserts several items at once into the control.
int | Insert (const wxArrayString &items, unsigned int pos, wxClientData **clientData)
| Inserts several items at once into the control.
int | Insert (unsigned int n, const wxString *items, unsigned int pos)
| Inserts several items at once into the control.
int | Insert (unsigned int n, const wxString *items, unsigned int pos, void **clientData)
| Inserts several items at once into the control.
int | Insert (unsigned int n, const wxString *items, unsigned int pos, wxClientData **clientData)
| Inserts several items at once into the control.
void | Set (const wxArrayString &items)
| Replaces the current control contents with the given items.
void | Set (const wxArrayString &items, void **clientData)
| Replaces the current control contents with the given items.
void | Set (const wxArrayString &items, wxClientData **clientData)
| Replaces the current control contents with the given items.
void | Set (unsigned int n, const wxString *items)
| Replaces the current control contents with the given items.
void | Set (unsigned int n, const wxString *items, void **clientData)
| Replaces the current control contents with the given items.
void | Set (unsigned int n, const wxString *items, wxClientData **clientData)
| Replaces the current control contents with the given items.
Static Public Member Functions inherited from wxControl
static wxString | GetLabelText (const wxString &label)
| Returns the given label string without mnemonics ("&" characters).
static wxString | RemoveMnemonics (const wxString &str)
| Returns the given str string without mnemonics ("&" characters).
static wxString | EscapeMnemonics (const wxString &text)
| Escapes the special mnemonics characters ("&") in the given string.
static wxString | Ellipsize (const wxString &label, const wxDC &dc, wxEllipsizeMode mode, int maxWidth, int flags=wxELLIPSIZE_FLAGS_DEFAULT)
| Replaces parts of the label string with ellipsis, if needed, so that it fits into maxWidth pixels if possible.
Protected Member Functions inherited from wxWindow
virtual void | DoCentre (int direction)
| Centres the window.
virtual wxSize | DoGetBestSize () const
| Implementation of GetBestSize() that can be overridden.
virtual wxSize | DoGetBestClientSize () const
| Override this method to return the best size for a custom control.
virtual int | DoGetBestClientHeight (int width) const
| Override this method to implement height-for-width best size calculation.
virtual int | DoGetBestClientWidth (int height) const
| Override this method to implement width-for-height best size calculation.
virtual void | SetInitialBestSize (const wxSize &size)
| Sets the initial window size if none is given (i.e. at least one of the components of the size passed to ctor/Create() is wxDefaultCoord).
void | SendDestroyEvent ()
| Generate wxWindowDestroyEvent for this window.
virtual bool | ProcessEvent (wxEvent &event)
| This function is public in wxEvtHandler but protected in wxWindow because for wxWindows you should always call ProcessEvent() on the pointer returned by GetEventHandler() and not on the wxWindow object itself.
bool | SafelyProcessEvent (wxEvent &event)
| See ProcessEvent() for more info about why you shouldn't use this function and the reason for making this function protected in wxWindow.
virtual void | QueueEvent (wxEvent *event)
| See ProcessEvent() for more info about why you shouldn't use this function and the reason for making this function protected in wxWindow.
virtual void | AddPendingEvent (const wxEvent &event)
| See ProcessEvent() for more info about why you shouldn't use this function and the reason for making this function protected in wxWindow.
void | ProcessPendingEvents ()
| See ProcessEvent() for more info about why you shouldn't use this function and the reason for making this function protected in wxWindow.
bool | ProcessThreadEvent (const wxEvent &event)
| See ProcessEvent() for more info about why you shouldn't use this function and the reason for making this function protected in wxWindow.
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data.