trichview.support
Re: Letter color changes when I start typing at the end of a textline... |
Author |
Message |
Sergey Tkachenko |
Posted: 11/26/2004 18:56:18 URL recognition is performed in DetectURL, so removing TerminateHyperlink must not stop it. Are you sure that your grey text is not a hyperlink? Look at the code: procedure TerminateHyperlink(rve: TCustomRichViewEdit; URLScanProcedure: TRVURLScanProcedure); var StyleNo: Integer; begin if (rve.CurTextStyleNo=rve.CurItemStyle) and rve.Style.TextStyles[rve.CurTextStyleNo].Jump and not rve.SelectionExists then begin rve := rve.TopLevelEditor; if rve.OffsetInCurItem>=rve.GetOffsAfterItem(rve.CurItemNo) then begin StyleNo := rve.CurTextStyleNo; URLScanProcedure(StyleNo, StyleNo, False); rve.CurTextStyleNo := StyleNo; end; end; end; This procedure does something only if the current text style is a hyperlink (checking rve.Style.TextStyles[rve.CurTextStyleNo].Jump) "Pieter E." <pifiles@hotmail.com> wrote in message news:41a5e2c2$1@support.torry.net... > > Dear Sergey, > > I found the problem. I use the following code: > > void __fastcall TForm1::RichViewEdit1KeyDown(TObject *Sender, WORD &Key, > TShiftState Shift) > { > if(Key == VK_SPACE || Key == VK_RETURN) > { // url detection > DetectURL(RichViewEdit1, URLScanEvent, true); > // closing url if necessary > TerminateHyperlink(RichViewEdit1, URLScanEvent); > } > } > //--------------------------------------------------------------- > > > The problem is in the "TerminateHyperlink(RichViewEdit1, URLScanEvent);". > When I remove this line, the text doesn't turn black anymore, but the RichViewEdit > doesn't recognize hyperlinks anymore. > > I think that the "TerminateHyperlink" returns the default font color after > recognizing hyperlinks, even when there are no hyperlinks. > > Could you give some advice?? |
Powered by ABC Amber Outlook Express Converter