Skip to content

Commit

Permalink
Merge pull request #28 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 0.5.3
  • Loading branch information
ricaun authored Aug 19, 2023
2 parents 3ded467 + 9bd600e commit a285ead
Show file tree
Hide file tree
Showing 19 changed files with 722 additions and 45 deletions.
7 changes: 5 additions & 2 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
Expand Down Expand Up @@ -54,6 +54,9 @@
"MainName": {
"type": "string"
},
"MiddleVersions": {
"type": "boolean"
},
"NewVersions": {
"type": "boolean"
},
Expand Down Expand Up @@ -179,4 +182,4 @@
}
}
}
}
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.5.3] / 2023-07-13
## Updated
- Update Image/LargeImage extension code.
- Update `UpdateRibbonDescription` Image code.
### UI
- Add `RibbonDialogLauncherExtension`
### Tests
- Add `RevitDialogLauncherTests`
- Add `RevitStackedItemsTests` for `RowStackedItems` and `FlowStackedItems`
- Add `RevitCreateItemsExtensionTests`
- Add `RevitNewItemsExtensionTests`
- Add `RevitCreateItemsImageTests`
- Add `RevitNewItemsImageTests`

## [0.5.2] / 2023-04-17
### UI
- Update `NewPushButtonData` the default `Text` equals to `targetName`.
Expand Down Expand Up @@ -241,6 +255,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[0.5.3]: ../../compare/0.5.2...0.5.3
[0.5.2]: ../../compare/0.5.1...0.5.2
[0.5.1]: ../../compare/0.5.0...0.5.1
[0.5.0]: ../../compare/0.4.0...0.5.0
[0.4.0]: ../../compare/0.3.2...0.4.0
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,35 @@ LanguageType languageType = LanguageExtension.GetLanguageType();
// LanguageExtension.IsBrazilianPortuguese;
```

### Ribbon Stacked Extension
Create `Autodesk.Windows.RibbonFlowPanel` and `Autodesk.Windows.RibbonRowPanel` using `Autodesk.Revit.UI.RibbonItem` array.
```C#
Autodesk.Revit.UI.RibbonItem[] ribbonItems;
Autodesk.Windows.RibbonFlowPanel awRibbonFlowPanel = ribbonPanel.FlowStackedItems(ribbonItems);
```
```C#
Autodesk.Revit.UI.RibbonItem[] ribbonItems;
Autodesk.Windows.RibbonRowPanel[] awRibbonRowPanels = ribbonPanel.RowStackedItems(ribbonItems);
```

### Ribbon DialogLauncher Extension
Create `DialogLauncher` in a `Autodesk.Revit.UI.RibbonPanel` using `Autodesk.Revit.UI.PushButton`.
```C#
Autodesk.Revit.UI.PushButton pushButton;
ribbonPanel.SetDialogLauncher(pushButton);
```

```C#
Autodesk.Windows.RibbonPanel awRibbonPanel;
Autodesk.Windows.RibbonCommandItem ribbonCommandItem = awRibbonPanel.GetDialogLauncher();
```

```C#
Autodesk.Windows.RibbonCommandItem ribbonCommandItem;
Autodesk.Windows.RibbonPanel awRibbonPanel;
awRibbonPanel.SetDialogLauncher(ribbonCommandItem);
```

### Ribbon Description Extension
... Todo

Expand Down
17 changes: 17 additions & 0 deletions ricaun.Revit.UI.Example/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,42 +185,59 @@ public Result OnStartup(UIControlledApplication application)
ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Power)
.SetText("Power")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Data)
.SetText("Data")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Communication)
.SetText("Communication")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Alarm)
.SetText("Alarm")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Nurce)
.SetText("Nurce")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Security)
.SetText("Security")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

ribbonPanel.CreatePushButton<Commands.Command<Point>>()
.SetLargeImage(Pack.Telephone)
.SetText("Telephone")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

var sw = ribbonPanel.CreatePushButton<Commands.Command<Point>, Commands.Availability.AvailableOnAnyDocument>()
.SetLargeImage(Pack.Switch)
.SetText("Switch")
.SetToolTip("ToolTip")
.SetLongDescription("LongDescription")
.AddQuickAccessToolBar();

#endregion

OrderPanelAndMove(ribbonPanel);
Expand Down
2 changes: 1 addition & 1 deletion ricaun.Revit.UI.Example/Revit/AppStacked.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace ricaun.Revit.UI.Example.Revit
{
[AppLoader]
//[AppLoader]
public class AppStacked : IExternalApplication
{
private static RibbonPanel ribbonPanel;
Expand Down
2 changes: 1 addition & 1 deletion ricaun.Revit.UI.Example/ricaun.Revit.UI.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<PropertyGroup>
<PackageId>ricaun.Revit.UI.Example</PackageId>
<Version>1.5.2</Version>
<Version>1.5.3</Version>
<ProjectGuid>{f736f68f-7101-4640-9093-8715f88ccb95}</ProjectGuid>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using NUnit.Framework;

namespace ricaun.Revit.UI.Tests.Items.Extensions
{
public class RevitCreateItemsExtensionTests : BaseCreatePanelTests
{
PushButton pushButton;

[SetUp]
public void CreatePushButton()
{
pushButton = ribbonPanel.CreatePushButton<BaseCommand>();
}

[TestCase("Test")]
[TestCase("Button")]
[TestCase("Name")]
public void SetText_Should_Be(string text)
{
pushButton.SetText(text);
Assert.AreEqual(text, pushButton.ItemText);
}

[Test]
public void SetText_Should_HiddenText()
{
pushButton.SetText();
Assert.IsFalse(pushButton.GetRibbonItem().ShowText);
}

[Test]
public void SetShowText_Should_HiddenText()
{
pushButton.SetShowText();
Assert.IsFalse(pushButton.GetRibbonItem().ShowText);

pushButton.SetShowText(true);
Assert.IsTrue(pushButton.GetRibbonItem().ShowText);
}

[Test]
public void SetShowImage_Should_HiddenImage()
{
pushButton.SetShowImage();
Assert.IsFalse(pushButton.GetRibbonItem().ShowImage);

pushButton.SetShowImage(true);
Assert.IsTrue(pushButton.GetRibbonItem().ShowImage);
}

[TestCase(" ")]
[TestCase("Tool")]
[TestCase("ToolTip")]
public void SetToolTip_Should_Be(string toolTip)
{
pushButton.SetToolTip(toolTip);
Assert.AreEqual(toolTip, pushButton.ToolTip);
}

[TestCase(" ")]
[TestCase("Description")]
[TestCase("LongDescription")]
public void SetLongDescription_Should_Be(string description)
{
pushButton.SetLongDescription(description);
Assert.AreEqual(description, pushButton.LongDescription);
}

[TestCase("https://www.autodesk.com/")]
[TestCase("help/file.txt")]
public void SetContextualHelp_Should_Be(string helpPath)
{
pushButton.SetContextualHelp(helpPath);
Assert.IsNotNull(pushButton.GetContextualHelp());
}
}
}
Loading

0 comments on commit a285ead

Please sign in to comment.