AddButton Method (TOOLBAR)


PLBCMP GUI Only

 

The AddButton method creates a new button in a TOOLBAR object. The method uses the following format:

 

[label]

{object}.AddButton

[GIVING {return}] USING [*AutoSize=]{autosize}[:

 

 

[*BtnStyle=]{btnstyle}][:

 

 

[*Enabled=]{enabled}][:

 

 

[*ImageIndex=]{imageindex}][:

 

 

[*PartialPush=]{partialpush}][:

 

 

[*Pushed=]{pushed}][:

 

 

[*Tag=]{tag}][:

 

 

[*Visible=]{visible}][:

 

 

[*Text=]{text}][:

 

 

[*RunName=]{runname}][:

 

 

[*ToolTip=]{tooltip}][:

 

 

[*MenuText=]{menutext}]:

 

 

[*UserData=]{userdata}][:

 

 

[*InsertAt=]{insertAt}][:

 

 

[*CauseValid=]{causevalid}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A TOOLBAR object to which a button is added.

return

Optional. A TOOLBUTTON object that gets the return value.

autosize

Optional. A decimal number or Numeric Variable that specifies the automatic sizing method. (see AUTOSIZE property)

btnstyle

Optional. A decimal number or Numeric Variable that specifies the button style. (see BTNSTYLE property)

enabled

Optional. A decimal number or Numeric Variable that set the buttons initial state. (see ENABLED property)

imageindex

Optional. A decimal number or Numeric Variable that specifies the image index of the button. (see IMAGEINDEX property)

partialpush

Optional. A decimal number or Numeric Variable that specifies the image index of the button. (see PARTIALPUSH property)

pushed

Optional. A decimal number or Numeric Variable that specifies the image index of the button. (see PUSHED property)

tag

Optional. A decimal number or Numeric Variable that specifies tab number of the button. (see TAG property)

visible

Optional. A decimal number or Numeric Variable that specifies the visibility of the button. (see VISIBLE property)

text

Optional. A Character String Variable or literal that specifies the text displayed on the button. (see TEXT property)

runname

Optional. A Character String Variable or literal that specifies the run time name of the button. (see RUNNAME property)

tooltip

Optional. A Character String Variable or literal that specifies the tool tip that is displayed for the button. (see TOOLTIP property)

menutext

Optional. A Character String Variable or literal that specifies the menu text for the button. (see MENUTEXT property)

userdata

Optional. A Character String Variable or literal that specifies the user defined data. (see USERDATA property)

insertAt

Optional. A decimal number or Numeric Variable that specifies the zero based index of the TOOLBAR button. (10.1B)

causevalid

Optional. A decimal number or Numeric Variable that disables or enables the CAUSEVALID event for a TOOLBUTTON being added. (10.4B)

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. If the value returned is zero, the ZERO Condition Flag is set.

  2. The OVER and EOS Condition Flags are always cleared.

  3. The created panel can be accessed through the BUTTONS collection.

  4. For improved performance in the Application Server environment, do not specify the optional return value and parameters unless needed.

  5. If ({index} is sprecified, the new TOOLBUTTON is inserted to the left of the TOOLBAR button specified by the value.

  6. A {causevalid} of zero disables the CAUSEVALID event. A non-zero value enables the CAUSEVALID event. If this parameter is not used, the CAUSEVALID event for the TOOBUTTON being added is enabled.

 

 

See Also: Example Code, Method Syntax, TOOLBAR Methods

 



PL/B Language Reference TOOLBAR Methods GetButton Method (TOOLBAR)