[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

WPTools

How can I avoid left-click effect when double-clicking on a TDBWPRichText?

J.A.
0
umh
Asked:
umh
  • 5
1 Solution
 
quiqueCommented:
You'll have to use FIgnoreAllMouseEvents in the object and then a Timer to activate it again.

QUIQUE.
0
 
kretzschmarCommented:
hi,

you can do a construction like this

Var ClickPending : Boolean = False;

procedure TForm1.FormClick(Sender: TObject);
Var I : Integer;
begin
  ClickPending := True;
  I := GetTickCount;
  while GetTickCount - I < 100 do
    Application.ProcessMessages;
  If ClickPending then
  Begin
    //
    Label1.Caption := 'Click';
    ClickPending := False;
  end;
end;

procedure TForm1.FormDblClick(Sender: TObject);
begin
  ClickPending := False;
  Label2.Caption := 'DblClick';
end;

remark: it is a general problem and not specific for TDBWPRichText

the value of 100 i used here is just tried, but you can get the delay which windows wait before it fires a dblclick-message from windows self.

meikl
0
 
kretzschmarCommented:
hi again,

to get the system-doubleclicktime use the function GetDoubleClickTime like

Var ClickPending : Boolean;

procedure TForm1.FormClick(Sender: TObject);
Var I,J : Integer;
begin
  ClickPending := True;
  J := GetDoubleClickTime;
  I := GetTickCount;
  while GetTickCount - I < J do
    Application.ProcessMessages;
  If ClickPending then
  Begin
    //
    Label1.Caption := 'Click';
    ClickPending := False;
  end;
end;

procedure TForm1.FormDblClick(Sender: TObject);
begin
  ClickPending := False;
  Label2.Caption := 'DblClick';
end;

meikl
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
kretzschmarCommented:
appendix (correction),
Var I,J : Integer;
shoud be
Var I,J : DWord;
meikl
0
 
kretzschmarCommented:
hmm, i see, just accepted :-(
0
 
kretzschmarCommented:
hi quique

just for satisfy my Curiosity

where do i find FIgnoreAllMouseEvents ?
when do i set it ?
when do i start the timer ?
how do i determine the intervall ?

meikl

0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now