home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Code Resources / PICT CDEF / Test Program / TestCDEF.p next >
Encoding:
Text File  |  1994-09-03  |  559 b   |  24 lines  |  [TEXT/PJMM]

  1. program TestCDEF;
  2.     const
  3.         DIALOG = 128;
  4.         PAGE1 = 132;
  5.         PAGE2 = 133;
  6.         PICTCNTLITEM = 4;
  7.         DONEITEM = 1;
  8.         SWITCHITEM = 2;
  9.     var
  10.         theDialog: DialogPtr;
  11.         item, itemType: integer;
  12.         theControl: ControlHandle;
  13.         r: Rect;
  14. begin
  15.     theDialog := GetNewDialog(DIALOG, nil, windowPtr(-1));
  16.     GetDItem(theDialog, PICTCNTLITEM, itemType, Handle(theControl), r);
  17.     SetCtlValue(theControl, PAGE1);
  18.     repeat
  19.         DrawDialog(theDialog);
  20.         ModalDialog(nil, item);
  21.         if item = SWITCHITEM then
  22.             SetCtlValue(theControl, 265 - GetCtlValue(theControl));
  23.     until item = DONEITEM;
  24. end.