class "opt_video" (CUIWindow)

function opt_video:__init() super()
end

function opt_video:__finalize()

end

function opt_video:InitControls(x, y, xml, handler)

	self:SetWndPos(vector2():set(x,y))
	self:SetWndSize(vector2():set(738,416))
	self:SetAutoDelete(true)
	self.scroll_v = xml:InitScrollView("main_dialog:scroll_v", self)

	local _st
	local addControl = function(crl)	
		self.scroll_v:AddWindow(crl, true)
		crl:SetAutoDelete(false)
	end

    _st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_renderer", _st)
	handler.combo_renderer = xml:InitComboBox("tab_video:list_renderer", _st)
	handler:Register(handler.combo_renderer, "combo_renderer")
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_preset", _st)
	handler.combo_preset = xml:InitComboBox("tab_video:list_presets", _st)
	handler:Register(handler.combo_preset, "combo_preset")
	addControl(_st)

    _st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_resolution",_st)
	xml:InitComboBox("tab_video:list_resolution",_st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_brightness", _st)
	xml:InitTrackBar("tab_video:track_brightness", _st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_contrast", _st)
	xml:InitTrackBar("tab_video:track_contrast", _st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_gamma", _st)
	xml:InitTrackBar("tab_video:track_gamma", _st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic ("tab_video:cap_fullscreen", _st)
	xml:InitCheck ("tab_video:check_fullscreen", _st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_rs_device_active", _st)
	xml:InitCheck("tab_video:check_rs_device_active", _st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_vsync", _st)
	xml:InitCheck("tab_video:check_vsync", _st)
	addControl(_st)

	_st = xml:InitStatic("video_adv:templ_item", nil)
	xml:InitStatic("tab_video:cap_screenshot_format", _st)
	xml:InitComboBox("tab_video:list_screenshot_format", _st)
	addControl(_st)

	btn = xml:Init3tButton("tab_video:btn_advanced", self)
	handler:Register(btn, "btn_advanced_graphic")
end
