Beispiel #1
0
        // 恢复 DpTable 的状态
        // 目前是栏宽度
        static void SetDpTableState(DpTable table, string strText)
        {
            string strState = "";

            if (IsType(strText, table, out strState) == false)
            {
                return;
            }
            DpTable.SetColumnHeaderWidth(table,
                                         strState,
                                         true);
        }
Beispiel #2
0
        void m_genDataViewer_MyFormClosed(object sender, EventArgs e)
        {
            if (m_genDataViewer != null)
            {
                Program.MainForm.AppInfo.SetBoolean("detailform", "gen_auto_run", m_genDataViewer.AutoRun);

                {       // 保存列宽度
                    string strWidths = DpTable.GetColumnWidthListString(m_genDataViewer.ActionTable);
                    Program.MainForm.AppInfo.SetString(
                        "gen_data_dlg",
                        "column_width",
                        strWidths);
                }

                Program.MainForm.AppInfo.UnlinkFormState(m_genDataViewer);
                // this.m_genDataViewer = null;
                CloseGenDataViewer();
            }
        }
Beispiel #3
0
 static string GetDpTableState(DpTable table)
 {
     return(table.GetType().ToString() + ":" + DpTable.GetColumnWidthListString(table));
 }
Beispiel #4
0
        void DisplayAutoGenMenuWindow(bool bOpenWindow)
        {
            // string strError = "";


            // 优化,避免无谓地进行服务器调用
            if (bOpenWindow == false)
            {
                if (Program.MainForm.PanelFixedVisible == false &&
                    (m_genDataViewer == null || m_genDataViewer.Visible == false))
                {
                    return;
                }
            }


            if (this.m_genDataViewer == null ||
                (bOpenWindow == true && this.m_genDataViewer.Visible == false))
            {
                m_genDataViewer = new GenerateDataForm();

                m_genDataViewer.AutoRun = Program.MainForm.AppInfo.GetBoolean("detailform", "gen_auto_run", false);
                // MainForm.SetControlFont(m_genDataViewer, this.Font, false);

                {       // 恢复列宽度
                    string strWidths = Program.MainForm.AppInfo.GetString(
                        "gen_data_dlg",
                        "column_width",
                        "");
                    if (String.IsNullOrEmpty(strWidths) == false)
                    {
                        DpTable.SetColumnHeaderWidth(m_genDataViewer.ActionTable,
                                                     strWidths,
                                                     false);
                    }
                }

                // m_genDataViewer.MainForm = Program.MainForm;  // 必须是第一句
                m_genDataViewer.Text = "创建数据";

                m_genDataViewer.DoDockEvent -= new DoDockEventHandler(m_genDataViewer_DoDockEvent);
                m_genDataViewer.DoDockEvent += new DoDockEventHandler(m_genDataViewer_DoDockEvent);

                m_genDataViewer.SetMenu -= new RefreshMenuEventHandler(m_genDataViewer_SetMenu);
                m_genDataViewer.SetMenu += new RefreshMenuEventHandler(m_genDataViewer_SetMenu);

                m_genDataViewer.TriggerAction -= new TriggerActionEventHandler(m_genDataViewer_TriggerAction);
                m_genDataViewer.TriggerAction += new TriggerActionEventHandler(m_genDataViewer_TriggerAction);

                m_genDataViewer.MyFormClosed -= new EventHandler(m_genDataViewer_MyFormClosed);
                m_genDataViewer.MyFormClosed += new EventHandler(m_genDataViewer_MyFormClosed);

                m_genDataViewer.FormClosed -= new FormClosedEventHandler(m_genDataViewer_FormClosed);
                m_genDataViewer.FormClosed += new FormClosedEventHandler(m_genDataViewer_FormClosed);
            }

            if (bOpenWindow == true)
            {
                if (m_genDataViewer.Visible == false)
                {
                    Program.MainForm.AppInfo.LinkFormState(m_genDataViewer, "autogen_viewer_state");
                    m_genDataViewer.Show(this._myForm);
                    m_genDataViewer.Activate();

                    Program.MainForm.CurrentGenerateDataControl = null;
                }
                else
                {
                    if (m_genDataViewer.WindowState == FormWindowState.Minimized)
                    {
                        m_genDataViewer.WindowState = FormWindowState.Normal;
                    }
                    m_genDataViewer.Activate();
                }
            }
            else
            {
                if (m_genDataViewer.Visible == true)
                {
                }
                else
                {
                    if (Program.MainForm.CurrentGenerateDataControl != m_genDataViewer.Table)
                    {
                        m_genDataViewer.DoDock(false); // 不会自动显示FixedPanel
                    }
                }
            }

            if (this.m_genDataViewer != null)
            {
                this.m_genDataViewer.CloseWhenComplete = bOpenWindow;
            }

            return;

            /*
             * ERROR1:
             * MessageBox.Show(this, "DisplayAutoGenMenu() 出错: " + strError);
             * */
        }