Print Page | Close Window

Office 2013 Theme / Backstage View

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
Printed Date: 04 July 2020 at 6:31am

Topic: Office 2013 Theme / Backstage View
Posted By: Lodep59
Subject: Office 2013 Theme / Backstage View
Date Posted: 09 November 2016 at 1:30pm

I've just updated from V16.3 to lastest 17.3.
I've found a way (there's no sample for VB !) to set the Powerpoint Theme for Office 2013 to command bars with :

CommandBarsGlobalSettings.ResourceImages.LoadFromFile App.Path & "\ressources\styles\office2013.dll", "Office2013PowerPointGrayDark.ini"

But, I still have the blue theme in backstage view as you can see :
How can I change this ?
Also, how to remove the shadow on dialog windows when I call the EnableOffice2007FrameHandle method ?

Thanks for your help.

Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)

Posted By: Lodep59
Date Posted: 09 November 2016 at 3:41pm
Forget it, I didn't notice that I needed to recreate the Backstage View.
Now it's OK.
However... it's not very intuitive... Couldn't you just update the backstage view to the new theme ?

Do you plan to update the VB samples to explain your users how to use the office 2013 themes (powerpoint, excel...) ?

Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)

Posted By: olebed
Date Posted: 10 November 2016 at 4:58am

Yes, VB  RibbonSample is a little sophisticated. I have simplified it. SetBackstageTheme is renamed to UpdateBackstageTheme. Creation of Backstage moved to UpdateBackstageTheme. So now we need just call SetCommandbarsTheme to create Backstage (if it is not exist) and change its theme to current:
Public Sub SetStyle(Id As Long)
    Dim ControlFile As CommandBarPopup
    Set ControlFile = RibbonBar.SystemButton

    Select Case Id
            SetCommandbarsTheme xtpThemeOffice2013, App.Path & "\..\..\..\Styles\Office2013.dll", "Office2013White.ini"
            ControlFile.Style = xtpButtonCaption
            CreateBackstageView   'Deleted. This call is in SetCommandbarsTheme  -> UpdateBackstageTheme

End Sub

Public Sub SetCommandbarsTheme(paintTheme As XtremeCommandBars.XTPVisualTheme, hModule As String, lpszINI As String)
    If Not hModule = App.Path & "\..\..\..\Styles\Office2007.dll" Then
    End If
End Sub

Public Sub UpdateBackstageTheme()
    Dim nTheme As XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle
    Dim RibbonBar As RibbonBar
    Dim BackstageView As RibbonBackstageView

    Set RibbonBar = CommandBars.ActiveMenuBar
    If Not TypeOf RibbonBar.SystemButton.CommandBar Is RibbonBackstageView Then
    End If
    Set BackstageView = RibbonBar.SystemButton.CommandBar
    Select Case CommandBars.VisualTheme
        Case xtpThemeOffice2013
            nTheme = xtpAppearanceOffice2013
            BackstageView.SetTheme xtpThemeOffice2013
        Case xtpThemeVisualStudio2015
            nTheme = xtpAppearanceVisualStudio2015
            BackstageView.SetTheme xtpThemeVisualStudio2015
        Case Else
            nTheme = xtpAppearanceResource
            BackstageView.SetTheme xtpThemeRibbon
    End Select
    If Not (pageBackstageInfo Is Nothing) Then
        pageBackstageInfo.SetAppearance nTheme, CommandBars
        pageBackstageInfo.SetColorsFromBackstageView BackstageView
    End If
    If Not (pageBackstageHelp Is Nothing) Then
        pageBackstageHelp.SetAppearance nTheme, CommandBars
        pageBackstageHelp.SetColorsFromBackstageView BackstageView
    End If
    If Not (pageBackstageSend Is Nothing) Then
        pageBackstageSend.SetAppearance nTheme, CommandBars
        pageBackstageSend.SetColorsFromBackstageView BackstageView
    End If
    If Not (pageBackstageRecent Is Nothing) Then
        pageBackstageRecent.SetAppearance nTheme
        pageBackstageRecent.SetColorsFromBackstageView BackstageView
    End If
    If Not (pageBackstagePrint Is Nothing) Then
        pageBackstagePrint.SetAppearance nTheme, CommandBars
        pageBackstagePrint.SetColorsFromBackstageView BackstageView
    End If
End Sub

Sub CreateBackstageView()
    Dim RibbonBar As RibbonBar
    Set RibbonBar = CommandBars.ActiveMenuBar
    Dim BackstageView As RibbonBackstageView
    Set BackstageView = CommandBars.CreateCommandBar("CXTPRibbonBackstageView")
    Set RibbonBar.AddSystemButton.CommandBar = BackstageView
    BackstageView.AddCommand ID_FILE_SAVE, "Save"
    BackstageView.AddCommand ID_FILE_SAVE_AS, "Save As"
    BackstageView.AddCommand ID_FILE_OPEN, "Open"
    BackstageView.AddCommand ID_FILE_CLOSE, "Close"
    If (pageBackstageInfo Is Nothing) Then Set pageBackstageInfo = New pageBackstageInfo
    If (pageBackstageSend Is Nothing) Then Set pageBackstageSend = New pageBackstageSend
    If (pageBackstageRecent Is Nothing) Then
        Set pageBackstageRecent = New pageBackstageRecent
        Set pageBackstageRecent.RecentFileList = CommandBars.RecentFileList
    End If
    If (pageBackstageHelp Is Nothing) Then Set pageBackstageHelp = New pageBackstageHelp
    If (pageBackstagePrint Is Nothing) Then Set pageBackstagePrint = New pageBackstagePrint
    Dim ControlInfo As RibbonBackstageTab
    Set ControlInfo = BackstageView.AddTab(1000, "Info", pageBackstageInfo.hwnd)
    BackstageView.AddTab ID_BACKSTAGETAB_RECENT, "Recent", pageBackstageRecent.hwnd
    BackstageView.AddTab ID_BACKSTAGETAB_PRINT, "Print", pageBackstagePrint.hwnd
    BackstageView.AddTab 1002, "Save && Send", pageBackstageSend.hwnd
    BackstageView.AddTab 1001, "Help", pageBackstageHelp.hwnd
    BackstageView.AddCommand ID_FILE_OPTIONS, "Options"
    BackstageView.AddCommand ID_APP_EXIT, "Exit"
    ControlInfo.DefaultItem = True
    CommandBars.Icons.LoadBitmap App.Path & "\res\BackstageIcons.png", _

End Sub

Private Sub CreateRibbonBar()
    UpdateBackstageTheme  'instead of CreateBackstageView
End Sub

Also I will add Office2013 subthemes to this sample.

 Oleksandr Lebed

Print Page | Close Window