home *** CD-ROM | disk | FTP | other *** search
/ Computer Club Elmshorn Atari PD / CCE_PD.iso / pc / 0600 / CCE_0632.ZIP / CCE_0632 / GOBJ_111.ZIP / GOBJECTS.111 / SOURCE / BEISPIEL / BEISPL09.PAS < prev    next >
Pascal/Delphi Source File  |  1994-03-26  |  16KB  |  652 lines

  1. program Beispiel; {$X+} { Beispiel Nr.9 }
  2.  
  3. uses
  4.  
  5.     Gem,Objects,OTypes,OProcs,OWindows,OValidat,ODialogs;
  6.  
  7. const
  8.  
  9.     {$I beispiel.i}
  10.  
  11. type
  12.  
  13.     PBeispielWindow = ^TBeispielWindow;
  14.     PAttrDialog     = ^TAttrDialog;
  15.     PLineData       = ^TLineData;
  16.     PLinie          = ^TLinie;
  17.     PPunkt          = ^TPunkt;
  18.     PAbout          = ^TAbout;
  19.     PNew            = ^TNew;
  20.     POpen           = ^TOpen;
  21.     PSave           = ^TSave;
  22.     PSaveAs         = ^TSaveAs;
  23.     PInfo           = ^TInfo;
  24.     PAttrib         = ^TAttrib;
  25.  
  26.     TMyApplication = object(TApplication)
  27.         save  : PSave;
  28.         saveas: PSaveAs;
  29.         info  : PInfo;
  30.         procedure InitInstance; virtual;
  31.         procedure InitMainWindow; virtual;
  32.         { neue Methoden: }
  33.         procedure UpdateInfo; virtual;
  34.     end;
  35.  
  36.     TBeispielWindow = object(TWindow)
  37.         Veraendert: boolean;
  38.         Dicke,
  39.         Farbe,
  40.         Art       : integer;
  41.         Pfad,
  42.         Datei     : string;
  43.         Zeichnung : PCollection;
  44.         constructor Init(AParent: PWindow; ATitle: string);
  45.         destructor Done; virtual;
  46.         procedure GetWindowClass(var AWndClass: TWndClass); virtual;
  47.         function GetClassName: string; virtual;
  48.         function CanClose: boolean; virtual;
  49.         procedure Paint(var PaintInfo: TPaintStruct); virtual;
  50.         procedure WMButton(mX,mY,BStat,KStat,Clicks: integer); virtual;
  51.         { neue Methoden: }
  52.         procedure SetAttr(Width,Color,Style: integer); virtual;
  53.         procedure CreateTitle; virtual;
  54.         procedure Speichern; virtual;
  55.     end;
  56.  
  57.     TAttrDialog = object(TDialog)
  58.         function OK: boolean; virtual;
  59.         function Help: boolean; virtual;
  60.     end;
  61.  
  62.     TLineData = record
  63.         Farben: array [0..7] of integer;
  64.         Stile : array [1..6] of integer;
  65.         Breite: string[5]
  66.     end;
  67.  
  68.     TLinie = object(TObject)
  69.         Punkte: PCollection;
  70.         Dicke,
  71.         Farbe,
  72.         Art   : integer;
  73.         constructor Init(Width,Color,Style: integer);
  74.         destructor Done; virtual;
  75.         procedure NeuerPunkt(AX,AY: integer); virtual;
  76.         procedure Zeichnen; virtual;
  77.         procedure Speichern; virtual;
  78.     end;
  79.  
  80.     TPunkt = object(TObject)
  81.         X,
  82.         Y: integer;
  83.         constructor Init(AX,AY: integer);
  84.     end;
  85.  
  86.     TAbout  = object(TKeyMenu)
  87.         procedure Work; virtual;
  88.     end;
  89.  
  90.     TNew    = object(TKeyMenu)
  91.         procedure Work; virtual;
  92.     end;
  93.  
  94.     TOpen   = object(TKeyMenu)
  95.         procedure Work; virtual;
  96.     end;
  97.  
  98.     TSave   = object(TKeyMenu)
  99.         procedure Work; virtual;
  100.     end;
  101.  
  102.     TSaveAs = object(TKeyMenu)
  103.         procedure Work; virtual;
  104.     end;
  105.  
  106.     TInfo   = object(TKeyMenu)
  107.         st1,
  108.         st2: PStatic;
  109.         procedure Work; virtual;
  110.         procedure BerechneWerte; virtual;
  111.     end;
  112.  
  113.     TAttrib = object(TKeyMenu)
  114.         LineData: TLineData;
  115.         procedure Work; virtual;
  116.     end;
  117.  
  118. var
  119.  
  120.     MyApp: TMyApplication;
  121.     f    : file of integer;
  122.  
  123.  
  124. procedure MyResource; external; {$L beispiel.o}
  125.  
  126.  
  127. procedure TMyApplication.InitInstance;
  128.  
  129.     begin
  130.         InitResource(@MyResource,nil);
  131.         LoadMenu(BSPMENU);
  132.         new(PAbout,Init(@self,K_CTRL,Ctrl_A,MABOUT,MTITLE1));
  133.         new(PNew,Init(@self,K_CTRL,Ctrl_N,MNEW,MTITLE2));
  134.         new(POpen,Init(@self,K_CTRL,Ctrl_O,MOPEN,MTITLE2));
  135.         save:=new(PSave,Init(@self,K_CTRL,Ctrl_S,MSAVE,MTITLE2));
  136.         saveas:=new(PSaveAs,Init(@self,K_CTRL,Ctrl_D,MSAVEAS,MTITLE2));
  137.         info:=new(PInfo,Init(@self,K_CTRL,Ctrl_I,MINFO,MTITLE3));
  138.         new(PAttrib,Init(@self,K_CTRL,Ctrl_T,MATTR,MTITLE3));
  139.         inherited InitInstance;
  140.         SetQuit(MQUIT,MTITLE2);
  141.         save^.Disable;
  142.         saveas^.Disable
  143.     end;
  144.  
  145.  
  146. procedure TMyApplication.InitMainWindow;
  147.  
  148.     begin
  149.         new(PBeispielWindow,Init(nil,'Beispiel  [unbenannt]'));
  150.         if (MainWindow=nil) or (ChkError<em_OK) then
  151.             Status:=em_InvalidMainWindow
  152.     end;
  153.  
  154.  
  155. procedure TMyApplication.UpdateInfo;
  156.  
  157.     begin
  158.         if info^.ADialog<>nil then
  159.             if info^.ADialog^.Attr.Status=ws_Open then
  160.                 info^.BerechneWerte
  161.     end;
  162.  
  163.  
  164. constructor TBeispielWindow.Init(AParent: PWindow; ATitle: string);
  165.  
  166.     begin
  167.         if not(inherited Init(AParent,ATitle)) then fail;
  168.         new(Zeichnung,Init(10,10));
  169.         Veraendert:=false;
  170.         SetAttr(3,Blue,LT_SOLID);
  171.         Datei:='';
  172.         Pfad:=''
  173.     end;
  174.  
  175.  
  176. destructor TBeispielWindow.Done;
  177.  
  178.     begin
  179.         dispose(Zeichnung,Done);
  180.         inherited Done
  181.     end;
  182.  
  183.  
  184. function TBeispielWindow.CanClose: boolean;
  185.     var valid: boolean;
  186.  
  187.     begin
  188.         valid:=inherited CanClose;
  189.         if valid and Veraendert then
  190.             valid:=(Application^.Alert(@self,1,WAIT,
  191.                 ' Die Grafik wurde verändert!| Wollen Sie sie speichern?',
  192.               '&Ja|  &Nein  ')=2);
  193.         CanClose:=valid
  194.     end;
  195.  
  196.  
  197. procedure TBeispielWindow.GetWindowClass(var AWndClass: TWndClass);
  198.  
  199.     begin
  200.         inherited GetWindowClass(AWndClass);
  201.         AWndClass.hCursor:=IDC_PENCIL
  202.     end;
  203.  
  204.  
  205. function TBeispielWindow.GetClassName: string;
  206.  
  207.     begin
  208.         GetClassName:='BeispielWindow'
  209.     end;
  210.  
  211.  
  212. procedure ZeichneLinienzug(p: PLinie);
  213.  
  214.     begin
  215.         p^.Zeichnen
  216.     end;
  217.  
  218.  
  219. procedure TBeispielWindow.Paint(var PaintInfo: TPaintStruct);
  220.  
  221.     begin
  222.         Zeichnung^.ForEach(@ZeichneLinienzug)
  223.     end;
  224.  
  225.  
  226. procedure TBeispielWindow.WMButton(mX,mY,BStat,KStat,Clicks: integer);
  227.     var xalt,yalt,btn,dummy: integer;
  228.         pxyarray           : ptsin_ARRAY;
  229.         ALinie             : PLinie;
  230.  
  231.     begin
  232.         if bTst(BStat,1) then
  233.             if GetDC>=0 then
  234.                 begin
  235.                     wind_update(BEG_MCTRL);
  236.                     vsl_width(vdiHandle,Dicke);
  237.                     vsl_color(vdiHandle,Farbe);
  238.                     vsl_type(vdiHandle,Art);
  239.                     vsl_ends(vdiHandle,LE_ROUNDED,LE_ROUNDED);
  240.                     ALinie:=new(PLinie,Init(Dicke,Farbe,Art));
  241.                     Zeichnung^.Insert(ALinie);
  242.                     ALinie^.NeuerPunkt(mX-Work.X,mY-Work.Y);
  243.                     repeat
  244.                         xalt:=mX;
  245.                         yalt:=mY;
  246.                         repeat
  247.                             graf_mkstate(mX,mY,btn,dummy)
  248.                         until (mX<>xalt) or (mY<>yalt) or not(bTst(btn,1));
  249.                         pxyarray[0]:=xalt;
  250.                         pxyarray[1]:=yalt;
  251.                         pxyarray[2]:=mX;
  252.                         pxyarray[3]:=mY;
  253.                         v_pline(vdiHandle,2,pxyarray);
  254.                         ALinie^.NeuerPunkt(mX-Work.X,mY-Work.Y)
  255.                     until not(bTst(btn,1));
  256.                     wind_update(END_MCTRL);
  257.                     ReleaseDC;
  258.                     Veraendert:=true;
  259.                     CreateTitle;
  260.                     MyApp.saveas^.Enable;
  261.                     if length(Datei)>0 then MyApp.save^.Enable;
  262.                     MyApp.UpdateInfo
  263.                 end;
  264.         if bTst(BStat,2) then
  265.             if CanClose then
  266.                 begin
  267.                     Zeichnung^.FreeAll;
  268.                     ForceRedraw;
  269.                     Veraendert:=false;
  270.                     CreateTitle;
  271.                     MyApp.save^.Disable;
  272.                     MyApp.saveas^.Disable;
  273.                     MyApp.UpdateInfo
  274.                 end
  275.     end;
  276.  
  277.  
  278. procedure TBeispielWindow.SetAttr(Width,Color,Style: integer);
  279.     const farben: array [0..7] of string[7] =
  280.         ('weiß','schwarz','rot','grün','blau','türkis','gelb','violett');
  281.                 arten: array [1..6] of string[16] =
  282.         ('durchgehend','langer Strich','Punkte','Strich, Punkt',
  283.                                      'Strich','Strich, 2 Punkte');
  284.  
  285.     begin
  286.         Dicke:=Width;
  287.         Farbe:=Color;
  288.         Art:=Style;
  289.         SetSubTitle(' Dicke: '+ltoa(Dicke)+'  Farbe: '+farben[Farbe]+
  290.                                 '   Art: '+arten[Art])
  291.     end;
  292.  
  293.  
  294. procedure TBeispielWindow.CreateTitle;
  295.     var titel: string;
  296.  
  297.     begin
  298.         if length(Datei)=0 then titel:='[unbenannt]'
  299.         else
  300.             titel:=Pfad+Datei;
  301.         if Veraendert then titel:='*'+titel;
  302.         titel:='Beispiel  '+titel;
  303.         SetTitle(titel)
  304.     end;
  305.  
  306.  
  307. procedure SpeichereLinienzug(p: PLinie);
  308.  
  309.     begin
  310.         p^.Speichern
  311.     end;
  312.  
  313.  
  314. procedure TBeispielWindow.Speichern;
  315.  
  316.     begin
  317.         BusyMouse;
  318.         assign(f,Pfad+Datei);
  319.         rewrite(f);
  320.         Zeichnung^.ForEach(@SpeichereLinienzug);
  321.         close(f);
  322.         ArrowMouse;
  323.         Veraendert:=false;
  324.         CreateTitle
  325.     end;
  326.  
  327.  
  328. function TAttrDialog.OK: boolean;
  329.     var valid: boolean;
  330.         d,f,s: integer;
  331.         attrb: ARRAY_4;
  332.  
  333.     begin
  334.         valid:=inherited OK;
  335.         if valid then
  336.             begin
  337.                 with PLineData(TransferBuffer)^ do
  338.                     begin
  339.                         f:=0;
  340.                         while Farben[f]<>bf_Checked do inc(f);
  341.                         s:=1;
  342.                         while Stile[s]<>bf_Checked do inc(s);
  343.                         vsl_width(vdiHandle,atol(Breite))
  344.                     end;
  345.                 vql_attributes(vdiHandle,attrb);
  346.                 PBeispielWindow(Application^.MainWindow)^.SetAttr(attrb[3],f,s)
  347.             end;
  348.         OK:=valid
  349.     end;
  350.  
  351.  
  352. function TAttrDialog.Help: boolean;
  353.  
  354.     begin
  355.         Application^.Alert(@self,1,NO_ICON,'In dieser Dialogbox werden die|Attribute der Linien eingestellt.|Die neuen Werte gelten ab der|ersten Linie, die nach dem|Schließen der Box gezeichnet|wird.','   &OK   ');
  356.         Help:=false
  357.     end;
  358.  
  359.  
  360. constructor TLinie.Init(Width,Color,Style: integer);
  361.  
  362.     begin
  363.         if not(inherited Init) then fail;
  364.         new(Punkte,Init(50,50));
  365.         Dicke:=Width;
  366.         Farbe:=Color;
  367.         Art:=Style
  368.     end;
  369.  
  370.  
  371. destructor TLinie.Done;
  372.  
  373.     begin
  374.         dispose(Punkte,Done);
  375.         inherited Done
  376.     end;
  377.  
  378.  
  379. procedure TLinie.NeuerPunkt(AX,AY: integer);
  380.  
  381.     begin
  382.         Punkte^.Insert(new(PPunkt,Init(AX,AY)))
  383.     end;
  384.  
  385.  
  386. procedure TLinie.Zeichnen;
  387.     var q       : longint;
  388.         vh,dx,dy: integer;
  389.         pxyarray: ptsin_ARRAY;
  390.  
  391.     begin
  392.         if Punkte^.Count>1 then
  393.             begin
  394.                 with Application^ do
  395.                     begin
  396.                         vh:=vdiHandle;
  397.                         dx:=MainWindow^.Work.X;
  398.                         dy:=MainWindow^.Work.Y
  399.                     end;
  400.                 vsl_width(vh,Dicke);
  401.                 vsl_color(vh,Farbe);
  402.                 vsl_type(vh,Art);
  403.                 vsl_ends(vh,LE_ROUNDED,LE_ROUNDED);
  404.                 with PPunkt(Punkte^.At(0))^ do
  405.                     begin
  406.                         pxyarray[2]:=X+dx;
  407.                         pxyarray[3]:=Y+dy
  408.                     end;
  409.                 for q:=1 to pred(Punkte^.Count) do
  410.                     with PPunkt(Punkte^.At(q))^ do
  411.                         begin
  412.                             pxyarray[0]:=pxyarray[2];
  413.                             pxyarray[1]:=pxyarray[3];
  414.                             pxyarray[2]:=X+dx;
  415.                             pxyarray[3]:=Y+dy;
  416.                             v_pline(vh,2,pxyarray)
  417.                         end
  418.             end
  419.     end;
  420.  
  421.  
  422. procedure TLinie.Speichern;
  423.     var q  : longint;
  424.         cnt: integer;
  425.  
  426.     begin
  427.         cnt:=Punkte^.Count;
  428.         if cnt>0 then
  429.             begin
  430.                 write(f,Dicke,Farbe,Art,cnt);
  431.                 for q:=0 to pred(cnt) do
  432.                     with PPunkt(Punkte^.At(q))^ do
  433.                         write(f,X,Y)
  434.             end
  435.     end;
  436.  
  437.  
  438. constructor TPunkt.Init(AX,AY: integer);
  439.  
  440.     begin
  441.         if not(inherited Init) then fail;
  442.         X:=AX;
  443.         Y:=AY
  444.     end;
  445.  
  446.  
  447. procedure TAbout.Work;
  448.  
  449.     begin
  450.         if ADialog=nil then
  451.             begin
  452.                 new(ADialog,Init(nil,'Über Beispiel',BSPABOUT));
  453.                 if ADialog<>nil then
  454.                     begin
  455.                         new(PGroupBox,Init(ADialog,IGROUP,'ObjectGEM '+
  456.                                                                 'Beispielprogramm','"42"'));
  457.                         new(PButton,Init(ADialog,IOK,id_OK,true,'Mit diesem '+
  458.                                             'Button|kann die Infobox|verlassen werden.'))
  459.                     end
  460.             end;
  461.         if ADialog<>nil then ADialog^.MakeWindow
  462.     end;
  463.  
  464.  
  465. procedure TNew.Work;
  466.  
  467.     begin
  468.         with PBeispielWindow(Application^.MainWindow)^ do
  469.             if CanClose then
  470.                 begin
  471.                     Zeichnung^.FreeAll;
  472.                     ForceRedraw;
  473.                     Veraendert:=false;
  474.                     Pfad:='';
  475.                     Datei:='';
  476.                     CreateTitle;
  477.                     MyApp.save^.Disable;
  478.                     MyApp.saveas^.Disable;
  479.                     MyApp.UpdateInfo
  480.                 end
  481.     end;
  482.  
  483.  
  484. procedure TOpen.Work;
  485.     var ALinie           : PLinie;
  486.         width,color,style: integer;
  487.         cnt,x,y          : integer;
  488.         q                : longint;
  489.  
  490.     begin
  491.         with PBeispielWindow(Application^.MainWindow)^ do
  492.             if FileSelect(nil,'BEISPIEL-LINIEN LADEN','*.BLN',
  493.                                             Pfad,Datei,true) then
  494.                 begin
  495.                     BusyMouse;
  496.                     Zeichnung^.FreeAll;
  497.                     assign(f,Pfad+Datei);
  498.                     reset(f);
  499.                     while not(eof(f)) do
  500.                         begin
  501.                             read(f,width,color,style,cnt);
  502.                             ALinie:=new(PLinie,Init(width,color,style));
  503.                             Zeichnung^.Insert(ALinie);
  504.                             for q:=1 to cnt do
  505.                                 begin
  506.                                     read(f,x,y);
  507.                                     ALinie^.NeuerPunkt(x,y)
  508.                                 end
  509.                         end;
  510.                     close(f);
  511.                     ArrowMouse;
  512.                     Veraendert:=false;
  513.                     CreateTitle;
  514.                     ForceRedraw;
  515.                     MyApp.save^.Enable;
  516.                     MyApp.saveas^.Enable;
  517.                     MyApp.UpdateInfo
  518.                 end
  519.     end;
  520.  
  521.  
  522. procedure TSave.Work;
  523.  
  524.     begin
  525.         PBeispielWindow(Application^.MainWindow)^.Speichern
  526.     end;
  527.  
  528.  
  529. procedure TSaveAs.Work;
  530.  
  531.     begin
  532.         with PBeispielWindow(Application^.MainWindow)^ do
  533.             if FileSelect(nil,'BEISPIEL-LINIEN SPEICHERN','*.BLN',
  534.                                             Pfad,Datei,false) then
  535.                 begin
  536.                     Speichern;
  537.                     MyApp.save^.Enable
  538.                 end
  539.     end;
  540.  
  541.  
  542. procedure TInfo.Work;
  543.  
  544.     begin
  545.         if ADialog=nil then
  546.             begin
  547.                 new(ADialog,Init(nil,'Info',BSPINFO));
  548.                 if ADialog<>nil then
  549.                     begin
  550.                         new(st1,Init(ADialog,FPOLY,22,false,'Gibt die Anzahl|der Linienzüge an.'));
  551.                         new(st2,Init(ADialog,FLINES,24,false,'Gibt die Anzahl|der Einzellinien|aller Linienzüge|an.'));
  552.                         new(PButton,Init(ADialog,FOK,id_OK,true,'Mit diesem '+
  553.                                             'Button|kann die Infobox|verlassen werden.'))
  554.                     end
  555.             end;
  556.         if ADialog<>nil then
  557.             begin
  558.                 BerechneWerte;
  559.                 ADialog^.MakeWindow
  560.             end
  561.     end;
  562.  
  563.  
  564. procedure TInfo.BerechneWerte;
  565.     var q,anz: longint;
  566.  
  567.     begin
  568.         with PBeispielWindow(Application^.MainWindow)^ do
  569.             begin
  570.                 anz:=0;
  571.                 st1^.SetText('Linienzüge:      '+ltoa(Zeichnung^.Count));
  572.                 if Zeichnung^.Count>0 then
  573.                     for q:=0 to pred(Zeichnung^.Count) do
  574.                         inc(anz,PLinie(Zeichnung^.At(q))^.Punkte^.Count);
  575.                 st2^.SetText('Linien (gesamt): '+ltoa(anz))
  576.             end
  577.     end;
  578.  
  579.  
  580. procedure TAttrib.Work;
  581.     var ed: PEdit;
  582.         q : integer;
  583.  
  584.     begin
  585.         if ADialog=nil then
  586.             begin
  587.                 ADialog:=new(PAttrDialog,Init(nil,'Attribute',BSPATTR));
  588.                 if ADialog<>nil then
  589.                     begin
  590.                         new(PGroupBox,Init(ADialog,ACGROUP,'Farbe',
  591.                                                         'Bestimmt die|Linienfarbe'));
  592.                         new(PGroupBox,Init(ADialog,ASGROUP,'Stil',
  593.                                                         'Bestimmt den|Linienstil'));
  594.                         new(PRadioButton,Init(ADialog,AWHITE,true,
  595.                                                         'Setzt Weiß als|neue Linienfarbe'));
  596.                         new(PRadioButton,Init(ADialog,ABLACK,true,
  597.                                                         'Setzt Schwarz als|neue Linienfarbe'));
  598.                         new(PRadioButton,Init(ADialog,ARED,true,
  599.                                                         'Setzt Rot als|neue Linienfarbe'));
  600.                         new(PRadioButton,Init(ADialog,AGREEN,true,
  601.                                                         'Setzt Grün als|neue Linienfarbe'));
  602.                         new(PRadioButton,Init(ADialog,ABLUE,true,
  603.                                                         'Setzt Blau als|neue Linienfarbe'));
  604.                         new(PRadioButton,Init(ADialog,ACYAN,true,
  605.                                                         'Setzt Türkis als|neue Linienfarbe'));
  606.                         new(PRadioButton,Init(ADialog,AYELLOW,true,
  607.                                                         'Setzt Gelb als|neue Linienfarbe'));
  608.                         new(PRadioButton,Init(ADialog,AMAGENTA,true,
  609.                                                         'Setzt Violett als|neue Linienfarbe'));
  610.                         new(PRadioButton,Init(ADialog,ASOLID,true,
  611.                                                         'Setzt LT_SOLID als|neuen Linienstil'));
  612.                         new(PRadioButton,Init(ADialog,ALONG,true,
  613.                                                         'Setzt LT_LONGDASH als|neuen Linienstil'));
  614.                         new(PRadioButton,Init(ADialog,ADOTS,true,
  615.                                                         'Setzt LT_DOTTED als|neuen Linienstil'));
  616.                         new(PRadioButton,Init(ADialog,ALINEDOT,true,
  617.                                                         'Setzt LT_DASHDOT als|neuen Linienstil'));
  618.                         new(PRadioButton,Init(ADialog,ALINE,true,
  619.                                                         'Setzt LT_DASHED als|neuen Linienstil'));
  620.                         new(PRadioButton,Init(ADialog,ALIN2DOT,true,
  621.                                                         'Setzt LT_DASHDOTDOT|als neuen Linienstil'));
  622.                         ed:=new(PEdit,Init(ADialog,AWIDTH,5,
  623.                                     'Gibt die Linien-|stärke an (1,3,..).|Immer UNgerade!'));
  624.                         new(PButton,Init(ADialog,ACANCEL,id_Cancel,true,
  625.                             'Bricht den Dialog ab,|ohne die neuen Werte|zu übernehmen'));
  626.                         new(PButton,Init(ADialog,AOK,id_OK,true,
  627.                                                     'Beendet den Dialog und|setzt die neuen Werte'));
  628.                         new(PButton,Init(ADialog,AHELP,id_Help,false,
  629.                             'Zeigt einen allgemeinen|Hilfstext über diesen|Dialog an.'));
  630.                         fillchar(LineData,sizeof(LineData),0);
  631.                         with PBeispielWindow(Application^.MainWindow)^ do
  632.                             with LineData do
  633.                                 begin
  634.                                     for q:=0 to 7 do Farben[q]:=bf_Unchecked;
  635.                                     for q:=1 to 6 do Stile[q]:=bf_Unchecked;
  636.                                     Farben[Farbe]:=bf_Checked;
  637.                                     Stile[Art]:=bf_Checked;
  638.                                     Breite:=ltoa(Dicke)
  639.                                 end;
  640.                         ADialog^.TransferBuffer:=@LineData;
  641.                         ed^.SetValidator(new(PRangeValidator,Init(1,99)))
  642.                     end
  643.             end;
  644.         if ADialog<>nil then ADialog^.MakeWindow
  645.     end;
  646.  
  647.  
  648. begin
  649.     MyApp.Init('BSPL','Beispiel');
  650.     MyApp.Run;
  651.     MyApp.Done
  652. end.