Example #1
0
        void SelectElement(Control ctrlEl)
        {
            m_CurSelDesignEl = ctrlEl;
            IDesignEl designEl = (IDesignEl)m_CurSelDesignEl;

            ShowFocusDot(ctrlEl);

            if (m_CurSelDesignEl == null)
            {
                return;
            }

            CWindowControl WindowControl = (CWindowControl)m_CurSelDesignEl.Tag;

            if (WindowControl.m_objTempData == null)
            {
                TableGridProp Setting = new TableGridProp();
                Setting.宽度 = m_CurSelDesignEl.Width;
                Setting.高度 = m_CurSelDesignEl.Height;
                Setting.停靠 = m_CurSelDesignEl.Dock;
                if (designEl.GetCtrlType() == ControlType.TableGrid)
                {
                    TableGridEl te = (TableGridEl)designEl;

                    Setting.工具栏显示 = te.TableInWindowControl.ShowToolBar;
                    Setting.标题栏显示 = te.TableInWindowControl.ShowTitleBar;
                }
                else if (designEl.GetCtrlType() == ControlType.TableTree)
                {
                }
                WindowControl.m_objTempData = Setting;
            }
            m_AttributeToolWindow.ControlEl = m_CurSelDesignEl;
        }
Example #2
0
        public void UpdatePropertyGrid()
        {
            if (m_AttrType == AttrType.WindowControl)
            {
                if (ControlEl == null || ControlEl.Tag == null)
                {
                    return;
                }
                IDesignEl designEl = (IDesignEl)ControlEl;
                if (designEl.GetCtrlType() == ControlType.NavBar)
                {
                    UIToolbarEl   toolbar = (UIToolbarEl)ControlEl;
                    UIToolbarProp Setting = new UIToolbarProp();

                    Setting.称  = toolbar.WindowControl.Name;
                    Setting.宽度 = toolbar.Width;
                    Setting.高度 = toolbar.Height;
                    Setting.停靠 = toolbar.Dock;
                    propertyGrid.SelectedObject = Setting;
                    propertyGrid.Refresh();
                }
                else if (designEl.GetCtrlType() == ControlType.TableGrid)
                {
                    TableGridEl   te      = (TableGridEl)ControlEl;
                    TableGridProp Setting = new TableGridProp();
                    Setting.称     = te.WindowControl.Name;
                    Setting.宽度    = te.Width;
                    Setting.高度    = te.Height;
                    Setting.停靠    = te.Dock;
                    Setting.工具栏显示 = te.ShowToolBar;
                    Setting.标题栏显示 = te.ShowTitleBar;
                    propertyGrid.SelectedObject = Setting;
                    propertyGrid.Refresh();
                }
                else if (designEl.GetCtrlType() == ControlType.TableTree)
                {
                    TableTreeEl   tree    = (TableTreeEl)ControlEl;
                    TableTreeProp Setting = new TableTreeProp();
                    Setting.称     = tree.WindowControl.Name;
                    Setting.宽度    = tree.Width;
                    Setting.高度    = tree.Height;
                    Setting.停靠    = tree.Dock;
                    Setting.标题栏显示 = tree.ShowTitleBar;
                    propertyGrid.SelectedObject = Setting;
                    propertyGrid.Refresh();
                }
                else if (designEl.GetCtrlType() == ControlType.ListBox)
                {
                    UIListBoxEl   list    = (UIListBoxEl)ControlEl;
                    UIListBoxProp Setting = new UIListBoxProp();
                    Setting.称     = list.WindowControl.Name;
                    Setting.宽度    = list.Width;
                    Setting.高度    = list.Height;
                    Setting.停靠    = list.Dock;
                    Setting.标题栏显示 = list.ShowTitleBar;
                    propertyGrid.SelectedObject = Setting;
                    propertyGrid.Refresh();
                }
                else if (designEl.GetCtrlType() == ControlType.ComboBox)
                {
                    UIComboBoxEl   combo   = (UIComboBoxEl)ControlEl;
                    UIComboBoxProp Setting = new UIComboBoxProp();
                    Setting.称     = combo.WindowControl.Name;
                    Setting.宽度    = combo.Width;
                    Setting.高度    = combo.Height;
                    Setting.停靠    = combo.Dock;
                    Setting.标题栏显示 = combo.ShowTitleBar;
                    propertyGrid.SelectedObject = Setting;
                    propertyGrid.Refresh();
                }
                else if (designEl.GetCtrlType() == ControlType.TableTab)
                {
                    TableTabEl   tab     = (TableTabEl)ControlEl;
                    TableGridEl  grid    = tab.GetCurTableGridEl();
                    TableTabProp Setting = new TableTabProp();
                    Setting.称     = tab.WindowControl.Name;
                    Setting.宽度    = tab.Width;
                    Setting.高度    = tab.Height;
                    Setting.停靠    = tab.Dock;
                    Setting.工具栏显示 = grid.ShowToolBar;
                    Setting.标题栏显示 = tab.ShowTitleBar;
                    propertyGrid.SelectedObject = Setting;
                    propertyGrid.Refresh();
                }
            }
            else
            {
                if (WindowEl == null || WindowEl.Window == null)
                {
                    return;
                }

                ChildenWindowProp Setting = new ChildenWindowProp();
                Setting.称  = WindowEl.Window.Name;
                Setting.宽度 = WindowEl.Width;
                Setting.高度 = WindowEl.Height;
                propertyGrid.SelectedObject = Setting;
                propertyGrid.Refresh();
            }
        }