Ejemplo n.º 1
0
                private void LayoutHorizontal()
                {
                    try
                    {
                        this.pnlErrorMsg.Location = new Point(0, 0);
                        this.pnlErrorMsg.Size     = new Size(200, System.Convert.ToInt32(this.Height));
                        this.pnlErrorMsg.Anchor   = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top;
                        this.txtMsgText.Size      = new Size(this.pnlErrorMsg.Width - this.pbError.Width - 8,
                                                             this.pnlErrorMsg.Height - 20);
                        this.lvErrorCollector.Location = new Point(this.pnlErrorMsg.Width + 5, 0);
                        this.lvErrorCollector.Size     =
                            new Size(System.Convert.ToInt32(this.Width - this.pnlErrorMsg.Width - 5),
                                     System.Convert.ToInt32(this.Height));
                        this.lvErrorCollector.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right |
                                                       AnchorStyles.Top;

                        this._Layout = ControlLayout.Horizontal;
                    }
                    catch (Exception ex)
                    {
                        Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                            (string)
                                                            ("LayoutHorizontal (UI.Window.ErrorsAndInfos) failed" +
                                                             Constants.vbNewLine + ex.Message), true);
                    }
                }
Ejemplo n.º 2
0
        private void LayoutHorizontal()
        {
            try
            {
                pnlErrorMsg.Location = new Point(0, 0);
                pnlErrorMsg.Size     = new Size(_display.ScaleWidth(200), Height);
                pnlErrorMsg.Anchor   = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top;

                txtMsgText.Size = new Size(
                    pnlErrorMsg.Width - pbError.Width - _display.ScaleWidth(8),
                    pnlErrorMsg.Height - _display.ScaleHeight(20));
                lvErrorCollector.Location = new Point(pnlErrorMsg.Width + _display.ScaleWidth(5), 0);
                lvErrorCollector.Size     = new Size(Width - pnlErrorMsg.Width - _display.ScaleWidth(5), Height);
                lvErrorCollector.Anchor   =
                    AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;

                _layout = ControlLayout.Horizontal;
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                    "LayoutHorizontal (UI.Window.ErrorsAndInfos) failed" +
                                                    Environment.NewLine + ex.Message, true);
            }
        }
Ejemplo n.º 3
0
    //Loads all Controller Layouts
    public static void LoadAllControllerLayouts()
    {
        allAvailableConfigs = new List <ControlLayout>();

        //Get string from Player Prefs
        string toLoad = PlayerPrefs.GetString("ControllerLayouts", "");

        if (toLoad != "")
        {
            //Split the string into each Controller Layout
            string[] inputs = toLoad.Split(';');

            foreach (string inputData in inputs)
            {
                //Parse the controller layout from the string. If an exception is thrown ignore that string
                // try
                //{
                ControlLayout cl = ControlLayout.Parse(inputData);
                allAvailableConfigs.Add(cl);

                /*}
                 * catch (Exception err)
                 * {
                 *  Debug.LogError(err.Message);
                 * }*/
            }
        }

        SetAllControllerLayouts(allAvailableConfigs);
    }
Ejemplo n.º 4
0
    //Parse current string into Control Layout
    public static ControlLayout Parse(string _data)
    {
        //Split the data
        List <string> allPairs = _data.Split('|').ToList();

        //Make the return value
        ControlLayout toReturn = new ControlLayout((InputType)int.Parse(allPairs[0]), allPairs[1], new Dictionary <string, List <ControlName> >());

        //Remove input type and name from array
        allPairs.RemoveRange(0, 2);

        foreach (string pair in allPairs)
        {
            //Split each input string into another list
            string[] array = pair.Split(':');

            //If we already have this input throw an exception
            if (toReturn.controls.ContainsKey(array[0]))
            {
                throw new Exception("Input already exists!");
            }

            //Create a new list of control names
            List <ControlName> inputs = new List <ControlName>();
            for (int i = 1; i < array.Length; i++)
            {
                inputs.Add(new ControlName(array[i], (array[i].Length > 4f && array[i].Substring(0, 4) == "Axis") ? true : false));
            }

            toReturn.controls.Add(array[0], inputs);
        }

        return(toReturn);
    }
