AddTBtextButton

Syntax:

AddTBtextButton( #ButtonID, Text$, Type )

Parameters:

#ButtonID

=

thats your "Button-Number" and at the same time it is the CommandID.

The CommandID is the value you get from EventMenuID() after WaitWindowEvent().

Use any value you want here, but not 0.

For not colliding with other MenuIDs, you can start this number at a higher count, lets say 500. Better 600. ;)


Text$

=

Your Text for this Button


Type

=

a Flag for the Button-Type. Use one of the following types:


#TBpro_Button

#TBpro_PushButton

#TBpro_CheckButton

#TBpro_DropdownButton

#TBpro_WholeDropdownButton


Return Values:

#FALSE

=

button creation failed

<> 0

=

button created


Description:

Add a TextButton to your Toolbar.

This Button doesnt have an Image, but Text.


Example:

  AddTBtextButton(100,"Button 01",#TBpro_BUTTON)
  AddTBtextButton(101,"Button 02",#TBpro_BUTTON)
  AddTBtextButton(102,"Button 03",#TBpro_BUTTON)
  AddTBtextButton(103,"Button 04",#TBpro_BUTTON)

Remarks:

Attention:

This command resets the ButtonWidth for all Buttons to its original state !!

(you can change the width with SetTBbuttonWidth() )

Use SetTBbuttonWidth() only after adding all TextButtons to your TB, and

not in the same loop with AddTBtextButton().


Dont use AddTBtextButton() with SetTBbuttonWidth() in the same loop !!


Button Types explained:


#TBpro_Button

Standard Button you can see in every Toolbar.

Simply press this button.


#TBpro_PushButton

This is a Button that toggles its state when you press it.

One click to ´mark´ it, another click to ´unmark´ it.


#TBpro_CheckButton

Like a PushButton, but used in a group.

Only 1 Button of the Group can be pressed at one time.


Its like a group of "RadioButtons".

Place a few of this Buttons beside each other and if you

dont want to add more Buttons to this Group, just use another

Style for the next Button or end the group with a Separator.


#TBpro_DropdownButton

Button with a little arrow on the right side.


The Button is splitted into 2 parts:

A ´normal part´ that acts like a standard button,

and the right part that displays the little arrow.

The ´normal part´ of the Button acts like a standard

button, but when you press the little arrow, the Toolbar

sends a #TBN_DROPDOWN notification to the main-window.

If you get this message you can display a popup-menu

with options etc..


#TBpro_WholeDropdownButton

Same like #TBpro_DropdownButton, but this time the

WHOLE Button sends the #TBN_DROPDOWN notification and this

Button is not splitted into 2 pieces.



Supported OS:   Windows