| 25 |
int FontHeight, FontWidth, ScreenWidth, ScreenHeight; |
int FontHeight, FontWidth, ScreenWidth, ScreenHeight; |
| 26 |
BOOL AdjustSize; |
BOOL AdjustSize; |
| 27 |
BOOL DontChangeSize=FALSE; |
BOOL DontChangeSize=FALSE; |
|
static int CRTWidth, CRTHeight; |
|
| 28 |
int CursorX, CursorY; |
int CursorX, CursorY; |
| 29 |
|
/* Virtual screen region */ |
| 30 |
|
RECT VirtualScreen; |
| 31 |
|
|
| 32 |
// --- scrolling status flags |
// --- scrolling status flags |
| 33 |
int WinOrgX, WinOrgY, NewOrgX, NewOrgY; |
int WinOrgX, WinOrgY, NewOrgX, NewOrgY; |
| 63 |
{ |
{ |
| 64 |
HDC TmpDC; |
HDC TmpDC; |
| 65 |
int i; |
int i; |
| 66 |
|
BOOL bMultiDisplaySupport = FALSE; |
| 67 |
|
|
| 68 |
TmpDC = GetDC(NULL); |
TmpDC = GetDC(NULL); |
| 69 |
|
|
| 106 |
/* background paintbrush */ |
/* background paintbrush */ |
| 107 |
Background = CreateSolidBrush(ts.VTColor[1]); |
Background = CreateSolidBrush(ts.VTColor[1]); |
| 108 |
/* CRT width & height */ |
/* CRT width & height */ |
| 109 |
CRTWidth = GetDeviceCaps(TmpDC,HORZRES); |
{ |
| 110 |
CRTHeight = GetDeviceCaps(TmpDC,VERTRES); |
OSVERSIONINFO ver; |
| 111 |
|
ZeroMemory( &ver, sizeof(ver) ); |
| 112 |
|
ver.dwOSVersionInfoSize = sizeof(ver); |
| 113 |
|
GetVersionEx( &ver ); |
| 114 |
|
switch( ver.dwPlatformId ) { |
| 115 |
|
// Windows 9x か NT かの判定 |
| 116 |
|
case VER_PLATFORM_WIN32_WINDOWS: |
| 117 |
|
if( ver.dwMajorVersion > 4 || |
| 118 |
|
(ver.dwMajorVersion == 4 && ver.dwMinorVersion >= 10) ) // Windows 98 or later |
| 119 |
|
bMultiDisplaySupport = TRUE; |
| 120 |
|
break; |
| 121 |
|
case VER_PLATFORM_WIN32_NT: |
| 122 |
|
if( ver.dwMajorVersion >= 5 ) // Windows 2000 or later |
| 123 |
|
bMultiDisplaySupport = TRUE; |
| 124 |
|
break; |
| 125 |
|
default: |
| 126 |
|
break; |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
if( bMultiDisplaySupport ) { |
| 130 |
|
VirtualScreen.left = GetSystemMetrics(SM_XVIRTUALSCREEN); |
| 131 |
|
VirtualScreen.top = GetSystemMetrics(SM_YVIRTUALSCREEN); |
| 132 |
|
VirtualScreen.right = VirtualScreen.left + GetSystemMetrics(SM_CXVIRTUALSCREEN); |
| 133 |
|
VirtualScreen.bottom = VirtualScreen.top + GetSystemMetrics(SM_CYVIRTUALSCREEN); |
| 134 |
|
} else { |
| 135 |
|
VirtualScreen.left = 0; |
| 136 |
|
VirtualScreen.top = 0; |
| 137 |
|
VirtualScreen.right = GetDeviceCaps(TmpDC,HORZRES); |
| 138 |
|
VirtualScreen.bottom = GetDeviceCaps(TmpDC,VERTRES); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
ReleaseDC(NULL, TmpDC); |
ReleaseDC(NULL, TmpDC); |
| 142 |
|
|
| 143 |
if ((ts.VTPos.x > CRTWidth) || (ts.VTPos.y > CRTHeight)) |
if ( (ts.VTPos.x > VirtualScreen.right) || (ts.VTPos.y > VirtualScreen.bottom) ) |
| 144 |
{ |
{ |
| 145 |
ts.VTPos.x = CW_USEDEFAULT; |
ts.VTPos.x = CW_USEDEFAULT; |
| 146 |
ts.VTPos.y = CW_USEDEFAULT; |
ts.VTPos.y = CW_USEDEFAULT; |
| 147 |
} |
} |
| 148 |
|
else if ( (ts.VTPos.x < VirtualScreen.left-20) || (ts.VTPos.y < VirtualScreen.top-20) ) |
| 149 |
|
{ |
| 150 |
|
ts.VTPos.x = CW_USEDEFAULT; |
| 151 |
|
ts.VTPos.y = CW_USEDEFAULT; |
| 152 |
|
} |
| 153 |
|
else { |
| 154 |
|
if ( ts.VTPos.x < VirtualScreen.left ) ts.VTPos.x = VirtualScreen.left; |
| 155 |
|
if ( ts.VTPos.y < VirtualScreen.top ) ts.VTPos.y = VirtualScreen.top; |
| 156 |
|
} |
| 157 |
|
|
| 158 |
if ((ts.TEKPos.x > CRTWidth) || (ts.TEKPos.y > CRTHeight)) |
if ( (ts.TEKPos.x > VirtualScreen.right) || (ts.TEKPos.y > VirtualScreen.bottom) ) |
| 159 |
{ |
{ |
| 160 |
ts.TEKPos.x = CW_USEDEFAULT; |
ts.TEKPos.x = CW_USEDEFAULT; |
| 161 |
ts.TEKPos.y = CW_USEDEFAULT; |
ts.TEKPos.y = CW_USEDEFAULT; |
| 162 |
} |
} |
| 163 |
|
else if ( (ts.TEKPos.x < VirtualScreen.left-20) || (ts.TEKPos.y < VirtualScreen.top-20) ) |
| 164 |
|
{ |
| 165 |
|
ts.TEKPos.x = CW_USEDEFAULT; |
| 166 |
|
ts.TEKPos.y = CW_USEDEFAULT; |
| 167 |
|
} |
| 168 |
|
else { |
| 169 |
|
if ( ts.TEKPos.x < VirtualScreen.left ) ts.TEKPos.x = VirtualScreen.left; |
| 170 |
|
if ( ts.TEKPos.y < VirtualScreen.top ) ts.TEKPos.y = VirtualScreen.top; |
| 171 |
|
} |
| 172 |
} |
} |
| 173 |
|
|
| 174 |
void EndDisp() |
void EndDisp() |
| 504 |
|
|
| 505 |
NewX = x; |
NewX = x; |
| 506 |
NewY = y; |
NewY = y; |
| 507 |
if (x+w > CRTWidth) |
if (x+w > VirtualScreen.right) |
| 508 |
{ |
{ |
| 509 |
NewX = CRTWidth-w; |
NewX = VirtualScreen.right-w; |
| 510 |
if (NewX < 0) NewX = 0; |
if (NewX < 0) NewX = 0; |
| 511 |
} |
} |
| 512 |
if (y+h > CRTHeight) |
if (y+h > VirtualScreen.bottom) |
| 513 |
{ |
{ |
| 514 |
NewY = CRTHeight-h; |
NewY = VirtualScreen.bottom-h; |
| 515 |
if (NewY < 0) NewY = 0; |
if (NewY < 0) NewY = 0; |
| 516 |
} |
} |
| 517 |
if ((NewX!=x) || (NewY!=y)) |
if ((NewX!=x) || (NewY!=y)) |
| 520 |
Point.x = 0; |
Point.x = 0; |
| 521 |
Point.y = ScreenHeight; |
Point.y = ScreenHeight; |
| 522 |
ClientToScreen(HVTWin,&Point); |
ClientToScreen(HVTWin,&Point); |
| 523 |
CompletelyVisible = (Point.y <= CRTHeight); |
CompletelyVisible = (Point.y <= VirtualScreen.bottom); |
| 524 |
if (IsCaretOn()) CaretOn(); |
if (IsCaretOn()) CaretOn(); |
| 525 |
} |
} |
| 526 |
} |
} |
| 1256 |
Point.x = 0; |
Point.x = 0; |
| 1257 |
Point.y = ScreenHeight; |
Point.y = ScreenHeight; |
| 1258 |
ClientToScreen(HVTWin,&Point); |
ClientToScreen(HVTWin,&Point); |
| 1259 |
CompletelyVisible = (Point.y <= CRTHeight); |
CompletelyVisible = (Point.y <= VirtualScreen.bottom); |
| 1260 |
} |
} |
| 1261 |
|
|
| 1262 |
void DispSetActive(BOOL ActiveFlag) |
void DispSetActive(BOOL ActiveFlag) |