BB___GROUPBOX

=GROUPBOX= toc

Description
> A GROUPBOX is a box with a label that surrounds a group of //controls// in a Graphical User Interface (GUI) window. Usually, the grouped controls will have a common purpose and would be grouped together for better organization and usability.

Groupbox Features
>> #handle.ext {"a string" or stringVar}
 * //**Changing the label.**// The "label" can be expressed as a literal string or a string variable. The label text can be changed after the GUI window is opened by printing the new text to the groupbox:

> //**Note**//: There appears to be a random bug that sometimes will cause the groupbox to display with two top borders. This seems to be connected with changing the font size of the label of the groupbox. With Just BASIC, the only //cure// seems to be to revert to the default font size for all of your groupboxes (if you find the display of the double border objectionable).


 * //**Grouping Radiobuttons.**// Sets of radiobuttons can be surrounded with a groupbox and made to act as a logical unit apart from any other radiobuttons, or sets of radiobuttons, on a window. This allows your program to have more than one radiobutton set at one time on any one window. See RADIOBUTTON.

Groupbox Commands
The following commands (Methods) can be used with groupboxes. See the individual pages for discussion. print #handle.ext, "!disable" print #handle.ext, "!enable" print #handle.ext, "!font facename pointSize" Notice that the commands all have an exclamation point (!) preceding them. This is because groupboxes can have text written on them, which is the "label". The exclamation point distinguishes a command from the label.

Example
code format="lb" 'The first groupbox groups together and organizes the customer input data. 'The second groupbox groups a set of radiobuttons together so one button ' can be selected and the selection in the third groupbox will not be affected. nomainwin

GROUPBOX #main.cus, "Enter Customer Data", 10, 40, 230, 80 statictext #main.nam "Name: ", 18, 60, 50, 25 textbox #main.nam1 70, 60, 150, 25 statictext #main.acct "Acct. no.: ", 18, 85, 50, 25 textbox #main.acct1 70, 85, 150, 25

statictext #main.st1 "Continue with input?", 10, 140, 150, 25

GROUPBOX #main.yorn, "Yes or No", 70, 160, 150, 80 radiobutton #main.yes, "Yes", doRadio, dummy, 88, 180, 100, 20 radiobutton #main.no, "No", doRadio,dummy, 88, 200, 100, 20

GROUPBOX #main.ok "Like this?", 10, 250, 150, 50 radiobutton #main.ok "I like groupboxes", [set], [reset], 18, 270, 100, 20

open "Groupboxes" for window as #main #main "trapclose [quit]" #main.cus "!font Arial 9 bold" #main.yorn "!font Arial 9 bold" #main.yes "set" #main.ok "set" wait

[set] wait [reset] wait

[quit] close #main end

sub doRadio main$ if main$ = "#main.yes" then notice "You selected yes" if main$ = "#main.no" then notice "You selected no" end sub code

Useful Functions
code format="lb" Place a useful function using this command here code