- Timestamp:
- May 9, 2007, 9:43:24 PM (18 years ago)
- Location:
- Include/Classes/System/Windows/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Windows/Forms/Control.ab
r223 r240 28 28 End Sub 29 29 30 Override Function AsyncState() As IObject30 Override Function AsyncState() As Object 31 31 Return Nothing 32 32 End Function … … 36 36 End Function 37 37 38 Override Function CompletedSynchronously() As B OOL38 Override Function CompletedSynchronously() As Boolean 39 39 Return FALSE 40 40 End Function 41 41 42 Override Function IsCompleted() As B OOL43 Return waitHandle.WaitOne(0, F ALSE)42 Override Function IsCompleted() As Boolean 43 Return waitHandle.WaitOne(0, False) 44 44 End Function 45 45 … … 69 69 '--------------------------------------------------------------------------- 70 70 ' Public Properties 71 72 71 Function AllowDrop() As Boolean 73 72 End Function … … 93 92 End Function 94 93 95 Sub Text( ByReft As String)94 Sub Text(t As String) 96 95 text = t 97 96 Dim e As EventArgs … … 185 184 186 185 Const Function Right() As Long 187 Return Left + Width 186 Dim b = Bounds 187 Return b.Left + b.Width 188 188 End Function 189 189 190 190 Const Function Bottom() As Long 191 Return Top + Height 191 Dim b = Bounds 192 Return b.Top + b.Height 192 193 End Function 193 194 … … 266 267 This.text = text 267 268 bkColor = DefaultBackColor 268 ' Debug269 CreateHandle()270 269 End Sub 271 270 … … 279 278 280 279 Virtual Sub ~Control() 281 If wnd.IsWindow Then 282 wnd.Destroy() ' 暫定 280 If Not Object.ReferenceEquals(wnd, Nothing) Then 281 If wnd.IsWindow Then 282 wnd.Destroy() ' 暫定 283 End If 283 284 End If 284 285 End Sub … … 358 359 End Sub 359 360 361 Sub CreateControl() 362 CreateHandle() '暫定 363 End Sub 364 360 365 Protected 366 361 367 '--------------------------------------------------------------------------- 362 368 ' Protected Properties … … 365 371 Return createParams 366 372 End Function 367 368 373 ' Virtual Function DefaultCursor() As Cursor 369 374 … … 377 382 378 383 ' Const Virtual Function Cursor() As Cursor 379 ' Virtual Sub Cursor( ByRefc As Cursor)384 ' Virtual Sub Cursor(c As Cursor) 380 385 381 386 '--------------------------------------------------------------------------- … … 385 390 Dim gch = GCHandle.Alloc(This) 386 391 TlsSetValue(tlsIndex, GCHandle.ToIntPtr(gch) As VoidPtr) 387 With createParams [0]392 With createParams 388 393 Dim hwndParent = 0 As HWND 389 394 If Not Object.ReferenceEquals(parent, Nothing) Then 390 395 hwndParent = parent.Handle 391 396 End If 392 If CreateWindowEx(.ExStyle, atom As ULONG_PTR As PCSTR, text, .Style, _ 397 Dim pText As PCTSTR 398 If String.IsNullOrEmpty(text) Then 399 pText = "" As PCTSTR 400 Else 401 pText = ToTCStr(text) 402 End If 403 404 If CreateWindowEx(.ExStyle, atom As ULONG_PTR As PCSTR, pText, .Style, _ 393 405 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, _ 394 406 hwndParent, 0, hInstance, 0) = 0 Then … … 437 449 Case WM_CREATE 438 450 OnHandleCreated(EventArgs.Empty) 451 Case WM_DESTROY 452 OnHandleDestroyed(EventArgs.Empty) 439 453 Case Else 440 454 DefWndProc(m) … … 487 501 Virtual Sub OnBackColorChanged(e As EventArgs) : End Sub 488 502 Virtual Sub OnHandleCreated(e As EventArgs) : End Sub 503 Virtual Sub OnHandleDestroyed(e As EventArgs) : End Sub 489 504 Virtual Sub OnTextChanged(e As EventArgs) 490 505 wnd.SetText(ToTCStr(text)) … … 527 542 .hbrBackground = 0 528 543 .lpszMenuName = 0 529 .lpszClassName = WindowClassName544 .lpszClassName = ToTCStr(WindowClassName) 530 545 .hIconSm = 0 531 546 End With … … 565 580 ' あってはならない事態 566 581 Debug 567 ExitThread( 0)582 ExitThread(-1) 568 583 End If 569 ' Debug570 584 rThis.wnd = New WindowHandle(hwnd) 571 585 SetWindowLongPtr(hwnd, GWLP_THIS, gchValue) 572 586 End If 573 Dim m As Message 574 m = Message.Create(hwnd, msg, wp, lp)587 588 Dim m = Message.Create(hwnd, msg, wp, lp) 575 589 rThis.WndProc(m) 576 590 Return m.Result … … 605 619 606 620 #endif '__SYSTEM_WINDOWS_FORMS_CONTROL_AB__ 621 -
Include/Classes/System/Windows/Forms/CreateParams.ab
r77 r240 13 13 X As Long 14 14 Y As Long 15 Wid htAs Long15 Width As Long 16 16 Height As Long 17 17 Parent As HWND -
Include/Classes/System/Windows/Forms/Message.ab
r223 r240 70 70 71 71 Static Function Create(hwnd As HWND, msg As DWord, wp As WPARAM, lp As LPARAM) As Message 72 Dim m AsMessage73 With m72 Create = New Message 73 With Create 74 74 .hwnd = hwnd 75 75 .msg = msg … … 77 77 .lp = lp 78 78 End With 79 Return m80 79 End Function 81 80
Note:
See TracChangeset
for help on using the changeset viewer.