home *** CD-ROM | disk | FTP | other *** search
/ TopWare 18: Liquid / Image.iso / liquid / top1143 / gepackt.exe / BSPQTSW.EXE / NUMBTST.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-06-28  |  2.3 KB  |  102 lines

  1. (***************************************
  2. * WG-VISION 1.0   BEISPIELPROGRAMM     *
  3. ****************************************
  4. *                                      *
  5. * Fenster mit Zählschalter             *
  6. *                                      *
  7. ****************************************
  8. * (c) 1993 Dipl.Phys. Mathias Scholz   *
  9. ***************************************)
  10.  
  11. {$I COMPILER.INC}
  12.  
  13. program NumbTest;
  14.  
  15. uses WDecl,
  16.      WEvent,
  17.      WApp,
  18.      WDlg;
  19.  
  20. const cmNewWindow=101;
  21.  
  22. type TApplication=object(TApp)
  23.       procedure InitMenuBar; virtual;
  24.       procedure SetDialogData; virtual;
  25.       procedure HandleEvent; virtual;
  26.       procedure NewWindow;
  27.      end;
  28.  
  29.      PNewWindow=^TNewWindow;
  30.      TNewWindow=object(TDlgWindow)
  31.       constructor Init;
  32.      end;
  33.  
  34.      tPrintPages=record
  35.                    Schalter:string[4];
  36.                    VonSeite:string[3];
  37.                    BisSeite:string[3];
  38.                    Exemplare:string[2];
  39.                  end;
  40.  
  41. var MyApp:TApplication;
  42.     PPages:tPrintPages;
  43.  
  44.  
  45. {Implementation TApplication}
  46.  
  47. procedure TApplication.InitMenuBar;
  48. begin
  49.   MainMenu('~F~enster',0);
  50.    SubMenu('~T~estfenster',cmNewWindow,0,0,false,false);
  51.    SubMenu('E~x~it  Alt-X',cmCloseApplication,0,altX,false,false);
  52. end;
  53.  
  54. procedure TApplication.SetDialogData;
  55. begin
  56.   with PPages do
  57.    begin
  58.      Schalter:='SLLL';
  59.      VonSeite:='  1';
  60.      BisSeite:='  1';
  61.      Exemplare:=' 1';
  62.    end;
  63. end;
  64.  
  65. procedure TApplication.HandleEvent;
  66. begin
  67.   TProgram.HandleEvent;
  68.   case Event.Command of
  69.    cmNewWindow:NewWindow;
  70.   end; {case}
  71. end;
  72.  
  73. procedure TApplication.NewWindow;
  74. var Window:PNewWindow;
  75. begin
  76.   Window:=New(PNewWindow, Init);
  77.   InsertDesktop(Window);
  78. end;
  79.  
  80. {Implementation TNewWindow}
  81.  
  82. constructor TNewWindow.Init;
  83. var RR:TRect;
  84. begin
  85.   RR.Assign(60,80,300,280);
  86.   TDlgWindow.Init(RR,'Fenster mit Zählschalter',winDouble+winPanel+winMenu+winKey);
  87.   SetStaticText(20,40,'Dokument drucken',LeftText);
  88.    ChangePalColor(10,Red);
  89.   SetNumButton(20,100,3,'~V~on',3,1,1,999,1,3.0);
  90.   SetNumButton(135,100,3,'~B~is',3,1,1,999,1,3.0);
  91.   SetNumButton(40,155,2,'~E~xemplare',2,2,1,99,1,2.0);
  92.   SetData(PPages);
  93. end;
  94.  
  95. {Hauptprogramm}
  96.  
  97. begin
  98.   MyApp.Init('Fenster-Test');
  99.   MyApp.Run;
  100.   MyApp.Done;
  101. end.
  102.