Hello,
I want to draw a line from the left memo border to the right memo border (like a pagebreak but without producing a new page in the print).
The horzline must be independent from font.size.
In RichViewActions I found
{ TrvActionInsertHLine }
constructor TrvActionInsertHLine.Create(AOwner: TComponent);
begin
inherited;
Color := clWindowText;
Width := 1;
FMessageID := rvam_act_InsertHLine;
end;
procedure TrvActionInsertHLine.ExecuteTarget(Target: TObject);
begin
GetControl(Target).InsertBreak(Width, rvbsLine, Color);
end;
procedure TrvActionInsertHLine.UpdateTarget(Target: TObject);
var rve: TCustomRichViewEdit;
begin
if not RVA_ActionsEnabled or Disabled then begin
Enabled := False;
exit;
end;
rve := GetControl(Target).TopLevelEditor;
Enabled := {not rve.ReadOnly and} (rve.RVData.PartialSelectedItem=nil);
end;
but I can't change code so that it runs.
Who has an idea ?
Jürgen
To draw a line
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In the meantime I have found my error.
In my trials I always write rve.InsertBreak(1, rvbsLine, clBlack);
but I must use the name of my rve-memo:
procedure TForm1.sbStrichClick(Sender: TObject);
begin // found in your support-forum
memo.InsertBreak(1, rvbsLine, clBlack);
if memo.TopLevelEditor.CurItemNo=memo.TopLevelEditor.ItemCount-1 then
SendMessage(memo.TopLevelEditor.Handle, WM_KEYDOWN, VK_RETURN,0)
else SendMessage(memo.TopLevelEditor.Handle, WM_KEYDOWN, VK_RIGHT,0);
end;
Now it runs.
I often don't know for which keyword I have to search. So I did not come on the idea that a BREAK (INSERTBREAK) means the inserting of a line (but it is a breaking of a text).
Jürgen
In my trials I always write rve.InsertBreak(1, rvbsLine, clBlack);
but I must use the name of my rve-memo:
procedure TForm1.sbStrichClick(Sender: TObject);
begin // found in your support-forum
memo.InsertBreak(1, rvbsLine, clBlack);
if memo.TopLevelEditor.CurItemNo=memo.TopLevelEditor.ItemCount-1 then
SendMessage(memo.TopLevelEditor.Handle, WM_KEYDOWN, VK_RETURN,0)
else SendMessage(memo.TopLevelEditor.Handle, WM_KEYDOWN, VK_RIGHT,0);
end;
Now it runs.
I often don't know for which keyword I have to search. So I did not come on the idea that a BREAK (INSERTBREAK) means the inserting of a line (but it is a breaking of a text).
Jürgen
Last edited by j&b on Thu Aug 16, 2007 2:48 pm, edited 1 time in total.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: