Version: 2.9.4
Public Member Functions
wxCommandLinkButton Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/commandlinkbutton.h>

Inheritance diagram for wxCommandLinkButton:

Detailed Description

Objects of this class are similar in appearance to the normal wxButtons but are similar to the links in a web page in functionality.

Pressing such button usually results in switching to another window of the program and so they can be used as a replacement for the "Next" button in a multi-page dialog (such as wxWizard), for example.

Their advantage compared to the ordinary wxButtons is that they emphasize the action of switching the window and also that they allow to give more detailed explanation to the user because, in addition to the short button label, they also show a longer description string.

The short, title-like, part of the label is called the main label and the longer description is the note. Both of them can be set and queried independently using wxCommandLinkButton-specific methods such as SetMainLabel() or GetNote() or also via SetLabel() and GetLabel() methods inherited from wxButton. When using the latter, the main label and the note are concatenated into a single string using a new line character between them (notice that the note part can have more new lines in it).

wxCommandLinkButton generates the same event as wxButton but doesn't support any of wxButton-specific styles nor adds any new styles of its own.

Currently this class uses native implementation under Windows Vista and later versions and a generic implementation for the other platforms and earlier Windows versions.

Since:
2.9.2

Library:  wxAdvanced
Category:  Controls

Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance
参照:
wxButton, wxBitmapButton

Public Member Functions

 wxCommandLinkButton ()
 Default constructor.
 wxCommandLinkButton (wxWindow *parent, wxWindowID id, const wxString &mainLabel=wxEmptyString, const wxString &note=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxButtonNameStr)
 Constructor really creating a command Link button.
bool Create (wxWindow *parent, wxWindowID id, const wxString &mainLabel=wxEmptyString, const wxString &note=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxButtonNameStr)
 Button creation function for two-step creation.
void SetMainLabelAndNote (const wxString &mainLabel, const wxString &note)
 Sets a new main label and note for the button.
virtual void SetLabel (const wxString &label)
 Sets the string label and note for the button.
wxString GetLabel () const
 Returns the string label for the button.
void SetMainLabel (const wxString &mainLabel)
 Changes the main label.
void SetNote (const wxString &note)
 Changes the note.
wxString GetMainLabel () const
 Returns the current main label.
wxString GetNote () const
 Returns the currently used note.

List of all members.


Constructor & Destructor Documentation

wxCommandLinkButton::wxCommandLinkButton ( )

Default constructor.

Use Create() to really create the control.

wxCommandLinkButton::wxCommandLinkButton ( wxWindow parent,
wxWindowID  id,
const wxString mainLabel = wxEmptyString,
const wxString note = wxEmptyString,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxValidator validator = wxDefaultValidator,
const wxString name = wxButtonNameStr 
)

Constructor really creating a command Link button.

The button will be decorated with stock icons under GTK+ 2.

Parameters:
parentParent window. Must not be NULL.
idButton identifier. A value of wxID_ANY indicates a default value.
mainLabelFirst line of text on the button, typically the label of an action that will be made when the button is pressed.
noteSecond line of text describing the action performed when the button is pressed.
posButton position.
sizeButton size. If the default size is specified then the button is sized appropriately for the text.
styleWindow style. See wxButton class description.
validatorWindow validator.
nameWindow name.
参照:
Create(), wxValidator

Member Function Documentation

bool wxCommandLinkButton::Create ( wxWindow parent,
wxWindowID  id,
const wxString mainLabel = wxEmptyString,
const wxString note = wxEmptyString,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxValidator validator = wxDefaultValidator,
const wxString name = wxButtonNameStr 
)

Button creation function for two-step creation.

For more details, see wxCommandLinkButton().

wxString wxCommandLinkButton::GetLabel ( ) const [virtual]

Returns the string label for the button.

参照:
SetLabel()
Returns:
A string with the main label and note concatenated together with a newline separating them.

Reimplemented from wxButton.

wxString wxCommandLinkButton::GetMainLabel ( ) const

Returns the current main label.

Returns:
Main label currently displayed.
wxString wxCommandLinkButton::GetNote ( ) const

Returns the currently used note.

Returns:
Note currently displayed.
virtual void wxCommandLinkButton::SetLabel ( const wxString label) [virtual]

Sets the string label and note for the button.

Parameters:
labelThe label and note to set, with the two separated by the first newline or none to set a blank note.

Reimplemented from wxButton.

void wxCommandLinkButton::SetMainLabel ( const wxString mainLabel)

Changes the main label.

Parameters:
mainLabelNew main label to use.
void wxCommandLinkButton::SetMainLabelAndNote ( const wxString mainLabel,
const wxString note 
)

Sets a new main label and note for the button.

Neither of the arguments can be empty, if you need to change just the label or just the note, use SetMainLabel() or SetNote() instead of this function.

Parameters:
mainLabelNew main label to use.
noteNew note to use.
void wxCommandLinkButton::SetNote ( const wxString note)

Changes the note.

Parameters:
noteNew note to use.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines