home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
dialgmgr.sit
/
Sample.p
< prev
next >
Wrap
Text File
|
1990-01-04
|
2KB
|
90 lines
program Sample;
uses
TObject, TDialogs;
const
red = 5;
white = 6;
blue = 7;
young = 8;
old = 9;
smart = 10;
name = 3;
nameCheck = 11;
nameList = 4;
fun = 12;
job = 13;
popStatic = 16;
popMenuNum = 2000;
townList = 15;
var
theDialog: TDialog;
theItem: Integer;
number: Integer;
text: Str255;
textRect: Rect;
begin
SetRect(TextRect, 5, 40, 500, 175);
SetTextRect(TextRect);
ShowText;
new(theDialog);
theDialog.Init;
theDialog.Define(2001, [smart], fun);
theDialog.RadioGroup(white, [red, white, blue], 'Color', FALSE);
theDialog.RadioGroup(young, [young, old], 'Age', TRUE);
theDialog.TextGroup(nameCheck, name);
theDialog.PopMenu(nil, popMenuNum, popStatic, 7);
theDialog.KeyButton(CHR(returnCode), OK);
theDialog.KeyButton(CHR(enterCode), OK);
theDialog.KeyButton('o', OK);
theDialog.KeyButton('.', Cancel);
theDialog.ItemList(nameList, 3, 5);
theDialog.ItemListText('Tom');
theDialog.ItemListText('Dick');
theDialog.ItemListText('Harry');
theDialog.ItemListText('Sally');
theDialog.ItemListText('Susan');
theDialog.ItemListText('Alice');
theDialog.ItemList(townList, 2, 5);
theDialog.ItemListText('Natick');
theDialog.ItemListText('Boston');
theDialog.ItemListText('Cambridge');
theDialog.ItemListText('Salem');
theDialog.ItemListText('Seattle');
theDialog.ItemListText('Portland');
theDialog.ItemListText('San Diego');
theDialog.ItemListText('San Francisco');
theDialog.ItemListText('Marin');
theDialog.ItemListText('Orlando');
theDialog.Display(TRUE);
theItem := theDialog.Accept;
Writeln('Button Clicked ', theItem : 3);
theDialog.ItemListGet(1, number, text);
Writeln('Item list #1 ', number : 3, ' ', text);
theDialog.ItemListGet(2, number, text);
Writeln('Item list #2 ', number : 3, ' ', text);
theDialog.RadioGroupGet(1, number);
Writeln('Radio Group #1 ', number : 3);
theDialog.RadioGroupGet(2, number);
Writeln('Radio Group #2 ', number : 3);
theDialog.PopMenuGet(1, number, text);
Writeln('PopUp Menu #1 ', number : 3, ' ', text);
number := theDialog.GetLongintValue(name);
text := theDialog.GetStringValue(name);
Writeln('Item name: ', number : 3, ' ', text);
number := theDialog.GetLongintValue(fun);
text := theDialog.GetStringValue(fun);
Writeln('Item fun: ', number : 3, ' ', text);
number := theDialog.GetLongintValue(job);
text := theDialog.GetStringValue(job);
Writeln('Item job: ', number : 3, ' ', text);
theDialog.Free;
end.