--OptionsDialog.lua

--require('ms')

------------------------------------------------------------------------------------------------------------------
function OnNavigateComplete(Object)
 m_simpleTV.Config.SetElementHtml(Object, 'oLegend', ms.lang.olegendtitle .. ' ' .. ms.GetVersion())
 m_simpleTV.Config.SetElementHtml(Object, 'oHeight', ms.lang.heightlabel)
 m_simpleTV.Config.SetElementHtml(Object, 'oWidth', ms.lang.widthlabel)
 m_simpleTV.Config.SetElementHtml(Object, 'oWidthString', ms.lang.widthstringlabel) 
 m_simpleTV.Config.SetElementValueString(Object, 'idSave', ms.lang.savetitle)
 if m_simpleTV.User == nil then m_simpleTV.User = {} end
 if m_simpleTV.User.MediaSearch == nil then m_simpleTV.User.MediaSearch = {} end 
 local value
 value = m_simpleTV.Config.GetConfigString(m_simpleTV.Defines.ID_EXT_MEDIASEARCH_HEIGHT)
 if value then value = m_simpleTV.Config.SetElementValueString(Object, 'idHeight', value) end
 value = m_simpleTV.Config.GetConfigString(m_simpleTV.Defines.ID_EXT_MEDIASEARCH_WIDTH)
 if value then value = m_simpleTV.Config.SetElementValueString(Object, 'idWidth', value) end
 value = m_simpleTV.Config.GetConfigString(m_simpleTV.Defines.ID_EXT_MEDIASEARCH_WIDTHSTRING)
 if value then value = m_simpleTV.Config.SetElementValueString(Object, 'idWidthString', value) end
 m_simpleTV.Config.AddEventHandler(Object,'OnClick','idSave','OnClickSave')
end
------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------
function OnClickSave(Object)
 local value
 value = m_simpleTV.Config.GetElementValueString(Object, 'idHeight')
 m_simpleTV.Config.SetConfigString(m_simpleTV.Defines.ID_EXT_MEDIASEARCH_HEIGHT, value)
 value = m_simpleTV.Config.GetElementValueString(Object, 'idWidth')
 m_simpleTV.Config.SetConfigString(m_simpleTV.Defines.ID_EXT_MEDIASEARCH_WIDTH, value)
 value = m_simpleTV.Config.GetElementValueString(Object, 'idWidthString')
 m_simpleTV.Config.SetConfigString(m_simpleTV.Defines.ID_EXT_MEDIASEARCH_WIDTHSTRING, value) 
end
------------------------------------------------------------------------------------------------------------------
function OnOk(Object)
end
------------------------------------------------------------------------------------------------------------------