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 = "continueverifywindow",
      x = 0,
      y = 0,
      w = kMax, 
      h = kMax,
      
      Text
      {
        name = "continuebody",
        label = "continueconfirm",
        x = kCenter,
        y = kCenter,
        flags = kVAlignTop + kHAlignCenter,
        w = kMax,
        h = 40,
      },
      
      SetStyle(OptionsValidationButtonStyle),
      Button
      {
        name = "quitOK",
        x = kCenter - 100,
        y = kMax - 90,
        label = "yes",
        close = true,
      },
      SetStyle(OptionsCancelButtonStyle),
      Button
      {
        name = "quitcancel",
        x = kCenter + 100,
        y = kMax - 90,
        label = "no",
        close = true,
		
        command = 
          function()
            PostMessageToParent( CreateNamedMessage( kUserMessageBase, "save" ) );
            PostMessageToParent( CreateNamedMessage( kUserMessageBase, "quit" ) );
          end
      },
    },
  },
}