private void MenuItemClickHandler(object sender, EventArgs e)
        {
            ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;

            portToolStripMenuItem.Text += " (" + clickedItem.ToString() + ")";
            //((ToolStripMenuItem)portToolStripMenuItem.DropDownItems[i]).Checked = true;
            //portToolStripMenuItem. += clickedItem;
            label5.Text = clickedItem.ToString();
            //i++;
            // Take some action based on the data in clickedItem
        }
Esempio n. 2
0
        private void MenuItemOnClick(object sender, EventArgs e)
        {
            // Referenciamos el control que ha desencadenado el evento
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            switch (item.ToString())
            {
            case "Alumnos":
                manEstudiante           = FrmMantenimientoEstudiante.getInstance();
                manEstudiante.MdiParent = this;
                manEstudiante.Show();
                break;

            case "Usuario":
                manUsuario           = FrmMantenimientoUsuario.getInstance();
                manUsuario.MdiParent = this;
                manUsuario.Show();
                break;

            case "Familia":
                manFamilia           = FrmMantenimientoFamilia.getInstance();
                manFamilia.MdiParent = this;
                manFamilia.Show();
                break;

            default:
                return;
            }
        }
        private void themeToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.Checked)
            {
                if (this.themeToolStripMenuItem1 != item)
                {
                    this.themeToolStripMenuItem1.Checked = false;
                }
                if (this.themeToolStripMenuItem2 != item)
                {
                    this.themeToolStripMenuItem2.Checked = false;
                }
                if (this.themeToolStripMenuItem3 != item)
                {
                    this.themeToolStripMenuItem3.Checked = false;
                }
                if (this.themeToolStripMenuItem4 != item)
                {
                    this.themeToolStripMenuItem4.Checked = false;
                }
                if (this.themeToolStripMenuItem5 != item)
                {
                    this.themeToolStripMenuItem5.Checked = false;
                }
                this.txtNfoArea.BackColor = item.BackColor;
                this.txtNfoArea.ForeColor = item.ForeColor;
                this.panel1.BackColor     = item.BackColor;
                item.Checked = true;
                Settings.Default.NFOTheme = item.ToString();
            }
        }
Esempio n. 4
0
        private void add_menu_items_textB(ToolStripMenuItem Parent, ToolStripMenuItem ChildItem)
        {
            Parent.DropDownItems.Add(ChildItem);
            ToolStripMenuItem item = new ToolStripMenuItem(ChildItem.Text + " Apply");
            ToolStripTextBox  box  = new ToolStripTextBox
            {
                BackColor = SystemColors.ScrollBar
            };
            ToolStripMenuItem item2 = new ToolStripMenuItem(ChildItem.Text + " Reset");

            if (start_values)
            {
                try
                {
                    box.Text = getValue(textB_values[ChildItem.ToString()].poke_offset, textB_values[ChildItem.ToString()].poke_type);
                }
                catch
                {
                }
            }
            ChildItem.DropDownItems.Add(item);
            ChildItem.DropDownItems.Add(box);
            ChildItem.DropDownItems.Add(item2);
            item.Click  += new EventHandler(MenuItemText_Click);
            item2.Click += new EventHandler(MenuItemText_Click);
        }
