Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Office 2013 Theme / Backstage View
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Office 2013 Theme / Backstage View

 Post Reply Post Reply
Author
Message
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Topic: Office 2013 Theme / Backstage View
    Posted: 09 November 2016 at 1:30pm
Hello,

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)
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2016 at 4:58am
Hello,

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)
    ID_THEME_CURRENT = Id
    
    Dim ControlFile As CommandBarPopup
    Set ControlFile = RibbonBar.SystemButton

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

            CommandBars.PaintManager.RefreshMetrics
            CommandBars.RecalcLayout
            picClient.Refresh
    .....
End Sub

Public Sub SetCommandbarsTheme(paintTheme As XtremeCommandBars.XTPVisualTheme, hModule As String, lpszINI As String)
    .....
    .....
    If Not hModule = App.Path & "\..\..\..\Styles\Office2007.dll" Then
        UpdateBackstageTheme
    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
        CreateBackstageView
    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", _
        Array(ID_FILE_SAVE, ID_FILE_SAVE_AS, ID_FILE_OPEN, ID_FILE_CLOSE, ID_FILE_OPTIONS, ID_APP_EXIT), xtpImageNormal

End Sub

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

Also I will add Office2013 subthemes to this sample.

Regards,
 Oleksandr Lebed
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.