AddTBbutton

Syntax:

AddTBbutton( #ButtonID, #Image, 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. ;)


#Image

=

The number of the image from your image-list (starting with 1) you want to use with this Button or one of the System Icons. See Remarks.


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 Button to your Toolbar.


Example:

                                                   ;BtnID|  Image  | Type
                                                   ;----------------------
   AddTBbutton(500,1,#TBpro_BUTTON)                ; 500 |    1    | Btn
   AddTBbutton(501,2,#TBpro_BUTTON)                ; 501 |    2    | Btn
   AddTBseparator()                                ;     |         | SEP
   AddTBbutton(502,  #TBpro_CUT,#TBpro_CheckBUTTON); 502 |Sys:Cut  | Check
   AddTBbutton(503, #TBpro_COPY,#TBpro_CheckBUTTON); 503 |Sys:Copy | Check
   AddTBbutton(504,#TBpro_PASTE,#TBpro_CheckBUTTON); 504 |Sys:Paste| Check
   AddTBseparator()                                ;     |         | SEP
   AddTBbutton(505,3,#TBpro_PushButton)            ; 505 |    3    | Push
   AddTBbutton(506,4,#TBpro_PushButton)            ; 506 |    4    | Push

Remarks:

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.




Image Numbers:

For the Image Number, you can use an Index from the ImageList

you added to the Toolbar with the command SetTBimage().


The ImageNumbers start at 1 and go up to the last image on

your Button-Picture.


When your Toolbar Image-Size is 16x16 or 24x24, you can use

System Icons instead of images.

Before you can use SystemIcons you have to call AddTBsysIcons()

after setting your button pictures.


If you have done all this setup carefully, you can use the

following constants for the image number:


(MOVE MOUSE CURSOR OVER THE IMAGES TO SEE THE #CONSTANT)


Image:

#TBpro_CUT#TBpro_COPY#TBpro_PASTE #TBpro_UNDO#TBpro_REDO #TBpro_FILENEW#TBpro_FILEOPEN#TBpro_FILESAVE #TBpro_DELETE#TBpro_HELP #TBpro_FIND#TBpro_REPLACE #TBpro_PRINT#TBpro_PRINTPREVIEW
#TBpro_PROPERTIES#TBpro_FAVORITES#TBpro_ADDTOFAVORITES #TBpro_BACK#TBpro_FORWARD #TBpro_VIEWTREE#TBpro_LARGEICONS#TBpro_SMALLICONS#TBpro_LISTICONS#TBpro_DETAILICONS #TBpro_SORTNAME#TBpro_SORTSIZE#TBpro_SORTDATE#TBpro_SORTTYPE #TBpro_PARENTFOLDER#TBpro_NEWFOLDER
#TBpro_NETCONNECT#TBpro_NETDISCONNECT




Supported OS:   Windows