Esempio n. 1
0
		/// <summary>Creates new instance of the class.</summary>
		public TreeGX()
		{
			ColorFunctions.Initialize();

			this.SetStyle(ControlStyles.UserPaint, true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.Opaque, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.SetStyle(ControlStyles.DoubleBuffer, true);
			this.SetStyle(ControlStyles.Selectable, true);

			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
			
			m_BackgroundStyle.StyleChanged+=new EventHandler(ElementStyleChanged);
			m_BackgroundStyle.TreeControl=this;

			// Setup layout helper
			//m_NodeLayout=new NodeTreeLayout(this,this.ClientRectangle);
			//m_NodeLayout=new NodeListLayout(this,this.ClientRectangle);
			//m_NodeLayout=new NodeDiagramLayout(this,this.ClientRectangle);
			m_NodeLayout=new NodeMapLayout(this,this.ClientRectangle);
			m_NodeLayout.NodeHorizontalSpacing=m_NodeHorizontalSpacing;
			m_NodeLayout.NodeVerticalSpacing=m_NodeVerticalSpacing;

			m_NodeLayout.LeftRight=this.RtlTranslateLeftRight(LeftRightAlignment.Left);

#if TRIAL
			NodeOperations.ColorExpAlt();
#endif
			// Setup display helper
			m_NodeDisplay=new NodeTreeDisplay(this);

			m_Headers=new HeadersCollection();

			m_Nodes.TreeControl=this;
			m_Styles.TreeControl=this;

			m_ColorScheme=new ColorScheme(eColorSchemeStyle.Office2003);

			m_SelectionBoxBorderColor=GetDefaultSelectionBoxBorderColor();
			m_SelectionBoxFillColor=GetDefaultSelectionBoxFillColor();

			m_ExpandButtonSize=GetDefaultExpandButtonSize();

			this.AllowDrop = true;
		}
Esempio n. 2
0
		private void SetLayout(eNodeLayout layout)
		{
			m_Layout=layout;
			if(m_Layout==eNodeLayout.Map)
			{
				m_NodeLayout=new NodeMapLayout(this,this.ClientRectangle);
			}
			else if(m_Layout==eNodeLayout.Diagram)
			{
				m_NodeLayout=new Layout.NodeDiagramLayout(this,this.ClientRectangle);
			}
			InvalidateNodesSize();
			OnLayoutChanged();
		}