private void OnQATButtonClick(object sender, EventArgs e) { KryptonRibbonQATButton button = (KryptonRibbonQATButton)sender; MessageBox.Show(this, "You selected the '" + button.Text + "' quick access toolbar button.", "QAT Button"); }
private void buttonAdd_Click(object sender, EventArgs e) { KryptonRibbonQATButton qatButton = new KryptonRibbonQATButton(); qatButton.Text = _names[_count]; qatButton.Image = _images[_count]; _count = (++_count % 12); kryptonRibbon.QATButtons.Add(qatButton); UpdateButtons(); }
// void AddActionToQAT(EditorAction action) { var button = new KryptonRibbonQATButton(); //action.createdQATButton = button; button.Enabled = false; button.Image = EditorAPI.GetImageForDispalyScale(action.GetImageSmall(), action.GetImageBig()); //!!!! //button.ShortcutKeys = action.shortcutKeys; button.Tag = action; //button.Tag = action.name; //!!!! button.Text = action.Name; //set tool tip var toolTip = EditorLocalization.Translate("EditorAction.Name", action.Name); if (action.Description != "") { toolTip += "\n" + EditorLocalization.Translate("EditorAction.Description", action.Description); } var keysString = EditorActions.ConvertShortcutKeysToString(action.ShortcutKeys); if (keysString != "") { toolTip += " (" + keysString + ")"; } button.ToolTipBody = toolTip; if (action.ActionType == EditorAction.ActionTypeEnum.DropDown) { button.IsDropDownButton = true; button.KryptonContextMenu = action.DropDownContextMenu; } kryptonRibbon.QATButtons.Add(button); button.Click += QATButton_Click; }