Пример #1
0
 void ShowDevices(ControlBox control)
 {
     foreach (GameObject a in control.connectedDevice)
     {
         WriteText(a.name);
     }
 }
Пример #2
0
 public static DialogResult ShowDialog(IWin32Window owner, Control control, string caption, bool canResize, bool useDefaultButtons)
 {
     if (useDefaultButtons)
     {
         return(ShowDialog(MainForm, control, caption, MessageBoxButtons.OK, 0, canResize, true));
     }
     return(ControlBox.Show(MainForm, control, caption, canResize));
 }
Пример #3
0
        protected override void OnMouseDoubleClick(MouseEventArgs e)
        {
            // Toggle window state.
            if (_windowTitleBarRectangle.Contains(e.Location))
            {
                ControlBox.ToggleWindowState(this);
            }

            base.OnMouseDoubleClick(e);
        }
Пример #4
0
 public void SetControlBox(int id)
 {
     foreach (var cb in ControlBoxes)
     {
         cb.gameObject.SetActive(false);
     }
     CurrentControlBox = ControlBoxes[id];
     CurrentControlBox.gameObject.SetActive(true);
     CurrentControlBox.ScreenImage.texture = Emulator.ScreenTexture;
     touchAreas_ = CurrentControlBox.gameObject.GetComponentsInChildren <TouchArea>();
 }
Пример #5
0
 private void btn_lock_Click(object sender, EventArgs e)
 {
     if (ControlBox.Equals(false))
     {
         ControlBox = true;
         btn_lock.BackgroundImage = Properties.Resources.Unlock;
     }
     else
     {
         ControlBox = false;
         btn_lock.BackgroundImage = Properties.Resources.Padlock;
         this.WindowState         = FormWindowState.Maximized;
     }
 }
Пример #6
0
        public bool HideControls(bool force)
        {
            if (!force && IsRealized)
            {
                ControlBox.GdkWindow.GetPointer(out var x, out var y, out var type);
                if (x < ControlBox.Allocation.Width && y < ControlBox.Allocation.Height)
                {
                    //hide.Start ();
                    return(true);
                }
            }

            //hide.Stop ();
            ControlBox.Hide();
            return(false);
        }
Пример #7
0
        public bool HideControls(bool force)
        {
            int x, y;

            Gdk.ModifierType type;

            if (!force && IsRealized)
            {
                ControlBox.GdkWindow.GetPointer(out x, out y, out type);
                if (x < ControlBox.Allocation.Width && y < ControlBox.Allocation.Height)
                {
                    hide.Start();
                    return(true);
                }
            }

            hide.Stop();
            ControlBox.Hide();
            return(false);
        }
Пример #8
0
        public View _code()
        {
            var controls = new ControlBox
            {
                Binding = new Xamarin.BindingInfoCollection {
                    { "UserName", new Xamarin.BindingInfo {
                          Caption = "Tên người dùng"
                      } },
                    { "Password", new Xamarin.BindingInfo {
                          Caption = "Mật khẩu", Input = "pass"
                      } }
                },
                Margin = 40,
            };

            controls.SetValue(new Models.LoginInfo {
                UserName = "******", Password = "******"
            });
            var btn = new MyButton
            {
                Text   = "Đăng nhập",
                Margin = new Thickness(0, 40, 0, 0),
            };

            btn.Clicked += e =>
            {
                var data = controls.GetValue <Models.LoginInfo>();
                if (data == null)
                {
                    //Message.Show("Tên người dùng và mật khẩu không được để trống");
                }
                MyApp.Execute("home/login", data);
            };
            controls.AddRow(btn);

            MainContent.VerticalOptions = LayoutOptions.CenterAndExpand;
            return(controls);
        }
Пример #9
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _styleManager = new StyleManager(theme);

                BackColor          = theme.ColorPalette.FormBackground;
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;
                ForeColor          = theme.ColorPalette.TextEnabled;
                _titleForeColor    = theme.ColorPalette.TextEnabled;
                _windowBarColor    = theme.ColorPalette.FormWindowBar;

                // Update internal controls.
                ControlBox.UpdateTheme(theme);
            }
            catch (Exception e)
            {
                Logger.WriteDebug(e);
            }

            OnThemeChanged(this, new ThemeEventArgs(theme));
        }
