Page 1 of 1

A problem about mouse left down

Posted: Mon Nov 30, 2009 1:07 am
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 .

Posted: Mon Nov 30, 2009 1:20 am
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.

Posted: Mon Nov 30, 2009 1:36 am
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.