Skip to content

Commit

Permalink
Merge pull request Alexey-T#104 from springsunx/master
Browse files Browse the repository at this point in the history
fix find logic
  • Loading branch information
Alexey-T authored Feb 8, 2023
2 parents 3163379 + b797c9d commit b26ba8b
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 81 deletions.
61 changes: 32 additions & 29 deletions cudalister.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -170,32 +170,35 @@ function ListSendCommand(ListWin: HWND;
end;


//function ListSearchTextW(ListWin: HWND;
// SearchString: PWideChar;
// SearchParameter: integer): integer; stdcall;
//var
// Form: TfmMain;
//begin
// Result:= LISTPLUGIN_OK;
// Form:= TfmMain(FindControl(ListWin));
// if Assigned(Form) then
// Form.DoFind(
// (SearchParameter and lcs_findfirst)=0,
// (SearchParameter and lcs_backwards)<>0,
// (SearchParameter and lcs_matchcase)<>0,
// (SearchParameter and lcs_wholewords)<>0,
// WideString(SearchString)
// );
//end;
//
//function ListSearchText(ListWin: HWND;
// SearchString: PChar;
// SearchParameter: integer): integer; stdcall;
//begin
// Result:= ListSearchTextW(ListWin,
// PWideChar(WideString(string(SearchString))),
// SearchParameter);
//end;
function ListSearchTextW(ListWin: HWND;
SearchString: PWideChar;
SearchParameter: integer): integer; stdcall;
var
Form: TfmMain;
begin
Result:= LISTPLUGIN_OK;
Form:= TfmMain(FindControl(ListWin));
if Assigned(Form) then
begin
Form.DoFind(
(SearchParameter and lcs_findfirst)=0,
(SearchParameter and lcs_backwards)<>0,
(SearchParameter and lcs_matchcase)<>0,
(SearchParameter and lcs_wholewords)<>0,
WideString(SearchString)
);
Form.Finder.StrFind:= SearchString;
end;
end;

function ListSearchText(ListWin: HWND;
SearchString: PChar;
SearchParameter: integer): integer; stdcall;
begin
Result:= ListSearchTextW(ListWin,
PWideChar(WideString(string(SearchString))),
SearchParameter);
end;


exports
Expand All @@ -206,9 +209,9 @@ function ListSendCommand(ListWin: HWND;
ListLoadNext,
ListLoadNextW,
ListCloseWindow,
ListSendCommand;
//ListSearchText,
//ListSearchTextW;
ListSendCommand,
ListSearchText,
ListSearchTextW;

begin
Application.ShowHint:= false;
Expand Down
14 changes: 14 additions & 0 deletions form_main.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ object fmMain: TfmMain
Left = 450
Top = 134
end
object PopupFileEnd: TPopupMenu
object mnuEndWin: TMenuItem
Caption = 'Win'
OnClick = mnuEndWinClick
end
object mnuEndUnix: TMenuItem
Caption = 'Unix'
OnClick = mnuEndUnixClick
end
object mnuEndMac: TMenuItem
Caption = 'Mac'
OnClick = mnuEndMacClick
end
end
object TimerStatusbar: TTimer
Enabled = False
Interval = 4000
Expand Down
Loading

0 comments on commit b26ba8b

Please sign in to comment.