Пример #10
0
        public Form2(int numofplayers, Form initiator, Monster m)
        {
            InitializeComponent();
            //this.TopMost = true;
            //this.WindowState = FormWindowState.Maximized;
            playerarray   = new Player[numofplayers];
            monster       = m;
            initiatorform = initiator;
            if (numofplayers > 4)
            {
                this.Close();
            }
            for (int i = 0; i < numofplayers; i++)
            {
                playerarray[i] = new Player();
                switch (i)
                {
                case 0:
                    playerarray[i].label = Player1Label;
                    Player1Label.Show();
                    playerarray[i].playing   = true;
                    playerarray[i].rectangle = new Rectangle(Player1Label.Location, Player1Label.Size);
                    break;

                case 1:
                    playerarray[i].label = Player2Label;
                    Player2Label.Show();
                    playerarray[i].playing   = true;
                    playerarray[i].rectangle = new Rectangle(Player2Label.Location, Player2Label.Size);
                    break;

                case 2:
                    playerarray[i].label = Player3Label;
                    Player3Label.Show();
                    playerarray[i].playing   = true;
                    playerarray[i].rectangle = new Rectangle(Player3Label.Location, Player3Label.Size);
                    break;

                case 3:
                    playerarray[i].label = Player4Label;
                    Player4Label.Show();
                    playerarray[i].playing   = true;
                    playerarray[i].rectangle = new Rectangle(Player4Label.Location, Player4Label.Size);
                    break;
                }
                playerarray[i].nonitcolor = playerarray[i].label.BackColor;
            }
            if (monster.type != Monster.Monster_Type.Posessor)
            {
                MonsterLabel.Size        = new System.Drawing.Size(monster.size * 2, monster.size * 2);
                monster.monsterLabel     = MonsterLabel;
                monster.monsterRectangle = new Rectangle(MonsterLabel.Location, MonsterLabel.Size);
            }
            else
            {
                MonsterLabel.Hide();
                possessed.rectangle = new Rectangle(-200, -200, 1, 1);
                possessed.label     = new Label();
            }
            Random rnd = new Random();

            if (monster.type != Monster.Monster_Type.Posessor & monster.type != Monster.Monster_Type.Hook)
            {
                it = playerarray[rnd.Next(0, numofplayers)];
                // it.label.BackColor = Color.Red;
                it.it = true;
                it.label.BorderStyle = BorderStyle.Fixed3D;
            }
            ControlBox.Focus();
            Player_Reset(4);
            MonsterLabel.Location             = new Point((this.Size.Width - 27) / 2, (this.Size.Height - 50) / 2);
            monster.start_Position            = MonsterLabel.Location;
            monster.monsterRectangle.Location = MonsterLabel.Location;
        }
Пример #11
0
    void FindComand(string comand)
    {
        switch (comand)
        {
        case "/help":
            WriteText("/clear");
            WriteText("/exit");
            break;

        case "/exit":
            NeedComfirm("Close?", "Closing...", "Canceled", comand, new Action(transform.parent.GetComponent <PC_Controler>().ClosePC));
            break;

        case "y":
            if (comandNeedConfirm != null)
            {
                confirm = Status.yes;
                FindComand(comandNeedConfirm);
                confirm = Status.norm;
            }
            else
            {
                FindComand("");
            }

            break;


        case "n":
            if (comandNeedConfirm != null)
            {
                confirm = Status.no;
                FindComand(comandNeedConfirm);
                confirm = Status.norm;
            }
            else
            {
                FindComand("");
            }
            break;


        case "/clear":
            ClearConsole();
            break;

        case "finddevice -hacked":
            FindDevice(true);
            break;

        case "finddevice -all":
            FindDevice(false);
            break;

        case "":
            break;

        case "showdevices -connected":
            ShowDevices(connectedBox);
            break;

        case "disconnect":
            WriteText("Disconnected");
            connectedBox = null;
            break;


        default:
            //  print("ja");
            //   WriteText("Wrong comand!!!");
            break;
        }

        if (comand.StartsWith("connect "))
        {
            ControlBox[] cb = FindObjectsOfType <ControlBox>();
            foreach (ControlBox c in cb)
            {
                if (comand.Contains(c.IP) && comand.EndsWith(c.password))
                {
                    WriteText("Connected");
                    connectedBox = c;
                }
                else if (comand.Contains(c.IP) && !comand.EndsWith(c.password))
                {
                    WriteText("Bad password");
                }
                else
                {
                    WriteText("Problem with connect");
                }
            }
        }

        foreach (GameObject a in connectedBox.connectedDevice)
        {
            if (comand == (a.name + ".") || comand == (a.name))
            {
                if (a.GetComponent <LightControl>())
                {
                    WriteText("on");
                    WriteText("off");
                }
            }
            else if (comand.StartsWith(a.name + "."))
            {
                if (a.GetComponent <LightControl>())
                {
                    if (comand == a.name + ".on")
                    {
                        a.GetComponent <LightControl>().isOn = true;
                        WriteText("Success");
                    }
                    else if (comand == a.name + ".off")
                    {
                        a.GetComponent <LightControl>().isOn = false;
                        WriteText("Success");
                    }
                }
            }
        }
    }
Пример #12
0
 public void RemoveControlBox(ControlBox box)
 {
     box.ButtonPushed -= OnButtonPushed;
     ControlBoxes.Remove(box);
 }
