Thread

AW_CALLBACK_ADDRESS/Getting the last visible line in a text/richtext box (Sdk)

AW_CALLBACK_ADDRESS/Getting the last visible line in a text/richtext box // Sdk

1  |  

baron

May 21, 2001, 7:36am
Two issues, one VB SDK specific and one on Windows API.

According to http://www.activeworlds.com/sdk/aw_address.htm a call to aw_address returns the IP address for a given session number. In AW_CALLBACK_ADDRESS the attributes AW_AVATAR_SESSION and AW_AVATAR_ADDRESS are returned. My problem is this callback does not appear in the procedure dropdown list for AwSdkOcx3. Is there any other way I can use it? Should it be missing from the procedure dropdown list in the first place or am I missing something? I've been messing with this for quite a while but haven't figured it out.

Second has to do with getting the last visible line in a text/richtext box. EM_GETFIRSTVISIBLELINE returns the first visible line but there is no message for the last visible line. I currently do it by sending EM_GETRECT to the control to get the rect and calculate the text/richtext box height, use WM_GETFONT and call GetTextMetrics to get tmHeight (line spacing) then divide height with it to get the number of visible lines, add visible lines to the index of first visible returned by EM_GETFIRSTVISIBLELINE to get the last visible line. This method works ok but it seems like going around the world to calculate earth's perimeter so...is there another way to do it? Anyone has a clue why it's missing by Win32 SDK anyway (if it's missing)?

Thanks,
Baron

mrgrimm

May 21, 2001, 9:19am
I checked AwSdkOcx3 and it appears that I forgot to implement
AW_CALLBACK_ADDRESS ... I'll fix this sometime soon.

-MG

[View Quote]

faber

May 21, 2001, 3:06pm
"baron" <pk39srt at hotmail.com> schrieb im Newsbeitrag news:3b08e18c at server1.Activeworlds.com...
> Second has to do with getting the last visible line in a text/richtext box. EM_GETFIRSTVISIBLELINE returns the first visible line
but there is no message for the last visible line. I currently do it by sending EM_GETRECT to the control to get the rect and
calculate the text/richtext box height, use WM_GETFONT and call GetTextMetrics to get tmHeight (line spacing) then divide height
with it to get the number of visible lines, add visible lines to the index of first visible returned by EM_GETFIRSTVISIBLELINE to
get the last visible line. This method works ok but it seems like going around the world to calculate earth's perimeter so...is
there another way to do it? Anyone has a clue why it's missing by Win32 SDK anyway (if it's missing)?


Hehe, i like that picture "This method works ok but it seems like going around the world to calculate earth's perimeter so..." :)

And i like your approach. I think that text edit controls simply do not support a message like EM_GETLASTVISIBLELINE, and therefore
your way seems to be perfectly valid.

Faber

grimble

May 23, 2001, 2:53pm
That's exactly right, to my knowledge. The top line is used by windows as
the key for painting the edit box itself. I don't think M$ beleive in doing
too much work for you when you're interfacing with windows.

So ... working out the size of the font and calculating the last visible
line is the way to do it. Heh heh ... not try it with a rich text box with
different fonts. :o).

Grims


[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2022. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn