GroupTabPositionDialog
Per-group tab position editor -- one dropdown per group for TabStripPosition (Top/Bottom/Left/Right/Hidden), returns only changed positions for clean DesignerTransaction
Table of Contents
Overview
Namespace: TheTechIdea.Beep.Winform.Controls.Design.Server.Dialogs
Inheritance: System.Windows.Forms.Form | Visibility: internal sealed
GroupTabPositionDialog(BeepDocumentHost host) builds a dialog with one dropdown per group, allowing the developer to set TabStripPosition (Top, Bottom, Left, Right, Hidden) independently for each split group. The dialog dynamically sizes based on the group count. On OK, CollectChanges(host) iterates all groups and populates ChangedPositions only with positions that differ from the current value, enabling the caller to apply them inside a single DesignerTransaction for clean undo.
Dialog Details
Features:
- One combo box per group in the host's Groups collection
- Each combo shows TabStripPosition options: Top, Bottom, Left, Right, Hidden
- Dynamic layout sizing -- dialog height adjusts to group count
- OK/Cancel buttons with proper keyboard support
ChangedPositions Property
Dictionary<string, TabStripPosition> ChangedPositions { get; } -- keyed by GroupId, populated at OK time with only the entries that differ from the current value. An empty dictionary means no changes were made. The caller wraps the application in a DesignerTransaction:
var dialog = new GroupTabPositionDialog(host);
if (dialog.ShowDialog() == DialogResult.OK)
{
using (var tx = DesignerHost.CreateTransaction("Set tab positions"))
{
foreach (var kvp in dialog.ChangedPositions)
host.Groups[kvp.Key].TabPosition = kvp.Value;
tx.Commit();
}
}Examples
// Open from BeepDocumentHostDesigner verb:
// Right-click host > "Set Group Tab Position..."
// (Only available when Groups.Count > 1)
// Dialog shows:
// Group "main": [Top v]
// Group "left": [Left v]
// Group "bottom":[Bottom v]
// OK Cancel