Esempio n. 1
0
        public void RemoveLayout(PadLayout layout)
        {
            if (layouts.ContainsKey(layout.ID))
            {
                layouts.Remove(layout.ID);

                int pos = layoutOrder.IndexOf(layout.ID);
                layoutOrder.Remove(layout.ID);

                if (layouts.Count == 0)
                {
                    currentLayout = Guid.Empty;
                    defaultLayout = Guid.Empty;
                }
                else
                {
                    if (currentLayout == layout.ID)
                    {
                        currentLayout = layoutOrder[Math.Min(layouts.Count - 1, pos)];
                    }
                    if (defaultLayout == layout.ID)
                    {
                        currentLayout = layoutOrder[Math.Min(layouts.Count - 1, pos)];
                    }
                }
            }
        }
Esempio n. 2
0
        public PadLayout Duplicate(PadProfile profile = null)
        {
            PadLayout copy = new PadLayout();

            if (profile == null)
            {
                copy.Name = copy.Name + " Copy";
            }
            else
            {
            }
            copy.ID = Guid.NewGuid();
            return(copy);
        }
Esempio n. 3
0
 public void CopyFrom(PadLayout old)
 {
     Rows    = old.rows;
     Columns = old.Columns;
     Width   = old.Width;
     Height  = old.Height;
     Name    = old.name;
     buttons.Clear();
     ID = old.id;
     foreach (var b in old.Buttons)
     {
         buttons.Add(new ButtonDescription(b));
     }
     Color       = old.Color;
     WindowMatch = new ActiveWindowMatch(old.WindowMatch);
 }
Esempio n. 4
0
        public void AddLayout(PadLayout layout, int?index = null)
        {
            CheckLayouts();

            if (layouts.ContainsKey(layout.ID))
            {
                RemoveLayout(layout);
            }
            layouts[layout.ID] = layout;
            if (index == null)
            {
                layoutOrder.Add(layout.ID);
            }
            else
            {
                layoutOrder.Insert(index.Value, layout.ID);
            }
            FixLayoutPointers();
        }
Esempio n. 5
0
        public KeyDialog(PadLayout layout, PadProfile profile, ButtonDescription button, ButtonPreviewFunction preview)
        {
            this.layout  = layout;
            this.profile = profile;
            this.preview = preview;

            InitializeComponent();


            SetupFontWeightBox();
            SetupFontFamilyBox();

            Button = button;

            SetupVKeys();

            ActionTypeCombo.SelectedIndex = (int)Button.Action.ActionType;
            UpdateForActionType();
        }
Esempio n. 6
0
 public PadLayout(PadLayout old)
 {
     CopyFrom(old);
 }