protected virtual void OnCommandSendToBack(object sender, System.EventArgs e) { UndoableCommand command = new UndoableCommand (new SendToBackCommand ("Send to back", this)); command.Execute (); }
private void BuildCommandsMenu() { Gtk.AccelGroup group = new AccelGroup (); Gtk.MenuItem commands = new MenuItem ("Commands"); Gtk.Menu commandsMenu = new Menu (); commands.Submenu = commandsMenu; menubar1.Append (commands); //Select all Gtk.MenuItem selectAll = new ImageMenuItem (Stock.SelectAll, group); selectAll.Activated += delegate { UndoableCommand command = new UndoableCommand (new SelectAllCommand ("Select all", this)); command.Execute (); }; commandsMenu.Append (selectAll); //Send to back command Gtk.MenuItem sendToBack = new ImageMenuItem ("Send to _back"); sendToBack.Activated += delegate { }; commandsMenu.Append (sendToBack); //Bring to front command Gtk.MenuItem bringToFront = new ImageMenuItem ("Bring to _front"); bringToFront.Activated += delegate { }; commandsMenu.Append (bringToFront); //Change attribute Gtk.MenuItem changeFontAttribute = new ImageMenuItem ("Change font to Terminus"); changeFontAttribute.Activated += delegate { Console.WriteLine ("Executng"); }; commandsMenu.Append (changeFontAttribute); }
protected virtual void OnCommandSelectAll(object sender, System.EventArgs e) { UndoableCommand command = new UndoableCommand (new SelectAllCommand ("Select all", this)); command.Execute (); }
protected virtual void OnCommandFontSize(object sender, System.EventArgs e) { EntryDialog dialog = new EntryDialog (); int value = 0; if (dialog.Run () == (int) Gtk.ResponseType.Ok && dialog.EntryValue != string.Empty) { if (int.TryParse (dialog.EntryValue, out value) == true) { UndoableCommand size = new UndoableCommand (new ChangeAttributeCommand ("Font size", FigureAttribute.FontSize, value, this)); size.Execute (); } } dialog.Destroy (); }
protected virtual void OnCommandFontFamily(object sender, System.EventArgs e) { EntryDialog dialog = new EntryDialog (); if (dialog.Run () == (int) Gtk.ResponseType.Ok && dialog.EntryValue != string.Empty) { UndoableCommand size = new UndoableCommand (new ChangeAttributeCommand ("Font family", FigureAttribute.FontFamily, dialog.EntryValue, this)); size.Execute (); } dialog.Destroy (); }
protected virtual void OnCommandFontColor(object sender, System.EventArgs e) { ColorDialog dialog = new ColorDialog (); if (dialog.Run () == (int) Gtk.ResponseType.Ok) { UndoableCommand fontColor = new UndoableCommand (new ChangeAttributeCommand ("Font color", FigureAttribute.FontColor, GdkCairoHelper.CairoColor (dialog.Color), this)); fontColor.Execute (); } dialog.Destroy (); }
protected virtual void OnCommandBringToFront(object sender, System.EventArgs e) { UndoableCommand command = new UndoableCommand (new BringToFrontCommand ("Bring to front", this)); command.Execute (); }