require( "facebook/common/style.lua" );
dofile( "facebook/common/facebook_functions.lua" );

---------------------------------------------------------------
-- This is a message box with a title and body, and an OK box
-- AND it has a checkbox and 'remain logged into Facebook'
--
-- gDialogTable.facebook_ok_title is the above-the-line title
-- gDialogTable.facebook_ok_body  is the below-the-line message
---------------------------------------------------------------

MakeDialog
{
	name='facebook_ok', 
	Bitmap
	{
		image="facebook/common/fb_posted_bg_box",
		x=kCenter,
		y=kCenter,
		Window
		{
			x = 2,
			y = 2,
			w = kMax - 2,
			h = 36,
			Text
			{
				font = FacebookTitleFont,
				x = 32,
				y = 10,
				w = kMax,
				h = 36,
				label= gDialogTable.facebook_ok_title,
				-- label = 'Successfully Posted'
			},
		},
		Window
		{
			x = 2,
			y = 39,
			h = kMax - 2,
			w = kMax - 2,

			Text
			{
				font = FacebookBodyFont,
				x = 13,
				y = 13,
				w = kMax - 13,
				h = 50,
				label = gDialogTable.facebook_ok_body,
				-- label = "Your message has been posted to Facebook."
			};

			SetStyle(FacebookOkayButtonStyle),
			FBButton
			{
				y = kMax - 10,
				align = kVAlignBottom,
				label = "OK",
				default = true,
				close = true,
				command=
					function()
						if (GetButtonToggleState('facebook_remainloggedin') == false) then
							Facebook_LogoutCurrentUser();
						else
							Facebook_SaveCurrentUser();	
						end
					end;
				name = 'facebook_btn_ok',
				label =	'facebook_btn_ok',
			},

			Window
			{
				x = 25,
				y = 50,
				w = kMax,
				h = 60,
				SetStyle({}),
				Text
				{
					font = FacebookBodyFont,
					y = 8,
					x = 24 + 8,
					w = kMax,
					h = 34,
					label = 'facebook_remainloggedin',
					-- label = "Remain logged in to Facebook",
				},
				SetStyle(FacebookCheckboxButtonStyle),
				FBButton
				{
					name = 'facebook_remainloggedin',
					on = true,
					x = 0,
					y = 0,
				},
			},
		},
	},
}
