1  unit gfnf_okno1;
  2
  3  {$mode objfpc}{$H+}
  4
  5  interface
  6
  7  uses
  8    Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9    Buttons, ExtCtrls, Arrow, Spin, gfnf_tabulka, ComCtrls, Menus;
 10
 11  type
 12    TForm_hlanvi = class(TForm)
 13      BtnGeneruj: TButton;
 14      EditOd: TEdit;
 15      EditDo: TEdit;
 16      EditKrok: TEdit;
 17      LabelOd: TLabel;
 18      LabelDo: TLabel;
 19      LabelKrok: TLabel;
 20      MaMeHlavni: TMainMenu;
 21      MenuItem1: TMenuItem;
 22      MenuItemRadian: TMenuItem;
 23      MenuItemStupen: TMenuItem;
 24      MenuItemSin: TMenuItem;
 25      SubMenuItemZakazat: TMenuItem;
 26      MenuItemCos: TMenuItem;
 27      MenuItemTg: TMenuItem;
 28      PopupItem2: TMenuItem;
 29      MenuItemSoubor: TMenuItem;
 30      MenuItemKonec: TMenuItem;
 31      PopupItem1: TMenuItem;
 32      SubMenuItemVolby: TMenuItem;
 33      SubMenuItemKonec: TMenuItem;
 34      napis: TLabel;
 35      PoMePopup: TPopupMenu;
 36      RadioGroupJednotky: TRadioGroup;
 37      RadioGroupFUnkce: TRadioGroup;
 38      StatusBar: TStatusBar;
 39      procedure BtnGenerujClick(Sender: TObject);
 40      procedure BtnGenerujMouseMove(Sender: TObject; Shift: TShiftState; X,
 41        Y: Integer);
 42      procedure EditDoClick(Sender: TObject);
 43      procedure EditDoEnter(Sender: TObject);
 44      procedure EditDoExit(Sender: TObject);
 45      procedure EditKrokClick(Sender: TObject);
 46      procedure EditKrokEnter(Sender: TObject);
 47      procedure EditKrokExit(Sender: TObject);
 48      procedure EditOdClick(Sender: TObject);
 49      procedure EditOdEnter(Sender: TObject);
 50      procedure EditOdExit(Sender: TObject);
 51      procedure EditOdMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
 52        );
 53      procedure Form_hlanviCreate(Sender: TObject);
 54      procedure Form_hlanviMouseMove(Sender: TObject; Shift: TShiftState; X,
 55        Y: Integer);
 56      procedure MenuItem5Click(Sender: TObject);
 57      procedure MenuItemCosClick(Sender: TObject);
 58      procedure MenuItemRadianClick(Sender: TObject);
 59      procedure MenuItemSinClick(Sender: TObject);
 60      procedure MenuItemStupenClick(Sender: TObject);
 61      procedure MenuItemTgClick(Sender: TObject);
 62      procedure PopupItem1Click(Sender: TObject);
 63      procedure PopupItem2Click(Sender: TObject);
 64      procedure RadioGroupFUnkceEnter(Sender: TObject);
 65      procedure RadioGroupFUnkceMouseMove(Sender: TObject; Shift: TShiftState; X,
 66        Y: Integer);
 67      procedure RadioGroupJednotkyEnter(Sender: TObject);
 68      procedure RadioGroupJednotkyMouseMove(Sender: TObject; Shift: TShiftState;
 69        X, Y: Integer);
 70      procedure SubMenuItemKonecClick(Sender: TObject);
 71      procedure SubMenuItemZakazatClick(Sender: TObject);
 72
 73    private
 74      FormTabulka:TFormTabulka;
 75      povedlose1,povedlose2,povedlose3:byte;
 76    public
 77      Odkud,kam,krok:real;
 78      ZahlaviFunkce,Jednotka:String;
 79    end;
 80
 81  var
 82    Form_hlanvi: TForm_hlanvi;
 83
 84  implementation
 85
 86  { TForm_hlanvi }
 87
 88
 89
 90  procedure TForm_hlanvi.BtnGenerujMouseMove(Sender: TObject; Shift: TShiftState;
 91    X, Y: Integer);
 92  begin
 93
 94  end;
 95
 96  procedure TForm_hlanvi.EditDoClick(Sender: TObject);
 97  begin
 98      EditDo.SelectAll;
 99  end;
