Left click (OpenInsight 32-Bit)
At 16 JUN 2005 11:14:54AM Ed Keeman wrote:
Hi
In an edittable I've created a right-click menu, but i want to know the column position of that r-click.
I found a way to calculate the column position, with a lot of ifs and thens.
Is there a way to send a left click to a control.
The left-click will set the selpos property.
Maybe it can be done with sendmessage or postmessage using the right parameters.
Thanks in advance.
At 16 JUN 2005 12:05PM [email protected]'s Roger Hall wrote:
You can use Send_Event(CtrlEntId, "CLICK") or Post_Event(CtrlEntId, "CLICK") if all you want is to send a left-click to a particular control.
At 16 JUN 2005 12:21PM Ed Keeman wrote:
A send_event or post_event will not work.
It must be a low programming windows function.
I know i must use the handle and the lparam.
Both those vars are available in the winmsg event.
Ed
At 16 JUN 2005 12:45PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Ed,
I'm on my way out to a Motorhead concert but here's a section of code from our internal EditTable handling code. Note this is unsupported and is made available as is, but you should get the idea of what's involved !! :)
<code> cursorCell:
This method returns the cell position in relation to the mouse position. * param1 -] DWORD value representing the client mouse coordinates as * passed from a WM_LBUTTONDOWN type message. If this is null then the GetCursorPos function is called to get the * current cursor position. * retValyPos =xyPos
end else * // Get the screen coordinates and map them into the client space xyPos=blank_Struct( "POINT" ) call winAPI_GetCursorPos( xyPos ) call winAPI_ScreenToClient( hwndEdt, xyPos ) xyPos=struct_To_Var( xyPos, "POINT" ) xPos =xyPos yPos =xyPos end if ( ( xPos =edtSize - winAPI_GetSystemMetrics( SM_CXHTHUMB$ ) end end end if bitAnd( edtStyle, WS_HSCROLL$ ) then * // Theres a horizontal scroll bar, so lets see if it's visible hwndScrollBar=function( @atSelf( object, "GETHSCROLLHWND" ) ) if hwndScrollBar then if winAPI_IsWindowVisible( hwndScrollBar ) then edtSize=edtSize - winAPI_GetSystemMetrics( SM_CYVTHUMB$ ) end end end if ( xPos ) then if ( yPos ) then * // We must be somewhere in the client area. Let's see if we * // have row buttons and if so is the cursor over them? if bitAnd( edtStyle, DTS_ROWBUTTONS$ ) or bitAnd( edtStyle, DTS_ROWNUMBERS$ ) then edtLabelW=( sendMessage( hwndEdt, DTM_GETDTMETRICS$, DT_LABELWIDTH$, 0 ) + 1 ) if ( xPos lastCol =edtLimit runningTotal=0 for x=firstCol to lastCol if bitAnd( edtColStyles, DTCS_HIDDEN$ ) else runningTotal += edtColWidths if ( xPos lastRow =edtLimit runningTotal=0 for x=firstRow to lastRow runningTotal += rowH if ( yPos The Sprezzatura Group[/url]World leaders in all things RevSoft
At 16 JUN 2005 12:52PM [email protected]'s Don Bakke wrote:
Ed,
It seems to me that you are looking for a way to left-click the edittable as a way to get the actual cell position you are right-clicking over. Our solution for this was to develop a utility that computes the position of the cell first and then set the SELPOS accordingly. I believe both Sprezz and SRP have this utility commercially available.
At 16 JUN 2005 12:53PM [email protected]'s Don Bakke wrote:
Ha…spoke too soon. Appears that Sprezz has opened their vault on this one!
At 16 JUN 2005 02:44PM Ed Keeman wrote:
Thanks for the response, and the code.
But this is also a calculating way.
I'm looking for a windows call to do a leftclick at the lparam position.
Maybe it is not posible at all.
Thanks again…
Ed
=== At 17 JUN 2005 08:03AM [email protected] wrote: ===
Just to confirm what we THINK you are saying. You want a right click to SELECT the cell it is clicked on so that SELPOS will then be set for you to access?
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 17 JUN 2005 08:18AM Ed Keeman wrote:
Yep, that is what I want for all my edittables.
A right-click will first select the cell and then pops up the contextmenu for that cell.
Just like excel….
I got the left click to work with a button:
ctrl=@window:'.BUTTON_1'
handle=@ctrl-]handle
call sendmessage(handle,513,0,0) ; * lbuttondown
call sendmessage(handle,514,0,0) ; * lbuttonup
Ed