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

---------------------------------------------------------------
-- This is a question box with a title and body, and a YES button and a NO button.
--
-- gDialogTable.facebook_yesno_title is the above-the-line title
-- gDialogTable.facebook_yesno_body  is the below-the-line message
-- gDialogTable.facebook_yes is the YES button
-- gDialogTable.facebook_no is the NO button
---------------------------------------------------------------

local FirstStage = false;

if FirstStage then
	if not gDialogTable then 
		gDialogTable = {};
	end;

	gDialogTable.facebook_yesno_title = "Dialog Title";
	gDialogTable.facebook_yesno_body = "Body of the dialog message which asks a yes or no question?";
	gDialogTable.facebook_yes = "Yes";
	gDialogTable.facebook_no = "No";
end;

MakeDialog
{
	name='facebook_yesno', 
    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 = kMax,
				label= gDialogTable.facebook_yesno_title,
			},
		},

		Window
		{
			x = 2,
			y = 39,
			h = kMax - 2,
			w = kMax - 2,

			Text
			{
				font = FacebookBodyFont,
				x = 13,
				y = 13,
				w = kMax - 13,
				h = 70,
				label = gDialogTable.facebook_yesno_body,
			};

			SetStyle(FacebookYesButtonStyle),
			FBButton
			{
				name = 'facebook_yes',
				x = 12 + 15,
				y = kMax - 10,
				align = kVAlignBottom,
				command = function()
					gReturnValue = 'yes';
					PopModal('facebook_yesno');
				end;
				label = gDialogTable.facebook_yes,
			},
		
			SetStyle(FacebookNoButtonStyle),
			FBButton
			{
				x = kMax - (12 + 15),
				y = kMax - 10,
				align = kVAlignBottom + kHAlignRight,
				command =
					function() 
						gReturnValue = 'no';
						PopModal('facebook_yesno');
					end;
				label =	gDialogTable.facebook_no,
			},
		},
	},
} -- MakeDialog
