svnno****@sourc*****
svnno****@sourc*****
2013年 5月 24日 (金) 19:58:57 JST
Revision: 5279 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5279 Author: doda Date: 2013-05-24 19:58:57 +0900 (Fri, 24 May 2013) Log Message: ----------- URL 上でマウスカーソル形状を変更する際の判定が左に半文字分ずれていたのを修正。 Modified Paths: -------------- trunk/teraterm/teraterm/buffer.c trunk/teraterm/teraterm/buffer.h trunk/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: trunk/teraterm/teraterm/buffer.c =================================================================== --- trunk/teraterm/teraterm/buffer.c 2013-05-24 08:45:38 UTC (rev 5278) +++ trunk/teraterm/teraterm/buffer.c 2013-05-24 10:58:57 UTC (rev 5279) @@ -2749,26 +2749,6 @@ X = NumOfColumns; } - // check URL string on mouse over(2005/4/3 yutaka) - if (NClick == 0) { - extern void SetMouseCursor(char *cursor); - - // \x83N\x83\x8A\x83b\x83J\x83u\x83\x8BURL\x82\xAA\x97L\x8C\xF8\x82̏ꍇ\x82̂݁A\x83}\x83E\x83X\x83J\x81[\x83\\x83\x8B\x82\xF0\x95ό`\x82\xB3\x82\xB9\x82\xE9\x81B(2009.8.27 yutaka) - if (ts.EnableClickableUrl) { - if ((AttrBuff[TmpPtr+X] & AttrURL)) { - SetMouseCursor("HAND"); - - } else { - SetMouseCursor(ts.MouseCursorName); - //SetCursor(LoadCursor(NULL, IDC_IBEAM)); - - } - } - - UnlockBuffer(); - return; - } - #if 0 /* start - ishizaki */ if (ts.EnableClickableUrl && (NClick == 2) && (AttrBuff[TmpPtr+X] & AttrURL)) { @@ -3703,3 +3683,33 @@ return (CursorX); } +BOOL BuffCheckMouseOnURL(int Xw, int Yw) +{ + int X, Y; + LONG TmpPtr; + BOOL Result, Right; + + DispConvWinToScreen(Xw, Yw, &X, &Y, &Right); + Y += PageStart; + + if (X < 0) + X = 0; + else if (X > NumOfColumns) + X = NumOfColumns; + if (Y < 0) + Y = 0; + else if (Y >= BuffEnd) + Y = BuffEnd - 1; + + TmpPtr = GetLinePtr(Y); + LockBuffer(); + + if (AttrBuff[TmpPtr+X] & AttrURL) + Result = TRUE; + else + Result = FALSE; + + UnlockBuffer(); + + return Result; +} Modified: trunk/teraterm/teraterm/buffer.h =================================================================== --- trunk/teraterm/teraterm/buffer.h 2013-05-24 08:45:38 UTC (rev 5278) +++ trunk/teraterm/teraterm/buffer.h 2013-05-24 10:58:57 UTC (rev 5279) @@ -82,6 +82,7 @@ void BuffScrollLeft(int count); void BuffScrollRight(int count); int BuffGetCurrentLineData(char *buf, int bufsize); +BOOL BuffCheckMouseOnURL(int Xw, int Yw); extern int StatusLine; extern int CursorTop, CursorBottom; Modified: trunk/teraterm/teraterm/vtwin.cpp =================================================================== --- trunk/teraterm/teraterm/vtwin.cpp 2013-05-24 08:45:38 UTC (rev 5278) +++ trunk/teraterm/teraterm/vtwin.cpp 2013-05-24 10:58:57 UTC (rev 5279) @@ -250,7 +250,7 @@ // Tera Term\x8BN\x93\xAE\x8E\x9E\x82\xC6URL\x95\xB6\x8E\x9A\x97\xF1mouse over\x8E\x9E\x82ɌĂ\xEA\x82\xE9 (2005.4.2 yutaka) -extern "C" void SetMouseCursor(char *cursor) +void SetMouseCursor(char *cursor) { HCURSOR hc; LPCTSTR name = NULL; @@ -2215,8 +2215,10 @@ mousereport = MouseReport(IdMouseEventMove, 0, point.x, point.y); if (! (LButton || MButton || RButton)) { - // \x83}\x83E\x83X\x83J\x81[\x83\\x83\x8B\x92\xBC\x89\xBA\x82\xC9URL\x95\xB6\x8E\x9A\x97\xA0\x82邩\x82𑖍\xB8\x82\xB7\x82\xE9 (2005.4.2 yutaka) - BuffChangeSelect(point.x, point.y,0); + if (BuffCheckMouseOnURL(point.x, point.y)) + SetMouseCursor("HAND"); + else + SetMouseCursor(ts.MouseCursorName); return; }