示例#1
0
        /// <summary>
        ///
        /// </summary>
        private void BackSpaceChar()
        {
            LineString lineString = null;
            string     lineText   = string.Empty;
            var        lnpID      = this.PParser.GetLineString.GetLnpAndId();

            if (this.PParser.PCursor.CousorPointForWord.X < 0)
            {
                if (this.PParser.PCursor.CousorPointForWord.Y == 0)
                {
                    this.PIsAddUndo = false;
                    return;
                }
                this.pEBackSpaceType = EBackSpaceType.Enter;
                this.SetOperationAction();
                string leavings = this.PParser.GetLineString.Text;
                var    nowLine  = this.PParser.GetLineString;
                this.PParser.PLineString.RemoveAt(this.PParser.PCursor.CousorPointForWord.Y);
                this.PParser.PCursor.CousorPointForWord.Y--;
                this.PParser.PCursor.CousorPointForEdit.Y -= FontContainer.FontHeight;
                if (this.PParser.PCursor.CousorPointForWord.Y < 0)
                {
                    this.PParser.PCursor.CousorPointForWord.Y = 0;
                    return;
                }
                lineString = this.PParser.GetLineString;
                this.MergeLineString(lineString, nowLine);
                this.ChangeIncrementLine(-1);
            }
            else
            {
                pEBackSpaceType = EBackSpaceType.Char;
                this.SetOperationAction();
                lineString = this.PParser.GetLineString;
                this.pChar = lineString.Text[this.PParser.PCursor.CousorPointForWord.X];
                lineText   = this.GetLineStringEffectualText(lineString).Remove(this.PParser.PCursor.CousorPointForWord.X, 1);

                int with = CharCommand.GetCharWidth(this.PParser.PIEdit.GetGraphics, this.pChar.ToString(), FontContainer.DefaultFont);
                this.PParser.PCursor.XForLeft             -= with;
                this.PParser.PCursor.CousorPointForEdit.X -= with;
                this.PParser.PCursor.CousorPointForWord.X -= 1;
                this.SetResetLineString(lineString, lineText);
                this.RemovePuckerLeavingOnly(lnpID, lineString);
                this.EndInsertChar();
            }
            this.SetSurosrPoint();
            this.PParser.PCursor.SetPosition();
        }
示例#2
0
 public void BackSpace()
 {
     if (this.PParser.GetSelectPartPoint == null)
     {
         BackSpaceChar();
     }
     else
     {
         this.pEBackSpaceType = EBackSpaceType.Select;
         this.SetOperationAction();
         var    selectBgs    = this.GetSelectBg();
         string backSpaceStr = this.DeleteSelectPart(out this.PDeleteLineCount, false);
         this.SetDrawBgClearSelectAndPucker(selectBgs);
         (this.PActionOperation as PasteAction).PPasteText = backSpaceStr;
         this.SetSurosrPoint();
         this.ChangeIncrementLine(this.GetDeleteLineCount * -1);
     }
 }