require( "scripts/style.lua" );

local yes="yes" ;
local yesname="yes" ;
local no="no" ;	
local noname="no" ;	
local name="yesnobox";
local yescmd=gDialogTable.yes;
local nocmd=gDialogTable.no;

if (gDialogTable.yeslabel) then
	yes = gDialogTable.yeslabel ;
end
if (gDialogTable.nolabel) then
	no = gDialogTable.nolabel ;
end
if (gDialogTable.yesname) then
	yesname = gDialogTable.yesname;
end
if (gDialogTable.noname) then
	noname = gDialogTable.noname;
end

if (gDialogTable.name) then
	name = gDialogTable.name;
end

MakeDialog
{
	FadeWindow
  {
    name = "yesno",
    x = 0, y = 0,
		w = ScreenWight, h = ScreenHeight,
		
    Bitmap
    {
		image="menu/dialog",
		x=kCenter,
		y=kCenter,

		Text
		{
			font = DialogTitleFont,
			flags = kVAlignCenter + kHAlignCenter,
			x=16,y=65,w=kMax,h=50,
			name = "yesnotitle",
			--label= "deletetitle",
			label= gDialogTable.title,
		};

		Text
		{
			font = DialogBodyFont,
			flags = kVAlignCenter + kHAlignCenter,
			x=16,y=12,w=kMax,h=kMax-30,
			name = "yesnobody",
			--label= "deleteconfirm",
			label= gDialogTable.body,
		};

      SetStyle(ProfilesButtonStyle),
      Button
      {
			command=
				function() 
				CloseFade("yesno","CloseWindow('yes')");
				end;
        flags = 5,
        label = "yes",
        name = yesname,
        x = kCenter-100,
        y = kMax-100,
		default=true,
        },
        Button
        {
			command=
				function() 
				CloseFade("yesno","CloseWindow('no')");
				end;
        flags = 5,
        label = "no",
        name = noname,
        x = kCenter+100,
        y = kMax-100,
		cancel=true,
        },
        
    };
  };

} -- MakeDialog
