Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Small contribution to GridCtrl
Small contribution to GridCtrl [message #23675] Thu, 12 November 2009 14:47 Go to next message
bubo is currently offline  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.
Re: Small contribution to GridCtrl [message #23688 is a reply to message #23675] Fri, 13 November 2009 20:14 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Try latest svn. It should be fixed now for every case. The focus was stolen during toolbar rebuilding.
Re: Small contribution to GridCtrl [message #23703 is a reply to message #23688] Mon, 16 November 2009 09:00 Go to previous message
bubo is currently offline  bubo
Messages: 6
Registered: July 2009
Promising Member
Thanks it is functional in latest svn.
Previous Topic: Arrayctrl and scroll lines
Next Topic: Problem in DropGrid
Goto Forum:
  


Current Time: Thu Mar 28 14:35:26 CET 2024

Total time taken to generate the page: 0.01128 seconds