OS: Windows 10@64
Compiler: Lazarus 3.4
Project: When text search is found and high lighted make more visible
logic
capture the seltext font attributes just before high light of a search
change that high lighted font attribute like size, color, and background color
show that high lighted text with the new temp attributes
and pause the search
but when continue to the next search restore all those attribute (which I think is already the default)
then repeat if another occurrence is found
The desired effect is the high light is Red background, with white text, and at least 20 font height
Tring to make the high light more noticeable
Function TForm1.RMS(aRM:TRichMemo;SStr:String;AskSWH:Boolean=false):Boolean;
begin
//StartPos is 0;
FindLength:=Length(SStr);
Result:=false;
While aRM.Search(SStr,StartPos,Length(aRM.rtf),[],StartPos,FindLength) do
begin
aRM.SelStart := StartPos;
aRM.SelLength := FindLength;
Result:=TRUE;
if AskSWH then
if NOT (MessageDlg(HLPQuery.FieldByName('H_Cat').AsAnsiString, HLPQuery.FieldByName('H_Item').AsAnsiString+#13+
HLPQuery.FieldByName('H_Sec').AsAnsiString+#13+
HLPQuery.FieldByName('H_Par').AsAnsiString+#13+
HLPQuery.FieldByName('H_Dat').AsAnsiString+#13+'Next?',mtConfirmation, [mbYes, mbNo], 0) in [mrYes,mrOK])
then break;
StartPos := StartPos + FindLength;
end;
if AskSWH then
if StartPos = -1 then
begin
if HLPQuery.RecNo<> hlpQuery.RecordCount
then
begin
HLPQuery.Next;
StartPos := 0;
RMS(aRM,SStr,AskSWH); //recursive
end;
end;
end;
Yes I know the line " then break;" will leave memory issues but that I can fix once I get the High light working