238
238
2023/03/11 Allow Qt to set Text and Background colour, force Gray for Inactive
239
239
background (in LoadNote) cos Kmemo get it wrong
240
240
2023/04/08 Get a note's height and width before populating KMemo, saves 200mS on a big note !
241
-
241
+ 2023/04/09 Keep Find-in-note prompt there unless not found.
242
242
}
243
243
244
244
@@ -1515,50 +1515,36 @@ procedure TEditBoxForm.SpeedLeftClick(Sender: TObject); // think btPrev
1515
1515
// var Res : Boolean = false;
1516
1516
begin
1517
1517
if (EditFind.Caption = ' ' ) or (EditFind.Caption = rsMenuSearch) then exit;
1518
- LabelFindInfo.Caption := ' ' ;
1519
- if not FindInNoteBack(lowercase(EditFind.Text)) then
1520
- LabelFindInfo.Caption := rsNotAvailable;
1518
+ if FindInNoteBack(lowercase(EditFind.Text)) then
1519
+ LabelFindInfo.Caption := { $ifdef DARWIN}
1520
+ rsFindNavRightHintMac + ' , ' + rsFindNavLeftHintMac
1521
+ { $else} rsFindNavRightHint + ' , ' + rsFindNavLeftHint{ $endif}
1522
+ else LabelFindInfo.Caption := rsNotAvailable;
1521
1523
if PanelFind.Height = SearchPanelHeight then
1522
1524
EditFind.SetFocus;
1523
-
1524
- (* Res := FindIt(EditFind.Text, KMemo1.SelStart, False, False);
1525
- if Res then LabelFindInfo.Caption := ''
1526
- else begin
1527
- LabelFindInfo.Caption := rsNotAvailable; // perhaps user has deleted the only term in the note ?
1528
- NumbFindHits := 0;
1529
- LabelFindCount.caption := ''; // this is set to data by GetFindHits()
1530
- end;
1531
- KMemo1.setfocus; *)
1532
1525
end ;
1533
1526
1534
1527
1535
1528
procedure TEditBoxForm.FindNew (IncStartPos : boolean);
1536
1529
var Found : boolean;
1537
1530
begin
1538
1531
if (EditFind.Caption = ' ' ) or (EditFind.Caption = rsMenuSearch) then exit;
1539
- LabelFindInfo.Caption := ' ' ;
1540
1532
if IncStartPos then
1541
1533
Found := FindInNote(lowercase(EditFind.Text), 1 )
1542
1534
else Found := FindInNote(lowercase(EditFind.Text), 0 );
1543
- if not Found then
1544
- LabelFindInfo.Caption := rsNotAvailable;
1535
+ if Found then
1536
+ LabelFindInfo.Caption := { $ifdef DARWIN}
1537
+ rsFindNavRightHintMac + ' , ' + rsFindNavLeftHintMac
1538
+ { $else} rsFindNavRightHint + ' , ' + rsFindNavLeftHint{ $endif}
1539
+ else
1540
+ LabelFindInfo.Caption := rsNotAvailable;
1545
1541
if PanelFind.Height = SearchPanelHeight then
1546
1542
EditFind.SetFocus;
1547
1543
end ;
1548
1544
1549
1545
procedure TEditBoxForm.SpeedRightClick (Sender: TObject); // think btNext
1550
- // var Res : Boolean = false;
1551
1546
begin
1552
1547
FindNew(True);
1553
-
1554
- (* Res := FindIt(EditFind.Text, KMemo1.SelStart+1, true, False);
1555
- if Res then LabelFindInfo.Caption := ''
1556
- else begin
1557
- LabelFindInfo.Caption := rsNotAvailable; // perhaps user has deleted the only term in the note ?
1558
- NumbFindHits := 0;
1559
- LabelFindCount.caption := ''; // this is set to data by GetFindHits()
1560
- end;
1561
- KMemo1.setfocus; *)
1562
1548
end ;
1563
1549
1564
1550
function TEditBoxForm.FindInNoteBack (Term : string) : boolean;
@@ -1673,9 +1659,6 @@ procedure TEditBoxForm.MenuItemCutClick(Sender: TObject);
1673
1659
if KMemo1.ReadOnly then exit();
1674
1660
KMemo1.ExecuteCommand(ecCut);
1675
1661
MarkDirty();
1676
- // if not Dirty then TimerSave.Enabled := true;
1677
- // Dirty := true;
1678
- // LabelFindInfo.Caption := 'd';
1679
1662
end ;
1680
1663
1681
1664
procedure TEditBoxForm.MenuItemDeleteClick (Sender: TObject);
@@ -1684,10 +1667,6 @@ procedure TEditBoxForm.MenuItemDeleteClick(Sender: TObject);
1684
1667
// KMemo1.ExecuteCommand(ecClearSelection);
1685
1668
Undoer.AddPasteOrCut(True);
1686
1669
KMemo1.Blocks.ClearSelection;
1687
- MarkDirty();
1688
- // if not Dirty then TimerSave.Enabled := true;
1689
- // Dirty := true;
1690
- // LabelFindInfo.Caption := 'd';
1691
1670
end ;
1692
1671
1693
1672
procedure TEditBoxForm.MenuItemExportPlainTextClick (Sender: TObject);
@@ -2203,7 +2182,7 @@ procedure TEditBoxForm.MarkTitle();
2203
2182
var
2204
2183
BlockNo : integer = 0 ;
2205
2184
EndBlock, blar : integer;
2206
- Tick, Tock, Tuck : qword; // ToDo : remove
2185
+ // Tick, Tock, Tuck : qword; // ToDo : remove
2207
2186
begin
2208
2187
// if Not Ready then exit(); // ToDo : what is effect of disabling this ?
2209
2188
{ if there is more than one block, and the first, [0], is a para, delete it.}
@@ -2214,7 +2193,7 @@ procedure TEditBoxForm.MarkTitle();
2214
2193
if Kmemo1.Blocks.Items[BlockNo].ClassName = ' TKMemoParagraph' then
2215
2194
Kmemo1.Blocks.DeleteEOL(0 );
2216
2195
try
2217
- Tick := GetTickCount64(); // this while loop can take 70mS when loading a big note, 100mS when updating title in a big note
2196
+ // Tick := GetTickCount64(); // this while loop can take 70mS when loading a big note, 100mS when updating title in a big note
2218
2197
while Kmemo1.Blocks.Items[BlockNo].ClassName <> ' TKMemoParagraph' do begin
2219
2198
if Kmemo1.Blocks.Items[BlockNo].ClassNameIs(' TKMemoTextBlock' ) then begin // just possible its an image, ignore ....
2220
2199
TKMemoTextBlock(Kmemo1.Blocks.Items[BlockNo]).TextStyle.Font.Size := Sett.FontTitle;
@@ -2227,7 +2206,7 @@ procedure TEditBoxForm.MarkTitle();
2227
2206
break;
2228
2207
end ;
2229
2208
end ; // Stopped at first TKMemoParagraph if it exists.
2230
- Tock := GetTickCount64();
2209
+ // Tock := GetTickCount64();
2231
2210
BlocksInTitle := BlockNo;
2232
2211
{ Make sure user has not smeared Title charactistics to next line
2233
2212
Scan back from cursor to end of title, if Title font, reset. }
@@ -2245,8 +2224,8 @@ procedure TEditBoxForm.MarkTitle();
2245
2224
KMemo1.Blocks.UnLockUpdate;
2246
2225
Ready := True;
2247
2226
end ;
2248
- Tuck := GetTickCount64();
2249
- debugln(' TEditBoxForm.MarkTitle ' + inttostr(Tock - Tick) + ' ' + inttostr(Tuck - Tock) + ' Total=' + inttostr(Tuck - Tick));
2227
+ // Tuck := GetTickCount64();
2228
+ // debugln('TEditBoxForm.MarkTitle ' + inttostr(Tock - Tick) + ' ' + inttostr(Tuck - Tock) + ' Total=' + inttostr(Tuck - Tick));
2250
2229
end ;
2251
2230
2252
2231
// This is a debug method, take care, it uses writeln and will kill Windows !
0 commit comments