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: 152
Currently Browsing this Page:
Guest Posters: 1
Moderators: W Pirkle: 689