Exemple #1
0
 protected virtual void OnCommandSendToBack(object sender, System.EventArgs e)
 {
     UndoableCommand command = new UndoableCommand (new SendToBackCommand ("Send to back", this));
     command.Execute ();
 }
Exemple #2
0
    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);
    }
Exemple #3
0
 protected virtual void OnCommandSelectAll(object sender, System.EventArgs e)
 {
     UndoableCommand command = new UndoableCommand (new SelectAllCommand ("Select all", this));
     command.Execute ();
 }
Exemple #4
0
    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 ();
    }
Exemple #5
0
    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 ();
    }
Exemple #6
0
 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 ();
 }
Exemple #7
0
 protected virtual void OnCommandBringToFront(object sender, System.EventArgs e)
 {
     UndoableCommand command = new UndoableCommand (new BringToFrontCommand ("Bring to front", this));
     command.Execute ();
 }