trichview.support
Re: How to get text style no |
Author |
Message |
Sergey Tkachenko |
Posted: 04/10/2004 15:02:32 Here is an example code. It switches the current text style to non-hypertext when user presses space character. You need to write function GetNonHypertextStyleNo returning non-hypertext style for the given hypertext style. procedure TForm3.RichViewEdit1KeyPress(Sender: TObject; var Key: Char); var rve: TCustomRichViewEdit; begin if (Key=' ') and (RichViewEdit1.CurTextStyleNo=RichViewEdit1.CurItemStyle) and RichViewEdit1.Style.TextStyles[RichViewEdit1.CurTextStyleNo].Jump and not RichViewEdit1.SelectionExists then begin rve := RichViewEdit1.TopLevelEditor; if rve.OffsetInCurItem>=rve.GetOffsAfterItem(rve.CurItemNo) then rve.CurTextStyleNo := GetNonHypertextStyleNo(rve.CurTextStyleNo); end; end; > Upon the solution provided on solving the hyperlink problem: > > To assign a lower priority to hyperlink styles. When the caret is at > the > border between hyperlink and normal text, normal text becomes current. > Like > in MS Word. It will make impossible to add a text to the end of > hyperlink by > typing > > how can I know the caret is in between the hyperlink and normal text? > > |
Powered by ABC Amber Outlook Express Converter