//+------------------------------------------------------------------+ //| Node.mqh | //| Copyright 2015, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2015, MetaQuotes Software Corp." #property link "http://www.mql5.com" #include #include #include "\Events\Event.mqh" #include "\Events\EventChartObjClick.mqh" #include "\Events\EventRefresh.mqh" #define NAME_SIZE 8 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class CNode : public CObject { private: static int m_count; protected: string m_name; CNode(); CArrayObj m_elements; virtual void OnShow(); virtual void OnHide(); // Скрывает дочерние элементы color FontColor; virtual void OnClick(CEventChartObjClick *event); virtual void OnRefresh(CEventRefresh *event); public: string Name(void); bool IsShowed(void); virtual void Show(); virtual void Hide(); // Скрывает текущий элемент virtual void Event(CEvent *event); void Tooltip(string message); ~CNode(); }; static int CNode::m_count=0; //+------------------------------------------------------------------+ //| Generate random uniq name | //+------------------------------------------------------------------+ CNode::CNode() { m_count++; uchar name[NAME_SIZE]; for(int i=0; i