Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - CommandBars.Actions don't work with Ribbon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBars.Actions don't work with Ribbon

 Post Reply Post Reply
Author
Message
dimdar View Drop Down
Groupie
Groupie
Avatar

Joined: 11 July 2007
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimdar Quote  Post ReplyReply Direct Link To This Post Topic: CommandBars.Actions don't work with Ribbon
    Posted: 12 July 2010 at 5:26am
Hi,
 
I have this problem with Actions and Ribbon see below:
 
    CommandBars.DeleteAll
   
    CommandBars.Options.SetIconSize True, 24, 24
    CommandBars.Options.SetPopupIconSize 24, 24
    CommandBars.Options.LargeIcons = True
    CommandBars.Options.ShowExpandButtonAlways = False
       
    ' Action
    CommandBars.EnableActions    
    CommandBars.Actions.Add 555, "555", "", "", "File" 'Action ID is 555
    
    Dim RibbonBar As RibbonBar
    Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
    RibbonBar.EnableDocking xtpFlagStretched
    
    Dim ControlFile As CommandBarPopup
    Dim PopupBar As CommandBar
   
    Set ControlFile = RibbonBar.AddSystemButton()
    ControlFile.IconId = tid_System_Icon
    ControlFile.Caption = "&File"
    
    With ControlFile.CommandBar
        .Controls.Add xtpControlButton, 444, "Button1"
        .Controls.Add xtpControlButton, 555, ""
       
        Dim ControlPrint As CommandBarPopup
        Set ControlPrint = AddButton(.Controls, xtpControlSplitButtonPopup, tid_File_Stampa)
        With ControlPrint
            .BeginGroup = True
           
            Set PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage")
            Set ControlPrint.CommandBar = PopupBar
           
            With PopupBar
                .SetIconSize 24, 24
                .ShowGripper = False
                .DefaultButtonStyle = xtpButtonCaptionAndDescription
                With AddButton(.Controls, xtpControlLabel, 0)
                    .Caption = "Preview and print the document"
                    .Width = 296
                    .DefaultItem = True
                    .Style = xtpButtonCaption
                End With
           
                .Controls.Add xtpControlButton, 555, "555 lost caption" 'I need  specify a caption otherwise is empty
            End With
        End With
                               
        .Controls.Add xtpControlButton, 555, ""
        .Controls.Add xtpControlButton, 666, "Exit"
    End With
   
    CommandBars.Actions.Action(555).Checked = True 'Check all 555 Command ID
 
The button with "555 lost caption" is not the same of actions and infact is not checked, I have missing something?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 July 2010 at 7:34am
Hello,

Thanks a lot. we agree problem with Popups that was created with CreateCommandBar method. It fixed for next release. Please as workaround manually connect control with its action:

Set Control = .Controls.Add(xtpControlButton, 555, "")
Set Control.Action = CommandBars.Actions.Action(555)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dimdar View Drop Down
Groupie
Groupie
Avatar

Joined: 11 July 2007
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimdar Quote  Post ReplyReply Direct Link To This Post Posted: 12 July 2010 at 9:00am

Thank you!

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.156 seconds.