Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Small contribution to GridCtrl
Small contribution to GridCtrl [message #23675] |
Thu, 12 November 2009 14:47  |
bubo
Messages: 6 Registered: July 2009
|
Promising Member |
|
|
I would like to post some patch (or hack) to correct the "Immediate search" imperfection in GridCtrl.
Symptoms of the bug are simple: when you immediate search in "GridFind" control, "find" member loses the focus after each key press and
you have to restore carret position of GridFind with mouse.
So it is very annoying for me, especially when I need to search for text with more then one character.
Here are changes to correct this:
in "GridCtrl.h"
class GridCtrl .... {
....
....
private:
....
....
void DoInternalFind(); // add this private method somewhere
....
....
};
in "GridCtrl.cpp"
// in constructor of GridCtrl change one line
GridCtrl::GridCtrl()
{
....
....
find <<= THISBACK(DoInternalFind); // original was: "find <<= THISBACK(DoFind);"
....
....
}
// implementation of new method
void GridCtrl::DoInternalFind()
{
DoFind(); // find ctrl loses the focus (I don't know why)
// restore focus and carret position (carret would be at the end of written search text)
find.SetFocus();
find.SetSelection(find.GetLength());
}
Notes:
This doesn't solves the case when carret wasn't at the end of serach text. So it need deeper implementation.
Or find out where in "DoFind" is the focus of "find" ctrl lost.
I would like to thank someone (who have write access to upp's SVN server) for applying this patch.
|
|
|
|
|
Goto Forum:
Current Time: Sun May 11 15:27:27 CEST 2025
Total time taken to generate the page: 0.03289 seconds
|