source: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab@ 559

Last change on this file since 559 was 559, checked in by イグトランス (egtra), 16 years ago

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

File size: 1021 bytes
Line 
1'Classes/ActiveBasic/Windows/UI/Form.ab
2
3#require <Classes/ActiveBasic/Windows/UI/Control.ab>
4#require <Classes/ActiveBasic/Windows/UI/Button.ab>
5
6Namespace ActiveBasic
7Namespace Windows
8Namespace UI
9
10/*!
11@date 2008/07/13
12@brief トップレベルウィンドウを表すクラス。
13@author Egtra
14*/
15
16Class Form
17 Inherits Control
18Public
19 Sub Form()
20 AddMessageEvent(WM_COMMAND, AddressOf (OnCommand))
21 End Sub
22
23Protected
24 Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
25 cs.style = WS_OVERLAPPEDWINDOW
26 End Sub
27
28 Sub OnCommand(sender As Object, e As MessageArgs)
29 Dim id = e.WParam And &hffff 'LOWORD(e.WParam)
30 Dim cmd = (e.WParam >> 16) And &hffff 'HIWORD(e.WParam)
31 Dim hwnd = e.LParam As HWND
32 If cmd = BN_CLICKED And hwnd <> 0 Then
33 Dim c = Control.FromHWnd(hwnd)
34 If IsNothing(c) = False Then
35 Dim b = c As Button
36 b.RaiseClick()
37 End If
38 End If
39 End Sub
40
41#include "FormEvent.sbp"
42End Class
43
44End Namespace 'UI
45End Namespace 'Widnows
46End Namespace 'ActiveBasic
Note: See TracBrowser for help on using the repository browser.