private void CreateRawFishTab() { this.c1Ribbon1.Tabs.Clear(); Ribbon.RibbonTab homeTab = new Ribbon.RibbonTab("Raw Fish"); Ribbon.RibbonGroup clipboardGroup = new Ribbon.RibbonGroup("Supply"); Ribbon.RibbonButton pasteButton = new Ribbon.RibbonButton("New Trip", null, Properties.Resources.paste); pasteButton.TextImageRelation = Ribbon.TextImageRelation.ImageAboveText; Ribbon.RibbonButton ownerButton = new Ribbon.RibbonButton("Owners", null, Properties.Resources.paste); ownerButton.TextImageRelation = Ribbon.TextImageRelation.ImageAboveText; Ribbon.RibbonMenu vesselButton = new Ribbon.RibbonMenu(); vesselButton.Text = "Vessels"; vesselButton.Name = "Vessels"; vesselButton.LargeImage = Properties.Resources.paste; vesselButton.Items.Add("US Vessel"); vesselButton.Items.Add("California Vessel"); vesselButton.TextImageRelation = Ribbon.TextImageRelation.Automatic; clipboardGroup.Items.Add(pasteButton); clipboardGroup.Items.Add(ownerButton); clipboardGroup.Items.Add(vesselButton); homeTab.Groups.Add(clipboardGroup); Ribbon.RibbonGroup receiptGroup = new Ribbon.RibbonGroup("Receipts"); Ribbon.RibbonButton receiptButton = new Ribbon.RibbonButton("New Receipt", null); receiptButton.TextImageRelation = Ribbon.TextImageRelation.ImageAboveText; receiptGroup.Items.Add(receiptButton); homeTab.Groups.Add(receiptGroup); this.c1Ribbon1.Tabs.Add(homeTab); }
public RibbonPreview() { InitializeComponent(); var selReportLabel = new C1.Win.C1Ribbon.RibbonButton(); c1RibbonPreview1.Ribbon.QatItemsHolder.Add(selReportLabel); c1RibbonPreview1.Ribbon.Qat.ItemLinks.Add(selReportLabel); selReportLabel.Text = "Select Report:"; selReportLabel.Click += selReportLabel_Click; comboReports = new RibbonComboBox(); c1RibbonPreview1.Ribbon.QatItemsHolder.Add(comboReports); c1RibbonPreview1.Ribbon.Qat.ItemLinks.Add(comboReports); comboReports.DropDownStyle = RibbonComboBoxStyle.DropDownList; comboReports.TextAreaWidth = 130; comboReports.Items.Add(new RibbonButton("Alternating Background")); comboReports.Items.Add(new RibbonButton("Conditional Formatting")); comboReports.Items.Add(new RibbonButton("Subtotals and Aggregates")); comboReports.Items.Add(new RibbonButton("Running Sums")); comboReports.Items.Add(new RibbonButton("Cross-tab Reports")); comboReports.Items.Add(new RibbonButton("Sorting")); comboReports.Items.Add(new RibbonButton("Unbound Images")); comboReports.Items.Add(new RibbonButton("Bound Images")); comboReports.Items.Add(new RibbonButton("Watermark")); comboReports.Items.Add(new RibbonButton("Force Page Breaks")); comboReports.Items.Add(new RibbonButton("Suppress or Force Zeros")); comboReports.Items.Add(new RibbonButton("Global Constant")); comboReports.Items.Add(new RibbonButton("Custom Paper Size")); comboReports.Items.Add(new RibbonButton("Gutters")); comboReports.Items.Add(new RibbonButton("CanGrow CanShrink")); comboReports.ChangeCommitted += new System.EventHandler(this.ComboReports_ChangeCommitted); }
private void CreateColdStorageTab() { //this.c1Ribbon1.Tabs.Clear(); Ribbon.RibbonTab homeTab = new Ribbon.RibbonTab("ColdStore"); Ribbon.RibbonGroup clipboardGroup = new Ribbon.RibbonGroup("Supply"); Ribbon.RibbonButton pasteButton = new Ribbon.RibbonButton("New Trip Code", null); pasteButton.TextImageRelation = Ribbon.TextImageRelation.ImageAboveText; clipboardGroup.Items.Add(pasteButton); homeTab.Groups.Add(clipboardGroup); this.c1Ribbon1.Tabs.Add(homeTab); }
private void ribbonButton_Click(object sender, EventArgs e) { try { if (((RibbonButton)sender).Tag != null && !String.IsNullOrEmpty(((RibbonButton)sender).Tag.ToString().Trim())) { string nameofWindow = ((RibbonButton)sender).Tag.ToString().Trim(); if (nameofWindow.IndexOf("!") >= 0) { nameofWindow = nameofWindow.Trim().Split('!')[0]; } ObjectHandle objHandle = Activator.CreateInstanceFrom(Assembly.GetEntryAssembly().CodeBase, Application.ProductName + "." + nameofWindow); Window = (Form)objHandle.Unwrap(); if (Window == null) { return; } // end if if (((RibbonButton)sender).Tag.ToString().Trim().IndexOf("!") >= 0) { Window.Tag = ((RibbonButton)sender).Tag.ToString().Trim().Split('!')[1]; } // end if else { Window.Tag = string.Empty; } // end else if (Window.Tag != null && !CheckIfFormOpened(Window.Name)) { this.AddOwnedForm(Window); Window.StartPosition = FormStartPosition.CenterScreen; rmOpenWindows.Items.Clear(); Form[] childarray = this.OwnedForms; foreach (Form child in childarray) { C1.Win.C1Ribbon.RibbonButton btnWindow = new C1.Win.C1Ribbon.RibbonButton(child.Text); rmOpenWindows.Items.Add(btnWindow); } Window.BackColor = this.BackColor; Window.Show(this); } // end if else { Window.Activate(); this.Cursor = Cursors.Default; } // end else } // end if } // end try catch (Exception error) { MessageBox.Show(error.ToString()); } // end catch if (Window.GetType().BaseType == typeof(DataForm)) { ////(Permissions.Delete == ((DataForm)frm).Permissions & Permissions.Add)) && ((DataForm)frm).AddNewButton //if (((DataForm)Window)._AddNewButton) //&& ((DataForm)frm).Name != "CostcenterOpenBalanceForm") //{ // //ToolBar_ButtonClick(2);//add new // ((DataForm)Window).ToolBar_ButtonClick("bttnAddNew"); //} //else //{ // //ToolBar_ButtonClick(3);//stopAddNew // ((DataForm)Window).ToolBar_ButtonClick("bttnStopAddNew"); //} } }
void AppMenu_DropDown(object sender, EventArgs e) { var ribbonItems = rpc.Ribbon.ApplicationMenu.RightPaneItems; while (ribbonItems.Count > 3) { int index = ribbonItems.Count - 1; var ri = ribbonItems[index]; ribbonItems.RemoveAt(index); ri.Dispose(); } if (CheckAssociations()) { _registerLabel.Text = "< unregister the file associations for .c1dx, .c1d, and .c1mdx >"; _registered = true; } else { _registerLabel.Text = "< register.c1dx, .c1d, and.c1mdx files with this application >"; _registered = false; } var items = atb.JumpList.GetKnownCategoryItems(JumpListKnownCategory.Recent); for (int i = 1; i <= items.Count; i++) { C1JumpPath jumpPath = items[i - 1] as C1JumpPath; if (jumpPath != null) { var rli = new C1.Win.C1Ribbon.RibbonListItem(); var sb = new StringBuilder(); if (i < 10) { sb.Append('&').Append(i).Append(" "); } else { sb.Append(i).Append(' '); } sb.Append(Path.GetFileNameWithoutExtension(jumpPath.Path)); rli.Items.Add(new RibbonLabel(sb.ToString())); var delButton = new C1.Win.C1Ribbon.RibbonButton(); if (i < 10) { delButton.KeyTip = "Y" + i.ToString(); } delButton.SelectableInListItem = true; delButton.SmallImage = Properties.Resources.Delete16x16; delButton.ToolTip = "Remove from list"; delButton.Click += new System.EventHandler(this.DelButton_Click); rli.Items.Add(delButton); ribbonItems.Add(rli); rli.Tag = jumpPath; rli.ToolTip = jumpPath.Path; rli.Click += RibbonListItem_Click; } } }