Change Vaultbrowser theme in Inventor

Change Vaultbrowser theme in Inventor

christian_skare
Enthusiast Enthusiast
193 Views
3 Replies
Message 1 of 4

Change Vaultbrowser theme in Inventor

christian_skare
Enthusiast
Enthusiast

Hi,

Not sure if this is a Vault or Inventor coding issue, but I'm making an addin for Inventor that opens a VaultBrowser.

How can I recolor this control?

 

       ' Create the Vault Browser control
       vaultBrowser = New ThemedVaultBrowserControl()
       vaultBrowser.Dock = DockStyle.Fill

       AddHandler vaultBrowser.EntityDoubleClick, AddressOf VaultBrowser_EntityDoubleClick

       Me.Controls.Add(vaultBrowser)

       Dim themeName As String = Invapp.ThemeManager.ActiveTheme.Name
       If themeName = "DarkTheme" Then
           vaultBrowser.BackColor = Drawing.Color.FromArgb(59, 68, 83)
           vaultBrowser.ForeColor = Drawing.Color.White
       Else
           vaultBrowser.BackColor = Drawing.Color.FromArgb(245, 245, 245)
           vaultBrowser.ForeColor = Drawing.Color.Black
       End If

 

christian_skare_0-1745833365159.png

I'd really like the colors to match Inventors color theme,

0 Likes
Accepted solutions (1)
194 Views
3 Replies
Replies (3)
Message 2 of 4

Markus.Koechl
Autodesk
Autodesk
Accepted solution

There is a basic approach setting back- and foreground colors like this:

if (PlmDockableWindow == null)
	PlmDockableWindow =
		userInterfaceManager.DockableWindows.Add(clientId, Options.InternalName, Options.WindowTitle);
try
{
	UserControl = new InvAddIn.Forms.mDockWindowChild(app.ActiveColorScheme.Name.Replace("Theme", ""));

	DockableWindow.AddChild(UserControl.Handle.ToInt64());

	var backgroundColor = app.ThemeManager.GetComponentThemeColor("BrowserPane_BackgroundColor");
	var color = System.Drawing.Color.FromArgb(backgroundColor.Red, backgroundColor.Green,
		backgroundColor.Blue);
	UserControl.BackColor = color;

	UserControl.Show();
}

An individual license of the DevExpress libraries makes applying the full theme colors to any control easier. I recently published an Inventor Addin implementing an iLogic-Vault panel here. Having a license allows you to derive the full Vault theme to any control without coding.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 4

christian_skare
Enthusiast
Enthusiast

Thanks for the reply Markus.

 

The code doesnt seem to do anything sadly, so I'm afraid I need to live with it in light mode, unless someone spot a mistake or a workaround.

Its just mildly annoying, so it doesn't justify the lisence cost of the DevExpress.

    Private Sub InitVaultBrowser()
        vaultConn = GetConnection()
        If vaultConn Is Nothing Then Exit Sub

        browserControl = New ThemedVaultBrowserControl()
        browserControl.Dock = DockStyle.Fill

        navModel = New ViewVaultNavigationModel()

        Dim propDefs = vaultConn.PropertyManager.GetPropertyDefinitions(Nothing, Nothing, Vault.Currency.Properties.PropertyDefinitionFilter.IncludeAll)

        Dim browserConfig = New VaultBrowserControl.Configuration(vaultConn, "AttachmentsConfig", propDefs)
        browserConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.FileStatus)
        browserConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName)
        browserConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.Revision)
        browserConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment)
        browserConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate)
        browserConfig.AddInitialSortCriteria(Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate, True)

        browserControl.SetDataSource(browserConfig, navModel)

        Dim themeColor = Invapp.ThemeManager.GetComponentThemeColor("BrowserPane_BackgroundColor")
        Dim backgroundColor = Drawing.Color.FromArgb(themeColor.Red, themeColor.Green, themeColor.Blue)
        browserControl.BackColor = backgroundColor
        browserControl.Update()
    End Sub

 

0 Likes
Message 4 of 4

Markus.Koechl
Autodesk
Autodesk

It should work if you derive the colors not from the new browser (this is your target to re-color), rather than another Inventor default control. The Vault 2026 SDK HelloWorld sample shares the principle of reflecting the themes without using third-party libraries; it is possible.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes