dualeditor for Srichviewedit
Posted: Wed Jan 07, 2009 7:29 am
1-how can I implant this procedure to Srichviewedit and without externalRvStyle
and RVStyle1DrawParaBack = ? (where write events) for Srichviewedit.
2-is there dual editor a example for Srichviewedit
procedure TForm1.RVStyle1DrawParaBack(Sender: TRVStyle; Canvas: TCanvas;
ParaNo: Integer; ARect: TRect; var DoDefault: Boolean);
var i, j: Integer;
MakeRed: Boolean;
begin
i := Sender.ItemNo;
if Sender.RVData=RichViewEdit1.RVData then
if FocusedEditor = RichViewEdit1 then
j := RichViewEdit1.CurItemNo
else
j := HltItemNo1
else
if FocusedEditor = RichViewEdit2 then
j := RichViewEdit2.CurItemNo
else
j := HltItemNo2;
repeat
MakeRed := i=j;
if MakeRed then
break;
dec(i);
until TCustomRVData(Sender.RVData).IsFromNewLine(i+1);
if MakeRed then begin
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := $CCCCFF;
Canvas.FillRect(ARect);
end;
end;
and RVStyle1DrawParaBack = ? (where write events) for Srichviewedit.
2-is there dual editor a example for Srichviewedit
procedure TForm1.RVStyle1DrawParaBack(Sender: TRVStyle; Canvas: TCanvas;
ParaNo: Integer; ARect: TRect; var DoDefault: Boolean);
var i, j: Integer;
MakeRed: Boolean;
begin
i := Sender.ItemNo;
if Sender.RVData=RichViewEdit1.RVData then
if FocusedEditor = RichViewEdit1 then
j := RichViewEdit1.CurItemNo
else
j := HltItemNo1
else
if FocusedEditor = RichViewEdit2 then
j := RichViewEdit2.CurItemNo
else
j := HltItemNo2;
repeat
MakeRed := i=j;
if MakeRed then
break;
dec(i);
until TCustomRVData(Sender.RVData).IsFromNewLine(i+1);
if MakeRed then begin
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := $CCCCFF;
Canvas.FillRect(ARect);
end;
end;