How can I solve this problem easy:
I have to sets of styles:
style 0..4 is normal
style 5..9 are the same styles but with an other color
User marks a text that contains different styles, e.g. normal bold and italic (set 0..4) if he releases the mouse the whole marked text should be converted. E.g. 0 > 5 (normal), 1 > 6 (bold) and 2 > 7 (italic)
thank you
Martin
Multi style conversion
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry for the delay.
Process OnRVMouseUp:
And OnStyleConversion:
Process OnRVMouseUp:
Code: Select all
procedure TForm3.RichViewEdit1RVMouseUp(Sender: TCustomRichView;
Button: TMouseButton; Shift: TShiftState; ItemNo, X, Y: Integer);
begin
if RichViewEdit1.SelectionExists then
RichViewEdit1.ApplyStyleConversion(0);
end;
Code: Select all
procedure TForm3.RichViewEdit1StyleConversion(Sender: TCustomRichViewEdit;
StyleNo, UserData: Integer; AppliedToText: Boolean; var NewStyleNo: Integer);
begin
NewStyleNo := StyleNo;
if StyleNo<5 then
inc(NewStyleNo, 5);
end;