Beispiel #1
0
 protected override void sizeHandle_MouseUp(object sender, MouseEventArgs e)
 {
     if (old_width != Width)
     {
         ResizeStripCommand resize = new ResizeStripCommand(mController, new Size(old_width, Height), Size);
         ResizeStripCommand parent_resize = new ResizeStripCommand(((SeqStrip)mController).Parent,
             new Size(old_pwidth, mParent.Height), mParent.Size);
         ((WorkAreaForm)ParentForm).PushUndo(new ConsCommand(resize.Label, resize, parent_resize));
     }
     resizing = false;
 }
Beispiel #2
0
        // Rename the currently selected item. This brings a text entry window in which the user can type the new name.
        // Nothing happens if there is no selected item at the moment.
        private void renameStripToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Strip strip = mStripManager.Selected;

            if (strip != null)
            {
                RenameStripBox box = new RenameStripBox(strip.Label);
                box.ShowDialog();
                if (box.DialogResult == DialogResult.OK)
                {
                    // Create the rename command. If the new label is too long for the strip, then resize it as well and issue
                    // a cons command so that undoing will restore the previous size of the strip.
                    ResizeStripCommand resize = new ResizeStripCommand(strip, strip.Size);
                    RenameStripCommand rename = new RenameStripCommand(strip, box.Label);
                    rename.Do();
                    PushUndo(new ConsCommand(rename.Label, resize, rename));
                }
            }
        }