예제 #1
0
파일: TreeViewAdv.cs 프로젝트: Ejik/Acotwin
        public TreeViewAdv()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint
                | ControlStyles.UserPaint
                | ControlStyles.OptimizedDoubleBuffer
                | ControlStyles.ResizeRedraw
                | ControlStyles.Selectable
                , true);

            if (Application.RenderWithVisualStyles)
                _columnHeaderHeight = 20;
            else
                _columnHeaderHeight = 17;

            //BorderStyle = BorderStyle.Fixed3D;
            _hScrollBar.Height = SystemInformation.HorizontalScrollBarHeight;
            _vScrollBar.Width = SystemInformation.VerticalScrollBarWidth;
            _rowLayout = new FixedRowHeightLayout(this, RowHeight);
            _rowMap = new List<TreeNodeAdv>();
            _selection = new List<TreeNodeAdv>();
            _readonlySelection = new ReadOnlyCollection<TreeNodeAdv>(_selection);
            _columns = new TreeColumnCollection(this);
            _toolTip = new ToolTip();

            _measureContext = new DrawContext();
            _measureContext.Font = Font;
            _measureContext.Graphics = Graphics.FromImage(new Bitmap(1, 1));

            Input = new NormalInputState(this);
            _search = new IncrementalSearch(this);
            CreateNodes();
            CreatePens();

            ArrangeControls();

            _plusMinus = new NodePlusMinus();
            _controls = new NodeControlsCollection(this);

            Font = _font;
            ExpandingIcon.IconChanged += ExpandingIconChanged;
        }
예제 #2
0
파일: TreeViewAdv.cs 프로젝트: Ejik/Acotwin
 internal void ChangeInput()
 {
     if ((ModifierKeys & Keys.Shift) == Keys.Shift)
     {
         if (!(Input is InputWithShift))
             Input = new InputWithShift(this);
     }
     else if ((ModifierKeys & Keys.Control) == Keys.Control)
     {
         if (!(Input is InputWithControl))
             Input = new InputWithControl(this);
     }
     else
     {
         if (!(Input.GetType() == typeof(NormalInputState)))
             Input = new NormalInputState(this);
     }
 }
예제 #3
0
파일: TreeViewAdv.cs 프로젝트: Ejik/Acotwin
        public TreeViewAdv()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint
                | ControlStyles.UserPaint
                | ControlStyles.OptimizedDoubleBuffer
                | ControlStyles.ResizeRedraw
                | ControlStyles.Selectable
                , true);

            if (Application.RenderWithVisualStyles)
                _columnHeaderHeight = 20;
            else
                _columnHeaderHeight = 17;

            BorderStyle = BorderStyle.Fixed3D;
            _hScrollBar.Height = SystemInformation.HorizontalScrollBarHeight;
            _vScrollBar.Width = SystemInformation.VerticalScrollBarWidth;
            _rowMap = new List<TreeNodeAdv>();
            _selection = new List<TreeNodeAdv>();
            _readonlySelection = new ReadOnlyCollection<TreeNodeAdv>(_selection);
            _columns = new TreeColumnCollection(this);
            _toolTip = new ToolTip();

            Input = new NormalInputState(this);
            CreateNodes();
            CreatePens();

            ArrangeControls();

            _plusMinus = new NodePlusMinus();
            _controls = new NodeControlsCollection(this);
        }