/* Filename: WhileMouseDownButton.cc Version: 1.00 Date: 2000 07 14 For: VdBase 7.x / Win9x Author: Ronnie MacGregor Contact: ronnie@high-lugtonridgeKILLSPAM.co.uk Revisions: ********** None. Description: ************ A custom PushButton which provides whileLeftMouseDown capability. Methods: ******** CheckMouse(hWND) Used to establish if the left mouse button is still down, as in the following general example: . function PUSHBUTTON1_onLeftMouseDown(flags, col, row) // onLeftMouseDown code goes here // Initial pause sleep 0.1 do while true if not this.Checkmouse(this.hwnd) // whileLeftMouseDown code goes here // repaint() goes here if required // Control loop speed sleep 0.1 else // onLeftMouseUp code can go here if desired exit endif enddo return Repaint() This is a copy of the repaint() function from the dUFLP, which is often needed to force an update of the screen while processing in a loop. Dependancies: ************* None. Acknowledgements: ***************** Thanks to Romain Strieff for the method, which has simply been turned into a custom control. */ class WhileMouseDownButton(parentObj) of PUSHBUTTON(parentObj) custom #ifndef PM_NOYIELD #define PM_NOYIELD 2 #endif #ifndef WM_LBUTTONDOWN #define WM_LBUTTONDOWN 513 #endif #ifndef WM_LBUTTONUP #define WM_LBUTTONUP 514 #endif if type("PeekMessage"); # "FP" extern cLogical ; PeekMessage(; CSTRING,; CHANDLE,; CLONG,; CLONG,; CLONG; ); User32; From "PeekMessageA" endif function CheckMouse(hWND) local cMsg cMsg = Space(14)//Buffer return PeekMessage(cMsg,; hWND,; WM_LBUTTONDOWN,; WM_LBUTTONUP,; PM_NOYIELD) function Repaint() // from the dUFLP parameter oForm if type( "oForm" ) == "U" or empty( oForm ) oForm = form endif // if type( "UpdateWindow" ) # "FP" extern CLOGICAL UpdateWindow( CHANDLE ) USER32 endif return UpdateWindow( oForm.hWnd ) endclass
Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0