phoenix_title wx.adv.CommandLinkButton

Objects of this class are similar in appearance to the normal Buttons 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 wx.adv.Wizard), for example.

Their advantage compared to the ordinary Buttons 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 CommandLinkButton-specific methods such as SetMainLabel or GetNote or also via SetLabel and GetLabel methods inherited from wx.Button. 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).

wx.adv.CommandLinkButton generates the same event as wx.Button but doesn’t support any of Button-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.

New in version 2.9.2.

See also

wx.Button, wx.BitmapButton


class_hierarchy Class Hierarchy

Inheritance diagram for class CommandLinkButton:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


method_summary Methods Summary

__init__

Default constructor.

Create

Button creation function for two-step creation.

GetClassDefaultAttributes

GetLabel

Returns the string label for the button.

GetMainLabel

Returns the current main label.

GetNote

Returns the currently used note.

SetLabel

Sets the string label and note for the button.

SetMainLabel

Changes the main label.

SetMainLabelAndNote

Sets a new main label and note for the button.

SetNote

Changes the note.


property_summary Properties Summary

Label

See GetLabel and SetLabel

MainLabel

See GetMainLabel and SetMainLabel

Note

See GetNote and SetNote


api Class API

class wx.adv.CommandLinkButton(Button)

Possible constructors:

CommandLinkButton()

CommandLinkButton(parent, id=ID_ANY, mainLabel="", note="",
                  pos=DefaultPosition, size=DefaultSize, style=0,
                  validator=DefaultValidator, name=ButtonNameStr)

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


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.

Use Create to really create the control.



__init__ (self, parent, id=ID_ANY, mainLabel=””, note=””, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ButtonNameStr)

Constructor really creating a command Link button.

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

Parameters:
  • parent (wx.Window) – Parent window. Must not be None.

  • id (wx.WindowID) – Button identifier. A value of wx.ID_ANY indicates a default value.

  • mainLabel (string) – First line of text on the button, typically the label of an action that will be made when the button is pressed.

  • note (string) – Second line of text describing the action performed when the button is pressed.

  • pos (wx.Point) – Button position.

  • size (wx.Size) – Button size. If the default size is specified then the button is sized appropriately for the text.

  • style (long) – Window style. See wx.Button class description.

  • validator (wx.Validator) – Window validator.

  • name (string) – Window name.

See also

Create , wx.Validator





Create(self, parent, id=ID_ANY, mainLabel="", note="", pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ButtonNameStr)

Button creation function for two-step creation.

For more details, see wx.adv.CommandLinkButton.

Parameters:
  • parent (wx.Window) –

  • id (wx.WindowID) –

  • mainLabel (string) –

  • note (string) –

  • pos (wx.Point) –

  • size (wx.Size) –

  • style (long) –

  • validator (wx.Validator) –

  • name (string) –

Return type:

bool



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)
Parameters:

variant (WindowVariant) –

Return type:

VisualAttributes



GetLabel(self)

Returns the string label for the button.

Return type:

string

Returns:

A string with the main label and note concatenated together with a newline separating them.

See also

SetLabel



GetMainLabel(self)

Returns the current main label.

Return type:

string

Returns:

Main label currently displayed.



GetNote(self)

Returns the currently used note.

Return type:

string

Returns:

Note currently displayed.



SetLabel(self, label)

Sets the string label and note for the button.

Parameters:

label (string) – The label and note to set, with the two separated by the first newline or none to set a blank note.



SetMainLabel(self, mainLabel)

Changes the main label.

Parameters:

mainLabel (string) – New main label to use.



SetMainLabelAndNote(self, mainLabel, 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:
  • mainLabel (string) – New main label to use.

  • note (string) – New note to use.



SetNote(self, note)

Changes the note.

Parameters:

note (string) – New note to use.


Properties

Label

See GetLabel and SetLabel



MainLabel

See GetMainLabel and SetMainLabel



Note

See GetNote and SetNote