Пример #13
0
 public void AddControlBox(ControlBox box)
 {
     box.ButtonPushed += OnButtonPushed;
     ControlBoxes.Add(box);
 }
Пример #14
0
 public void ShowControls()
 {
     //hide.Stop ();
     //hide.Start ();
     ControlBox.Show();
 }
Пример #15
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     kit_kat.AdobeColors.HSB hsb1 = new kit_kat.AdobeColors.HSB();
     kit_kat.AdobeColors.HSB hsb2 = new kit_kat.AdobeColors.HSB();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ColorPicker));
     this.m_txt_Hex           = new System.Windows.Forms.TextBox();
     this.m_lbl_HexPound      = new System.Windows.Forms.Label();
     this.m_lbl_Primary_Color = new System.Windows.Forms.Label();
     this.panel1         = new System.Windows.Forms.Panel();
     this.controlBox1    = new kit_kat.ControlBox();
     this.AppTitle       = new kit_kat.CustomLabel();
     this.m_ctrl_BigBox  = new kit_kat.ctrl2DColorBox();
     this.m_ctrl_ThinBox = new kit_kat.ctrlVerticalColorSlider();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // m_txt_Hex
     //
     this.m_txt_Hex.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.m_txt_Hex.Location    = new System.Drawing.Point(307, 40);
     this.m_txt_Hex.Name        = "m_txt_Hex";
     this.m_txt_Hex.Size        = new System.Drawing.Size(55, 20);
     this.m_txt_Hex.TabIndex    = 19;
     this.m_txt_Hex.Leave      += new System.EventHandler(this.m_txt_Hex_Leave);
     //
     // m_lbl_HexPound
     //
     this.m_lbl_HexPound.Location = new System.Drawing.Point(290, 42);
     this.m_lbl_HexPound.Name     = "m_lbl_HexPound";
     this.m_lbl_HexPound.Size     = new System.Drawing.Size(19, 15);
     this.m_lbl_HexPound.TabIndex = 27;
     this.m_lbl_HexPound.Text     = "#";
     //
     // m_lbl_Primary_Color
     //
     this.m_lbl_Primary_Color.BackColor = System.Drawing.Color.White;
     this.m_lbl_Primary_Color.Location  = new System.Drawing.Point(288, 5);
     this.m_lbl_Primary_Color.Name      = "m_lbl_Primary_Color";
     this.m_lbl_Primary_Color.Size      = new System.Drawing.Size(74, 29);
     this.m_lbl_Primary_Color.TabIndex  = 36;
     //
     // panel1
     //
     this.panel1.Controls.Add(this.m_ctrl_BigBox);
     this.panel1.Controls.Add(this.m_lbl_Primary_Color);
     this.panel1.Controls.Add(this.m_ctrl_ThinBox);
     this.panel1.Controls.Add(this.m_txt_Hex);
     this.panel1.Controls.Add(this.m_lbl_HexPound);
     this.panel1.Location = new System.Drawing.Point(0, 29);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(367, 254);
     this.panel1.TabIndex = 40;
     //
     // controlBox1
     //
     this.controlBox1.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.controlBox1.Font     = new System.Drawing.Font("Verdana", 8F);
     this.controlBox1.Location = new System.Drawing.Point(299, 0);
     this.controlBox1.Name     = "controlBox1";
     this.controlBox1.Size     = new System.Drawing.Size(68, 29);
     this.controlBox1.TabIndex = 41;
     this.controlBox1.Text     = "controlBox1";
     //
     // AppTitle
     //
     this.AppTitle.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F);
     this.AppTitle.ForeColor = System.Drawing.Color.White;
     this.AppTitle.Location  = new System.Drawing.Point(0, 0);
     this.AppTitle.Name      = "AppTitle";
     this.AppTitle.Size      = new System.Drawing.Size(144, 29);
     this.AppTitle.TabIndex  = 42;
     this.AppTitle.Tag       = "Overide";
     this.AppTitle.Text      = "kit-kat - Color Picker";
     this.AppTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // m_ctrl_BigBox
     //
     this.m_ctrl_BigBox.BaseColorComponent = kit_kat.ColorComponent.Hue;
     hsb1.B = 1D;
     hsb1.H = 0D;
     hsb1.S = 1D;
     this.m_ctrl_BigBox.HSB               = hsb1;
     this.m_ctrl_BigBox.Location          = new System.Drawing.Point(-2, -2);
     this.m_ctrl_BigBox.Name              = "m_ctrl_BigBox";
     this.m_ctrl_BigBox.RGB               = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.m_ctrl_BigBox.Size              = new System.Drawing.Size(256, 256);
     this.m_ctrl_BigBox.TabIndex          = 39;
     this.m_ctrl_BigBox.WebSafeColorsOnly = false;
     this.m_ctrl_BigBox.SelectionChanged += new System.EventHandler(this.m_ctrl_BigBox_SelectionChanged);
     //
     // m_ctrl_ThinBox
     //
     this.m_ctrl_ThinBox.BackColor          = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(108)))), ((int)(((byte)(128)))));
     this.m_ctrl_ThinBox.BaseColorComponent = kit_kat.ColorComponent.Hue;
     hsb2.B = 1D;
     hsb2.H = 0D;
     hsb2.S = 1D;
     this.m_ctrl_ThinBox.HSB               = hsb2;
     this.m_ctrl_ThinBox.Location          = new System.Drawing.Point(244, -4);
     this.m_ctrl_ThinBox.Name              = "m_ctrl_ThinBox";
     this.m_ctrl_ThinBox.RGB               = System.Drawing.Color.Red;
     this.m_ctrl_ThinBox.Size              = new System.Drawing.Size(39, 262);
     this.m_ctrl_ThinBox.TabIndex          = 38;
     this.m_ctrl_ThinBox.WebSafeColorsOnly = false;
     this.m_ctrl_ThinBox.SelectionChanged += new System.EventHandler(this.m_ctrl_ThinBox_SelectionChanged);
     //
     // ColorPicker
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(118)))), ((int)(((byte)(138)))));
     this.ClientSize          = new System.Drawing.Size(367, 283);
     this.Controls.Add(this.controlBox1);
     this.Controls.Add(this.AppTitle);
     this.Controls.Add(this.panel1);
     this.Font            = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.Name            = "ColorPicker";
     this.SizeGripStyle   = System.Windows.Forms.SizeGripStyle.Hide;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text            = "kit-kat - Color Picker";
     this.FormClosed     += new System.Windows.Forms.FormClosedEventHandler(this.ColorPicker_FormClosed);
     this.MouseDown      += new System.Windows.Forms.MouseEventHandler(this.FormDrag);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.ResumeLayout(false);
 }
