Beispiel #1
0
      public static bool moveBlockUp(bool figureIsMarked)
      {
          if (rangeOk && figureIsMarked)
          {
              string key = "";
              if (type == xmlMarkerType.Figure)
              {
                  key = xmlMarker.figureStart;
              }
              else if (type == xmlMarkerType.Group)
              {
                  key = xmlMarker.groupStart;
              }

              int newPos = -1;
              if (key.Length > 1)
              {
                  newPos = findUp(key, start - 1);      //   find previous xmlStart marker
              }
              if (newPos >= 0)
              {
                  if (gcode.loggerTrace)
                  {
                      Logger.Trace("moveBlockUp Start {0} {1}", newPos, fCTB.Lines[newPos]);
                  }
                  Bookmarks tmp = new Bookmarks(fCTB);
                  tmp.Clear();
                  fCTB.Cut();
                  List <int> remove = new List <int>();
                  remove.Add(start);
                  fCTB.RemoveLines(remove);         // remove empty line after cut

                  Place selStart;
                  selStart.iLine = newPos;
                  selStart.iChar = 0;
                  Range mySelection = new Range(fCTB);  // fCTBCode.Range;
                  mySelection.Start = mySelection.End = selStart;
                  fCTB.Selection    = mySelection;
                  fCTB.Paste();
                  fCTB.InsertText("\r\n");
                  return(true);
              }
          }
          return(false);
      }
Beispiel #2
0
 private void Cut_ToolStripButton_Click(object sender, EventArgs e)
 {
     if (tabControlCode.TabCount > 0)
     {
         FastColoredTextBox textBox = tabControlCode.SelectedTab.Controls[0] as FastColoredTextBox;
         textBox.Cut();
         textBox.Focus();
     }
 }
Beispiel #3
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            FastColoredTextBox textBox = tabControlCode.SelectedTab.Controls[0] as FastColoredTextBox;

            if (textBox.SelectionLength > 0)
            {
                textBox.Cut();
            }
            textBox.Focus();
        }
Beispiel #4
0
        private void CortarArchivo()
        {
            if (tabArchivo.SelectedIndex != -1)
            {
                TabPage            sPage      = tabArchivo.SelectedTab;
                FastColoredTextBox ctbArchivo = (FastColoredTextBox)sPage.Controls[0];

                if (!ctbArchivo.Selection.Text.Equals(""))
                {
                    ctbArchivo.Cut();
                }
            }
        }
Beispiel #5
0
        public void Cut()
        {
            Logger.GetInstance().Debug("Cut() >>");

            try
            {
                _innerTextbox.Cut();
            }
            catch (Exception e)
            {
                throw e;
            }

            Logger.GetInstance().Debug("<< Cut()");
        }
Beispiel #6
0
        //-----------------------------------------------------------------------------

        // Cut.
        private void buttonCut_Click(object sender, EventArgs e)
        {
            codeEditor.Cut();
        }
 public void CutWithMarkup() => _tb.Cut();
Beispiel #8
0
        private void bt_cut_Click(object sender, EventArgs e)
        {
            FastColoredTextBox fctb = ((FastColoredTextBox)(tabControl1.SelectedTab.Controls[0]));

            fctb.Cut();
        }
Beispiel #9
0
 private void cutToolStripButton_Click(object sender, EventArgs e)
 {
     if (lastSelectedTextControl.SelectedText != "")
         lastSelectedTextControl.Cut();
 }