100
101  procedure TForm_hlanvi.EditDoEnter(Sender: TObject);
102  begin
103      EditDo.SelectAll;
104      StatusBar.Panels[1].Text:='Vyberte meze a krok';
105  end;
106
107  procedure TForm_hlanvi.EditDoExit(Sender: TObject);
108  begin
109
110  end;
111
112  procedure TForm_hlanvi.EditKrokClick(Sender: TObject);
113  begin
114      EditKrok.SelectAll;
115  end;
116
117  procedure TForm_hlanvi.EditKrokEnter(Sender: TObject);
118  begin
119      EditKrok.SelectAll;
120      StatusBar.Panels[1].Text:='Vyberte meze a krok';
121  end;
122
123  procedure TForm_hlanvi.EditKrokExit(Sender: TObject);
124  begin
125
126  end;
127
128  procedure TForm_hlanvi.EditOdClick(Sender: TObject);
129  begin
130      EditOd.SelectAll;
131  end;
132
133  procedure TForm_hlanvi.EditOdEnter(Sender: TObject);
134  begin
135    EditOd.SelectAll;
136    StatusBar.Panels[1].Text:='Vyberte meze a krok';
137  end;
138
139  procedure TForm_hlanvi.EditOdExit(Sender: TObject);
140  begin
141
142  end;
143
144  procedure TForm_hlanvi.EditOdMouseMove(Sender: TObject; Shift: TShiftState; X,
145    Y: Integer);
146  begin
147      StatusBar.Panels[1].Text:='Vyberte meze a krok';
148  end;
149
150  procedure TForm_hlanvi.Form_hlanviCreate(Sender: TObject);
151  begin
152  end;
153
154  procedure TForm_hlanvi.Form_hlanviMouseMove(Sender: TObject;
155    Shift: TShiftState; X, Y: Integer);
156  begin
157    StatusBar.Panels[1].Text:='';
158  end;
159
160  procedure TForm_hlanvi.MenuItem5Click(Sender: TObject);
161  begin
162
163  end;
164
165  procedure TForm_hlanvi.MenuItemCosClick(Sender: TObject);
166  begin
167    RadioGroupFUnkce.ItemIndex:=1;
168  end;
169
170  procedure TForm_hlanvi.MenuItemRadianClick(Sender: TObject);
171  begin
172      RadioGroupJednotky.ItemIndex:=0;
173  end;
174
175  procedure TForm_hlanvi.MenuItemSinClick(Sender: TObject);
176  begin
177    RadioGroupFUnkce.ItemIndex:=0;
178  end;
179
180  procedure TForm_hlanvi.MenuItemStupenClick(Sender: TObject);
181  begin
182    RadioGroupJednotky.ItemIndex:=1;
183  end;
184
185  procedure TForm_hlanvi.MenuItemTgClick(Sender: TObject);
186  begin
187      RadioGroupFUnkce.ItemIndex:=2;
188  end;
189
190  procedure TForm_hlanvi.PopupItem1Click(Sender: TObject);
191  begin
192    BtnGenerujClick(sender);
193  end;
194
195  procedure TForm_hlanvi.PopupItem2Click(Sender: TObject);
196  begin
197    close;
198  end;
199
200  procedure TForm_hlanvi.RadioGroupFUnkceEnter(Sender: TObject);
201  begin
202    StatusBar.Panels[1].Text:='Vyberte funkci';
203  end;
204
205  procedure TForm_hlanvi.RadioGroupFUnkceMouseMove(Sender: TObject;
206    Shift: TShiftState; X, Y: Integer);
207  begin
208    StatusBar.Panels[1].Text:='Vyberte funkci';
209  end;
210
211  procedure TForm_hlanvi.RadioGroupJednotkyEnter(Sender: TObject);
212  begin
213    StatusBar.Panels[1].Text:='Vyberte jednotky';
214  end;
215
216  procedure TForm_hlanvi.RadioGroupJednotkyMouseMove(Sender: TObject;
217    Shift: TShiftState; X, Y: Integer);
218  begin
219    StatusBar.Panels[1].Text:='Vyberte jednotky';
220  end;
221
222  procedure TForm_hlanvi.SubMenuItemKonecClick(Sender: TObject);
223  begin
224     Close;
225  end;
226
227  procedure TForm_hlanvi.SubMenuItemZakazatClick(Sender: TObject);
228  begin
229    SubMenuItemZakazat.Checked:=not(SubMenuItemZakazat.Checked);
230    BtnGeneruj.Enabled:=not(SubMenuItemZakazat.Checked)                                    ;
231  end;
232
233  procedure TForm_hlanvi.BtnGenerujClick(Sender: TObject);
234
235  begin
236    val(EditOd.Text,Odkud,povedlose1);
237    val(EditDo.Text,kam,povedlose2);
238    val(EditKrok.Text,krok,povedlose3);
239    if povedlose1+povedlose2+povedlose3<>0 then
240                 ShowMessage('Zadaná hodnota není platná')
241    else begin
242         FormTabulka:=TFormTabulka.Create(self);
243         ZahlaviFunkce:=RadioGroupFUnkce.Items[RadioGroupFUnkce.ItemIndex];
244         Jednotka:=RadioGroupJednotky.Items[RadioGroupJednotky.ItemIndex];
245         FormTabulka.Show;
246    end;
247
248  end;
249
250  initialization
251    {$I gfnf_okno1.lrs}
252
253  end.
254