Ejemplo n.º 5
0
        public Player(CharacterClass classe, Weapon weapon, Team team, ControlLayout controlLayout, Vector2 Position)
        {
            #region sons
            for (int i = 1; i <= 8; i++)
            {
                killVoices.Add(Game1.Content.Load <SoundEffect>("audio/kills/" + i + "kill"));
            }

            #endregion
            this.weapon = weapon;
            if (weapon != null)
            {
                weapon.Holder = this;
            }
            this.classe    = classe;
            this.Health    = classe.Health;
            this.team      = team;
            this.MaxHealth = Health;
            this.Controls  = controlLayout;
            this.Position  = Position;
            healthBar      = new HealthBar(this);
            Console.WriteLine(Position);
            Pseudo = "Jean-kevin";
            LoadContent(Game1.Content);
            team.TeamPlayerList.Add(this);
        }
Ejemplo n.º 6
0
            public override void DoLoad(int _version, BinaryReader _stream)
            {
                allAvailableConfigs = new List <ControlLayout>();

                //Get string from Player Prefs
                string toLoad = _stream.ReadString();

                if (toLoad != "")
                {
                    //Split the string into each Controller Layout
                    string[] inputs = toLoad.Split(';');

                    foreach (string inputData in inputs)
                    {
                        //Parse the controller layout from the string. If an exception is thrown ignore that string
                        // try
                        //{
                        ControlLayout cl = ControlLayout.Parse(inputData);
                        allAvailableConfigs.Add(cl);

                        /*}
                         * catch (Exception err)
                         * {
                         *  Debug.LogError(err.Message);
                         * }*/
                    }
                }

                SetAllControllerLayouts(allAvailableConfigs);
            }
Ejemplo n.º 7
0
        private void SetLayout()
        {
            IniFile ini = new IniFile();

            ini.Load(IniData.SettingIniFile);
            IniSection resSect     = ini["Resources"];
            IniSection equipSect   = ini["Equipment"];
            string     bgResPath   = System.IO.Directory.GetCurrentDirectory() + $@"{resSect["ResourceFolder"]}{resSect["BGFolder"]}";
            string     textResPath = System.IO.Directory.GetCurrentDirectory() + $@"{resSect["ResourceFolder"]}{resSect["TextFolder"]}";

            this.Location = new Point(this.Left, 0);
            this.Size     = new Size(int.Parse(equipSect["Width"].ToString()), int.Parse(equipSect["Height"].ToString()));
            ControlLayout ctrlLayout = new ControlLayout();

            this.Padding = new Padding(ctrlLayout.GetXPosByRatio(this.Size, LeftPadding), ctrlLayout.GetYPosByRatio(this.Size, TopPadding), 0, 0);

            Pnl_Drag.BackgroundImage = Image.FromFile(bgResPath + @"\bg_box2_NoBorder.png");
            ctrlLayout.Control_Sizing(Pnl_Drag, this.Size, 1, 0.15f);

            ctrlLayout.Control_Sizing(Btn_Process, this.Size, 0.075f, 0.05f);
            ctrlLayout.Control_Positioning(Btn_Process, this.Size, 0.05f, 0.2f);
            Btn_Process.BackgroundImage = Image.FromFile(textResPath + @"\btn_s작업지시_nomal.png");
            Btn_Process.Text            = "";

            ctrlLayout.Control_Sizing(Btn_Logout, this.Size, 0.075f, 0.05f);
            ctrlLayout.Control_Positioning(Btn_Logout, this.Size, 0.9f, 0.1f);
            Btn_Logout.BackgroundImage = Image.FromFile(textResPath + @"\Logout.png");
            Btn_Logout.Text            = "";

            ctrlLayout.Control_Sizing(Btn_Exit, this.Size, 0.05f, 0.05f);
            ctrlLayout.Control_Positioning(Btn_Exit, this.Size, 1, 0.1f, ControlLayout.HorizontalSiding.Right);
            Btn_Exit.BackgroundImage = Image.FromFile(textResPath + @"\Exit.png");
            Btn_Exit.Text            = "";
        }
Ejemplo n.º 8
0
    //Constructor
    public InputDevice(int _joystickID)
    {
        //Set inital layout to defeault
        currentLayout = defaultLayout;

        joystickID = _joystickID;
        toggle     = false;
        killing    = false;
        inputLock  = "Submit";
    }
