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

#pragma once

#include "Control.h"

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

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

		// 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;
			void			SetItemText(size_t itemIndex, const TXString& text);

			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);

			void			AddTabStop(size_t size);
			void			RemoveLastTabStop();

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

			TMarkersArray		farrIndexToMarker;
		};
	}
}