RE: [WIN] How to ignore doubleClicks

new topic     » topic index » view thread      » older message » newer message

Hi Derek,

Thanks for the help. I think that your first glance was correct. I 
'lifted'
the 'event' test right out of the program 'RUNTHIS.EXW', without 
noticing 
that it was part of the onMouse handler, and I had not referenced that 
routine
in the program. So, of course, 'event' was not assigned a value.  
The button control in question is, in fact, a PushButton control.

I need to go back to my program and see how and where to call the 
onMouse 
handler, to make use of the 'event = LeftDoubleClick". But then, I'm 
still not
clear on how to have the program treat a doubleclick the same way as a 
single 
click. I guess something like 
       
       if event = LeftDoubleClick    then        
          --- do the same thing as for a single onClick 
       else
          --- do the single click code here, too.
       end if
       
which looks a bit silly on the surface, but how else to deal with an 
accidental
double click?

I'd like to keep trying to figure this out (with your kind help) before 
giving 
up and sending you the program; I'd prefer not to impose too much on 
your valuable 
time.    


----------------------------  ORIGINAL MESSAGE   
------------------------------

Hi Josh,
      at first glace, I'd say there is a problem with your code then. 
The
  "event" parameter is sent to the onMouse handler and definitely has a 
value.
  But just to make sure, does the Euphoria error refer to a line in 
win32lib
  code or your code?

  There is a known bug with double-clicks being ignored on Window 
controls,
  but you mention that you're using buttons. Is that a PushButton 
control
  then?

  To fix the ignored double-clicks you need to change the win32lib.ew 
file.
  Replace the line that has ...

      vWindowClassStyle = {CS_HREDRAW, CS_VREDRAW}

  with ...

      vWindowClassStyle = {CS_HREDRAW, CS_VREDRAW, CS_DBLCLKS }

  but i don't think that's your problem, in this case.

  For other controls, Windows sends the mouse events in this order ...

  onMouse(WM_LBUTTONDOWN)
  onMouse(WM_LBUTTONUP)
  onClick()
  onMouse(WM_LBUTTONDBLCLK)
  onMouse(WM_LBUTTONUP)

  and there maybe some onMouse(WM_MOUSEMOVE) in amongst those.

  Finally, you can always send me the code (or a reproducable sample of 
the
  problem) to examine.
  ------
  Derek Parnell
  Melbourne, Australia
  "To finish a job quickly, go slower."

  ----- Original Message -----
  From: "Jim Duffy" <futu- at earthlink.net>;
  To: "EUforum" <EUfo- at topica.com>;
  Sent: Tuesday, May 15, 2001 5:01 AM
  Subject: [WIN] How to ignore doubleClicks

   
   I'm having trouble with a program which has several button controls 

  (Win32lib.ew). If a user clicks on a button, the
   
   expected processes execute correctly. But, if the user double-clicks 
on a 

  button, the program code executes twice. I
   
   need a way to have the program treat a 'double-click' as if it were a 


  'single left-click'. I've searched through the
   
   programs which came with Win32Lib (v.55.1) and found 'if event = 

  LeftDoubleClick' in program 'RUNTHIS.EXW', but haven't
   
   been able to get this working in the program I'm working on (get 
error 

  "event" has not been assigned a value." 
Derek Parnell wrote:
> Hi Josh,
>     at first glace, I'd say there is a problem with your code then. The
> "event" parameter is sent to the onMouse handler and definitely has a 
> value.
> But just to make sure, does the Euphoria error refer to a line in 
> win32lib
> code or your code?
> 
> There is a known bug with double-clicks being ignored on Window 
> controls,
> but you mention that you're using buttons. Is that a PushButton control
> then?
> 
> To fix the ignored double-clicks you need to change the win32lib.ew 
> file.
> Replace the line that has ...
> 
>     vWindowClassStyle = {CS_HREDRAW, CS_VREDRAW}
> 
> with ...
> 
>     vWindowClassStyle = {CS_HREDRAW, CS_VREDRAW, CS_DBLCLKS }
> 
> but i don't think that's your problem, in this case.
> 
> For other controls, Windows sends the mouse events in this order ...
> 
> onMouse(WM_LBUTTONDOWN)
> onMouse(WM_LBUTTONUP)
> onClick()
> onMouse(WM_LBUTTONDBLCLK)
> onMouse(WM_LBUTTONUP)
> 
> and there maybe some onMouse(WM_MOUSEMOVE) in amongst those.
> 
> Finally, you can always send me the code (or a reproducable sample of 
> the
> problem) to examine.
> ------
> Derek Parnell
> Melbourne, Australia
> "To finish a job quickly, go slower."
> 
> ----- Original Message -----
> From: "Jim Duffy" <futures8 at earthlink.net>
> To: "EUforum" <EUforum at topica.com>
> Sent: Tuesday, May 15, 2001 5:01 AM
> Subject: [WIN] How to ignore doubleClicks
> 
> 
<snip>



josh

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu