Код: Выделить всё
procedure TfrmMain.imgBufferClick(Sender: TObject);
begin
inherited;
// if it is active, store and deactivate
If (camMain.Active) Then Begin
camMain.SampleBufferToBitmap(imgBuffer.Bitmap,True);
// code to store
StopCam ()
End
// else, activate
Else
StartCam ()
end;
Код: Выделить всё
procedure TfrmMain.imgBufferGesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
inherited;
With tableWithImages Do
Case EventInfo.GestureID Of
sgiLeft : Prior;
sgiRight : Next;
sgiSemiCircleLeft : First;
sgiSemiCircleRight : Last
End;
UpdateScreen (1); // loads the picture and other information on the app
Handled := True
end;
Код: Выделить всё
procedure TfrmMain.imgBufferGesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
inherited;
With tableWithImages Do
Case EventInfo.GestureID Of
sgiLeft : Prior;
sgiRight : Next;
sgiSemiCircleLeft : First;
sgiSemiCircleRight : Last
End;
UpdateScreen (1); // loads the picture and other information on the app
Handled := True;
FLAG_TO_INDICATE_GESTURE := True // global property
end;
procedure TfrmMain.imgBufferClick(Sender: TObject);
begin
inherited;
If (FLAG_TO_INDICATE_GESTURE) Then Begin
FLAG_TO_INDICATE_GESTURE := False;
Exit
End;
// if it is active, store and deactivate
If (camMain.Active) Then Begin
camMain.SampleBufferToBitmap(imgBuffer.Bitmap,True);
// code to store
StopCam ()
End
// else, activate
Else
StartCam ()
end;
Итак, как я могу заставить OnGesture срабатывать до OnClick или вообще не срабатывать, когда пользователь делает жест? Я хочу, чтобы приложение вело себя следующим образом:
- Если пользователь делает жест, отвечайте на него, но не запускайте OnClick
Если пользователь нажимает на изображение, отвечайте как обычно
Подробнее здесь: https://stackoverflow.com/questions/792 ... lick-event
Мобильная версия