A problem about mouse left down Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
happybamboo
Knows some wx things
Knows some wx things
Posts: 27
Joined: Tue Sep 16, 2008 4:19 am

A problem about mouse left down

Post by happybamboo »

Hi,guys,this is my first time to ask question here,and english is not my mother language,so,if I spell some word wrong,or write something wrong,please don't mock me.
Here is my problem.I drew a rectangle(or whatever) on a canvas,when I put my mouse on it ,I pressed the mouse left button down,and keeping the mouse left button down for 1 sec.then the rectangle is changed(or whatever).How to realize it? Caution,the mouse left button is down for 1 sec,then the change happened,not I pressed the left button and after 1 sec it changed.
This problem puzzled me for a month,then last night "bang",I remember there is a forum I can ask help.So,please ,please help me.thank you .
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

On mouse down, you could start a wxTimer that wakes up once in a while until the mouse is released (mouse release event stops the timer). Then, this timer can increment a counter, and something can happen when the counter reaches some value.
"Keyboard not detected. Press F1 to continue"
-- Windows
happybamboo
Knows some wx things
Knows some wx things
Posts: 27
Joined: Tue Sep 16, 2008 4:19 am

Post by happybamboo »

Auria wrote:On mouse down, you could start a wxTimer that wakes up once in a while until the mouse is released (mouse release event stops the timer). Then, this timer can increment a counter, and something can happen when the counter reaches some value.
i'll try your answer,thank you very much.
Post Reply