BoxButtonDraw

 

Creates a push-button in a WinBatch box.

Syntax:

BoxButtonDraw(box ID, button ID, text, coordinates)

Parameters:

(i) box ID the ID number of the desired WinBatch box..

(i) button ID the ID number from 1 - 16 specifying the desired push-button. Maximum buttons allowed, 16.

(s) text text to appear in the button

(s) coordinates dimensions of button, in virtual units (upper-x upper-y lower-x lower-y).

Returns:

(i) @TRUE on success; @FALSE on failure.

 

Draws a button using standard Windows colors and fonts by specifying a unique "ID", text and coordinates. If an existing button "ID" is reused, the text will be changed and then the button will be moved.

 

Note: If a button is moved, it is best to do so before the background is painted in order to color over the buttons original position. Moving buttons does cause some "flashing" on the screen.

 

The BoxButtonDraw function, which draws buttons in a WinBatch "box" window, is limited to 16 buttons per box window, but you can have up to 8 separate box windows, so you could have up to 128 buttons spread out over all the box windows.

Example:

;; sample code for BoxButtonDraw
bDraw1=1
bDraw2=2
bDraw3=3
BoxesUp("100,100,900,900", @NORMAL)
BoxDrawText(1, "0,210,1000,1000", "WinBatch Box Example - BoxButtonDraw %@CRLF% Drawing Buttons", @FALSE, 1)
TimeDelay(2)
BoxButtonDraw(1, bDraw1, "Button 1", "100,450,300,550")
TimeDelay(2)
BoxButtonDraw(1, bDraw2, "Button 2", "400,450,600,550")
TimeDelay(2)
BoxButtonDraw(1, bDraw3, "Button 3", "700,450,900,550")
bWho=0
While bWho == 0
   For x =1 To 3
      If BoxButtonStat(1,x) Then bWho=x
   Next
EndWhile
Message("Excuse Me", "Please, don't push my buttons")
BoxDestroy(1)
See Also:

BoxButtonKill, BoxButtonStat, BoxButtonWait, BoxesUp, BoxNew