//
//	Copyright © 2006 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#pragma once

#include "Dialog.h"
#include "StaticTextCtrl.h"
#include "EditTextCtrl.h"

namespace VectorWorks
{
	namespace VWUI
	{
		// ---------------------------------------------------------------------------------------------------------------
		class CStandardEditTextBoxDlg : public VWDialog
		{
		public:
								CStandardEditTextBoxDlg(const TXString& 	strTitle,
														const TXString& 	strLabel,
														const TXString& 	strValue,
														const TXString& 	strOkBtnText,
														const TXString& 	strCancelBntText);

								CStandardEditTextBoxDlg(const TXString& 	strTitle,
														const TXString& 	strLabel,
														const TXString& 	strValue,
														size_t				nBoxWidth,
														size_t				nBoxHeight,
														const TXString& 	strOkBtnText,
														const TXString& 	strCancelBntText);

			virtual				~CStandardEditTextBoxDlg();

			void				SetReadOnly(bool bReadOnly);
			void				SetAllowEmptyResult(bool bAllowEmptyRes);
			TXString			GetValue() const;

		protected:
			virtual bool		CreateDialogLayout();
			virtual	void		OnDDXInitialize();

			virtual void		OnSetUpEvent();
			virtual void		OnUpdateUI();

		// dispatch map
		protected:
			DEFINE_EVENT_DISPATH_MAP;
			void				OnEditControl(TControlID controlID, VWDialogEventArgs& eventArgs);

		private:
			VWStaticTextCtrl	fStaticTextCtrl;
			VWEditTextCtrl		fEditTextCtrl;

			bool				fbIsReadOnly;
			bool				fbAllowEmtpyResult;

			TXString			fstrTitle;
			TXString			fstrLabel;
			size_t				fnBoxWidth;
			size_t				fnBoxHeight;
			TXString			fstrOkBtnText;
			TXString			fstrCancelBntText;

			TXString			fDDXTextValue;
			TXString			fstrOrgValue;
		};	}
}