示例#1
0
        public ConfigDrawerDialog(IModuleDrawer drawer, string helpTopic)
        {
            Dialog = Far.Api.CreateDialog(-1, -1, 77, 8);
            Dialog.HelpTopic = helpTopic;

            // Box
            Dialog.AddBox(3, 1, 0, 0, drawer.Name);
            int x = 14;

            // Mask
            Dialog.AddText(5, -1, 0, "&Mask");
            Mask = Dialog.AddEdit(x, 0, 71, drawer.Mask);

            // Priority
            Dialog.AddText(5, -1, 0, "&Priority");
            Priority = Dialog.AddEdit(x, 0, 71, string.Format(null, "{0}", drawer.Priority));

            Dialog.AddText(5, -1, 0, string.Empty).Separator = 1;

            IButton buttonOK = Dialog.AddButton(0, -1, "Ok");
            buttonOK.CenterGroup = true;

            IButton buttonCancel = Dialog.AddButton(0, 0, "Cancel");
            buttonCancel.CenterGroup = true;
        }
示例#2
0
        public ConfigDrawerDialog(IModuleDrawer drawer, string helpTopic)
        {
            Dialog           = Far.Api.CreateDialog(-1, -1, 77, 8);
            Dialog.HelpTopic = helpTopic;

            // Box
            Dialog.AddBox(3, 1, 0, 0, drawer.Name);
            int x = 14;

            // Mask
            Dialog.AddText(5, -1, 0, "&Mask");
            Mask = Dialog.AddEdit(x, 0, 71, drawer.Mask);

            // Priority
            Dialog.AddText(5, -1, 0, "&Priority");
            Priority = Dialog.AddEdit(x, 0, 71, string.Format(null, "{0}", drawer.Priority));

            Dialog.AddText(5, -1, 0, string.Empty).Separator = 1;

            IButton buttonOK = Dialog.AddButton(0, -1, "Ok");

            buttonOK.CenterGroup = true;

            IButton buttonCancel = Dialog.AddButton(0, 0, "Cancel");

            buttonCancel.CenterGroup = true;
        }
示例#3
0
        public static void Show(IList <IModuleDrawer> drawers, string helpTopic)
        {
            if (drawers == null)
            {
                return;
            }

            IMenu menu = Far.Api.CreateMenu();

            menu.AutoAssignHotkeys = true;
            menu.HelpTopic         = helpTopic;
            menu.Title             = Res.ModuleDrawers;

            foreach (IModuleDrawer it in drawers)
            {
                menu.Add(Utility.FormatConfigMenu(it)).Data = it;
            }

            while (menu.Show())
            {
                FarItem       mi     = menu.Items[menu.Selected];
                IModuleDrawer drawer = (IModuleDrawer)mi.Data;

                var dialog = new ConfigDrawerDialog(drawer, helpTopic);
                while (dialog.Dialog.Show())
                {
                    var mask = ConfigTool.ValidateMask(dialog.Mask.Text);
                    if (mask == null)
                    {
                        continue;
                    }

                    int    priority;
                    string priorityText = dialog.Priority.Text.Trim();
                    if (!int.TryParse(priorityText, out priority))
                    {
                        Far.Api.Message("Invalid Priority.");
                        continue;
                    }

                    // set
                    drawer.Mask     = mask;
                    drawer.Priority = priority;
                    drawer.Manager.SaveSettings();
                    break;
                }
            }
        }
示例#4
0
文件: Host.cs 项目: pezipink/FarNet
 public abstract void RegisterProxyDrawer(IModuleDrawer info);
示例#5
0
文件: Editor.cs 项目: pezipink/FarNet
 /// <summary>
 /// Adds the drawer to this editor.
 /// </summary>
 /// <param name="drawer">The drawer.</param>
 public abstract void AddDrawer(IModuleDrawer drawer);
示例#6
0
文件: Editor.cs 项目: MoonDav/FarNet
 /// <summary>
 /// Adds the drawer to this editor.
 /// </summary>
 /// <param name="drawer">The drawer.</param>
 public abstract void AddDrawer(IModuleDrawer drawer);
示例#7
0
 public abstract void RegisterProxyDrawer(IModuleDrawer info);