Ejemplo n.º 9
0
        public void LayoutChildren()
        {
            if (Content.Value == null)
            {
                return;
            }
            var view = Content.Value.GetWinFormsView();

            view.ActualBounds.Value = ControlLayout.CalculateBounds(_form.ClientSize, view.LayoutPreferences);
        }
Ejemplo n.º 10
0
        public void SetUp()
        {
            Mock <BlockControl> control = new Mock <BlockControl>();

            control.Object.Padding = "1 2 3 4";

            controlLayout = new ControlLayout
            {
                Control = control.Object
            };

            controlLayout.Calculate();
        }
        public void NextLayout()
        {
            if (controls == null)
            {
                return;
            }
            int next = controls.IndexOf(currentControlLayout) + 1;

            if (next >= controls.Count)
            {
                next = 0;
            }
            currentControlLayout = controls[next];
            currentControlLayout.Select();
        }
        public void PreviousLayout()
        {
            if (controls == null)
            {
                return;
            }
            int prev = controls.IndexOf(currentControlLayout) - 1;

            if (prev < 0)
            {
                prev = controls.Count - 1;
            }
            currentControlLayout = controls[prev];
            currentControlLayout.Select();
        }
Ejemplo n.º 13
0
        private void SetLayout()
        {
            IniFile ini = new IniFile();

            ini.Load(IniData.SettingIniFile);
            IniSection resSect     = ini["Resources"];
            string     bgResPath   = System.IO.Directory.GetCurrentDirectory() + $@"{resSect["ResourceFolder"]}{resSect["BGFolder"]}";
            string     textResPath = System.IO.Directory.GetCurrentDirectory() + $@"{resSect["ResourceFolder"]}{resSect["TextFolder"]}";

            ControlLayout ctrlLayout = new ControlLayout();

            ctrlLayout.MakeCurvedBorder(this, 18, 18);
            this.BackgroundImage = Image.FromFile(bgResPath + @"\bg_tabpage.png");

            ctrlLayout.Control_Sizing(Pnl_Drag, this.Size, 1, 0.2f);

            ctrlLayout.Control_Sizing(Pic_Title, this.Size, 0.05f, 0.1f);
            ctrlLayout.Control_Positioning(Pic_Title, this.Size, 0.1f, 0.2f);
            Pic_Title.Load(textResPath + @"\In.png");

            ctrlLayout.Control_Sizing(Lbl_Title, this.Size, 0.15f, 0.1f);
            ctrlLayout.Control_Positioning(Lbl_Title, this.Size, 0.2f, 0.2f);

            ctrlLayout.Control_Sizing(Pic_ID, this.Size, 0.1f, 0.15f);
            ctrlLayout.Control_Positioning(Pic_ID, this.Size, 0.12f, 0.4f);
            Pic_ID.Load(textResPath + @"\Key.png");
            ctrlLayout.Control_Sizing(Txt_ID, this.Size, 0.5f, 0.1f);
            ctrlLayout.Control_Positioning(Txt_ID, this.Size, 0.2f, 0.4f, ControlLayout.HorizontalSiding.Left);


            ctrlLayout.Control_Sizing(Pic_PW, this.Size, 0.1f, 0.15f);
            ctrlLayout.Control_Positioning(Pic_PW, this.Size, 0.12f, 0.6f);
            Pic_PW.Load(textResPath + @"\Lock.png");
            ctrlLayout.Control_Sizing(Txt_PW, this.Size, 0.5f, 0.1f);
            ctrlLayout.Control_Positioning(Txt_PW, this.Size, 0.2f, 0.6f, ControlLayout.HorizontalSiding.Left);


            ctrlLayout.Control_Sizing(Btn_LogIn, this.Size, 0.2f, 0.15f);
            ctrlLayout.Control_Positioning(Btn_LogIn, this.Size, 0.5f, 0.85f);
            Btn_LogIn.Text            = "";
            Btn_LogIn.BackgroundImage = Image.FromFile(textResPath + @"\Login.png");
            ctrlLayout.MakeCurvedBorder(Btn_LogIn, 18, 18);

            ctrlLayout.Control_Sizing(Btn_Exit, this.Size, 0.15f, 0.15f);
            ctrlLayout.Control_Positioning(Btn_Exit, this.Size, 0.9f, 0.1f);
            Btn_Exit.BackgroundImage = Image.FromFile(textResPath + @"\Exit.png");
            ctrlLayout.MakeCurvedBorder(Btn_Exit, 18, 18);
        }
