private void MenuItemAddGroupClick(object sender, EventArgs e)
        {
            // добавить группу кнопок
            DialogResult rst;
            var          groupName = Dialogs.ShowInputDialog(Localizer.GetString("TitleGroupName"), "", out rst);

            if (rst != DialogResult.OK || string.IsNullOrEmpty(groupName))
            {
                return;
            }
            var dlg = new SelectPictureForm(lstIcons);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (dlg.ImageIndex < 0)
            {
                return;
            }

            // добавить в дерево
            var group = new ToolButtonGroup {
                ImageIndex = dlg.ImageIndex, Title = groupName, ButtonType = buttonType
            };
            var nodeGroup = new TreeNode(string.Format("[{0}]", group.Title),
                                         group.ImageIndex, group.ImageIndex)
            {
                Tag = group
            };

            treeButtons.Nodes.Add(nodeGroup);
        }
        private void BtnPictureClick(object sender, EventArgs e)
        {
            var dlg = new SelectPictureForm(lstIcons);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            btnPicture.ImageIndex = dlg.ImageIndex;

            /*var item = treeButtons.SelectedNode;
             * if (item == null)
             *  return;
             * var group = item.Tag as ToolButtonGroup;
             * if (group != null)
             * {
             *  group.ImageIndex = btnPicture.ImageIndex;
             *  item.ImageIndex = btnPicture.ImageIndex;
             *  item.SelectedImageIndex = btnPicture.ImageIndex;
             *  return;
             * }
             * var btnSets = item.Tag as ChartToolButtonSettings;
             * if (btnSets == null)
             *  return;
             * btnSets.Image = btnPicture.ImageIndex;
             * item.ImageIndex = btnPicture.ImageIndex;
             * item.SelectedImageIndex = btnPicture.ImageIndex;*/
        }
Esempio n. 3
0
        private void BtnImageClick(object sender, EventArgs e)
        {
            var dlg = new SelectPictureForm(lstIcons);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            btnImage.ImageIndex = dlg.ImageIndex;
        }