In Delphi editor I find it quite pleasant to press the (highlighted) line 2 spaces to the right (Ctrl+k i ) and 2 spaces to
the left (Ctrl+k u).
I have both implemented for TRichViewEdit about ctrl+spacebar and shift+spacebar.
When I move the (unmarked) line 2 places to the left (cursor stands at the beginning of a memoline - using shift+spacebar)
it bothers me that I can see that a space is inserted before line is going 2 spaces to the left.
I can't prevent that space character is being inserted. I have tried many things (key: = 0 - KeyPreview:= true -
form1.keyUp ...).
Does anyone know a solution that I can't see that a space is inserted before line is going 2 spaces to the left) ?
memo: TRichViewEdit;
memo.Options.rvoShowSpecialCharacters:= true; //damit man die Leerzeichen sieht
procedure TForm1.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var memopos: integer;
begin
if (ssCtrl in Shift) and (key= 32) then begin
try
LockWindowUpdate(form1.Handle); //#32 wird 2x eingefügt:
memoPos:=RVGetLinearCaretPos(memo); //1. durch key= 32 und
memo.InsertText(#32); //2. durch memo.InsertText
Application.ProcessMessages; //MUSS sein
memo.selectCurrentword;
RVSetLinearCaretPos(memo,memopos); //Cursor wieder an Ausgangsposition
finally
LockWindowUpdate(0);
end;
end;
end;
procedure TForm1.memoKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (ssShift in Shift) and (key= 32) then begin
try //1 Space wurde zuvor durch
memoPos:=RVGetLinearCaretPos(memo)-1; //key= 32 eingefügt - egal was ich
ausprobiert habe
LockWindowUpdate(form1.Handle);
RVSetSelection(memo,memopos, 3);
if memo.GetSelText= #32#32#32 then RVSetSelection(memo,memopos, 3) //eingefügtes + 2 weitere Leerzeichen
else if pos(#32#32,memo.GetSelText)= 1 then RVSetSelection(memo,memopos, 2)
else if pos(#32,memo.GetSelText)= 1 then RVSetSelection(memo,memopos, 1)
else exit;
Application.ProcessMessages; //MUSS sein
memo.deleteSelection;
RVSetLinearCaretPos(memo,memoPos);
finally
LockWindowUpdate(0);
end;
end;
end;
press a line 2 spaces to the right (or left)
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
After I wrote a topic, I had the option to press button 'PREVIEW' or to press 'SUBMIT').
A few years ago I was able to change my text in the 'Preview', set font attributes etc. When I was satisfied, I submit the text.
This is now not possible. When I click 'Preview', I only get the topics which are submitted.
Where can I find a help - if possible in German - to write and to change topics BEFORE I submit the text (I have seen the hint that I can't edit topics - I refer it to SUBMITTED topics)
A few years ago I was able to change my text in the 'Preview', set font attributes etc. When I was satisfied, I submit the text.
This is now not possible. When I click 'Preview', I only get the topics which are submitted.
Where can I find a help - if possible in German - to write and to change topics BEFORE I submit the text (I have seen the hint that I can't edit topics - I refer it to SUBMITTED topics)
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: