protected override void OnShown(EventArgs e) { base.OnShown(e); editorControl1.AddButton("Frame", image: GetImage("Dialog.png"), showText: false, operation: t => { return @"@startsalt { {Content goes here} } @endsalt "; }); editorControl1.AddSeparator(); editorControl1.AddButton("Button", image: GetImage("Button.png"), showText: false, operation: t => { return ButtonPropertiesDialog.CreateText(); }); editorControl1.AddButton("Radio Button", image: GetImage("Radio.png"), showText: false, operation: t => { return RadioButtonPropertiesDialog.CreateText(); }); editorControl1.AddButton("Checkbox", image: GetImage("Checkbox.png"), showText: false, operation: t => { return CheckboxPropertiesDialog.CreateText(); }); editorControl1.AddButton("Text Box", image: GetImage("Textbox.png"), showText: false, operation: t => { return TextboxPropertiesDialog.CreateText(); }); editorControl1.AddButton("Droplist", image: GetImage("Droplist.png"), showText: false, operation: t => { return DroplistPropertiesDialog.CreateText(); }); editorControl1.AddSeparator(); // Create a new button editorControl1.AddButton("Lower", image: GetImage("Button.png"), showText: false, operation: t => { return t.ToLower(); }); //editorControl1.AddDropdownButton("DDB1", "Dropdown Button tests"); // editorControl1.AddMenuItem("DDB1|Menu One", operation: t => { MessageBox.Show(t); return t; }); editorControl1.AddDropdownButton("Level One", "Menu Tests"); editorControl1.AddMenuItem("Level One|Level Two|Menu Two", operation: t => { MessageBox.Show(t); return t; }); editorControl1.AddMenuItem("Level One|Menu Three", operation: t => { MessageBox.Show(t, "Menu Three"); return t; }); // editorControl1.AutoSaveProcess = t => { MessageBox.Show(t, "AutoSave"); return ""; }; // editorControl1.FormatProcess = t => { return $"<html><body><h1>{t}</h2></body></html>"; }; // H1 document //editorControl1.FormatProcess = t => { return $"<html><body>{t.Replace("\n", "<br/>")}</body></html>"; }; // H1 document //editorControl1.FormatProcess = t => { // return new Editor.FormatDetails { // Result = "https://cnn.com", // IsUrl = true // }; //}; editorControl1.FormatProcess = t => { PlantUmlTranslator translator = new PlantUmlTranslator(); return new Editor.FormatDetails { Result = translator.Translate(t.Input), IsUrl = true }; }; }
void ShowButtonProperties(int button) { ButtonPropertiesDialog dialog = new ButtonPropertiesDialog (project, button); if (dialog.RunModal () == ResponseType.Ok) { // Can change the button ShowAs QueueDraw (); } }