• (cs)

    So the actual action was determined not only by whether there was one click or two, but by when the timer event occurred?

    Phew!

  • (cs) in reply to Bellinghman

    There's a timer involved in this?  How can you tell?  I mean, the object (?) name tmrClickTimer is sort of vague on this.

  • (cs)

    Help! Help!  My square wheel doesn't roll very well!

  • (cs)

    I am not a VBguy so I might not be up on all the fiddly bits, but near as I can tell actually clicking the button does not initiate any action. It simply flips this toggle button. I am calling it a toggle button because it will toggle between two states until the timer comes along a clears it again to the empty state.

    An FSM should look like the following I believe.

        empty state ---> 1.click <---[ click event]---> 2.click

    So, depending on the duration of the timer you might be in any state as the user clicks the button (does not see anything happen) then clicks a few more time.

    Thus Click2 is more like State 2.

  • Daveh (unregistered)

    If the timer fires between the user's first click and second click, you'll end up with 2 single-click events, instead of a single, uh, dual-click (not the same as a double click evidently). I'm curious as to what the timer interval was set to. Too fast and you'll have a problem dual-clicking, too slow and the user will be waiting for their single-click to process.

  • dan jones (unregistered)

    wow... this is user interface design at its most obfuscated... not only is there a timer involved, but it acts like a queue to hold all the different requests... polling its own tag value to see just what's up... what happens if the user clicks three times?  the value is set back to 1.  and no indication that this will happen, either -- like, say, changing the label name to indicate that different actions will be taken depending on whether the number of clicks is odd or even.

    this is teh lame.

  • uniposter (unregistered)

    This "Click2" technology is sure to revolutionize the world of user interface design.

  • (cs)

    That's just funny. They have the ability to extend it beyond two clicks though ... triple click anyone?

  • spacey (unregistered) in reply to uniposter

    just when i was starting to think that MY job sucks....

    click2 saves the day....

  • Anonymous (unregistered)

    Maybe the programmer just wanted a different maximum time interval than you get with DblClick.

  • (cs)

    Damn, even if you didn't know that there was a double-click event, why not just keep a LastClickTime variable?

  • (cs) in reply to PstScrpt
    PstScrpt:
    Damn, even if you didn't know that there was a double-click event, why not just keep a LastClickTime variable?


    That is was a trade secret. [:)]
  • (cs)

    Also, let's not ignore the lines:

    'MsgBox "Unknown Button: " & aryArgs(1)

    Commented-out, which to me says "I could figure out why I was getting the error message, but it's easier just to silence it".

     

  • (cs) in reply to PstScrpt

    PstScrpt:
    Damn, even if you didn't know that there was a double-click event, why not just keep a LastClickTime variable?

    It looks like it is used on multiple controls, therefore he needs to know which control was (double) clicked on...

    <SNIP>

        'Click twice if already clicked
        If tmrClickTimer.Tag = "1.lblSetText" Then
            tmrClickTimer.Tag = "2.lblSetText"
        Else
            tmrClickTimer.Tag = "1.lblSetText"
        End If

    <SNIP>

        
                Select Case aryArgs(1)
                    Case "cmdLoadFile"
                        Call cmdLoadFile_Click
                   
    <SNIP>

    Not that that is an excuse for this abomination... [6]

    Actually this reminds me of something I ran across last week... someone re-invented the case statement in vbscript. Now to find it again and send it in [:O]

  • (cs) in reply to whojoedaddy

    whojoedaddy:
    That's just funny. They have the ability to extend it beyond two clicks though ... triple click anyone?

    In fact, it's very easy to make it go to ELEVEN!!!!!!!!!!

  • Dustin (unregistered) in reply to Anonymous

    lol. It must be for a program with people who click verrry slowwwly.

  • Dustin (unregistered) in reply to mizhi
    mizhi:
    PstScrpt:
    Damn, even if you didn't know that there was a double-click event, why not just keep a LastClickTime variable?


    That is was a trade secret. [:)]


    Doh! Apparently I've never used a forum before. I meant to quote this and to say that it must be for people who click very slowly. *But really*, I think it's a simple case of over-architecting. I do it when I get bored [:)] You know, like a Rube-Goldberg illustration. (Please don't flame me, It's just a joke!)
  • Anonymous (unregistered)

    I can't (and won't) defend the implementation, but I wouldn't be surprised if this was the result of one or more users who couldn't master the double click.  Some people have a very hard time double clicking for some reason, and the developer may have been told to "Make it work!!!!" 

  • (cs) in reply to Dustin

    Ah...  There's nothing quite like working with an app that not only implements double click incorrectly but ignores your double click speed setting in Whendoes.

  • DavidK (unregistered) in reply to dubwai

    I'm going to use this to put a triple click easter egg into my site.

    No-one will ever find it!

  • (cs)

    What happens if the user does a genuine double-click?  IIRC, you will get one Click event, then a DblClick event?  So this code will count it as a single click?

  • (cs) in reply to DavidK

    Anonymous:
    I'm going to use this to put a triple click easter egg into my site.

    No-one will ever find it!

    My old boss showed me one that he created with a triple right-click once.

  • (cs) in reply to Dustin

    Anonymous:
    lol. It must be for a program with people who click verrry slowwwly.

    Actually, you have to click kinda fast, because if a tmrClickTimer_Timer occurs between the first and second clicks, you get two first clicks.

  • (cs) in reply to dubwai

    The triple click has actually been implemented in a lot of products.  For example, in many windows apps you double-click to select a word, then click again (a.k.a triple click) to select the whole line. 

    The only logical reason I can see for this code to exist (and im stretching a bit here) is so that the single-click event doesnt fire if they double click, and ONLY the double click event fires.  Kind of sucks to have to wait .5 seconds (or whatever) for your single click to be processed though.


  • anonymous coward (unregistered)

    what happened to using 2 buttons?

  • coding slob (unregistered) in reply to Rick Mogstad

    Rick Mogstad:
    The triple click has actually been implemented in a lot of products.  For example, in many windows apps you double-click to select a word, then click again (a.k.a triple click) to select the whole line. 

    The only logical reason I can see for this code to exist (and im stretching a bit here) is so that the single-click event doesnt fire if they double click, and ONLY the double click event fires.  Kind of sucks to have to wait .5 seconds (or whatever) for your single click to be processed though.


    or could it be that he didn't know or understand lblSetText_DblClick() event?

  • (cs)

    Ignoring the fact that I don't know anything about how timers in VB6 work, I wonder what will happen if for example the call to "cmdLoadFile_Click" takes longer than a single timer interval ??

  • (cs) in reply to coding slob
    Anonymous:

    Rick Mogstad:
    The triple click has actually been implemented in a lot of products.  For example, in many windows apps you double-click to select a word, then click again (a.k.a triple click) to select the whole line. 

    The only logical reason I can see for this code to exist (and im stretching a bit here) is so that the single-click event doesnt fire if they double click, and ONLY the double click event fires.  Kind of sucks to have to wait .5 seconds (or whatever) for your single click to be processed though.


    or could it be that he didn't know or understand lblSetText_DblClick() event?




    The point, though, is that even if you implement both the lblSetText_Click() event and the lblSetText_DblClick() event, both will fire when you double click.  The Click event will fire first, then the DblClick event will fire afterward.  With this based approach, you could have a "1 or the other" type approach, which isnt really possible otherwise. 

    Like I said, its a stretch, but could explain the thinking.
  • (cs) in reply to Rick Mogstad

    Rick Mogstad:


    The point, though, is that even if you implement both the lblSetText_Click() event and the lblSetText_DblClick() event, both will fire when you double click.  The Click event will fire first, then the DblClick event will fire afterward.  With this based approach, you could have a "1 or the other" type approach, which isnt really possible otherwise. 

    Like I said, its a stretch, but could explain the thinking.

    Hmm.  A solution to incompatible single-click and double-click handling.  Could be.  That's a fine bit of forensic pathology you did there.

  • (cs) in reply to dubwai
    dubwai:

    Rick Mogstad:


    The point, though, is that even if you implement both the lblSetText_Click() event and the lblSetText_DblClick() event, both will fire when you double click.  The Click event will fire first, then the DblClick event will fire afterward.  With this based approach, you could have a "1 or the other" type approach, which isnt really possible otherwise. 

    Like I said, its a stretch, but could explain the thinking.

    Hmm.  A solution to incompatible single-click and double-click handling.  Could be.  That's a fine bit of forensic pathology you did there.



    Lets just say that I have to work with people who may or may not use this kind of approach for things..... on a regular basis....


  • Hank Miller (unregistered)

    WTF!  Double click is the most human interface invented.   All because back in 1984 Apple wanted to advertise that you couldn't push the wrong button.   Windows is slowly moving away from this.    Everyone else is trying too, because it does not work.

    Have you ever watched an old person try to double click something?  It is frusterating.   It is hard to hold the mouse still while clicking within the allotted time (actually holding the mouse still while clicking is difficult).   The allotted time cannot be safely increased because power users are unwilling to wait any longer when they want two single clicks.


  • uniposter (unregistered) in reply to Hank Miller
    Anonymous:
    WTF!  Double click is the most human interface invented.   All because back in 1984 Apple wanted to advertise that you couldn't push the wrong button.   Windows is slowly moving away from this.    Everyone else is trying too, because it does not work.

    Have you ever watched an old person try to double click something?  It is frusterating.   It is hard to hold the mouse still while clicking within the allotted time (actually holding the mouse still while clicking is difficult).   The allotted time cannot be safely increased because power users are unwilling to wait any longer when they want two single clicks.




    Yeah I hear they're moving away from monitors and speakers too because they're way too hard for deaf mutes to use.
  • (cs) in reply to Anonymous

    Anonymous:
    I can't (and won't) defend the implementation, but I wouldn't be surprised if this was the result of one or more users who couldn't master the double click.  Some people have a very hard time double clicking for some reason, and the developer may have been told to "Make it work!!!!" 

    It would have to be quite the PHB to tell a developer that, because now there's a double click that is even harder to use. When you try to double click, sometimes you get a double click, sometimes you get two single clicks even when clicking exactly the same way, depending on some invisible timer event. Or you're trying to single click: You click. Nothing happens (timer event hasn't occurred yet), so you click again. Oops. Double click. You're such a luser.

    Of course, there are lots of users that have trouble with double click, but the solution is to not use double click, except as a shortcut for the non-digitally-challenged to do something that can be done with menus or something.

    As for doing this to prevent a single click event firing when double clicking, the WTF is that the developer doesn't understand double clicking. It should always  do the single click action (generally selection), then augment it some way (e.g., execute dialog box action or open properties box).

    Let me guess: he wants to support double clicking of "buttons." That might explain why he's got clicking and double clicking of labels and images. That's just a plain bad idea. You want some sort of power-user activation of buttons? Try metakey-clicking.

    I bet he supports double clicking of checkboxes too.

    --RA

  • (cs)

    Wow, damn. I try to defend VB programmers since I know we are not the best in the world, but I can't defend this. Using a timer...to figure out a double click... I suppose the timer thing is an OK way of doing it, but it still feels dirty. Especially when you consider that the DblClick event already exists...

    You heard it here folks, the pro-VB troll just shot down one of his own. Right now Ghandi is having a snowball fight with Mother Theresa in Hell.

  • (cs)

    Now I'm ready for the morse code button
    Click for short, dblClick for long
    <font style="font-family: courier new;" size="3">.--  -  ..-.


    </font>

  • (cs) in reply to Hank Miller

    Anonymous:
    Have you ever watched an old person try to double click something?  It is frusterating.   It is hard to hold the mouse still while clicking within the allotted time (actually holding the mouse still while clicking is difficult).   The allotted time cannot be safely increased because power users are unwilling to wait any longer when they want two single clicks.

    Settings/Control Panel/Mouse: "Double-click speed" is on the first tab.

  • (cs) in reply to Rick Mogstad

    Rick Mogstad:
    With this based approach, you could have a "1 or the other" type approach, which isn't really possible otherwise. 

    Nonsense.  It's a bit of a nuisance to set up, and does require setting a timer, but the procedure for handling a "double click without doing the single click action" is fairly easy, widely documented and widely used --On any window (in MSWindows) single click on the icon in the upper left corner, and the menu displays.  Double click and the window closes without the menu appearing.

    Basically, you tell the control to only send single click notifications. When a click event occurs, you set a timer for the double-click timeout.  If a second click arrives before the timer ticks, do the double-click action and kill the timer.  If not, on the timer tick, do the single click action (and kill the timer)

    So, basically, he's sorta on the right track.  The WTF here is that the timer is constantly going and is asynchronous with the clicks..

     

     

  • (cs)

    My "web savvy" wife must be hip to this functionality, since she annoying clicks every link on the web twice.

  • (cs) in reply to Hank Miller

    Hank Miller:


    Have you ever watched an old person try to double click something?  It is frusterating.   It is hard to hold the mouse still while clicking within the allotted time (actually holding the mouse still while clicking is difficult).   The allotted time cannot be safely increased because power users are unwilling to wait any longer when they want two single clicks.

    Totally.  It be nice if there were some way to like, I don't know, set the double-click speed.   There isn't one that I know of.  Not in the control panel.  Definitely not under 'mouse' and not in the 'double click speed' section.

  • (cs) in reply to JamesCurran
    JamesCurran:

    Rick Mogstad:
    With this based approach, you could have a "1 or the other" type approach, which isn't really possible otherwise. 

    Nonsense.  It's a bit of a nuisance to set up, and does require setting a timer, but the procedure for handling a "double click without doing the single click action" is fairly easy, widely documented and widely used --On any window (in MSWindows) single click on the icon in the upper left corner, and the menu displays.  Double click and the window closes without the menu appearing.

    Basically, you tell the control to only send single click notifications. When a click event occurs, you set a timer for the double-click timeout.  If a second click arrives before the timer ticks, do the double-click action and kill the timer.  If not, on the timer tick, do the single click action (and kill the timer)

    So, basically, he's sorta on the right track.  The WTF here is that the timer is constantly going and is asynchronous with the clicks..



    I guess I should have said "without an approach LIKE this".  I am certainly not defending this guy's code by any means, just trying to figure out what the intent was.  There is no standard way to keep a click event from firing while trapping a double click.  It really doesnt make sense that there should be a way to do this standardly, as the first part of the double-click is a single-click, which should fire an event. 

    FWIW, your solution is mighty similar. 
  • Andrew Parsons (unregistered)

    Just so you all know and don't die wondering, the programmer didn't realise there was a double-click event.

    So, don't credit him for forward thinking for triple clicks and the like - it was a double-click replacement due to a lack of knowledge about VB (and this was from a guy with 3-4 years VB experience).

  • (cs) in reply to Andrew Parsons

    That wasn't 3-4 years experience. That was 3-4 days, repeatedly.

  • coding slob (unregistered) in reply to Andrew Parsons

    Anonymous:
    Just so you all know and don't die wondering, the programmer didn't realise there was a double-click event.

    So, don't credit him for forward thinking for triple clicks and the like - it was a double-click replacement due to a lack of knowledge about VB (and this was from a guy with 3-4 years VB experience).

    3-4 years VB experience is not enough to learn notice dblClick event?

    It used to piss me off when I was looking for a job, and some recruiters wouldn't even talk to me 'cause job requirements asked for 5 years exp., while I only  had 3 or 4. Now it makes sense...

  • (cs) in reply to coding slob

    The code is horrifying, but here's my mild defense: In VB6, there's no _DblClick event on CommandButtons.

    But I think there's a pretty good reason for that.

     

     

  • dance2die (unregistered)

    I have a faith in M$ implementation of DblClick event.

    But sometimes when you think there is just too many bugs in M$ lib's, you might as well go with "Click2"...

    All "Click2" needs now is a GPL license...

  • (cs) in reply to JamesCurran
    JamesCurran:

    On any window (in MSWindows) single click on the icon in the upper left corner, and the menu displays.  Double click and the window closes without the menu appearing.

    Uhhh.. which version of Windows are you using there? When I double click on the icon, the menu does appear for a split-second.

     

  • (cs) in reply to Andrew Parsons

    Maybe his boss is the type that expects that clicking many times on a button makes the damn program work faster (like those that expect that pressing again and again on the elevator's button will make it arrive faster), therefore requiring to know how many times the user clicked [:P]

     

    PS: yes, I need sleep, lol..

  • Amit Patankar (unregistered)

    OMGWTF..... is there a petition where i could sign in support of the litigation against that certain company? I guess the decision has been made "And the programmer of the year award goes to.......for his groundbreaking role in inventing Click2 and saving the computing world". I wish there was a emoticon for screaming out LOUD.

  • (cs) in reply to A Wizard A True Star
    A Wizard A True Star:
    JamesCurran:

    On any window (in MSWindows) single click on the icon in the upper left corner, and the menu displays.  Double click and the window closes without the menu appearing.

    Uhhh.. which version of Windows are you using there? When I double click on the icon, the menu does appear for a split-second.

     



    Now that you mention it, so does mine....
  • (cs) in reply to Dustin
    Anonymous:
    mizhi:
    PstScrpt:
    Damn, even if you didn't know that there was a double-click event, why not just keep a LastClickTime variable?


    That is was a trade secret. [:)]


    Doh! Apparently I've never used a forum before. I meant to quote this and to say that it must be for people who click very slowly. *But really*, I think it's a simple case of over-architecting. I do it when I get bored [:)] You know, like a Rube-Goldberg illustration. (Please don't flame me, It's just a joke!)


    I won't flame you, but Rube Goldberg needs a flame or two.  I'd never seen his work before now, but apart from using only one of his cartoons to describe excess detail/work, the rest a pretty useless.  Each one is the same joke over again.  I fail to see how anyone could ever in all time remain amused by these drawings longer than halfway through the first one they ever see.

Leave a comment on “I Call It The &quot;Click2&quot;”

Log In or post as a guest

Replying to comment #:

« Return to Article