Ejemplo n.º 14
0
        public void HorizontalAlignment_is_null__call_ActualFullWidth__returns_AvailableWidth()
        {
            Mock <BlockControl> control = new Mock <BlockControl>();

            ControlLayout controlLayout = new ControlLayout
            {
                Control        = control.Object,
                AvailableWidth = 100
            };

            controlLayout.Calculate();

            int actual = controlLayout.ActualFullWidth;

            Assert.That(actual, Is.EqualTo(100));
        }
        public void HorizontalAlignment_is_Stretch__call_ActualWidth__returns_AvailableWidth_without_Margins()
        {
            Mock <BlockControl> control = new Mock <BlockControl>();

            control.Object.HorizontalAlignment = HorizontalAlignment.Stretch;
            control.Object.Margin = 10;

            ControlLayout controlLayout = new ControlLayout
            {
                Control        = control.Object,
                AvailableWidth = 102
            };

            controlLayout.Calculate();

            int actual = controlLayout.ActualWidth;

            Assert.That(actual, Is.EqualTo(82));
        }
Ejemplo n.º 16
0
        private void LayoutVertical()
        {
            try
            {
                pnlErrorMsg.Location      = new Point(0, Height - 200);
                pnlErrorMsg.Size          = new Size(Width, Height - pnlErrorMsg.Top);
                pnlErrorMsg.Anchor        = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
                txtMsgText.Size           = new Size(pnlErrorMsg.Width - pbError.Width - 8, pnlErrorMsg.Height - 20);
                lvErrorCollector.Location = new Point(0, 0);
                lvErrorCollector.Size     = new Size(Width, Height - pnlErrorMsg.Height - 5);
                lvErrorCollector.Anchor   = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;

                _layout = ControlLayout.Vertical;
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "LayoutVertical (UI.Window.ErrorsAndInfos) failed" + Environment.NewLine + ex.Message, true);
            }
        }
Ejemplo n.º 17
0
        private void LayoutHorizontal()
        {
            try
            {
                this.pnlErrorMsg.Location      = new Point(0, 0);
                this.pnlErrorMsg.Size          = new Size(200, this.Height);
                this.pnlErrorMsg.Anchor        = (System.Windows.Forms.AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top);
                this.txtMsgText.Size           = new Size(this.pnlErrorMsg.Width - this.pbError.Width - 8, this.pnlErrorMsg.Height - 20);
                this.lvErrorCollector.Location = new Point(this.pnlErrorMsg.Width + 5, 0);
                this.lvErrorCollector.Size     = new Size(this.Width - this.pnlErrorMsg.Width - 5, this.Height);
                this.lvErrorCollector.Anchor   = (System.Windows.Forms.AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);

                this._Layout = ControlLayout.Horizontal;
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "LayoutHorizontal (UI.Window.ErrorsAndInfos) failed" + Environment.NewLine + ex.Message, true);
            }
        }
        public void HorizontalAlignment_is_null__returns_AvailableWidth_without_Margins_and_Paddings()
        {
            Mock <BlockControl> control = new Mock <BlockControl>();

            control.Object.Margin  = 10;
            control.Object.Padding = 7;

            ControlLayout controlLayout = new ControlLayout
            {
                Control        = control.Object,
                AvailableWidth = 100
            };

            controlLayout.Calculate();

            int actual = controlLayout.ActualClientWidth;

            Assert.That(actual, Is.EqualTo(66));
        }
Ejemplo n.º 19
0
        public void HorizontalAlignment_is_Stretch_DesiredContentWidth_is_not_specified__returns_AvailableWidth_without_Margins_and_Paddings()
        {
            Mock <BlockControl> control = new Mock <BlockControl>();

            control.Object.HorizontalAlignment = HorizontalAlignment.Stretch;
            control.Object.Margin  = 10;
            control.Object.Padding = 7;

            ControlLayout controlLayout = new ControlLayout
            {
                Control        = control.Object,
                AvailableWidth = 102
            };

            controlLayout.Calculate();

            int actual = controlLayout.ActualContentWidth;

            Assert.That(actual, Is.EqualTo(68));
        }