Esempio n. 5
0
        private void mnuPlaylistsAddSelectedTracksTo_DropDownOpening(object sender, EventArgs e)
        {
            List <string> playlists = Database.GetPlaylists().FindAll(s => !Database.IsPlaylistDynamic(s));

            mnuPlaylistsAddSelectedTracksTo.DropDownItems.Clear();
            foreach (string s in playlists)
            {
                ToolStripMenuItem tsi = (ToolStripMenuItem)mnuPlaylistsAddSelectedTracksTo.DropDownItems.Add(s);

                tsi.Click += (s1, e1) =>
                {
                    controller.AddToPlaylist(tsi.ToString(), normal.SelectedTracks);
                    controller.TargetPlaylistName = tsi.ToString();
                    controller.RequestAction(QActionType.RefreshAll);
                };
            }
        }
        private void pxToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.Checked)
            {
                if (this.pxToolStripMenuItem7 != item)
                {
                    this.pxToolStripMenuItem7.Checked = false;
                }
                if (this.pxToolStripMenuItem8 != item)
                {
                    this.pxToolStripMenuItem8.Checked = false;
                }
                if (this.pxToolStripMenuItem9 != item)
                {
                    this.pxToolStripMenuItem9.Checked = false;
                }
                if (this.pxToolStripMenuItem10 != item)
                {
                    this.pxToolStripMenuItem10.Checked = false;
                }
                item.Checked = true;
                string str = item.ToString();
                if (str != null)
                {
                    if (str == "7px")
                    {
                        this.txtNfoArea.Font = new Font("Lucida Console", 7f, FontStyle.Regular, GraphicsUnit.Point, 0);
                    }
                    else if (str == "8px")
                    {
                        this.txtNfoArea.Font = new Font("Lucida Console", 8f, FontStyle.Regular, GraphicsUnit.Point, 0);
                    }
                    else if (str == "9px")
                    {
                        this.txtNfoArea.Font = new Font("Lucida Console", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
                    }
                    else if (str == "10px")
                    {
                        this.txtNfoArea.Font = new Font("Lucida Console", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
                    }
                }
                Settings.Default.NFOSize = item.ToString();
            }
        }
Esempio n. 7
0
 private void add_menu_item(ToolStripMenuItem Parent, ToolStripMenuItem ChildItem)
 {
     if (ChildItem.ToString() == "DebugCam")
     {
         ChildItem.ShortcutKeys = Keys.F2;
     }
     if (ChildItem.ToString() == "Disable Intro")
     {
         ChildItem.ShortcutKeys = Keys.F3;
     }
     if (ChildItem.ToString() == "Disable RSA Checks")
     {
         ChildItem.ShortcutKeys = Keys.F4;
     }
     Parent.DropDownItems.Add(ChildItem);
     ChildItem.Click += new EventHandler(MenuItem_Click);
 }
Esempio n. 8
0
File: Main.cs Progetto: iraphic/TAS
        private void methodeCelect(object sender, EventArgs e)
        {
            houghCircleToolStripMenuItem.Checked = false;
            ToolStripMenuItem menu = (ToolStripMenuItem)sender;

            menu.Checked   = true;
            method         = menu.ToString();
            groupBox3.Text = method;
            groupBox7.Text = " Parameter " + method;
        }
Esempio n. 9
0
        private void MenuItemOnClick(object sender, EventArgs e)
        {
            // Referenciamos el control que ha desencadenado el evento
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.ToString() == "Departamentos")
            {
                toolStripButton1.PerformClick();
            }
            else if (item.ToString() == "Compañías / Fabricantes")
            {
                toolStripButton3.PerformClick();
            }
            else if (item.ToString() == "Empleados")
            {
                toolStripButton5.PerformClick();
            }
            else if (item.ToString() == "Productos")
            {
                toolStripButton4.PerformClick();
            }
            else if (item.ToString() == "Orden de Compra")
            {
                toolStripButton6.PerformClick();
            }
            else if (item.ToString() == "Salir")
            {
                Close();
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Handles when an item in the themes menu is clicked.
        /// Functions like a radio button (only one can be checked),
        /// then applies the selected theme to the application.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void themeMenuItemClicked(object sender, EventArgs e)
        {
            ToolStripMenuItem selectedItem = ((ToolStripMenuItem)sender);

            foreach (ToolStripMenuItem menuItem in themeToolStripMenuItem.DropDownItems)
            {
                if (menuItem.ToString() != selectedItem.ToString())
                {
                    menuItem.Checked = false;
                }
                selectedItem.Checked = true;
                this.loadedTheme     = this.themes.First(x => x.name == selectedItem.Text);
                themeAllForms(this.loadedTheme);
            }
        }
Esempio n. 11
0
File: Main.cs Progetto: iraphic/TAS
        private void resolutionSelect(object sender, EventArgs e)
        {
            x256Res.Checked  = false;
            x480Res.Checked  = false;
            x780Res.Checked  = false;
            x912Res.Checked  = false;
            x1200Res.Checked = false;

            ToolStripMenuItem menu = (ToolStripMenuItem)sender;

            menu.Checked = true;
            string[] res = menu.ToString().Split('x');
            width  = Convert.ToDouble(res[0]);
            height = Convert.ToDouble(res[1]);
        }
Esempio n. 12
0
        private string GetMenuFullName(ToolStripMenuItem menu)
        {
            if (menu == null)
            {
                return(String.Empty);
            }

            string        menuFullName = menu.ToString();
            ToolStripItem parentMenu   = menu.OwnerItem;

            while (parentMenu != null)
            {
                menuFullName = parentMenu.ToString() + "_" + menuFullName;
                parentMenu   = parentMenu.OwnerItem;
            }
            return(menuFullName);
        }
        private void toolStripDropDownButtonAlignToStrength_MenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = sender as ToolStripMenuItem;

            if (item != null && !item.Checked)
            {
                foreach (ToolStripMenuItem subItem in item.Owner.Items)
                {
                    if (!item.Equals(subItem) && subItem != null)
                    {
                        subItem.Checked = false;
                    }
                }
                item.Checked      = true;
                AlignTo_Threshold = item.ToString();
            }
        }
Esempio n. 14
0
        private void MenuStrip1_ItemClicked(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            switch (item.ToString())
            {
            case "&Opciones":
                SettingsForm SettFrm = new SettingsForm();
                SettFrm.ShowDialog();
                break;

            case "&Salir":
                Dispose();
                break;

            default:
                break;
            }
        }
Esempio n. 15
0
        void subItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.Tag != System.DBNull.Value)
            {
                string   loadForm   = item.Tag.ToString();
                object[] parameters = new object[1];
                parameters[0] = item.ToString() + "-" + UserName;
                //             parameters[1] = this.UserName;
                Form f = (Form)Assembly.Load("UI").CreateInstance("UI." + loadForm, true, System.Reflection.BindingFlags.Default, null, parameters, null, null);
                this.IsMdiContainer = true;
                f.MdiParent         = this;
                f.StartPosition     = FormStartPosition.CenterScreen;
                f.Show();
            }
            //菜单项里面的“退出”操作
            if (item.Text == "【退出】")
            {
                this.Close();
            }
        }
