Announcement

Collapse
No announcement yet.

Suppress doubleclick time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Suppress doubleclick time

    In VB the button control and others behaving quite good on doubleclicks.

    In PB (WINAPI), when you click a button, within the doubleclicktime you can't press the button again.
    The button generates a doubleclick message while i simply need another click.

    A listbox example:
    1) My listbox is filled with items
    2) I click an unselected item
    3) I click it again but in within the doubleclick time.
    4) The second click is not executed.

    Clicks is in this case SELCHANGE of course..

    And, try clicking a VB button several times, a winapi button will react much slower.

    How?


    ------------------
    ebknop[email protected]
    hellobasic

  • #2
    If you need to modify the behavior of a standard control, then you should use Instance Subclassing - this will give you access to the %WM_LBUTTONUP message and you can generate your own message to the dialog/window callback, such as %BN_CLICKED, etc.

    By responding to the %WM_LBUTTONUP rather than %WM_LBUTTONDOWN, you can try to maintain the standard behavior of dragging the cursor off the control (before releasing the button) to negate the "click".

    It is also worth pointing out that VB controls are not a standard Windows' controls - they are custom (Superclassed) controls and have their own unique behavior, such as you mention.

    I hope this helps!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Lance,

      I superclassed my control and removed the CS_DBLCLK style from the class.
      Now it works properly.
      Unf, VB HAS this style set and now i'm missing my doubleclick.

      Is it really the only solution to get both worlds as you describe it?

      I was really thinking VB simply knows what to do (suppressing some wm_getdlgcode or sort of)



      ------------------
      [email protected]
      hellobasic

      Comment


      • #4
        As I noted, you should be able to do it by subclassing the control rather than superclassing it. That way you can augment your double-click event rather than disable it.

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Sure Lance,
          I get the point
          Sending another click in the doubleclick etc..

          However, my point is that there are buttons having the doubleclick style IN the class while they react as fast as it should.

          When you doubleclick on a Winapi (PB) button, the second click will not insert the button graphically.
          The ordinary 2nd click is suppressed too.

          This confuses me, i simply must reinvestigate how to get these 2 things togheter.

          Thanks,


          ------------------
          [email protected]
          hellobasic

          Comment

          Working...
          X