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)]; } } } }
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); }
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); }
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(); }
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(); }
public PadLayout(PadLayout old) { CopyFrom(old); }