//========= Copyright © 1996-2003, Valve LLC, All rights reserved. ============
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
// Valve, L.L.C., or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================

#ifndef MESSAGEBOX_H
#define MESSAGEBOX_H

#ifdef _WIN32
#pragma once
#endif

#include <vgui/VGUI.h>
#include <vgui_controls/Frame.h>

// prevent windows macros from messing with the class
#ifdef MessageBox
#undef MessageBox
#endif

namespace vgui
{

class Label;
class Button;

//-----------------------------------------------------------------------------
// Purpose: Popup discardable message box
//-----------------------------------------------------------------------------
class MessageBox : public Frame
{
public:
	// title - Text to be displayed in the title bar of the window
	// text - Text message in the message box
	// startMinimized - wether message box starts minimized. Starts invisible by default
	// parent - parent panel of the message box, by default it has no parent. This will keep the box visible until the OK button is pressed. 
	MessageBox(const char *title, const char *text, Panel *parent = NULL);
	MessageBox(const wchar_t *wszTitle, const wchar_t *wszText, Panel *parent = NULL);
	~MessageBox();

	// Put the message box into a modal state
	virtual void DoModal(Frame *pFrameOver = NULL);

	// make the message box appear and in a modeless state
	virtual void ShowWindow(Frame *pFrameOver = NULL);

	// Set a string command to be sent when the OK button is pressed
	// Use AddActionSignalTarget() to mark yourself as a recipient of the command
	virtual void SetCommand(const char *command);
	
	// Set the visibility of the OK button.
	virtual void SetOKButtonVisible(bool state);

	// Set the text on the OK button
	virtual void SetOKButtonText(const char *buttonText);
	virtual void SetOKButtonText(const wchar_t *wszButtonText);

	// Toggles visibility of the close box.
	virtual void DisableCloseButton(bool state);

protected:
	virtual void PerformLayout();
	virtual void OnClose();
	virtual void ApplySchemeSettings(IScheme *pScheme);

protected:
	Button				*m_pOkButton;
	Label				*m_pMessageLabel;

private:
	virtual void OnShutdownRequest();

	void Init();
	
	KeyValues			*m_OkCommand;
	vgui::Frame *m_pFrameOver;

	DECLARE_PANELMAP();

	typedef Frame BaseClass;
};

} // namespace vgui


#endif // MESSAGEBOX_H
