Changeset 123 for Include/basic/prompt.sbp
- Timestamp:
- Mar 1, 2007, 12:31:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/basic/prompt.sbp
r121 r123 38 38 39 39 _PromptSys_bInitFinish=0 40 CreateThread( _ 41 0, 42 0, 43 AddressOf(PromptMain) As LPTHREAD_START_ROUTINE, 44 0 As VoidPtr, 45 0, 46 _PromptSys_dwThreadID) 40 CreateThread(0, 0, AddressOf(PromptMain) As LPTHREAD_START_ROUTINE, 0, 0, _PromptSys_dwThreadID) 47 41 Do 48 42 Sleep(20) … … 135 129 If buf[i2] = 9 Then 'tab 136 130 i3 = 8 - (.x And 7) '(.x mod 8) 137 Dim j As Long 138 Dim p = VarPtr(_PromptSys_Buffer[.y][.x]) As *Char 139 ' FillMemory(_PromptSys_Buffer[.y]+.x, i3, Asc(" ")) 140 For j = 0 To ELM(i3) 141 p[j] = &h20 'Asc(" ") 142 Next 131 _System_FillChar(VarPtr(_PromptSys_Buffer[.y][.x]), i3, &h20) 'Asc(" ") 143 132 i2++ 144 133 .x += i3 … … 194 183 Dim tm As TEXTMETRIC 195 184 Dim hOldFont=SelectObject(_PromptSys_hMemDC, _PromptSys_hFont) As HFONT 196 GetTextExtentPoint32(_PromptSys_hMemDC, Ex" " As PCTSTR, 1, _PromptSys_FontSize)185 GetTextExtentPoint32(_PromptSys_hMemDC, " " As PCTSTR, 1, _PromptSys_FontSize) 197 186 GetTextMetrics(_PromptSys_hMemDC, tm) 198 187 SelectObject(_PromptSys_hMemDC, hOldFont) … … 215 204 With CompForm 216 205 .dwStyle = CFS_POINT 217 .ptCurrentPos.x = _PromptSys_CurPos.x *_PromptSys_FontSize.cx218 .ptCurrentPos.y = _PromptSys_CurPos.y *_PromptSys_FontSize.cy206 .ptCurrentPos.x = _PromptSys_CurPos.x * _PromptSys_FontSize.cx 207 .ptCurrentPos.y = _PromptSys_CurPos.y * _PromptSys_FontSize.cy 219 208 End With 220 209 ImmSetCompositionWindow(hIMC, CompForm) … … 223 212 ImmReleaseContext(hWnd, hIMC) 224 213 225 CreateCaret(hWnd, NULL,9,6)214 CreateCaret(hWnd, NULL, 9, 6) 226 215 SetCaretPos(_PromptSys_CurPos.x*_PromptSys_FontSize.cx, _ 227 216 (_PromptSys_CurPos.y+1)*_PromptSys_FontSize.cy-7) … … 256 245 Dim pTemp = GlobalLock(hGlobal) As PCSTR 257 246 #ifdef UNICODE 'A版ウィンドウプロシージャ用 258 Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, -1, 0, 0) + 1 247 Dim tempSizeA = lstrlenA(pTemp) 248 Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, tempSizeA, 0, 0) + 1 259 249 TempStr = ZeroString(tempSizeW) 260 MultiByteToWideChar(CP_ACP, 0, pTemp, -1, StrPtr(TempStr), tempSizeW)250 MultiByteToWideChar(CP_ACP, 0, pTemp, tempSizeA, StrPtr(TempStr), tempSizeW) 261 251 #else 262 252 TempStr = ZeroString(lstrlen(pTemp) + 1) … … 335 325 'Regist Prompt Class 336 326 Dim wcl As WNDCLASSEX 337 FillMemory(VarPtr(wcl),Len(wcl),0) 338 wcl.cbSize=Len(wcl) 339 wcl.hInstance=GetModuleHandle(0) 340 wcl.style=CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS 341 wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION)) 342 wcl.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_WINLOGO)) 343 wcl.hCursor=LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW)) 344 wcl.lpszClassName="PROMPT" 345 wcl.lpfnWndProc=AddressOf(PromptProc) 346 wcl.hbrBackground=GetStockObject(BLACK_BRUSH) 327 ZeroMemory(VarPtr(wcl), Len(wcl)) 328 With wcl 329 .cbSize = Len(wcl) 330 .hInstance = GetModuleHandle(0) 331 .style = CS_HREDRAW or CS_VREDRAW' or CS_DBLCLKS 332 .hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION)) 333 .hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(IDI_WINLOGO)) 334 .hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)) 335 .lpszClassName = "PROMPT" 336 .lpfnWndProc = AddressOf(PromptProc) 337 .hbrBackground = GetStockObject(BLACK_BRUSH) 338 End With 347 339 Dim atom = RegisterClassEx(wcl) 348 340 349 341 'Create Prompt Window 350 342 _PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,atom As ULONG_PTR As PCSTR,"BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0) 351 ShowWindow(_PromptSys_hWnd, SW_SHOW)343 ShowWindow(_PromptSys_hWnd, SW_SHOW) 352 344 UpdateWindow(_PromptSys_hWnd) 353 345 354 Dim msg As MSG , iResult As Long346 Dim msg As MSG 355 347 Do 356 iResult=GetMessage(msg,0,0,0)357 If iResult =0 or iResult=-1 Then Exit Do348 Dim iResult = GetMessage(msg, 0, 0, 0) 349 If iResult = 0 or iResult = -1 Then Exit Do 358 350 TranslateMessage(msg) 359 351 DispatchMessage(msg) … … 392 384 If num=1 or num=3 Then 393 385 'Clear the text screen 394 For i =0 To 100395 FillMemory(_PromptSys_Buffer[i],255,0)386 For i = 0 To 100 387 _System_FillChar(_PromptSys_Buffer[i],255,0) 396 388 Next 397 _PromptSys_CurPos.x=0 398 _PromptSys_CurPos.y=0 389 With _PromptSys_CurPos 390 .x = 0 391 .y = 0 392 End With 399 393 End If 400 394 … … 488 482 If y<0 Then y=0 489 483 If y>100 Then y=100 490 491 _PromptSys_CurPos.x=x492 _PromptSys_CurPos.y=y493 484 With _PromptSys_CurPos 485 .x = x 486 .y = y 487 End With 494 488 i=0 495 489 While _PromptSys_Buffer[y][i] … … 497 491 Wend 498 492 499 If i <x Then500 FillMemory(_PromptSys_Buffer[y]+i,x-i,Asc(" "))501 For i2 =i To x-1502 _PromptSys_BackColor[y][i2] =-1493 If i < x Then 494 _System_FillChar(VarPtr(_PromptSys_Buffer[y][i]), x - i, &h20) 'Asc(" ") 495 For i2 = i To x - 1 496 _PromptSys_BackColor[y][i2] = -1 503 497 Next 504 498 End If
Note:
See TracChangeset
for help on using the changeset viewer.