Example #1
0
 public Document_Box(usrc_InputControl inpCtrl)
 {
     DBm_Document = new DBm_Document();
     //FileInfo_Box = new FileInfo_Box(inpCtrl,this);
     Picture = new PictureBox();
     Picture.Parent = this;
     Picture.Top = this.Height;
     Picture.Width = const_DocumentPictureWidth;
     Picture.Height = const_DocumentPictureHeight;
     this.Height += Picture.Height;
 }
Example #2
0
        public Picture_Box(usrc_InputControl xinpCtrl, SQLTable pParentTbl, int PictureBoxWidth, int PictureBoxHeight, bool xbReadOnly)
        {
            inpCtrl = xinpCtrl;
            DBm_Image_Table = pParentTbl;
            bReadOnly = xbReadOnly;
            if (!bReadOnly)
            {
                btnFolderSelect = new Button();
                xinpCtrl.Controls.Add(btnFolderSelect);
                btnFolderSelect.Width = BtnFileSelectWidth;
                btnFolderSelect.Height = InputBoxHeight;
                btnFolderSelect.Image = Properties.Resources.SmallFolderIcon.ToBitmap();
                btnFolderSelect.Text = "";
                btnFolderSelect.Visible = true;
                btnFolderSelect.Tag = this;
            }

            DBm_Image = new DBm_Image();
            //FileInfo_Box = new FileInfo_Box(inpCtrl,this);
            Picture = new PictureBox();
            Picture.Parent = this;
            Picture.Top = 10;
            Picture.Left = 5;
            Picture.Width = PictureBoxWidth - 10;
            Picture.Height =PictureBoxHeight - 15;
            //this.Height += Picture.Height;
            Picture.SizeMode = PictureBoxSizeMode.Zoom;
            this.Height = PictureBoxHeight;
            if (!bReadOnly)
            {
                this.Cursor = Cursors.Arrow;
                btnFolderSelect.Cursor = Cursors.Arrow;
                Picture.Cursor = Cursors.Arrow;
                btnFolderSelect.Tag = Picture;
                btnFolderSelect.Click += new EventHandler(OnButtonClick_PictureSelect);
            }
            else
            {
                this.Cursor = Cursors.No;
                Picture.Cursor = Cursors.No;
            }
        }
 void myGroupBox_usrc_InputControl_ObjectChanged(SQLTable tbl, usrc_InputControl InputControl)
 {
     if (pParentTable != null)
     {
         pParentTable.myGroupBox.SetEvent_ObjectChanged(tbl, InputControl);
         this.myGroupBox.Changed_up = AtLeastOneInputControlChanged();
     }
     else
     {
         this.myGroupBox.Changed_up = AtLeastOneInputControlChanged();
     }
 }
        public void CreateInputControls(SQLTable pPrevTable,
                                        Column fcol, 
                                        string sParentKeys, 
                                        ref List<usrc_InputControl> 
                                        inpCtrlList, 
                                        Object pParentWindow, 
                                        Control pControl,
                                        DBTableControl xDBTables,
                                        bool bReadOnly,
                                        NavigationButtons.Navigation xnav)
        {
            int iCol = 0;
            int iCount = Column.Count();
            this.pParentTable = pPrevTable;
            this.myGroupBox = new usrc_myGroupBox();
            this.myGroupBox.SelectionButtonVisible = m_SelectionButtonVisible;
            this.myGroupBox.Init(this, fcol, sParentKeys, pParentWindow, pControl, xDBTables, bReadOnly,xnav);

            if (pParentWindow.GetType() == typeof(myPanel))
            {
                this.myGroupBox.Left = 5;
                this.myGroupBox.Top = 5;
                Panel pnl = (Panel)pParentWindow;
                pnl.Controls.Add(myGroupBox);
            }
            else if (pParentWindow.GetType() == typeof(usrc_myGroupBox))
            {
                usrc_myGroupBox pParentMyGroupBox = (usrc_myGroupBox)pParentWindow;
                MyControl mctrl = new MyControl(this.myGroupBox);
                pParentMyGroupBox.controls.Add(mctrl);
            }

            for (iCol = 0; iCol < iCount; iCol++)
            {
                Column col = Column[iCol];
                if (!col.IsIdentity)
                {
                    if (col.fKey != null)
                    {
                        string sKey;
                        bool xbReadOnly = bReadOnly;

                        if (col.Style == CodeTables.Column.eStyle.ReadOnlyTable)
                        {
                            xbReadOnly = true;
                        }

                        sKey = sParentKeys + "*" + col.fKey.refInListOfTables.TableName + ">";
                        col.fKey.fTable.CreateInputControls(this, col, sKey, ref inpCtrlList, this.myGroupBox, pControl, xDBTables, xbReadOnly,xnav);
                    }
                    else
                    {
                        string sImportExportLine;
                        usrc_InputControl inpCtrl;
                        if (col.IsNumber())
                        {
                            sImportExportLine = sParentKeys + col.Name + ",";
                            inpCtrl = new usrc_InputControl();
                            inpCtrl.Init(this, col, inpCtrlList, sImportExportLine, true,bReadOnly);
                            if (!bReadOnly)
                            {
                                inpCtrl.ObjectChanged += new usrc_InputControl.delegate_ObjectChanged(inpCtrl_ObjectChanged);
                            }
                            col.InputControl = inpCtrl;
                        }
                        else
                        {
                            sImportExportLine = sParentKeys + col.Name + ",";
                            inpCtrl = new usrc_InputControl();
                            inpCtrl.Init(this, col, inpCtrlList, sImportExportLine, false,bReadOnly);
                            if (!bReadOnly)
                            {
                                inpCtrl.ObjectChanged += new usrc_InputControl.delegate_ObjectChanged(inpCtrl_ObjectChanged);
                            }
                            col.InputControl = inpCtrl;
                        }
                        MyControl mctrl = new MyControl(inpCtrl);
                        this.myGroupBox.controls.Add(mctrl);
                    }
                }
            }

            if (pPrevTable!=null)
            {
                if (pParentWindow is usrc_myGroupBox)
                {
                    if (!bReadOnly)
                    {
                        this.myGroupBox.Unique_parameter_exist += myGroupBox_Unique_parameter_exist;
                        this.myGroupBox.bUnique_parameter_exist = true;
                        this.myGroupBox.RowReferenceFromTable_Check_NoChangeToOther += myGroupBox_RowReferenceFromTable_Check_NoChangeToOther;
                        this.myGroupBox.usrc_myGroupBox_IndexChanged += new usrc_myGroupBox.delegate_IndexChanged(myGroupBox_usrc_myGroupBox_IndexChanged);
                        this.myGroupBox.usrc_InputControl_ObjectChanged += new usrc_myGroupBox.delegate_ObjectChanged(myGroupBox_usrc_InputControl_ObjectChanged);
                    }
                }
                //if (pParentWindow is Panel)
                //{
                //    if (!bReadOnly)
                //    {
                //        this.myGroupBox.Unique_parameter_exist += myGroupBox_Unique_parameter_exist;
                //        this.myGroupBox.bUnique_parameter_exist = true;
                //        this.myGroupBox.RowReferenceFromTable_Check_NoChangeToOther += myGroupBox_RowReferenceFromTable_Check_NoChangeToOther;
                //        //this.myGroupBox.usrc_myGroupBox_IndexChanged += new usrc_myGroupBox.delegate_IndexChanged(myGroupBox_usrc_myGroupBox_IndexChanged);
                //        //this.myGroupBox.usrc_InputControl_ObjectChanged += new usrc_myGroupBox.delegate_ObjectChanged(myGroupBox_usrc_InputControl_ObjectChanged);
                //    }
                //}
            }
        }
 public void inpCtrl_ObjectChanged(SQLTable tbl,usrc_InputControl InputControl)
 {
     myGroupBox.SetEvent_ObjectChanged(tbl,InputControl);
     this.myGroupBox.Changed_up = AtLeastOneInputControlChanged();
     if (pParentTable != null)
     {
         pParentTable.myGroupBox.SetEvent_ObjectChanged(tbl, InputControl);
     }
 }
 //public FileInfo_Box FileInfo_Box;
 public InputControl_DocumentBox(usrc_InputControl xinpCtrl)
 {
     InitializeComponent();
     inpCtrl = xinpCtrl;
 }