Exemplo n.º 1
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (CurrentEditorOwner != null)
            {
                CurrentEditorOwner.EndEdit(true);
                return;
            }

            if (!Focused)
            {
                Focus();
            }

            _search.EndSearch();
            if (e.Button == MouseButtons.Left)
            {
                TreeColumn c;
                c = GetColumnDividerAt(e.Location);
                if (c != null)
                {
                    Input = new ResizeColumnState(this, c, e.Location);
                    return;
                }
                c = GetColumnAt(e.Location);
                if (c != null)
                {
                    Input = new ClickColumnState(this, c, e.Location);
                    UpdateView();
                    return;
                }
            }

            ChangeInput();
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null && args.Control != null)
            {
                args.Control.MouseDown(args);
            }

            if (!args.Handled)
            {
                Input.MouseDown(args);
            }

            base.OnMouseDown(e);
        }
		protected override void OnMouseDown(MouseEventArgs e)
		{
			if (CurrentEditorOwner != null)
			{
				CurrentEditorOwner.EndEdit(true);
				return;
			}

			if (!Focused)
				Focus();

			_search.EndSearch();
			if (e.Button == MouseButtons.Left)
			{
				TreeColumn c;
				c = GetColumnDividerAt(e.Location);
				if (c != null)
				{
					Input = new ResizeColumnState(this, c, e.Location);
					return;
				}
				c = GetColumnAt(e.Location);
				if (c != null)
				{
					Input = new ClickColumnState(this, c, e.Location);
					UpdateView();
					return;
				}
			}

			ChangeInput();
			TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

			if (args.Node != null && args.Control != null)
				args.Control.MouseDown(args);

			if (!args.Handled)
				Input.MouseDown(args);

			base.OnMouseDown(e);
		}