/*!
@file
@brief 「Win32プログラミング講座 〜 Step11. テキスト エディタを作る 〜」のAB5移植版
http://www.activebasic.com/help_center/articles/win32/step05/
まだメニューバーがないんでそれっぽくありません。

@date 2008/07/20
@auther Egtra
*/

#require <Classes/ActiveBasic/Windows/UI/Application.ab>
#require <Classes/ActiveBasic/Windows/UI/Form.ab>
#require <Classes/ActiveBasic/Windows/UI/EditBox.ab>

#resource "UI_Sample.rc"

Imports ActiveBasic.Windows.UI

Class MyForm
	Inherits Form
Public
	Sub MyForm()
		AddResize(AddressOf(OnResize))
		CreateForm()
		myEdit = New EditBox
		With myEdit
			.Create(This, ES_MULTILINE Or ES_WANTRETURN Or ES_AUTOHSCROLL Or ES_AUTOVSCROLL Or WS_HSCROLL Or WS_VSCROLL, WS_EX_CLIENTEDGE)
			.SendMessage(WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT) As WPARAM, 0)
		End With
		Show(SW_SHOWDEFAULT)
	End Sub

	Sub OnResize(sender As Object, e As ResizeArgs)
		myEdit.Move(0, 0, e.X, e.Y)
	End Sub
Private
	myEdit As EditBox
End Class

Control.Initialize(GetModuleHandle(0))

Application.Run(New MyForm)
