"Android / iOS app developing with Delphi"
Part Two Edition published.
The authors are me and Wonkyoung Kim and Hyunsu Kim.
- Internet store link of korea.
| function TForm1.CalcDistance( lon1, lat1, lon2, lat2 : single ) : single; var theta, dist : double; begin theta := lon1 - lon2; dist := sin( degTorad(lat1)) * sin(degTorad(lat2)) + cos(degTorad(lat1)) * cos(degTorad(lat2)) * cos(degTorad(theta)); dist := arccos(dist); dist := radTodeg(dist); dist := dist * 60 * 1.1515; dist := dist * 1.609344; result := dist; end; |
| var ClickInterval : Cardinal = 0; const LONG_TIME = 8; // Long Touch Time : 0.8 sec |
| procedure TForm1.ListBoxItem1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin ClickInterval := 0; Timer1.Enabled := TRUE; end; //********************************************************************************** // Short Touch procedure TForm1.ListBoxItem1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin if ClickInterval < LONG_TIME then begin Timer1.Enabled := FALSE; ClickInterval := 0; ShowMessage( 'ListBox Shot Touch..!!'); end; end; //*************************************************************************************** // Long Touch // Called once every 0.1 seconds -> When the 8th call is a Long touch procedure TForm1.Timer1Timer(Sender: TObject); begin ClickInterval := ClickInterval + 1; if ( ClickInterval = LONG_TIME ) then begin Timer1.Enabled := FALSE; ShowMessage( 'ListBox Long Touch..!!'); end; end; |