home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Games / Stella Obscura 1.1 / source / Parts ƒ / HowToView.p < prev    next >
Encoding:
Text File  |  1990-05-13  |  2.4 KB  |  110 lines  |  [TEXT/PJMM]

  1. unit howToView;
  2.  
  3. interface
  4.  
  5.     procedure D_howToView;
  6.  
  7. implementation
  8.  
  9.     const
  10.         I_Okay = 1;
  11.         I_Static_Text = 2;
  12.         I_Static_Text3 = 3;
  13.         I_Static_Text5 = 4;
  14.         I_Static_Text7 = 5;
  15.         I_Static_Text9 = 6;
  16.         I_Static_Text11 = 7;
  17.         I_Static_Text13 = 8;
  18.         I_Static_Text15 = 9;
  19.         I_Static_Text17 = 10;
  20.         I_Static_Text19 = 11;
  21.         I_Static_Text21 = 12;
  22.         I_Static_Text23 = 13;
  23.         I_Static_Text25 = 14;
  24.         I_Picturex27 = 15;
  25.         I_Picturex28 = 16;
  26.     var
  27.         ExitDialog: boolean;                 {Flag used to exit the Dialog}
  28.  
  29. {===========================================================}
  30.  
  31.     function MyFilter (theDialog: DialogPtr; var theEvent: EventRecord; var itemHit: integer): boolean;
  32.         var
  33.             DoubleClick: boolean;
  34.             MyPt: Point;
  35.             tempRect: Rect;
  36.     begin
  37.         MyFilter := FALSE;
  38.         if (theEvent.what = MouseDown) then
  39.             begin
  40.                 MyPt := theEvent.where;
  41.                 with theDialog^.portBits.bounds do
  42.                     begin
  43.                         myPt.h := myPt.h + left;
  44.                         myPt.v := myPt.v + top;
  45.                     end;
  46.             end;
  47.     end;
  48.  
  49. {===========================================================}
  50.  
  51.     procedure D_howToView;
  52.         var
  53.             GetSelection: DialogPtr;
  54.             tempRect: Rect;
  55.             DType: Integer;
  56.             Index: Integer;
  57.             DItem: Handle;
  58.             CItem, CTempItem: controlhandle;
  59.             sTemp: Str255;
  60.             itemHit: Integer;
  61.             temp: Integer;
  62.             Icon_Handle: Handle;
  63.             NewMouse: Point;
  64.             InIcon: boolean;
  65.             ThisEditText: TEHandle;
  66.             TheDialogPtr: DialogPeek;
  67.  
  68.         procedure Refresh_Dialog;
  69.             var
  70.                 rTempRect: Rect;
  71.         begin
  72.         end;
  73.  
  74.     begin
  75.         GetSelection := GetNewDialog(3, nil, Pointer(-1));
  76.         ShowWindow(GetSelection);
  77.         SelectWindow(GetSelection);
  78.         SetPort(GetSelection);
  79.         TheDialogPtr := DialogPeek(GetSelection);
  80.         ThisEditText := TheDialogPtr^.textH;
  81.         HLock(Handle(ThisEditText));
  82.         ThisEditText^^.txSize := 9;
  83.         TextSize(9);
  84.         ThisEditText^^.txFont := geneva;
  85.         TextFont(geneva);
  86.         ThisEditText^^.txFont := 3;
  87.         ThisEditText^^.fontAscent := 10;
  88.         ThisEditText^^.lineHeight := 10 + 2 + 0;
  89.         HUnLock(Handle(ThisEditText));
  90.         ExitDialog := FALSE;
  91.         repeat
  92.             ModalDialog(nil, itemHit);
  93.             GetDItem(GetSelection, itemHit, DType, DItem, tempRect);
  94.             CItem := Pointer(DItem);
  95.             if (ItemHit = I_Okay) then
  96.                 begin
  97.                     ExitDialog := TRUE;
  98.                     Refresh_Dialog;
  99.                 end;
  100.             if (ItemHit = I_Picturex27) then
  101.                 begin
  102.                 end;
  103.             if (ItemHit = I_Picturex28) then
  104.                 begin
  105.                 end;
  106.         until ExitDialog;
  107.         DisposDialog(GetSelection);
  108.     end;
  109.  
  110. end.                                    {End of unit}