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