1  unit gfnf_tabulka;
 2
 3  {$mode objfpc}{$H+}
 4
 5  interface
 6
 7  uses
 8    Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Calendar,
 9    Grids, StdCtrls;
10
11  type
12    TFormTabulka = class(TForm)
13      LabelJednotka: TLabel;
14      LabelNapis: TLabel;
15      StGrTabulka: TStringGrid;
16      procedure FormTabulkaClose(Sender: TObject; var CloseAction: TCloseAction);
17      procedure FormTabulkaCreate(Sender: TObject);
18      procedure FormTabulkaShow(Sender: TObject);
19      procedure FormTabulkaStartDock(Sender: TObject;
20        var DragObject: TDragDockObject);
21      procedure StGrTabulkaClick(Sender: TObject);
22    private
23      { private declarations }
24    public
25
26
27    end;
28
29  var
30    FormTabulka: TFormTabulka;
31
32  implementation
33  uses gfnf_okno1,marek_unit;
34  { TFormTabulka }
35
36  procedure TFormTabulka.FormTabulkaShow(Sender: TObject);
37  var hodnota:real;
38      i:longint;
39  begin
40    //Top:=Form_hlanvi.top;
41    //Left:=Form_hlanvi.Left+Form_hlanvi.Width+10;
42
43    Caption:='Tabulka funkce '+Form_hlanvi.ZahlaviFunkce;
44    LabelNapis.Text:='Tabulka funkce '+Form_hlanvi.ZahlaviFunkce;
45    LabelJednotka.Text:='Jednotka: '+Form_hlanvi.Jednotka;
46    StGrTabulka.Cells[0,0]:='x';
47    StGrTabulka.Cells[1,0]:=Form_hlanvi.ZahlaviFunkce+'(x)';
48
49    //generování tabulky
50    hodnota:=Form_hlanvi.Odkud;
51    i:=1;
52    StGrTabulka.RowCount:=trunc((Form_hlanvi.kam-Form_hlanvi.Odkud)/Form_hlanvi.krok)+4;
53    while hodnota<=Form_hlanvi.kam do begin
54          StGrTabulka.Cells[0,i]:=FloatToStrF(hodnota,ffFixed,3,2);
55          StGrTabulka.Cells[1,i]:=FloatToStrF
56            (gonio(Form_hlanvi.RadioGroupFUnkce.ItemIndex,Form_hlanvi.RadioGroupJednotky.ItemIndex,hodnota)
57             ,ffFixed,3,2);
58          hodnota:=hodnota+Form_hlanvi.krok;
59          Inc(i);
60    end;
61     if hodnota < Form_hlanvi.kam+Form_hlanvi.krok then begin
62        StGrTabulka.RowCount:=i+1;
63        StGrTabulka.Cells[0,i]:=FloatToStrF(Form_hlanvi.kam,ffFixed,3,2);
64        StGrTabulka.Cells[1,i]:=FloatToStrF
65            (gonio(Form_hlanvi.RadioGroupFUnkce.ItemIndex,Form_hlanvi.RadioGroupJednotky.ItemIndex,Form_hlanvi.kam)
66             ,ffFixed,3,2);
67     end else
68       StGrTabulka.RowCount:=i;
69
70  end;
71
72  procedure TFormTabulka.FormTabulkaStartDock(Sender: TObject;
73    var DragObject: TDragDockObject);
74  begin
75      Top:=Form_hlanvi.top;
76    Left:=Form_hlanvi.Left+Form_hlanvi.Width+10;
77  end;
78
79  procedure TFormTabulka.FormTabulkaCreate(Sender: TObject);
80  begin
81
82  end;
83
84  procedure TFormTabulka.FormTabulkaClose(Sender: TObject;
85    var CloseAction: TCloseAction);
86  begin
87    FormTabulka.Free;
88  end;
89
90  procedure TFormTabulka.StGrTabulkaClick(Sender: TObject);
91  begin
92
93  end;
94
95  initialization
96    {$I gfnf_tabulka.lrs}
97
98  end.
99