Пример #16
0
 public static void ShowFloatWindow(Control control, string caption, bool canResize, bool allowMaximize = false)
 {
     ControlBox.ShowFloatWindow(MainForm, control, caption, canResize, allowMaximize);
 }
Пример #17
0
 public static DialogResult ShowDialog(IWin32Window owner, Control control, string caption, MessageBoxButtons buttons, int defaultButton, bool canResize, bool needButtons)
 {
     return(ControlBox.Show(owner, control, caption, buttons, defaultButton, canResize, needButtons));
 }
Пример #18
0
        public ControlsOptionsWindow()
        {
            Size = new SlimDX.Vector2(500, 520);
            CreateTitle(Locale.Resource.Controls);
            keys.Clear();
            int i = 0;

            foreach (var v in typeof(PublicControlsSettings).GetProperties())
            {
                var a = Attribute.GetCustomAttributes(v, false);
                foreach (ControlsAttribute type in a)
                {
                    Label t;
                    AddChild(t = new Label
                    {
                        Anchor     = textBoxOrientation,
                        Background = null,
                        Position   = new SlimDX.Vector2(textBoxPositionX, textBoxPositionStartY * 1.25f + textBoxPositionOffset * i * 1.5f),
                        Size       = textBoxSize
                    });

                    switch (v.Name)
                    {
                    case "MeleeWeapon":
                        t.Text = Locale.Resource.ControlMelee;
                        break;

                    case "RangedWeapon":
                        t.Text = Locale.Resource.ControlRanged;
                        break;

                    case "MoveForward":
                        t.Text = Locale.Resource.ControlMoveForward;
                        break;

                    case "MoveBackward":
                        t.Text = Locale.Resource.ControlMoveBackward;
                        break;

                    case "StrafeLeft":
                        t.Text = Locale.Resource.ControlStrafeLeft;
                        break;

                    case "StrafeRight":
                        t.Text = Locale.Resource.ControlStrafeRight;
                        break;

                    case "Jump":
                        t.Text = Locale.Resource.ControlJump;
                        break;

                    default:
                        t.Text = v.Name;
                        break;
                    }

                    ControlBox c;
                    AddChild(c = new ControlBox(Util.KeyToString((System.Windows.Forms.Keys)v.GetValue(Program.ControlsSettings, null)))
                    {
                        Anchor     = dropBoxOrientation,
                        Position   = new SlimDX.Vector2(dropBoxPositionX, dropBoxPositionStartY + 7.5f + dropBoxPositionOffset * i * 1.5f),
                        TextAnchor = global::Graphics.Orientation.Center
                    });
                    c.OnChanging        += new EventHandler(t_OnChanging);
                    c.SwitchedToSameKey += new EventHandler(t_SwitchedToSameKey);
                    textBoxes.Add(c);
                    keys.Add(c.Key);
                    i++;
                }
            }
        }