EhLib.Com
https://forum.ehlib.com/en/

Help with SearchPanel
https://forum.ehlib.com/en/viewtopic.php?f=5&t=985
Page 1 of 1

Author:  danieldavila [ 12 Jul 2019, 13:29 ]
Post subject:  Help with SearchPanel

I emailed support@ehlib.com two days ago and had no response. We paid for EhLib but only here in the forum to get help. :roll: :|

Hello, the company that I work for "LIMBER SOFTWARE E CONSULTORIA LTDA" has bought the components EhLib and I have a couple of questions regarding the SearchPanel.
My native language is Portuguese and to make the search more accurate I need to know if it is possible to replace accents in the words to do the search itself.
For example:
I have the word: "Português" and when I type in the word: "Portugues" in the SearchPanel I need to find in the search "Português" with its accents.

Last question: Is it possible to create an "OnExit" event in the SearchPanel and also that by pressing the ENTER key it switches focus to the searches boxes in the grid?

Author:  EhLibSupport [ 15 Jul 2019, 17:27 ]
Post subject:  Re: Help with SearchPanel

Hello

You can use DBUtilsEh.MakeStringRoughProcEh function pointer to assign MakeStringRoughProcEh
by the function that replace any word by it simple form.

In the function, it is necessary to replace the letters with a weak difference by their simplest form, like this.

Use next code in your main Form unit

Code:
unit Unit1;
...
function MakeStringRoughEh(s: String): String;
begin
Result := StringReplace(s, 'ê', 'e', [rfReplaceAll]);
end;
....

initialization
  DBUtilsEh.MakeStringRoughProcEh := MakeStringRoughEh;
end.



SearchPanel calls MakeStringRoughProcEh before comparing values from the cell and Text in the SearchPanel.

Author:  danieldavila [ 15 Jul 2019, 17:33 ]
Post subject:  Re: Help with SearchPanel

EhLibSupport wrote:
Hello

You can use DBUtilsEh.MakeStringRoughProcEh function pointer to assign MakeStringRoughProcEh
by the function that replace any word by it simple form.

In the function, it is necessary to replace the letters with a weak difference by their simplest form, like this.

Use next code in your main Form unit

Code:
unit Unit1;
...
function MakeStringRoughEh(s: String): String;
begin
Result := StringReplace(s, 'ê', 'e', [rfReplaceAll]);
end;
....

initialization
  DBUtilsEh.MakeStringRoughProcEh := MakeStringRoughEh;
end.



SearchPanel calls MakeStringRoughProcEh before comparing values from the cell and Text in the SearchPanel.


And how can i do this:

Last question: Is it possible to create an "OnExit" event in the SearchPanel and also that by pressing the ENTER key it switches focus to the searches boxes in the grid?

Author:  EhLibSupport [ 15 Jul 2019, 17:41 ]
Post subject:  Re: Help with SearchPanel

Quote:
And how can i do this:


You should add next code in the main unit of your project:

Code:
unit Unit1;
...
function MakeStringRoughEh(s: String): String;
begin
Result := StringReplace(s, 'ê', 'e', [rfReplaceAll]);
end;
....

initialization
  DBUtilsEh.MakeStringRoughProcEh := MakeStringRoughEh;
end.


then recompile and launch the project to test if searchPanel works for words that contain letters 'ê' and 'e'.

Author:  danieldavila [ 15 Jul 2019, 19:14 ]
Post subject:  Re: Help with SearchPanel

EhLibSupport wrote:
Quote:
And how can i do this:


You should add next code in the main unit of your project:

Code:
unit Unit1;
...
function MakeStringRoughEh(s: String): String;
begin
Result := StringReplace(s, 'ê', 'e', [rfReplaceAll]);
end;
....

initialization
  DBUtilsEh.MakeStringRoughProcEh := MakeStringRoughEh;
end.


then recompile and launch the project to test if searchPanel works for words that contain letters 'ê' and 'e'.


Worked perfectly
But I still have the doubt below:
Is it possible to create an "OnExit" event in the SearchPanel and also that by pressing the ENTER key it switches focus to the searches boxes in the grid?

Author:  danieldavila [ 17 Jul 2019, 18:14 ]
Post subject:  Re: Help with SearchPanel

Waiting... :?

Author:  EhLibSupport [ 17 Jul 2019, 22:48 ]
Post subject:  Re: Help with SearchPanel

Hello

Quote:
Is it possible to create an "OnExit" event in the SearchPanel and also that by pressing the ENTER key it switches focus to the searches boxes in the grid?

Can you write how you are going to use "OnExit" event and ENTER key (what control is focused when you want to catch ENTER pressing).

Author:  danieldavila [ 18 Jul 2019, 11:49 ]
Post subject:  Re: Help with SearchPanel

EhLibSupport wrote:
Hello

Quote:
Is it possible to create an "OnExit" event in the SearchPanel and also that by pressing the ENTER key it switches focus to the searches boxes in the grid?

Can you write how you are going to use "OnExit" event and ENTER key (what control is focused when you want to catch ENTER pressing).


When the Enter is pressed, I want the focus to go directly to the search results, just as it is done when the down-arrow key is pressed.
The OnExit event would be for example when to exit the SearchPanel run specific command we need here because SearchPanel will not always be visible because we use the search in a dynamic way.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/