refactor wxStaticText::Ellipsize so it's a static public utility function; document...
[wxWidgets.git] / interface / wx / control.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: control.h
3 // Purpose: interface of wxControl
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxControl
11
12 This is the base class for a control or "widget".
13
14 A control is generally a small window which processes user input and/or
15 displays one or more item of data.
16
17 @library{wxcore}
18 @category{ctrl}
19
20 @see wxValidator
21 */
22 class wxControl : public wxWindow
23 {
24 public:
25 /**
26 Simulates the effect of the user issuing a command to the item.
27
28 @see wxCommandEvent
29 */
30 virtual void Command(wxCommandEvent& event);
31
32 /**
33 Returns the control's text.
34
35 @note The returned string contains mnemonics ("&" characters) if it has
36 any, use GetLabelText() if they are undesired.
37 */
38 wxString GetLabel() const;
39
40 /**
41 Returns the control's label without mnemonics.
42 */
43 wxString GetLabelText() const;
44
45 /**
46 Returns the given @a label string without mnemonics ("&" characters).
47 */
48 static wxString GetLabelText(const wxString& label);
49
50 /**
51 Removes the mnemonics ("&" characters) from the given string.
52 */
53 static wxString RemoveMnemonics(const wxString& str);
54
55 /**
56 Sets the item's text.
57
58 Any "&" characters in the @a label are special and indicate that the
59 following character is a @e mnemonic for this control and can be used to
60 activate it from the keyboard (typically by using @e Alt key in
61 combination with it).
62 To insert a literal ampersand character, you need to double it, i.e. use "&&".
63 */
64 void SetLabel(const wxString& label);
65 };
66