Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Syntax Edit
  New Posts New Posts RSS Feed - Cursorposition under mouse?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cursorposition under mouse?

 Post Reply Post Reply
Author
Message
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Topic: Cursorposition under mouse?
    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)?

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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);
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2009 at 5:30am
???

Thank you, but Please give me a VB-sample!
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post 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!!!
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2009 at 4:03am
Great!

Can you already say when 13.1 will be released? (approximate)
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2009 at 2:26pm

May - June I guess

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.