Rev | Line | |
---|
[77] | 1 | ' Classes/System/Windows/Forms/Message.ab
|
---|
| 2 |
|
---|
| 3 | #ifndef __SYSTEM_WINDOWS_FORMS_MESSAGE_AB__
|
---|
| 4 | #define __SYSTEM_WINDOWS_FORMS_MESSAGE_AB__
|
---|
| 5 |
|
---|
[223] | 6 | #require <windows.sbp>
|
---|
| 7 |
|
---|
[77] | 8 | Class Message
|
---|
| 9 | Public
|
---|
[223] | 10 | Const Function HWnd() As HWND
|
---|
[77] | 11 | Return hwnd
|
---|
| 12 | End Function
|
---|
| 13 |
|
---|
| 14 | Sub HWnd(hw As HWND)
|
---|
| 15 | hwnd = hw
|
---|
| 16 | End Sub
|
---|
| 17 |
|
---|
[223] | 18 | Const Function Msg() As DWord
|
---|
[77] | 19 | Return msg
|
---|
| 20 | End Function
|
---|
| 21 |
|
---|
| 22 | Sub Msg(m As DWord)
|
---|
| 23 | msg = m
|
---|
| 24 | End Sub
|
---|
| 25 |
|
---|
[223] | 26 | Const Function WParam() As WPARAM
|
---|
[77] | 27 | Return wp
|
---|
| 28 | End Function
|
---|
| 29 |
|
---|
| 30 | Sub WParam(wParam As WPARAM)
|
---|
| 31 | wp = wParam
|
---|
| 32 | End Sub
|
---|
| 33 |
|
---|
[223] | 34 | Const Function LParam() As LPARAM
|
---|
[77] | 35 | Return lp
|
---|
| 36 | End Function
|
---|
| 37 |
|
---|
| 38 | Sub LParam(lParam As LPARAM)
|
---|
| 39 | lp = lParam
|
---|
| 40 | End Sub
|
---|
| 41 |
|
---|
[223] | 42 | Const Function Result() As LRESULT
|
---|
[77] | 43 | Return lr
|
---|
| 44 | End Function
|
---|
| 45 |
|
---|
| 46 | Sub Result(res As LRESULT)
|
---|
| 47 | lr = res
|
---|
| 48 | End Sub
|
---|
| 49 |
|
---|
[223] | 50 | /*Const*/ Function Equals(x As Message) As Boolean
|
---|
[77] | 51 | Return hwnd = x.hwnd And _
|
---|
| 52 | msg = x.msg And _
|
---|
| 53 | wp = .wp And _
|
---|
| 54 | lp = .lp And _
|
---|
| 55 | lr = .lr
|
---|
| 56 | End Function
|
---|
| 57 |
|
---|
[223] | 58 | Override Function GetHashCode() As Long
|
---|
| 59 | Return _System_HashFromPtr(hwnd) Xor (Not msg) Xor _System_HashFromPtr(wp As VoidPtr) Xor _
|
---|
| 60 | (Not _System_HashFromPtr(lp As VoidPtr)) Xor _System_HashFromPtr(lr As VoidPtr)
|
---|
| 61 | End Function
|
---|
| 62 |
|
---|
| 63 | Const Function Operator ==(x As Message) As BOOL
|
---|
[77] | 64 | Return Equals(x)
|
---|
| 65 | End Function
|
---|
| 66 |
|
---|
[223] | 67 | Const Function Operator <>(x As Message) As BOOL
|
---|
[77] | 68 | Return Not Equals(x)
|
---|
| 69 | End Function
|
---|
| 70 |
|
---|
| 71 | Static Function Create(hwnd As HWND, msg As DWord, wp As WPARAM, lp As LPARAM) As Message
|
---|
[240] | 72 | Create = New Message
|
---|
| 73 | With Create
|
---|
[77] | 74 | .hwnd = hwnd
|
---|
| 75 | .msg = msg
|
---|
| 76 | .wp = wp
|
---|
| 77 | .lp = lp
|
---|
| 78 | End With
|
---|
| 79 | End Function
|
---|
| 80 |
|
---|
| 81 | Private
|
---|
| 82 | hwnd As HWND
|
---|
| 83 | msg As DWord
|
---|
| 84 | wp As WPARAM
|
---|
| 85 | lp As LPARAM
|
---|
| 86 | lr As LRESULT
|
---|
| 87 | End Class
|
---|
| 88 |
|
---|
| 89 | #endif '__SYSTEM_WINDOWS_FORMS_MESSAGE_AB__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.