home *** CD-ROM | disk | FTP | other *** search
/ Best of German Only 1 / romside_best_of_german_only_1.iso / wissen / dos / wgraph / entpack.exe / WGBSP!.EXE / BSP20.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-05  |  2KB  |  94 lines

  1. program Beispiel20;
  2.  
  3. uses GDecl,
  4.      GEvent,
  5.      GViews,
  6.      GDlg,
  7.      GApp,
  8.      Graph;
  9.  
  10.  
  11. const cmDialog = 101;
  12.  
  13. type TApplication=object(TApp)
  14.        procedure InitMenuBar; virtual;
  15.        procedure SetDialogData; virtual;
  16.        procedure HandleEvent; virtual;
  17.        procedure DialogWindow;
  18.      end;
  19.  
  20.      tDialogData=record
  21.                    Schalter:string[19];
  22.                  end;
  23.  
  24. var MyProg:TApplication;
  25.     PrintDialogData:tDialogData;
  26.  
  27. {Implementation TApplication}
  28.  
  29. procedure TApplication.InitMenuBar;
  30. begin
  31.   Palette[1]:=#14;
  32.   Palette[5]:=#14;
  33.   Palette[4]:=#4;
  34.   Palette[12]:=#4;
  35.   MainMenu('~F~enster',0);
  36.    SubMenu('~D~ialogfenster',cmDialog,0,0,false,false);
  37.    SubMenu('E~x~it  Alt-X',cmCloseApplication,0,altX,false,false);
  38. end;
  39.  
  40. procedure TApplication.SetDialogData;
  41. begin
  42.   with PrintDialogData do Schalter:='TTGRrrrrGrRrCGcccS';
  43. end;
  44.  
  45. procedure TApplication.HandleEvent;
  46. begin
  47.   Heap^.ShowHeapStatus(523,8,White);
  48.   TProgram.HandleEvent;
  49.   case Event.Command of
  50.    cmDialog : DialogWindow;
  51.   end; {case}
  52. end;
  53.  
  54.  
  55. procedure TApplication.DialogWindow;
  56. var R:TRect;
  57.     Window:PDlgWindow;
  58. begin
  59.   R.Assign(60,80,440,390);
  60.   Window:=new(PDlgWindow, Init(R,'Beispiel 20 : Radio- und Checkbuttons',winDouble+winPanel));
  61.   with Window^ do
  62.    begin
  63.      SetPushButton(190,270,80,22,'OK',cmCloseWindow);
  64.      SetPushButton(285,270,80,22,'Abbrechen',cmNothing);
  65.      SetGroupFrame(20,40,180,140,'Druckertyp',NormWidth);
  66.       SetRadioButton(40,70,'~M~atrixdrucker',1);
  67.       SetRadioButton(40,90,'~L~aserdrucker',1);
  68.       SetRadioButton(40,110,'~T~ypenraddrucker',1);
  69.       SetRadioButton(40,130,'~B~ubble-Jet',1);
  70.       SetRadioButton(40,150,'T~h~ermodrucker',1);
  71.      SetGroupFrame(220,40,135,90,'Auflösung',NormWidth);
  72.       SetRadioButton(240,70,'~3~00 dpi',2);
  73.       SetRadioButton(240,90,'~1~60 dpi',2);
  74.       SetRadioButton(240,110,' ~7~5 dpi',2);
  75.      SetCheckButton(225,165,'~E~inzelblatt');
  76.      SetGroupFrame(20,200,155,88,'',ThickWidth);
  77.       SetCheckButton(40,225,'~F~ett');
  78.       SetCheckButton(40,245,'~K~ursiv');
  79.       SetCheckButton(40,265,'~U~nterstrichen');
  80.      SetStaticText(195,210,'Drucker-Dialog',LeftText);
  81.       SetTextParameters(TSCRFont,HorizDir,1);
  82.       ChangePalColor(10,Red);
  83.      SetData(PrintDialogData);
  84.    end;
  85.   InsertDesktop(Window);
  86. end;
  87.  
  88. {--- Hauptprogramm ---}
  89.  
  90. begin
  91.   MyProg.Init('Beispiel 20');
  92.   MyProg.Run;
  93.   MyProg.Done;
  94. end.