]>
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
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxCommandLinkButton
12 Objects of this class are similar in appearance to the normal wxButtons but
13 are similar to the links in a web page in functionality.
15 Pressing such button usually results in switching to another window of the
16 program and so they can be used as a replacement for the "Next" button in a
17 multi-page dialog (such as wxWizard), for example.
19 Their advantage compared to the ordinary wxButtons is that they emphasize
20 the action of switching the window and also that they allow to give more
21 detailed explanation to the user because, in addition to the short button
22 label, they also show a longer description string.
24 The short, title-like, part of the label is called the <em>main label</em>
25 and the longer description is the <em>note</em>. Both of them can be set
26 and queried independently using wxCommandLinkButton-specific methods such
27 as SetMainLabel() or GetNote() or also via SetLabel() and GetLabel()
28 methods inherited from wxButton. When using the latter, the main label and
29 the note are concatenated into a single string using a new line character
30 between them (notice that the note part can have more new lines in it).
32 wxCommandLinkButton generates the same event as wxButton but doesn't
33 support any of wxButton-specific styles nor adds any new styles of its own.
35 Currently this class uses native implementation under Windows Vista and
36 later versions and a generic implementation for the other platforms and
37 earlier Windows versions.
43 @appearance{commandlinkbutton.png}
45 @see wxButton, wxBitmapButton
47 class wxCommandLinkButton
: public wxButton
53 Use Create() to really create the control.
55 wxCommandLinkButton();
58 Constructor really creating a command Link button.
60 The button will be decorated with stock icons under GTK+ 2.
63 Parent window. Must not be @NULL.
65 Button identifier. A value of wxID_ANY indicates a default value.
67 First line of text on the button, typically the label of an action
68 that will be made when the button is pressed.
70 Second line of text describing the action performed when the button
75 Button size. If the default size is specified then the button is sized
76 appropriately for the text.
78 Window style. See wxButton class description.
84 @see Create(), wxValidator
86 wxCommandLinkButton(wxWindow
* parent
, wxWindowID id
,
87 const wxString
& mainLabel
= wxEmptyString
,
88 const wxString
& note
= wxEmptyString
,
89 const wxPoint
& pos
= wxDefaultPosition
,
90 const wxSize
& size
= wxDefaultSize
,
92 const wxValidator
& validator
= wxDefaultValidator
,
93 const wxString
& name
= wxButtonNameStr
);
96 Button creation function for two-step creation.
97 For more details, see wxCommandLinkButton().
99 bool Create(wxWindow
* parent
, wxWindowID id
,
100 const wxString
& mainLabel
= wxEmptyString
,
101 const wxString
& note
= wxEmptyString
,
102 const wxPoint
& pos
= wxDefaultPosition
,
103 const wxSize
& size
= wxDefaultSize
,
105 const wxValidator
& validator
= wxDefaultValidator
,
106 const wxString
& name
= wxButtonNameStr
);
109 Sets a new main label and note for the button.
111 Neither of the arguments can be empty, if you need to change just the
112 label or just the note, use SetMainLabel() or SetNote() instead of this
116 New main label to use.
120 void SetMainLabelAndNote(const wxString
& mainLabel
, const wxString
& note
);
123 Sets the string label and note for the button.
126 The label and note to set, with the two separated
127 by the first newline or none to set a blank note.
129 virtual void SetLabel(const wxString
& label
);
132 Returns the string label for the button.
137 A string with the main label and note concatenated
138 together with a newline separating them.
140 wxString
GetLabel() const;
143 Changes the main label.
146 New main label to use.
148 void SetMainLabel(const wxString
& mainLabel
);
156 void SetNote(const wxString
& note
);
159 Returns the current main label.
162 Main label currently displayed.
164 wxString
GetMainLabel() const;
167 Returns the currently used note.
170 Note currently displayed.
172 wxString
GetNote() const;