Print Page | Close Window

CommandBars.Actions don't work with Ribbon

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16937
Printed Date: 06 October 2024 at 8:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBars.Actions don't work with Ribbon
Posted By: dimdar
Subject: CommandBars.Actions don't work with Ribbon
Date 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?



Replies:
Posted By: Oleg
Date 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


Posted By: dimdar
Date Posted: 12 July 2010 at 9:00am

Thank you!




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net