Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Beginning Programming for Dummies 2004.pdf
Скачиваний:
109
Добавлен:
17.08.2013
Размер:
8.05 Mб
Скачать

Chapter 14: Creating a User Interface 213

NOTICE “You chose = “ + selected$

WAIT

[quit]

CONFIRM “Are you sure that you want to quit?”; quit$

IF quit$ = “no” THEN WAIT

CLOSE #1

END

Creating group boxes

Group boxes do nothing more than surround other controls, as shown in Figure 14-9. This can be especially useful when you want to separate groups of radio buttons or check boxes. To create a group box, use the following command:

GROUPBOX #Windowhandle, “Groupbox text”, xpos, ypos, width,

height

To see how group boxes work, try the following program:

NOMAINWIN WindowWidth = 250 WindowHeight = 200

GROUPBOX #1, “Your choices are”, 5, 5, 225, 120

RADIOBUTTON #1.radio2, “Radical liberalism”, [set], [reset], 10, 30, 150, 15

RADIOBUTTON #1.radio3, “The status quo”, [set], [reset], 10, 60, 150, 15

RADIOBUTTON #1.radio4, “Anything to benefit the rich”, [set], [reset], 10, 90, 150, 15

BUTTON #1.button1, “Exit program”, [quit], LL, 50, 1 OPEN “Vote for one or more” FOR Window AS #1

PRINT #1, “trapclose [quit]” WAIT

[set] WAIT

[quit]

CONFIRM “Are you sure you want to quit?”; quit$ IF quit$ = “no” THEN WAIT

CLOSE #1 END

214 Part III: Advanced Programming with Liberty BASIC

Figure 14-9:

A group box organizes multiple controls such as radio buttons.