[ Pobierz całość w formacie PDF ]
.btnWyczyscClick(Sender: TObject);beginWith sgPunkty doBeginRowCount:=2;Cells[0,1]:='';Cells[1,1]:='';Cells[2,1]:='';Cells[3,1]:='';end;sgPunkty.Enabled:=False;end;procedure TfmGlowneOkno.tsAzymutShow(Sender: TObject);vari:integer;begincbP0.Clear;cbP1.Clear;For i:=0 to sgPunkty.RowCount DoBegincbP1.Items.Add(sgPunkty.Cells[0,i]);cbP0.Items.Add(sgPunkty.Cells[0,i]);end; //forif cbP0.Items.Count>=2 ThenBegincbP0.ItemIndex:=0;cbP1.ItemIndex:=0;End;//ifsgAzymut.Rows[0]:=sgPunkty.Rows[0];sgAzymutDowolne.Rows[0]:=sgPunkty.Rows[0];sgAzymutDowolne.Cells[0,1]:='A';sgAzymutDowolne.Cells[0,2]:='B';end;procedure TfmGlowneOkno.bbtnAzymutObliczClick(Sender: TObject);varA,B:TPunktGeo;beginif rbPDane.Checked thenbeginA.x:=StrToFloatDef(sgAzymut.Cells[1,1],0);A.y:=StrToFloatDef(sgAzymut.Cells[2,1],0);B.x:=StrToFloatDef(sgAzymut.Cells[1,2],0);B.y:=StrToFloatDef(sgAzymut.Cells[2,2],0);endelsebeginA.x:=StrToFloatDef(sgAzymutDowolne.Cells[1,1],0);A.y:=StrToFloatDef(sgAzymutDowolne.Cells[2,1],0);B.x:=StrToFloatDef(sgAzymutDowolne.Cells[1,2],0);B.y:=StrToFloatDef(sgAzymutDowolne.Cells[2,2],0);end;case rgJednostka.ItemIndex of0:edtAzymut.Text:=FloatToStrF(azymut(A,B),ffGeneral,5,3);1:edtAzymut.Text:=FloatToStrF(DegToGrad(azymut(A,B)),ffGeneral,5,4);2:edtAzymut.Text:=FloatToStrF(DegToRad(azymut(A,B)),ffGeneral,5,3);3:edtAzymut.Text:=Deg60(azymut(A,B));end;end;procedure TfmGlowneOkno.cbP0Change(Sender: TObject);beginif cbP0.ItemIndex <>0 thensgAzymut.Rows[1]:=sgPunkty.Rows[cbP0.ItemIndex]elsesgAzymut.Rows[1].Clear;end;procedure TfmGlowneOkno.sgAzymutClick(Sender: TObject);beginif cbP1.ItemIndex<>0 thensgAzymut.Rows[2]:=sgPunkty.Rows[cbP1.ItemIndex]elsesgAzymut.Rows[2].Clear;end;procedure TfmGlowneOkno.PanelAzymutZmiana(Sender: TObject);beginif rbPDowolne.Checked thenbegingbPunkty.Enabled:=False;gbPunktyDowolne.Enabled:=True;endelsebegingbPunkty.Enabled:=True;gbPunktyDowolne.Enabled:=False;end;end;procedure TfmGlowneOkno.btnDodajClick(Sender: TObject);var pos: integer;label start;beginstart:fmDodajPunkt.bbtnDodaj.Caption:='Dodaj';fmDodajPunkt.ShowModal;if fmDodajPunkt.ModalResult=mrOK thenif not CzyIstnieje(fmDodajPunkt.sgDodajPunkt.cells[0,1],sgPunkty, pos) thenbeginif (sgPunkty.RowCount=2) and (sgPunkty.Cells[0,1]='') thenbeginsgPunkty.Rows[1]:=fmDodajPunkt.sgDodajPunkt.Rows[1]endelsebeginsgPunkty.RowCount:=sgPunkty.RowCount+1;sgPunkty.Rows[sgPunkty.RowCount-1]:=fmDodajPunkt.sgDodajPunkt.Rows[1];end;endelsebeginif Application.MessageBox('Punkt juz istnieje!'#13'Czy zamienic?'#13'Nie aby poprawic','Dodaj punkt', MB_YESNO+MB_ICONEXCLAMATION)=IDYES thenbeginsgPunkty.Rows[pos]:=fmDodajPunkt.sgDodajPunkt.Rows[1];endelse GoTo start;end;end;procedure TfmGlowneOkno.btnEdytujClick(Sender: TObject);var w:integer;beginw:=sgPunkty.Row;fmDodajPunkt.BBtnDodaj.Caption:='Edytuj';fmDodajPunkt.Caption:='Edytuj';fmDodajPunkt.sgDodajPunkt.Rows[1]:=sgPunkty.Rows[w];fmDodajPunkt.ShowModal;if fmDodajPunkt.ModalResult=mrOK thensgPunkty.Rows[w]:=fmDodajPunkt.sgDodajPunkt.Rows[1];end;procedure TfmGlowneOkno.btnUsunClick(Sender: TObject);var w:integer;var i:integer;beginw:=sgPunkty.Row;if (w>0) and (sgPunkty.RowCount>2) thenwith sgPunkty dobeginRows[w].Clear;for i:=w to RowCount-1 doRows[i]:=Rows[i+1];RowCount:=RowCount-1;endelse sgPunkty.Rows[1].Clear;end;end.unit OknoDialogoweDodajPunkt;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, Grids, StdCtrls, Buttons;typeTfmDodajPunkt = class(TForm)BBtnDodaj: TBitBtn;BBtnAnuluj: TBitBtn;sgDodajPunkt: TStringGrid;private{ Private declarations }public{ Public declarations }end;varfmDodajPunkt: TfmDodajPunkt;implementation{$R *.dfm}e [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • katek.htw.pl






  • Formularz

    POst

    Post*

    **Add some explanations if needed