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!!!
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.
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:
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.
Most Users Ever Online: 55
Currently Browsing this Page:
Guest Posters: 1
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