Skip to content

Commit c2b09d0

Browse files
committed
Support AddSlideOut and DialogLauncher
1 parent 5b912cb commit c2b09d0

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.4.0] / 2025-07-18
8+
### Features
9+
- Support `AddSlideOut` extension.
10+
- Support `SetDialogLauncher` and `GetDialogLauncher` extensions.
11+
### UI
12+
- Update `RibbonExtension` to support `AddSlideOut`.
13+
- Update `RibbonExtension` to support `SetDialogLauncher` and `GetDialogLauncher`.
14+
715
## [0.3.0] / 2025-07-15
816
### Features
917
- Support `CreateSplitButton` extension.
@@ -46,6 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4654
- Add `Busy`, `Runtime`, `Tasks`, and `Windows` utilities.
4755

4856
[vNext]: ../../compare/1.0.0...HEAD
57+
[0.4.0]: ../../compare/0.3.0...0.4.0
4958
[0.3.0]: ../../compare/0.2.0...0.3.0
5059
[0.2.0]: ../../compare/0.1.0...0.2.0
5160
[0.1.0]: ../../compare/0.1.0

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.3.0</Version>
3+
<Version>0.4.0-alpha</Version>
44
</PropertyGroup>
55
</Project>

ricaun.AutoCAD.UI.Example/App.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ await autoCADTask.Run(() =>
116116
.SetLargeImage("Resources/Cube-Green-Light.tiff")
117117
.SetDescription("This is a PulldownButton");
118118

119+
ribbonPanel.AddSlideOut();
120+
ribbonPanel.RowStackedItems(
121+
ribbonPanel.CreateButton("1")
122+
.SetLargeImage("Resources/Cube-Grey-Light.tiff"),
123+
ribbonPanel.CreateButton("2")
124+
.SetLargeImage("Resources/Cube-Grey-Light.tiff"),
125+
ribbonPanel.CreateButton("3")
126+
.SetLargeImage("Resources/Cube-Grey-Light.tiff")
127+
);
128+
129+
ribbonPanel.SetDialogLauncher(ribbonPanel.CreateButton("DialogLauncher").SetCommand(e => Windows.MessageBox.ShowMessage(e.Text)));
130+
119131
ribbonControl.ActiveTab = ribbonPanel.Tab;
120132
}
121133
public override void OnShutdown(RibbonControl ribbonControl)

ricaun.AutoCAD.UI/RibbonExtension.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,45 @@ public static RibbonPanel AddSeparator(this RibbonPanel ribbonPanel)
522522
return ribbonPanel;
523523
}
524524

525+
/// <summary>
526+
/// Adds a slide-out (panel break) to the ribbon panel.
527+
/// </summary>
528+
/// <param name="ribbonPanel">The ribbon panel to extend.</param>
529+
/// <returns>The ribbon panel with the slide-out added.</returns>
530+
public static RibbonPanel AddSlideOut(this RibbonPanel ribbonPanel)
531+
{
532+
if (ribbonPanel is null) return ribbonPanel;
533+
ribbonPanel.AddItem(new RibbonPanelBreak());
534+
return ribbonPanel;
535+
}
536+
537+
/// <summary>
538+
/// Sets the dialog launcher for the specified <see cref="RibbonPanel"/>.
539+
/// </summary>
540+
/// <param name="ribbonPanel">The ribbon panel to set the dialog launcher for.</param>
541+
/// <param name="ribbonItem">The <see cref="RibbonCommandItem"/> to use as the dialog launcher.</param>
542+
/// <returns>The <see cref="RibbonPanel"/> with the dialog launcher set.</returns>
543+
public static RibbonPanel SetDialogLauncher(this RibbonPanel ribbonPanel, RibbonCommandItem ribbonItem)
544+
{
545+
if (ribbonPanel is null) return ribbonPanel;
546+
ribbonPanel.Source.DialogLauncher = ribbonItem;
547+
ribbonPanel.Remove(ribbonItem);
548+
return ribbonPanel;
549+
}
550+
551+
/// <summary>
552+
/// Gets the dialog launcher <see cref="RibbonCommandItem"/> for the specified <see cref="RibbonPanel"/>.
553+
/// </summary>
554+
/// <param name="ribbonPanel">The ribbon panel to retrieve the dialog launcher from.</param>
555+
/// <returns>
556+
/// The <see cref="RibbonCommandItem"/> set as the dialog launcher for the panel, or <c>null</c> if the panel is <c>null</c>.
557+
/// </returns>
558+
public static RibbonCommandItem GetDialogLauncher(this RibbonPanel ribbonPanel)
559+
{
560+
if (ribbonPanel is null) return null;
561+
return ribbonPanel.Source.DialogLauncher;
562+
}
563+
525564
#region RibbonListButton
526565

527566
/// <summary>

0 commit comments

Comments
 (0)