Esempio n. 16
0
        //Right Click Menu Event
        void t_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem t = sender as ToolStripMenuItem;

            if (t == null)
            {
                return;
            }

            MultipleCell mc = null;

            // currently this only works for one multiple cell
            // need to refactor to include multiple multiple cells
            for (int i = 0; i < ViewData.ColumnHeaders().Count; i++)
            {
                if (ViewData.GetCellType(0, i) == CellType.Multiple)
                {
                    mc = ViewData.GetCell(0, i) as MultipleCell;
                    break;
                }
            }

            // make sure we have the multiple cell selected
            if (mc == null)
            {
                return;
            }

            int rowIndex = NewBalanceDataGridView.CurrentCell.RowIndex;

            mc = ViewData.GetCell(rowIndex, mc.ColumnIndex) as MultipleCell;
            if (mc == null)
            {
                return;
            }
            mc.ChangeOption(t.ToString());
        }
Esempio n. 17
0
        private void MenuItemOnClick(object sender, EventArgs e)
        {
            // Referenciamos el control que ha desencadenado el evento
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item.ToString() == "Clientes")
            {
                FrmClientes llamar = null;

                llamar           = FrmClientes.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Proveedores")
            {
                FrmProveedores llamar = null;

                llamar           = FrmProveedores.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Usuario")
            {
                FrmUsuario llamar = null;

                llamar           = FrmUsuario.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Reportes Clientes")
            {
                FrmReporteCliente rep = new FrmReporteCliente();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Reportes de Ventas")
            {
                FrmReporteFactura rep = new FrmReporteFactura();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Reportes Productos")
            {
                FrmReporteProducto rep = new FrmReporteProducto();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Reportes Usuario")
            {
                FrmReporteUsuario rep = new FrmReporteUsuario();
                rep.ShowDialog();
            }
            else if (item.ToString() == "Productos")
            {
                FrmProductos llamar = null;

                llamar           = FrmProductos.Instance();
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Facturar")
            {
                FrmFacturar llamar = null;
                string      u      = toolStripStatusLabel1.Text;
                llamar           = FrmFacturar.Instance();
                llamar           = new FrmFacturar(u);
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Inventario ")
            {
                FrmInventario llamar = null;

                llamar           = FrmInventario.Instance();
                llamar           = new FrmInventario(usu);
                llamar.MdiParent = this;
                llamar.Show();
            }
            else if (item.ToString() == "Ayuda")
            {
                BtnAyuda.PerformClick();
            }
            else if (item.ToString() == "Salir")
            {
                toolStripButton4.PerformClick();
            }
        }