Print Page | Close Window

System Button Popup: Possible Now or Later?

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=7382
Printed Date: 18 June 2025 at 11:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: System Button Popup: Possible Now or Later?
Posted By: apuhjee
Subject: System Button Popup: Possible Now or Later?
Date Posted: 14 June 2007 at 1:52pm



Replies:
Posted By: apuhjee
Date Posted: 14 June 2007 at 2:08pm
Nevermind.  It appears that you forgot to include this in the C# sample.
 
Codejock:  Could you please post the C# code necessary to perform the same functionality as the VB sample?  Thanks.
 
jp


Posted By: SuperMario
Date Posted: 15 June 2007 at 4:26pm
Hi Jason, this should be enought to get you started:

            XtremeCommandBars.RibbonBar RibbonBar = null;
            RibbonBar = CommandBars.AddRibbonBar("The Ribbon");
            RibbonBar.EnableDocking(XtremeCommandBars.XTPToolBarFlags.xtpFlagStretched);

            XtremeCommandBars.CommandBarPopup ControlFile = null;
            XtremeCommandBars.CommandBarPopup ControlTheme = null;
            XtremeCommandBars.CommandBarControl ControlAbout = null;
            XtremeCommandBars.CommandBar PopupBar = null;

            ControlFile = RibbonBar.AddSystemButton();
            ControlFile.IconId = ID.ID_SYSTEM_ICON;
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_NEW, "&New", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_OPEN, "&Open...", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_SAVE, "&Save", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_SAVE_AS, "Save &As...", false, false);
            ControlPopup = (XtremeCommandBars.CommandBarPopup)ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlSplitButtonPopup, ID.ID_FILE_PRINT, "&Print", false, false);
            ControlPopup.BeginGroup = true;

            PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage");
            ControlPopup.CommandBar = PopupBar;
            Control = PopupBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlLabel, 0, "Preview and print the document", false, false);
            Control.Width = 296;
            Control.DefaultItem = true;
            Control.Style = XtremeCommandBars.XTPButtonStyle.xtpButtonCaption;
            PopupBar.DefaultButtonStyle = XtremeCommandBars.XTPButtonStyle.xtpButtonCaptionAndDescription;
            PopupBar.SetIconSize(32, 32);
            PopupBar.ShowGripper = false;
            PopupBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_PRINT, "Print Pre&view", false, false);
            PopupBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_PRINT_SETUP, "Pr&int Setup...", false, false);
            PopupBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_PRINT_PREVIEW, "Print Pre&view", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_PREPARE, "Prepare", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_SEND, "Send", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_PREPARE, "Publish", false, false);
            ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_CLOSE, "Close", false, false);
            Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListCaption");
            Control.Caption = "Recent Documents";
            Control.BeginGroup = true;
            ControlFile.CommandBar.Controls.AddControl(Control, -1);


            Control = ControlFile.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID.ID_FILE_MRU_FILE1, "Recent File", false, false); 

            Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarButton");
            Control.Caption = "Options";
            Control.Id = ID.ID_FILE_OPTIONS;
            ControlFile.CommandBar.Controls.AddControl(Control, -1);    

            Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarButton");
            Control.Caption = "Exit Sample";
            Control.Id = ID.ID_APP_EXIT;
            ControlFile.CommandBar.Controls.AddControl(Control, -1);

            ControlFile.CommandBar.SetIconSize(32, 32);


Posted By: apuhjee
Date Posted: 15 June 2007 at 5:49pm
Thanks Mike. Worked perfectly.



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