예제 #1
0
        public void OnUINavigatorEvent(UIFuncItemInfo funcItemInfo)
        {
            if (funcItemInfo.Function == UIFunctionEnum.Backward)
            {
                if (m_PreviousFuncItemInfo != null)
                {
                    OnUINavigatorEvent(m_PreviousFuncItemInfo);
                }
                return;
            }
            m_tabCtrlContainer.SuspendLayout();
            m_splitContainer.SuspendLayout();

            if (funcItemInfo.Function == UIFunctionEnum.ShowDownloadListForm)
            {
                if (m_FormDownloadInfoList == null)
                {
                    System.Diagnostics.Trace.WriteLine("m_FormDownloadInfoList = new FormDownloadInfoList()");
                    m_FormDownloadInfoList = new FormDownloadInfoList();
                    m_FormDownloadInfoList.StartPosition = FormStartPosition.CenterParent;
                    m_FormDownloadInfoList.FormClosed   += new FormClosedEventHandler(FormDownloadInfoList_FormClosed);
                    m_FormDownloadInfoList.Show(Framework.Container.Instance.MainControl);
                }
                else
                {
                    System.Diagnostics.Trace.WriteLine("m_FormDownloadInfoList.Show()");

                    m_FormDownloadInfoList.Show();
                }
            }

            funcItemInfo = Container.Instance.NaviRecord.GetSubItem(funcItemInfo);
            int oldSplitPosition = m_splitContainer.SplitterPosition;

            // m_tabCtrlContainer.SuspendLayout();

            ucContentBase tabPage = GetContentPage(funcItemInfo);

            if (tabPage != null)
            {
                this.m_captionLabel.Text    = funcItemInfo.Caption;
                this.m_captionLabel.Visible = tabPage.ShowCaption;

                tabPage.BringToFront();

                if (m_CurrentContentPage != null)
                {
                    if (!m_CurrentContentPage.RetainWhenDisppear)
                    {
                        RemovePage(m_CurrentFuncItemInfo, m_CurrentContentPage);

                        if (m_CurrentContentPage.ViewModel != null)
                        {
                            Framework.Container.Instance.VVMDataBindings.RemoveBindings(m_CurrentContentPage.ViewModel);
                        }
                    }
                    else
                    {
                        m_PreviousFuncItemInfo = m_CurrentFuncItemInfo;
                    }
                }

                m_CurrentContentPage = tabPage;

                if (funcItemInfo.Function == UIFunctionEnum.Backward)
                {
                    m_PreviousFuncItemInfo = null;
                    m_CurrentFuncItemInfo  = m_PreviousFuncItemInfo;
                }
                else
                {
                    m_CurrentFuncItemInfo = funcItemInfo;
                }

                int splitPosition;
                Container.Instance.NaviRecord.RegisterSubItem(funcItemInfo, oldSplitPosition, out splitPosition);

                if (splitPosition > -1)
                {
                    m_splitContainer.SplitterPosition = splitPosition;
                    object o = AppDomain.CurrentDomain.GetData("OCXContainer");
                    if (o == null)
                    {
                        m_splitContainer.PanelVisibility = (splitPosition == 0) ? SplitPanelVisibility.Panel2 : SplitPanelVisibility.Both;
                    }
                }
            }
            m_tabCtrlContainer.ResumeLayout();
            m_splitContainer.ResumeLayout();
        }
예제 #2
0
        private void GridControlHandleCreated(object sender, EventArgs e)
        {
            if (_GridControl != sender)
            {
                _GridControl = sender as GridControl;
                if (_GridControl != null)
                {
                    _FilterPanel     = new PanelControl();
                    buttonsContainer = new ButtonsContainer();
                    _FilterPanel.BeginInit();
                    _FilterPanel.SuspendLayout();

                    // buttonsContainer
                    buttonsContainer.Location            = new Point(0, 0);
                    buttonsContainer.AllowCustomization  = false;
                    buttonsContainer.ContainerId         = FilterPanelGroup;
                    buttonsContainer.HideItemsCompletely = false;
                    buttonsContainer.Name              = "filterPanelButtonsContainer";
                    buttonsContainer.ActionItemAdding += ButtonsContainer_ActionItemAdding;

                    // _FilterPanel
                    _FilterPanel.Controls.Add(buttonsContainer);
                    _FilterPanel.Padding  = new Forms.Padding(2, 6, 2, 6);
                    buttonsContainer.Dock = Forms.DockStyle.Fill;
                    _FilterPanel.Name     = nameof(_FilterPanel);
                    _FilterPanel.Height   = 40;
                    _FilterPanel.TabIndex = 1;
                    _FilterPanel.Dock     = ((IModelFilterPanel)View.Model).FilterPanelPosition;

                    if (!_GridControl.FormsUseDefaultLookAndFeel)
                    {
                        _FilterPanel.LookAndFeel.Assign(_GridControl.LookAndFeel);
                        buttonsContainer.LookAndFeel.Assign(_GridControl.LookAndFeel);
                    }

                    _FilterPanel.EndInit();
                    _FilterPanel.ResumeLayout(false);

                    if (Frame != null && Frame.Template != null)
                    {
                        var template = Frame.Template as IDynamicContainersTemplate;
                        if (template != null)
                        {
                            template.RegisterActionContainers(new IActionContainer[] { buttonsContainer });
                        }
                    }
                    var ff = buttonsContainer.ActionItems.FirstOrDefault(t => t.Key.Id == newFilterFieldsAction.Id);
                    if (ff.Value != null && ff.Value.LayoutItem != null)
                    {
                        ff.Value.LayoutItem.Spacing = new DevExpress.XtraLayout.Utils.Padding(12, 0, 0, 0);
                    }

                    if (_GridControl.Parent != null)
                    {
                        _GridControl.Parent.Controls.Add(_FilterPanel);
                    }
                    else
                    {
                        _GridControl.ParentChanged += GridControlParentChanged;
                    }

                    UpdateActionState();
                    OnFilterControlCreated(EventArgs.Empty);
                }
            }
        }