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

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

GDI+をコンパイルできるように修正。FontFamily, Penの追加。サンプルとして、Step 32のGDI+版を制作。
(#56)

File size: 1.1 KB
RevLine 
[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
6Namespace ActiveBasic
7Namespace Windows
8Namespace UI
9
10/*!
11@date 2008/07/13
12@brief トップレベルウィンドウを表すクラス。
13@author Egtra
14*/
[551]15
[547]16Class Form
17 Inherits Control
[551]18Public
19 Sub Form()
[615]20 AddMessageEvent(WM_COMMAND, AddressOf(OnCommand))
[551]21 End Sub
22
[547]23Protected
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)
[637]35' Dim id = e.WParam And &hffff 'LOWORD(e.WParam)
36 Dim cmd = ((e.WParam >> 16) And &hffff) As Word 'HIWORD(e.WParam)
[551]37 Dim hwnd = e.LParam As HWND
[637]38 If hwnd <> 0 Then
39 Dim c = Control.FromHWnd(hwnd) As WmCommandControl
[551]40 If IsNothing(c) = False Then
[637]41 c.RaiseCommandEvent(cmd)
[551]42 End If
43 End If
44 End Sub
45
[547]46#include "FormEvent.sbp"
47End Class
48
49End Namespace 'UI
50End Namespace 'Widnows
51End Namespace 'ActiveBasic
Note: See TracBrowser for help on using the repository browser.