Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 21 May 2022, 16:23

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Help with SearchPanel
PostPosted: 12 Jul 2019, 13:29 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
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?


Top
 Profile  
 
PostPosted: 15 Jul 2019, 17:27 
Offline

Joined: 08 May 2014, 18:06
Posts: 533
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.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 15 Jul 2019, 17:33 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
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?


Top
 Profile  
 
PostPosted: 15 Jul 2019, 17:41 
Offline

Joined: 08 May 2014, 18:06
Posts: 533
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'.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 15 Jul 2019, 19:14 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
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?


Top
 Profile  
 
PostPosted: 17 Jul 2019, 18:14 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
Waiting... :?


Top
 Profile  
 
PostPosted: 17 Jul 2019, 22:48 
Offline

Joined: 08 May 2014, 18:06
Posts: 533
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).

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 18 Jul 2019, 11:49 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group