Ignore:
Timestamp:
Jul 21, 2008, 1:26:05 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

UI_Sampleの追加。イベントのコメントアウト解除。Form.abからテスト部分を除去。Application.DoEventsを実装。MakeControlEventHandlerを静的メンバのイベント対応へ。WindowsExceptionの追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab

    r551 r559  
    4545End Namespace 'Widnows
    4646End Namespace 'ActiveBasic
    47 
    48 '----------
    49 'テスト実行用
    50 
    51 #require <Classes/ActiveBasic/Windows/UI/Application.ab>
    52 #require <Classes/ActiveBasic/Windows/UI/Button.ab>
    53 
    54 Imports ActiveBasic.Windows.UI
    55 
    56 'OleInitialize()
    57 Control.Initialize(GetModuleHandle(0))
    58 
    59 Sub Paint(sender As Object, e As PaintDCArgs)
    60     TextOut(e.Handle, 10, 10, "Hello world!", 12)
    61 End Sub
    62 
    63 Class MyForm
    64     Inherits Form
    65 Public
    66     Sub MyForm()
    67         AddPaintDC(AddressOf (Paint))
    68         AddMouseClick(AddressOf (Mouse))
    69         s = "aaa"
    70     End Sub
    71 
    72 '   Sub Paint(sender As Object, e As PaintDCArgs)
    73 '       TextOut(e.Handle, 10, 10, ToTCStr(s), s.Length)
    74 '   End Sub
    75 
    76     Sub Mouse(sender As Object, e As MouseArgs)
    77         Invalidate()
    78     End Sub
    79 
    80     Sub OnClick(sender As Object, e As Args)
    81         OutputDebugString(Ex"====OnClick====\r\n")
    82     End Sub
    83 
    84     s As String
    85 End Class
    86 
    87 Dim f = New MyForm
    88 f.Create()
    89 f.Text = "Hello"
    90 
    91 Dim b = New Button
    92 b.Create(f)
    93 b.Move(50, 50, 100, 100)
    94 b.Text = "Ok"
    95 b.AddClick(AddressOf(f.OnClick))
    96 
    97 Application.Run(f)
    98 f = Nothing
    99 System.GC.Collect()
    100 
    101 Control.Uninitialize()
    102 'OleUninitialize()
    103 
    104 End
Note: See TracChangeset for help on using the changeset viewer.