Print Page | Close Window

Cursorposition under mouse?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=13837
Printed Date: 02 May 2024 at 11:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Cursorposition under mouse?
Posted By: Jebo
Subject: Cursorposition under mouse?
Date 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)?




Replies:
Posted By: mdoubson
Date Posted: 28 March 2009 at 8:44pm

// 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);


-------------
Mark Doubson, Ph.D.


Posted By: Jebo
Date Posted: 29 March 2009 at 5:30am
???

Thank you, but Please give me a VB-sample!


Posted By: mdoubson
Date Posted: 29 March 2009 at 10:25am

You can use event

CurPosChanged(long nNewRow, long nNewCol);
TextChanged(long nRowFrom, long nRowTo, long nActions);
 
Open your VB Object Browser and look


-------------
Mark Doubson, Ph.D.


Posted By: Jebo
Date Posted: 29 March 2009 at 10:41am
Sorry, but I think you dont understand what I want!

Originally posted by mdoubson mdoubson wrote:

CurPosChanged(long nNewRow, long nNewCol);
TextChanged(long nRowFrom, long nRowTo, long nActions);
 


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.




Posted By: mdoubson
Date Posted: 29 March 2009 at 11:46am
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

-------------
Mark Doubson, Ph.D.


Posted By: Jebo
Date Posted: 29 March 2009 at 12:00pm
Originally posted by mdoubson mdoubson wrote:

...function RowColFromPoint...

Yep, that's exactly what I need!


Originally posted by mdoubson mdoubson wrote:

...open Issue and ask about such feature. I can do it for ver 13.1

Done!!!


Posted By: mdoubson
Date Posted: 29 March 2009 at 11:37pm
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


-------------
Mark Doubson, Ph.D.


Posted By: Jebo
Date Posted: 30 March 2009 at 4:03am
Great!

Can you already say when 13.1 will be released? (approximate)


Posted By: mdoubson
Date Posted: 17 April 2009 at 2:26pm

May - June I guess



-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net