示例#1
0
        public FormTree(Control parentCntrl)
        {
            this._name          = "";
            this._visible       = true;
            this._enabled       = true;
            this._title         = "";
            this._parent        = null;
            this._parentControl = parentCntrl;

            this._methodName = "";
            this._thisScript = null;

            this._methodNameDblClick = "";
            this._thisScriptDblClick = null;

            this._methodOnChoice = "";
            this._scriptOnChoice = null;

            _dataTable = new DataTableProvider();
            _item      = new TreeViewColumns();

            _nodesMap = new Dictionary <TreeNode, ValueTreeRow>();

            //# Создаем контейнер для элемента формы
            _panelMainContainer    = new Panel();
            _panelTitleContainer   = new Panel();
            _panelControlContainer = new Panel();

            _panelMainContainer.Controls.Add(_panelControlContainer);
            _panelMainContainer.Controls.Add(_panelTitleContainer);

            _panelMainContainer.Dock         = DockStyle.Top;
            _panelMainContainer.MinimumSize  = new Size(150, 22);
            _panelMainContainer.AutoSize     = true;
            _panelMainContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            _panelTitleContainer.Dock         = DockStyle.Left;
            _panelTitleContainer.MinimumSize  = new Size(50, 21);
            _panelTitleContainer.AutoSize     = true;
            _panelTitleContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            _label = new Label();
            _panelTitleContainer.Controls.Add(_label);
            _label.AutoSize = true;
            _label.Dock     = DockStyle.Fill;


            //# Установка параметров панели для поля с данными
            _panelControlContainer.Dock         = DockStyle.Fill;
            _panelControlContainer.MinimumSize  = new Size(100, 21);
            _panelControlContainer.AutoSize     = true;
            _panelControlContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            this._parentControl.Controls.Add(_panelMainContainer);
            _panelMainContainer.BringToFront();

            this.createFormFieldByType();
        }