#Include Once "../Inc/Translate.bi"

Constructor ClassTranslate

	Dim sArrayLang(1) As String = _
	{"Английский -> Русский",_
	"Русский -> Английский"}


	hwndMain = OpenWindow(Space(45) & "YandexTranslate",_
	10,10,400,500,,WS_EX_PALETTEWINDOW)
	
	HideWindow(hwndMain, TRUE )

	CenterWindow(hwndMain)

	WindowColor(hwndMain,&hE08292)

	SetTransparentWindow(hwndMain,230)

	RegisterHotKey(hwndMain,HOTKEY,MOD_CONTROL Or MOD_SHIFT,0)

	AddSysTrayIcon(SYSTRAY,_
						hwndMain,_
						LoadIcon(GetModuleHandle(0),Cast(LPSTR,100)),_
						"YandexTranslate")

	hMenu = CreatePopMenu()

	MenuItem(MENUOPENWINDOW,hMenu,"Главное окно")

	MenuItem(MENUCLOSE,hMenu,"Закрыть программу")
	
	hMenu2 = CreatePopMenu()

	MenuItem(MENUCOPY,hMenu2,"Копировать")	
	
	MenuItem(MENUPASTE,hMenu2,"Вставить")

	MenuItem(MENUSELECTALL,hMenu2,"Выделить все")	

	#Macro SG(E__T,YY)

		EditorGadget(_
						E__T,_
						10,_
						YY,_
						365,_
						200)

		SetGadgetColor(E__T,&h0,&hFFFFFF,3)

	#EndMacro

	SG(EDITOR_IN,10)

	SG(EDITOR_OUT,258)

	#Undef SG

	ComboBoxGadget(COMBO_LANG,40,222,200,200)

	For i As Integer = 0 To 1

		AddComboBoxItem(COMBO_LANG,sArrayLang(i),-1)

	Next

	SetItemComboBox(COMBO_LANG, 0)

	ButtonGadget(BUTTON_CONFIRM,260,222,85,24,"Перевести")

	MainEvent

End Constructor
