|
|
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl: detecting a change of a search string
GridCtrl: detecting a change of a search string [message #31997] |
Sat, 16 April 2011 18:30 |
Novo
Messages: 1371 Registered: December 2006
|
Ultimate Contributor |
|
|
I'm trying to use the WhenSearchCursor callback to detect changing of a search string (to recalculate summary value). It works fine in all cases except of one, when a search string gets cleared.
Is there a way to detect this situation?
TIA
Regards,
Novo
|
|
|
Re: GridCtrl: detecting a change of a search string [message #32767 is a reply to message #31997] |
Tue, 07 June 2011 08:29 |
|
Novo wrote on Sat, 16 April 2011 12:30 | I'm trying to use the WhenSearchCursor callback to detect changing of a search string (to recalculate summary value). It works fine in all cases except of one, when a search string gets cleared.
Is there a way to detect this situation?
TIA
|
You mean WhenSearchCursor is not called in that case (when string gets cleared) ?
|
|
|
Re: GridCtrl: detecting a change of a search string [message #32795 is a reply to message #32767] |
Fri, 10 June 2011 03:44 |
Novo
Messages: 1371 Registered: December 2006
|
Ultimate Contributor |
|
|
unodgs wrote on Tue, 07 June 2011 02:29 |
Novo wrote on Sat, 16 April 2011 12:30 | I'm trying to use the WhenSearchCursor callback to detect changing of a search string (to recalculate summary value). It works fine in all cases except of one, when a search string gets cleared.
Is there a way to detect this situation?
TIA
|
You mean WhenSearchCursor is not called in that case (when string gets cleared) ?
|
Yes. I also tried to attach a callback directly to the member find, but unfortunately it gets reset when search options are changed.
I also need to handle enter when immediate search is disabled. If I install a handler on find.WhenEnter it also will be reset when search options change.
Regards,
Novo
|
|
|
|
Re: GridCtrl: detecting a change of a search string [message #32968 is a reply to message #32965] |
Sun, 26 June 2011 15:17 |
Novo
Messages: 1371 Registered: December 2006
|
Ultimate Contributor |
|
|
unodgs wrote on Sun, 26 June 2011 07:11 | Could you explain what you mean by "find.WhenEnter it also will be reset when search options change"?
|
void GridCtrl::SetFindOpts(int n)
{
switch(n)
{
case 0:
search_immediate = !search_immediate;
if(!search_immediate)
{
find <<= THISBACK(Nothing);
find.WhenEnter = THISBACK(DoFind);
}
else
{
find <<= THISBACK(DoFind);
find.WhenEnter = THISBACK(Nothing);
}
break;
case 1:
search_hide = !search_hide;
if(!String(~find).IsEmpty())
{
if(!search_hide)
ShowRows();
else
DoFind();
}
break;
case 2:
search_highlight = !search_highlight;
if(!search_highlight)
{
ClearFound(false);
Refresh();
}
else
DoFind();
break;
case 3:
search_case = !search_case;
DoFind();
break;
}
}
GridCtrl::SetFindOpts() resets find.WhenEnter and find.WhenAction when search_immediate option is changed. Sorry, it is just one option.
I believe member find was made public by mistake.
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Sat Sep 21 02:53:43 CEST 2024
Total time taken to generate the page: 0.05846 seconds
|
|
|