zephyrer / advcombobox

Automatically exported from code.google.com/p/advcombobox
0 stars 0 forks source link

Autocompletion scrolling problem #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
http://www.codeproject.com/Messages/1492472/Autocompletion-scrolling-problem.asp
x

Hello everyone and special regards to Mathias

for this really useful control. I have just put in my project and it fits all 
needs. Thanks!

In the OnEditUpdate handler there is the code for the auto completion if a 
unique match has been found. The core of the code is these two lines.

m_pEdit->SetWindowText( m_iter->strText.c_str() );
m_pEdit->SetSel(nEditLen, (int)m_iter->strText.length(), TRUE );

These lines are the one that are my problem. If the matched text is a long 
string, taking a wider space than the edit control, the SetWindowText will move 
the caret pos to the end of the text and doing so it scrolls the beginning of 
the text (which the user has just typed) out of view.

I have tried several scrolling things or using a additional SetSel(0,0,) before 
the second line, but it was of no use: on the second SetSel, the caret pos 
always goes to the end of the selection and the scroll always occurs.

Help!
Thomas 

Original issue reported on code.google.com by mathias....@gmail.com on 29 Sep 2010 at 9:34

GoogleCodeExporter commented 9 years ago
I guess we need to subclass the CEdit class and put the functionality in there.

Original comment by mathias....@gmail.com on 29 Sep 2010 at 9:35

GoogleCodeExporter commented 9 years ago

Original comment by mathias....@gmail.com on 29 Sep 2010 at 7:13