-- K-MeleonCCF Preference Dialog V0.01

require "dialog"
require "preferenceGUI\\locals"

local a = create_dialog({
	width = 120,         -- width
	height = 130,        -- height
	caption = "dialog",  -- caption
	font="Arial",

	{
		type = "button",    -- control type
		style = w32dlg.BS_DEFPUSHBUTTON,
		x = 40,              -- x position
		y = 90,              -- y position
		width = 40,         -- width
		height = 15,        -- height
		id = "IDBUTTON",    -- ID
		caption = "OK"      -- caption
	},

	{
		type = "static",        -- control type
		x = 25,                 -- x position
		y = 5,                -- y position
		width = 80,             -- width
		height = 80,            -- height
		id = "IDSTATIC1",       -- ID
		caption = "About K-MeleonCCF ME\n\n\ Version 0.095 V3 \n\n Author: Hao Jiang \n\t xvacant \n\t Dorian\n\t Guenter\n\t Mark307 \n\n        2009.06"
	},
})


function CCFDialog()
	local r, rr, t, k, v, m
	
	m = {"Gestures","Hotlinks","Bookmark","Favorites","Search Bar","URL Bar","Advanced"}
	
	r, rr = d("Preference", {
		IDLIST1 = {
			{1},  -- initial selection
			m,    -- items
		},
	})
	if r=="IDBUTTONNEXT" or r=="IDLIST1" then
		if table.concat(rr.IDLIST1, " ") == "1" then 
			gestrures_dialog()
			CCFDialog()
		elseif table.concat(rr.IDLIST1, " ") == "2" then 
			hotlink_dialog()
			CCFDialog()
		elseif table.concat(rr.IDLIST1, " ") == "3" then 
			bookmark_dialog()
			CCFDialog()
		elseif table.concat(rr.IDLIST1, " ") == "4" then 
			favorite_dialog()
			CCFDialog()
		elseif table.concat(rr.IDLIST1, " ") == "5" then 
			searchbar_dialog()
			CCFDialog()
		elseif table.concat(rr.IDLIST1, " ") == "6" then 
			urlbar_dialog()
			CCFDialog()
		elseif table.concat(rr.IDLIST1, " ") == "7" then 
			advanced_dialog()	
			CCFDialog()
		end
	elseif r=="IDBUTTONCANCEL" then
	end		
end

function AboutDialog()
	r, rr = a(_ABOUT)
end
