Click to See Complete Forum and Search --> : ToolBar & Timer problem?


Paul Sharp
April 22nd, 1999, 01:48 PM
I have derived a class from CToolbar that starts
a timer when the leftmouse button is pressed down,

The timer does not work properly, it is supposed to fire after 2 seconds, but it fires immediatley
(2000 mill).

when I run the app in debug mode when I moved the mouse pointer over the toolbar the OnTimer event fired, this must be the mfc source, so I put an if statement in the onTimer function.

if(IdEvent == m_TimerVal)
Even when the the value of m_TimerVal is 0 and the IdEvent is not, it still processes the if statement, when logic say's it shouldnt?

can anyone help.

Dan O'Brien
April 22nd, 1999, 03:19 PM
It looks like you used a double equal in your if statement. That would be the obvious answer. You should include more code, though. It's hard to tell from one line.

Paul Sharp
April 23rd, 1999, 11:12 PM
I have solved the problem.
Now I have another!

My app creates toolbars like Netobjects fusion.
When I hold the left mouse button on a toolbar button it checks immediatley(standard mfc only gray's it) in the leftbutton down message handler,
I set a timer when the interval comes a popup toolbar appears below the button, it disapears when the left button is let up, if you move the mouise with the leftbutton down over a button in the popup toolbar, it selects it into the original toolbar.

still with me.

When I hold the left button down on a checked button the popup appears but does not recieve focus. but If I hold down on an unchecked button the popup toolbar apears and recieves mouse messages.

This is standard with all toolbars try with an app on your machine, if you press on an unchecked
button you can move the mouse onto another button
and select it by letting the mouse button up.

but not with a checked button.

any suggestions