Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Mouse click timer
Avatar
Xav
Member
Members
July 5, 2019 - 1:04 pm
Member Since: October 13, 2017
Forum Posts: 6
sp_UserOfflineSmall Offline

Hi ,

 

will like to have help

 

need to buid a kickbutton  which when pressed the left click mouse  for more than 5 seconds do something:

 

onMouserightclik (button,timer )
{

//1.It neeeds to  detect that  the button was pressed 

//2.create a counter timer=0sec  and if the button is still pressed the counter will increase (each frame ) until timer=5 seconds.

3//if buttion was released before 5 sec put timer =0

//if timer =>5 do something ,for example mute the volume!!! 

 

}

 

Cheers

 

Thank you

Avatar
W Pirkle
Admin
July 8, 2019 - 11:00 am
Member Since: January 29, 2017
Forum Posts: 344
sp_UserOfflineSmall Offline

There is an example subclassed CKickButton in the customcontrols.h and .cpp files in every ASPiK and RackAFX7 project. These have the onMouseDown( ) and onMouseUp( ) functions overridden. See that example and then add your own timer. VSTGUI4 defines a timer object as CVSTGUITimer which is documented in that library.

- Will

Avatar
Xav
Member
Members
July 8, 2019 - 3:32 pm
Member Since: October 13, 2017
Forum Posts: 6
sp_UserOfflineSmall Offline

So where can i see the actual code when a kickbutton is created ,the one i created when using the rackfx or aspik creator?

Avatar
W Pirkle
Admin
July 11, 2019 - 2:17 pm
Member Since: January 29, 2017
Forum Posts: 344
sp_UserOfflineSmall Offline

The CKickButton object is created by the VSTGUI4 class factories when the XML file that contains the GUI information is parsed - it is the same for both RackAFX7 and ASPiK. 

If you use the RackAFX7 GUI designer, or the VSTGUI4 GUI Designer (ASPiK), and add a CKickButton object, link it to a GUI parameter (variable), then you can set the Custom View Name. If you use the following Custom View Name:

CustomKickButton

then a CKickButtonEx object is created for that control. You can watch the construction of this object by placing a breakpoint in the PluginGUI::createView( ) function. Another option is to place a breakpoint in the CKickButtonEx constructor. When you open the GUI, the object will be created; you can place breakpoints in the mouse handlers or onDraw( ) - all of the code is there in the .h/.cpp files above.

- Will 

Forum Timezone: America/New_York

Most Users Ever Online: 55

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 41

clau_ste: 39

TheSmile: 37

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 565

Moderators: 1

Admins: 4

Forum Stats:

Groups: 12

Forums: 36

Topics: 581

Posts: 2326

Newest Members:

frankthetank, dhodgson, Wanderer, mister1234, Evan Galvanek, Rowan Fraser, patrickbarr1984, Ray C., Jon R., Pat

Moderators: W Pirkle: 344

Administrators: Tom: 69, JD Young: 80, Will Pirkle: 0, W Pirkle: 344