Button - speed

Started by Anonymous, February 26, 2005, 09:59:12 AM

Previous topic - Next topic

Anonymous

Hi,

if i put on a FireFley - form one button and compile this, the reaction of a buttonpress is very slow.
The same in VB or PB take each command by the mouse.
For example if i press 10 times very quick the button on the PB or VB programm, the counter show me 10.  (counter every click)
If i press  10 times the button on the programm, createt with FireFley, the counter show me 5.

Many thanks for informations.
_________________
Fürstauer Rudolf

(Sorry for my english)

Haakon Birkeland

Hmm.. Yes, it seems a bit slow when mouse-clicking on it. I manage to make it count 6-7 of the clicks, but still.. If the button is invoked by the keyboard (space) it's as responsive as it's supposed (expected) to be.

I assume this is related to the code/system perceiving some of the clicks as double-clicks because of the short time between them, thus it's not beeing reacted to it with the code placed in the single-click "event".

Capturing a double-click message from the button propbably would confirm this..!?

TechSupport

You will need to modify the button class style, %CS_DBLCLKS. Add the following code to your Form's WM_CREATE message. (replace HWND_FORM1_COMMAND1 with the handle of the command button that you are interested in).


 Local ClassStyles As Long
 ClassStyles = GetClassLong(HWND_FORM1_COMMAND1, %GCL_STYLE)
 ClassStyles = ClassStyles And (Not (%CS_DBLCLKS) )
 SetClassLong HWND_FORM1_COMMAND1, %GCL_STYLE, ClassStyles


This change will also affect other controls of the same class (i.e. "BUTTON" class). These would include other Command Buttons, ImageButtons, CheckBoxes, OptionButtons and Frames.

Haakon Birkeland

Will Class Styles for buttons (and other appropriate classes), as they are for a forms for instance, be available in the Properties dialog? - at some point..?

Anonymous

Hi Paul,

it works well.

Thank you


Rudolf
----------------------------
firefly is the missing link, a great tool.

TechSupport

Quote from: Haakon BirkelandWill Class Styles for buttons (and other appropriate classes), as they are for a forms for instance, be available in the Properties dialog? - at some point..?

I doubt it. There is rarely a need to modify the standard button class styles. When it is needed, you can use the approach that I posted above.

TechSupport

Quote from: Vbxler
it works well.

Thank you

Great! Happy to help.  :)


Quotefirefly is the missing link, a great tool.
Hey, thanks! Help spread the word to others. The more popular that FireFly becomes, the more that it will evolve and develop.

Roger Garstang

Can't you change it on the form too and make it work?  Or, I actually process my controls all in the Custom of the Form and check for click or doubleclick of the button...they respond a lot better then.  I do this because everyone at my work is like 40+ and think they have to doubleclick everything in Windoze.

Haakon Birkeland

Imagine my challenge then, when I'm teaching a class called "eBorger" (eCitizen), where most of the pupils are from the "granny-generation", and they have never ever even turned on a computer before.  :evil:

David Martin

Quote from: Roger GarstangI do this because everyone at my work is like 40+
Careful what you say.  There are a lot of us 40+ people out there  8)

Anonymous

You got that right. I reach the half century next year......

Andrew

Haakon Birkeland

The "grumpy old man"..  :wink:  Don't worry Andrew, with the speed Paul churns out new FF versions, and you're finishing new projects, you don't have time to become old(er). And I bet those snoozes keep you looking fit anyway.

Roger Garstang

Alright, I forgot there were some old timers here that walked to school uphill both ways, etc...  What is it though with the double clicking?  Icons= Double Click...everything else= Single Click unless they have put some special code to handle double.  Even my dad does it, he keeps double clicking things in the Start Menu and since he moves slightly between clicks he moves things around...Explorer is the same way.