]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/commandlinkbutton.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/commandlinkbutton.h
3 // Purpose: interface of wxCommandLinkButton
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 @class wxCommandLinkButton
11 Objects of this class are similar in appearance to the normal wxButtons but
12 are similar to the links in a web page in functionality.
14 Pressing such button usually results in switching to another window of the
15 program and so they can be used as a replacement for the "Next" button in a
16 multi-page dialog (such as wxWizard), for example.
18 Their advantage compared to the ordinary wxButtons is that they emphasize
19 the action of switching the window and also that they allow to give more
20 detailed explanation to the user because, in addition to the short button
21 label, they also show a longer description string.
23 The short, title-like, part of the label is called the <em>main label</em>
24 and the longer description is the <em>note</em>. Both of them can be set
25 and queried independently using wxCommandLinkButton-specific methods such
26 as SetMainLabel() or GetNote() or also via SetLabel() and GetLabel()
27 methods inherited from wxButton. When using the latter, the main label and
28 the note are concatenated into a single string using a new line character
29 between them (notice that the note part can have more new lines in it).
31 wxCommandLinkButton generates the same event as wxButton but doesn't
32 support any of wxButton-specific styles nor adds any new styles of its own.
34 Currently this class uses native implementation under Windows Vista and
35 later versions and a generic implementation for the other platforms and
36 earlier Windows versions.
42 @appearance{commandlinkbutton}
44 @see wxButton, wxBitmapButton
46 class wxCommandLinkButton
: public wxButton
52 Use Create() to really create the control.
54 wxCommandLinkButton();
57 Constructor really creating a command Link button.
59 The button will be decorated with stock icons under GTK+ 2.
62 Parent window. Must not be @NULL.
64 Button identifier. A value of wxID_ANY indicates a default value.
66 First line of text on the button, typically the label of an action
67 that will be made when the button is pressed.
69 Second line of text describing the action performed when the button
74 Button size. If the default size is specified then the button is sized
75 appropriately for the text.
77 Window style. See wxButton class description.
83 @see Create(), wxValidator
85 wxCommandLinkButton(wxWindow
* parent
, wxWindowID id
,
86 const wxString
& mainLabel
= wxEmptyString
,
87 const wxString
& note
= wxEmptyString
,
88 const wxPoint
& pos
= wxDefaultPosition
,
89 const wxSize
& size
= wxDefaultSize
,
91 const wxValidator
& validator
= wxDefaultValidator
,
92 const wxString
& name
= wxButtonNameStr
);
95 Button creation function for two-step creation.
96 For more details, see wxCommandLinkButton().
98 bool Create(wxWindow
* parent
, wxWindowID id
,
99 const wxString
& mainLabel
= wxEmptyString
,
100 const wxString
& note
= wxEmptyString
,
101 const wxPoint
& pos
= wxDefaultPosition
,
102 const wxSize
& size
= wxDefaultSize
,
104 const wxValidator
& validator
= wxDefaultValidator
,
105 const wxString
& name
= wxButtonNameStr
);
108 Sets a new main label and note for the button.
110 Neither of the arguments can be empty, if you need to change just the
111 label or just the note, use SetMainLabel() or SetNote() instead of this
115 New main label to use.
119 void SetMainLabelAndNote(const wxString
& mainLabel
, const wxString
& note
);
122 Sets the string label and note for the button.
125 The label and note to set, with the two separated
126 by the first newline or none to set a blank note.
128 virtual void SetLabel(const wxString
& label
);
131 Returns the string label for the button.
136 A string with the main label and note concatenated
137 together with a newline separating them.
139 wxString
GetLabel() const;
142 Changes the main label.
145 New main label to use.
147 void SetMainLabel(const wxString
& mainLabel
);
155 void SetNote(const wxString
& note
);
158 Returns the current main label.
161 Main label currently displayed.
163 wxString
GetMainLabel() const;
166 Returns the currently used note.
169 Note currently displayed.
171 wxString
GetNote() const;