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

#pragma once

#include "Control.h"

namespace VectorWorks
{
	namespace VWUI
	{
		class VWPullDownMenuCtrl : public VWControl
		{
		public:
							VWPullDownMenuCtrl(TControlID id);
			virtual			~VWPullDownMenuCtrl();

			virtual bool	CreateControl(VWDialog* pDlg, short widthInCharacters);

		// attributes
		public:
			void			DeleteAllItems();
			void			AddItem(const TXString& itemText, size_t insertAt = (size_t) -1, long marker = 0);

			void			RemoveItem(size_t itemIndex);

			size_t			GetItemsCount() const;
			size_t			GetItemIndex(const TXString& itemText) const;
			void			GetItemText(size_t itemIndex, TXString& outText) const;

			long			GetItemMarker(size_t itemIndex) const;
			void			SetItemMarker(size_t itemIndex, long marker);

			size_t			GetSelectedIndex() const;
			void			SelectIndex(size_t itemIndex);

			long			GetSelectedItemMarker() const;
			bool			SelectItemWithMarker(long marker);

			// Enable sending an item hit notification when the pull down menu is clicked
			// allowing developers to dynamically populate the menu.
			void			EnableNotifyPullDown();

			// Set the indicated item as enabled or disabled, which should cause it to be greyed and not selectable.
			virtual void	SetItemEnabled(size_t itemIndex, bool enabled=true); 

		private:
			typedef std::vector<long>		TMarkersArray;

			TMarkersArray		farrIndexToMarker;
		};
	}
}