Example #1
0
        public CommonObject ParseCommonObject(List <String> Lines, ref int i)
        {
            CommonObject Obj = new CommonObject();

            do
            {
                ParseLine(Lines[i++]);
                Obj = (CommonObject)ParseCommonData(Obj);
                ParseData("IncX", ref Obj.IncX);
                ParseData("IncY", ref Obj.IncY);
                ParseData("ItemTab", ref ItemTabCommon);
            } while (Lines[i] != "");
            return(Obj);
        }
Example #2
0
        public void ProcessFields(frmMain Main, TabControl MainTabControl, Dictionary <string, List <TabPage> > CustomTabPages, Dictionary <string, List <CustomUIObject> > Objects, Graphics g)
        {
            foreach (KeyValuePair <string, List <CustomUIObject> > kvp in Objects)
            {
                // This is the TabPage where these objects go to
                TabPage Page = GetCustomTabPage(Main, MainTabControl, CustomTabPages, kvp.Key);
                if (Page == null)
                {
                    continue;
                }

                InitEnvironment();

                foreach (CustomUIObject CObj in kvp.Value)
                {
                    int PosX = GetObjectValue(CObj.PosX, CommonPosX);
                    int PosY = GetObjectValue(CObj.PosY, CommonPosY);

                    Point Position = new Point(PosX, PosY);

                    if (CObj is LabelObject)
                    {
                        Page.Controls.Add(CreateLabelControl((LabelObject)CObj, Position));
                    }
                    else if (CObj is FieldObject)
                    {
                        FieldObject FObj = (FieldObject)CObj;
                        if (FObj.DataType == "bool")
                        {
                            Page.Controls.Add(CreateCheckBoxControl((FieldObject)CObj, Position));
                        }
                        else
                        {
                            // Label-->[Space]-->NumericControl
                            Page.Controls.Add(CreateLabelControl(CObj.Text, new Point(PosX, PosY), 0));
                            int Space = GetObjectValue(FObj.Space, CommonSpace);
                            Page.Controls.Add(CreateNumericControl(FObj, new Point(PosX + Space, PosY - 2)));
                        }
                    }
                    else if (CObj is CommonObject)
                    {
                        CommonObject IObj = (CommonObject)CObj;
                        IfNonZeroSet(IObj.Space, ref CommonSpace.Value);
                        IfNonZeroSet(IObj.IncX, ref IncX);
                        IfNonZeroSet(IObj.IncY, ref IncY);
                        IfNonZeroSet(IObj.Min, ref CommonMin.Value);
                        IfNonZeroSet(IObj.Max, ref CommonMax.Value);
                        IfNonZeroSet(IObj.Width, ref CommonWidth.Value);
                        IfNonZeroSet(IObj.PosX, ref CommonPosX);
                        IfNonZeroSet(IObj.PosY, ref CommonPosY);
                        IfNonZeroSet(IObj.ItemTab, ref CommonItemTab);
                    }

                    if (!(CObj is CommonObject))
                    {
                        CommonPosX += IncX;
                        CommonPosY += IncY;
                    }
                }
            }
        }
Example #3
0
 public CommonObject ParseCommonObject(List<String> Lines, ref int i)
 {
     CommonObject Obj = new CommonObject();
     do
     {
         ParseLine(Lines[i++]);
         Obj = (CommonObject)ParseCommonData(Obj);
         ParseData("IncX", ref Obj.IncX);
         ParseData("IncY", ref Obj.IncY);
         ParseData("ItemTab", ref ItemTabCommon);
     } while (Lines[i] != "");
     return Obj;
 }