![]() |
Cursorposition under mouse? |
Post Reply ![]() |
Author | ||
Jebo ![]() Senior Member ![]() Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
![]() ![]() ![]() ![]() ![]() Posted: 28 March 2009 at 5:05am |
|
Hi,
how can I detect the Row/Col-Position under my mouse (on MouseMove-Event, if I have X/Y-Coordinates)? |
||
![]() |
||
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
|
// Returns the row and col (Not validated) for a specific point. Use
// CalcValidDispCol for validation.
// Parameters:
// pt : [in] The point in client co-ordinate.
// pRow : [out] The out parameter contains the calculated
// document row.
// pCol : [out] The out parameter contains the calculated col.
// pDispRow : [out] The out parameter contains the calculated
// visible row.
// pDispCol : [out] The out parameter contains the calculated
// visible col.
// bVirtualSpace : [in] Set TRUE if virtual space is enabled
// (cursor can be paced in any place after line end).
// Returns:
// BOOL : True if point was out of bound and index was corrected
BOOL RowColFromPoint(CPoint pt, int *pRow, int *pCol, int *pDispRow = NULL, int *pDispCol = NULL, BOOL bVirtualSpace = -1);
|
||
![]() |
||
Jebo ![]() Senior Member ![]() Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
![]() ![]() ![]() ![]() ![]() |
|
???
Thank you, but Please give me a VB-sample! |
||
![]() |
||
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
|
You can use event CurPosChanged(long nNewRow, long nNewCol);
TextChanged(long nRowFrom, long nRowTo, long nActions); Open your VB Object Browser and look
|
||
![]() |
||
Jebo ![]() Senior Member ![]() Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
![]() ![]() ![]() ![]() ![]() |
|
Sorry, but I think you dont understand what I want!
Both Events fires ONLY if I've a focus inside the control. That's not what I need! I need Row/Col-Position under the mouse-pointer to set the cursor by code (!). What I already have are the X/Y-Coordinates - and NO FOCUS inside the SyntexEditor. |
||
![]() |
||
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
|
if you need to use to expose function RowColFromPoint to ActiveX - open Issue and ask about such feature. I can do it for ver 13.1
|
||
![]() |
||
Jebo ![]() Senior Member ![]() Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
![]() ![]() ![]() ![]() ![]() |
|
Yep, that's exactly what I need!
Done!!! |
||
![]() |
||
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
|
I also done with new ActiveX function: long POS = RowColCodeFromPoint(long X, long Y)
return POS as nNewRow * 1000 + nNewCol - need to decode back to use
I already changed syntax to
BOOL RowColCodeFromPoint(long x, long y, long* row, long* col)
- no need to decode and unrestricted columns range
|
||
![]() |
||
Jebo ![]() Senior Member ![]() Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
![]() ![]() ![]() ![]() ![]() |
|
Great!
Can you already say when 13.1 will be released? (approximate) |
||
![]() |
||
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
|
May - June I guess |
||
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |