Ejemplo n.º 1
0
        void treeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeView tree = (TreeView)sender;

            tree.SelectedNode = e.Node;

            TableTreeF   tt          = (TableTreeF)tree.Parent;
            CFormControl FormControl = (CFormControl)tt.Tag;

            //RefreshLinkageWindowControl(FormControl);
        }
Ejemplo n.º 2
0
        void LoadData()
        {
            if (FormF == null)
            {
                return;
            }

            this.Width  = FormF.Width;
            this.Height = FormF.Height;

            List <CBaseObject> lstFormControl = FormF.FormControlMgr.GetList();

            foreach (CBaseObject obj in lstFormControl)
            {
                CFormControl FormControl = (CFormControl)obj;


                if (FormControl.CtrlType == (int)ControlType.TableGrid)
                {
                    if (FormControl.TableInFormControlMgr.GetList().Count == 0)
                    {
                        continue;
                    }
                    CTableInFormControl TableInFormControl = (CTableInFormControl)FormControl.TableInFormControlMgr.GetFirstObj();
                    CTable table = (CTable)Program.Ctx.TableMgr.Find(TableInFormControl.FW_Table_id);
                    if (table == null)
                    {
                        continue;
                    }

                    CBaseObjectMgr objMgr = new CBaseObjectMgr();
                    objMgr.TbCode = table.Code;
                    objMgr.Ctx    = Program.Ctx;
                    TableGridF te = new TableGridF();
                    te.TableInFormControl = TableInFormControl;
                    te.BaseObjectMgr      = objMgr;
                    te.Name         = FormControl.Name;
                    te.ShowToolBar  = TableInFormControl.ShowToolBar;
                    te.ShowTitleBar = TableInFormControl.ShowTitleBar;
                    te.CaptionText  = FormControl.Name;
                    te.Tag          = FormControl;
                    flowPanel.Controls.Add(te);

                    te.dataGridView.CellClick += new DataGridViewCellEventHandler(dataGridView_CellClick);
                }
                else if (FormControl.CtrlType == (int)ControlType.TableTree)
                {
                    TableTreeF tt = new TableTreeF();
                    tt.CaptionText  = FormControl.Name;
                    tt.ShowTitleBar = FormControl.ShowTitleBar;
                    tt.FormControl  = FormControl;
                    tt.Name         = FormControl.Name;
                    tt.Tag          = FormControl;
                    flowPanel.Controls.Add(tt);
                    tt.Dock = DockStyle.Fill;
                    tt.BringToFront();

                    tt.treeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(treeView_NodeMouseClick);
                }
                else if (FormControl.CtrlType == (int)ControlType.TableTab)
                {
                    TableTabF tab = new TableTabF();
                    tab.FormControl  = FormControl;
                    tab.CaptionText  = FormControl.Name;
                    tab.Name         = FormControl.Name;
                    tab.ShowTitleBar = FormControl.ShowTitleBar;
                    tab.Tag          = FormControl;
                    flowPanel.Controls.Add(tab);
                    tab.Dock = DockStyle.Fill;
                    tab.BringToFront();
                }
                else if (FormControl.CtrlType == (int)ControlType.ComboBox)
                {
                    if (FormControl.TableInFormControlMgr.GetList().Count == 0)
                    {
                        continue;
                    }
                    CTableInFormControl TableInFormControl = (CTableInFormControl)FormControl.TableInFormControlMgr.GetFirstObj();
                    CTable table = (CTable)Program.Ctx.TableMgr.Find(TableInFormControl.FW_Table_id);
                    if (table == null)
                    {
                        continue;
                    }

                    CBaseObjectMgr objMgr = new CBaseObjectMgr();
                    objMgr.TbCode = table.Code;
                    objMgr.Ctx    = Program.Ctx;

                    UIComboBoxF cb = new UIComboBoxF();
                    cb.CaptionText        = FormControl.Name + ":";
                    cb.TableInFormControl = TableInFormControl;
                    cb.BaseObjectMgr      = objMgr;
                    cb.Name = FormControl.Name;
                    cb.Tag  = FormControl;
                    flowPanel.Controls.Add(cb);
                    cb.Dock = DockStyle.Top;
                    cb.BringToFront();

                    cb.comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged);
                }
                else if (FormControl.CtrlType == (int)ControlType.ListBox)
                {
                    if (FormControl.TableInFormControlMgr.GetList().Count == 0)
                    {
                        continue;
                    }
                    CTableInFormControl TableInFormControl = (CTableInFormControl)FormControl.TableInFormControlMgr.GetFirstObj();
                    CTable table = (CTable)Program.Ctx.TableMgr.Find(TableInFormControl.FW_Table_id);
                    if (table == null)
                    {
                        continue;
                    }

                    CBaseObjectMgr objMgr = new CBaseObjectMgr();
                    objMgr.TbCode = table.Code;
                    objMgr.Ctx    = Program.Ctx;

                    UIListBoxF listBox = new UIListBoxF();
                    listBox.CaptionText        = FormControl.Name;
                    listBox.TableInFormControl = TableInFormControl;
                    listBox.BaseObjectMgr      = objMgr;
                    listBox.Name = FormControl.Name;
                    listBox.Tag  = FormControl;
                    flowPanel.Controls.Add(listBox);
                    listBox.Dock = DockStyle.Fill;
                    listBox.BringToFront();

                    listBox.listBox.SelectedIndexChanged += new EventHandler(listBox_SelectedIndexChanged);
                }
            }
        }