Ejemplo n.º 20
0
        public void HorizontalAlignment_is_null_DesiredContentWidth_is_less_than_available_space__returns_ContentDesiredWidth()
        {
            Mock <BlockControl> control = new Mock <BlockControl>();

            control.Object.Margin  = 10;
            control.Object.Padding = 7;

            ControlLayout controlLayout = new ControlLayout
            {
                Control             = control.Object,
                AvailableWidth      = 100,
                DesiredContentWidth = 20
            };

            controlLayout.Calculate();

            int actual = controlLayout.ActualContentWidth;

            Assert.That(actual, Is.EqualTo(20));
        }
Ejemplo n.º 21
0
        protected override ControlLayout Layout(ControlLayout layout)
        {
            if (null == layout)
            {
                throw new ArgumentNullException(nameof(layout));
            }

            quitButton            = new Label(this, layout.RemainingWidth / 2, Owner.TextFontDefault.Height, CatalogManager.Catalog.GetString($"Quit ({InputSettings.UserCommands[UserCommand.QuitGame]})"), LabelAlignment.Center);
            quitButton.OnClick   += QuitButton_OnClick;
            cancelButton          = new Label(this, layout.RemainingWidth / 2, Owner.TextFontDefault.Height, CatalogManager.Catalog.GetString("Cancel"), LabelAlignment.Center);
            cancelButton.OnClick += CancelButton_OnClick;
            layout = base.Layout(layout);
            ControlLayout buttonLine = layout.AddLayoutHorizontal((int)(Owner.TextFontDefault.Height * 1.25));

            buttonLine.Add(quitButton);
            buttonLine.AddVerticalSeparator();
            buttonLine.Add(cancelButton);
            layout.AddHorizontalSeparator(false);
            printScreenButton          = new Label(this, layout.RemainingWidth, Owner.TextFontDefault.Height, CatalogManager.Catalog.GetString($"Take Screenshot ({InputSettings.UserCommands[UserCommand.PrintScreen]})"), LabelAlignment.Center);
            printScreenButton.OnClick += PrintScreenButton_OnClick;
            layout.Add(printScreenButton);
            return(layout);
        }
 protected override void InitializeControls()
 {
     base.InitializeControls();
     UpdateButtonsControlLayout();
     UpdateApplyChangesButton();
     UpdateCancelButton();
     UpdateOKButton();
     UpdateDesignerModeButton();
     UpdateContextHelpButton();
     UpdateMainControlLayout();
     UpdateCustomControls();
     UpdateDescriptionEdit();
     UpdateNameEdit();
     TopLevelControl.MoveItem(0, BaseMessagePanel);
     TopLevelControl.MoveItem(1, MainControlLayout);
     MainControlLayout.MoveItem(0, NameEdit);
     MainControlLayout.MoveItem(1, DescriptionEdit);
     MainControlLayout.InsertItem(2, CreateReverseRelationTypeEdit());
     MainControlLayout.InsertItem(3, CreateControlLayout());
     ControlLayout.InsertItem(0, CreateControlLayout1());
     ControlLayout1.InsertItem(0, CreateForContactContactEdit());
     ControlLayout1.InsertItem(1, CreateForAccountContactEdit());
     ControlLayout.InsertItem(1, CreateControlLayout2());
     ControlLayout2.InsertItem(0, CreateForContactAccountEdit());
     ControlLayout2.InsertItem(1, CreateForAccountAccountEdit());
     MainControlLayout.MoveItem(4, CustomControls);
     TopLevelControl.MoveItem(2, ButtonsControlLayout);
     ButtonsControlLayout.MoveItem(0, ContextHelpButton);
     ButtonsControlLayout.MoveItem(1, DesignerModeButton);
     ButtonsControlLayout.MoveItem(2, SpacerButton);
     ButtonsControlLayout.MoveItem(3, OKButton);
     ButtonsControlLayout.MoveItem(4, CancelButton);
     ButtonsControlLayout.MoveItem(5, ApplyChangesButton);
     TopLevelControl.MoveItem(3, DataSource);
     SetControlsDefInheritance(UId);
     InitializeLocalizableValues();
 }
 public RadioButtonControlGroup(ControlLayout layout)
 {
     radioLayout   = layout;
     radioControls = new List <RadioButtonControl>();
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Constructs a keyframe with the specified layout.
 /// </summary>
 /// <param name="layout"></param>
 public KeyFrame(ControlLayout layout)
 {
     mLayout = layout;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Default constructor, necessary for serialization
 /// </summary>
 public KeyFrame()
 {
     mLayout = new ControlLayout();
 }
Ejemplo n.º 26
0
                private void LayoutHorizontal()
                {
                    try
                    {
                        this.pnlErrorMsg.Location = new Point(0, 0);
                        this.pnlErrorMsg.Size = new Size(200, System.Convert.ToInt32(this.Height));
                        this.pnlErrorMsg.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top;
                        this.txtMsgText.Size = new Size(this.pnlErrorMsg.Width - this.pbError.Width - 8,
                                                        this.pnlErrorMsg.Height - 20);
                        this.lvErrorCollector.Location = new Point(this.pnlErrorMsg.Width + 5, 0);
                        this.lvErrorCollector.Size =
                            new Size(System.Convert.ToInt32(this.Width - this.pnlErrorMsg.Width - 5),
                                     System.Convert.ToInt32(this.Height));
                        this.lvErrorCollector.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right |
                                                       AnchorStyles.Top;

                        this._Layout = ControlLayout.Horizontal;
                    }
                    catch (Exception ex)
                    {
                        Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                            (string)
                                                            ("LayoutHorizontal (UI.Window.ErrorsAndInfos) failed" +
                                                             Constants.vbNewLine + ex.Message), true);
                    }
                }
Ejemplo n.º 27
0
 /// <summary>
 /// Default constructor, necessary for serialization
 /// </summary>
 public KeyFrame()
 {
     mLayout = new ControlLayout();
 }
        private void InitializeChart()
        {
            chtType = ChtRefreshType.RefreshAll;

            IniFile iniFile = new IniFile();

            iniFile.Load(IniData.SettingIniFile);
            IniSection dbSection = iniFile[DBConnect.IniSectionName];

            DBConnect  connect = new DBConnect();
            SqlCommand command = new SqlCommand();

            command.CommandText = $@"Select {dbSection["QMasTB_Code"]}, {dbSection["QMasTB_Name"]}, {dbSection["QMasTB_Min"]}, {dbSection["QMasTB_Max"]}
                                       from {dbSection["QMasTB"]}";

            DataSet       datas;
            bool          result     = connect.Search(command, out datas);
            ControlLayout ctrlLayout = new ControlLayout();

            if (!result)
            {
                Tim_Per3Sec.Enabled = false;
                return;
            }

            foreach (DataRow row in datas.Tables[0].Rows)
            {
                Tab_Data.TabPages.Add(row[0].ToString(), row[1].ToString());

                Chart cht = new Chart();
                cht.ChartAreas.Add($"{row[0].ToString()}Area");
                cht.Legends.Add(row[0].ToString());
                cht.Series.Add(row[0].ToString());
                cht.Series[row[0].ToString()].ChartType   = SeriesChartType.Line;
                cht.Series[row[0].ToString()].BorderWidth = 4;
                cht.Series[row[0].ToString()].ChartArea   = $"{row[0].ToString()}Area";
                cht.Series[row[0].ToString()].Legend      = row[0].ToString();
                cht.Series[row[0].ToString()].LegendText  = row[0].ToString();
                cht.Series[row[0].ToString()].XValueType  = ChartValueType.DateTime;
                cht.ChartAreas[$"{row[0].ToString()}Area"].AxisX.LabelStyle.Format = "HH시 mm분";

                // 품질 경계를 표시하기 위한 코드
                double min       = double.Parse(row[2].ToString());
                double max       = double.Parse(row[3].ToString());
                double minborder = (min * 1.5) - (max * 0.5);
                double maxborder = (max * 1.5) - (min * 0.5);
                cht.ChartAreas[$"{row[0].ToString()}Area"].AxisY.Minimum  = minborder;
                cht.ChartAreas[$"{row[0].ToString()}Area"].AxisY.Maximum  = maxborder;
                cht.ChartAreas[$"{row[0].ToString()}Area"].AxisY.Interval = (max - min) * 0.5;
                StripLine line = new StripLine();
                line.Interval       = 0;
                line.StripWidth     = (max - min) * 0.5;
                line.BackColor      = Color.Salmon;
                line.IntervalOffset = minborder;
                StripLine line2 = new StripLine();
                line2.Interval       = 0;
                line2.StripWidth     = (max - min) * 0.5;
                line2.BackColor      = Color.Salmon;
                line2.IntervalOffset = max;
                cht.ChartAreas[$"{row[0].ToString()}Area"].AxisY.StripLines.Add(line);
                cht.ChartAreas[$"{row[0].ToString()}Area"].AxisY.StripLines.Add(line2);

                //cht.ChartAreas[$"{row[0].ToString()}Area"].AxisX.IntervalType = DateTimeIntervalType.Seconds;
                //cht.ChartAreas[$"{row[0].ToString()}Area"].AxisX.Interval = 3;
                ctrlLayout.Control_Sizing(cht, this.Size, 0.5f, 0.3f);
                Tab_Data.TabPages[row[0].ToString()].Controls.Add(cht);
            }
        }
 protected void RemoveControlLayout(ControlLayout ctrl)
 {
     PreviousLayout();
     controls.Remove(ctrl);
 }
 public bool IsLayoutSelected(ControlLayout layout)
 {
     return(currentControlLayout == layout);
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Constructs a keyframe with the specified layout.
 /// </summary>
 /// <param name="layout"></param>
 public KeyFrame(ControlLayout layout)
 {
     mLayout = layout;
 }
 protected void AddControlLayout(ControlLayout ctrl)
 {
     ctrl.SetModule(this);
     controls.Add(ctrl);
     currentControlLayout = controls[0];
 }
        private void SetLayout()
        {
            IniFile ini = new IniFile();

            ini.Load(IniData.SettingIniFile);
            IniSection resSect     = ini["Resources"];
            string     bgResPath   = System.IO.Directory.GetCurrentDirectory() + $@"{resSect["ResourceFolder"]}{resSect["BGFolder"]}";
            string     textResPath = System.IO.Directory.GetCurrentDirectory() + $@"{resSect["ResourceFolder"]}{resSect["TextFolder"]}";

            // 부모 폼의 Mdi Container에 크기를 맞춘다
            this.Location = new Point(0, 0);
            this.Size     = new Size(this.MdiParent.ClientSize.Width - this.MdiParent.Padding.Left - this.MdiParent.Padding.Right,
                                     this.MdiParent.ClientSize.Height - this.MdiParent.Padding.Top - this.MdiParent.Padding.Bottom);
            this.BackgroundImage = Image.FromFile(bgResPath + @"\bg_USER_SEL_Simple.png");

            ControlLayout ctrlLayout = new ControlLayout();

            ctrlLayout.Control_Positioning(Lbl_CurrentTime, this.Size, 0.86f, 0.03f);
            ctrlLayout.Control_Sizing(Txt_CurrentTime, this.Size, 0.1f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_CurrentTime, this.Size, 0.89f, 0.03f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_Order, this.Size, 0.07f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_Order, this.Size, 0.07f, 0.2f);
            Pic_Order.Load(textResPath + @"\작업지시.png");
            ctrlLayout.Control_Sizing(Cmb_Order, this.Size, 0.2f, 0.05f);
            ctrlLayout.Control_Positioning(Cmb_Order, this.Size, 0.12f, 0.2f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_ItemCode, this.Size, 0.07f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_ItemCode, this.Size, 0.07f, 0.25f);
            Pic_ItemCode.Load(textResPath + @"\품번.png");
            ctrlLayout.Control_Sizing(Txt_ItemCode, this.Size, 0.2f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_ItemCode, this.Size, 0.12f, 0.25f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_ItemName, this.Size, 0.07f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_ItemName, this.Size, 0.07f, 0.3f);
            Pic_ItemName.Load(textResPath + @"\품명.png");
            ctrlLayout.Control_Sizing(Txt_ItemName, this.Size, 0.2f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_ItemName, this.Size, 0.12f, 0.3f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_Proc, this.Size, 0.08f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_Proc, this.Size, 0.07f, 0.35f);
            Pic_Proc.Load(textResPath + @"\공정 및 기기.png");
            ctrlLayout.Control_Sizing(Txt_ProcName, this.Size, 0.1f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_ProcName, this.Size, 0.12f, 0.35f, ControlLayout.HorizontalSiding.Left);
            ctrlLayout.Control_Sizing(Cmb_Machine, this.Size, 0.1f, 0.05f);
            ctrlLayout.Control_Positioning(Cmb_Machine, this.Size, 0.22f, 0.35f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_TargetAmount, this.Size, 0.08f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_TargetAmount, this.Size, 0.18f, 0.4f, ControlLayout.HorizontalSiding.Right);
            Pic_TargetAmount.Load(textResPath + @"\목표생산량.png");
            ctrlLayout.Control_Sizing(Txt_TargetAmount, this.Size, 0.1f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_TargetAmount, this.Size, 0.2f, 0.4f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_TotalAmount, this.Size, 0.08f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_TotalAmount, this.Size, 0.2f, 0.44f, ControlLayout.HorizontalSiding.Right);
            Pic_TotalAmount.Load(textResPath + @"\총생산량.png");
            ctrlLayout.Control_Sizing(Txt_TotalAmount, this.Size, 0.08f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_TotalAmount, this.Size, 0.22f, 0.44f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_NormalAmount, this.Size, 0.08f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_NormalAmount, this.Size, 0.2f, 0.48f, ControlLayout.HorizontalSiding.Right);
            Pic_NormalAmount.Load(textResPath + @"\양품수.png");
            ctrlLayout.Control_Sizing(Txt_NormalAmount, this.Size, 0.08f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_NormalAmount, this.Size, 0.22f, 0.48f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Pic_DefectAmount, this.Size, 0.08f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_DefectAmount, this.Size, 0.2f, 0.52f, ControlLayout.HorizontalSiding.Right);
            Pic_DefectAmount.Load(textResPath + @"\불량품 수.png");
            ctrlLayout.Control_Sizing(Txt_DefectAmount, this.Size, 0.08f, 0.05f);
            ctrlLayout.Control_Positioning(Txt_DefectAmount, this.Size, 0.22f, 0.52f, ControlLayout.HorizontalSiding.Left);

            ctrlLayout.Control_Sizing(Btn_OrderStart, this.Size, 0.1f, 0.08f);
            ctrlLayout.Control_Positioning(Btn_OrderStart, this.Size, 0.4f, 0.3f);
            Btn_OrderStart.BackgroundImage = Image.FromFile(textResPath + @"\btn_작업시작_nomal.png");
            Btn_OrderStart.Text            = "";

            ctrlLayout.Control_Sizing(Pic_DieLbl, this.Size, 0.08f, 0.04f);
            ctrlLayout.Control_Positioning(Pic_DieLbl, this.Size, 0.5f, 0.15f, ControlLayout.HorizontalSiding.Center, ControlLayout.VerticalSiding.Top);
            Pic_DieLbl.Load(textResPath + @"\금형.png");
            ctrlLayout.Control_Sizing(Pic_Dies, this.Size, 0.3f, 0.3f);
            ctrlLayout.Control_Positioning(Pic_Dies, this.Size, 0.55f, 0.15f, ControlLayout.HorizontalSiding.Left, ControlLayout.VerticalSiding.Top);

            ctrlLayout.Control_Sizing(Tab_Data, this.Size, 0.5f, 0.35f);
            ctrlLayout.Control_Positioning(Tab_Data, this.Size, 0.3f, 0.8f);
        }
Ejemplo n.º 34
0
        private void LayoutVertical()
        {
            try
            {
                this.pnlErrorMsg.Location = new Point(0, this.Height - 200);
                this.pnlErrorMsg.Size = new Size(this.Width, this.Height - this.pnlErrorMsg.Top);
                this.pnlErrorMsg.Anchor = (System.Windows.Forms.AnchorStyles) (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
                this.txtMsgText.Size = new Size(this.pnlErrorMsg.Width - this.pbError.Width - 8, this.pnlErrorMsg.Height - 20);
                this.lvErrorCollector.Location = new Point(0, 0);
                this.lvErrorCollector.Size = new Size(this.Width, this.Height - this.pnlErrorMsg.Height - 5);
                this.lvErrorCollector.Anchor = (System.Windows.Forms.AnchorStyles) (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);

                this._Layout = ControlLayout.Vertical;
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "LayoutVertical (UI.Window.ErrorsAndInfos) failed" + Environment.NewLine + ex.Message, true);
            }
        }