require "scripts/style.lua"

--[[DisplayDialog{
	"scripts/yesno.lua",
	yes=function()
			PostMessage( CreateNamedMessage( kQuitNow, "quit" ) );
	   end,
	title = "quittitle",
	body = "quitconfirm",
};]]--

MakeDialog
{
  Bitmap
  {
    image = "backgrounds/speedmenu",
    x = kCenter,
    y = kCenter,
    
    QuitVerifyWindow
    {
      name = "quitverifywindow",
      x = 0,
      y = 0,
      w = kMax, 
      h = kMax,
	  
	  SetStyle(DialogTitleTextQuit),
        Text
		{
			name = "quittitle",
			label= "quittitle",
			x=kCenter,
			y=30,
		};
		
		SetStyle(DialogBodyTextQuit),
		Text
		{
			name = "quitbody",
			label= "quitconfirm",
		};
      
      SetStyle(OptionsValidationButtonStyle),
      Button
      {
        name = "quitOK",
        x = kCenter - 100,
        y = kMax - 90,
        label = "quit",
        close = true,
        command = 
          function()
            PostMessageToParent( CreateNamedMessage( kUserMessageBase, "save" ) );
            PostMessage( CreateNamedMessage( kQuitNow, "quit" ) );
          end
      },
      SetStyle(OptionsCancelButtonStyle),
      Button
      {
        name = "quitcancel",
        x = kCenter + 100,
        y = kMax - 90,
        label = "cancel",
        close = true,
      },
    },
  },
}