Print Page | Close Window

Small bug with autocomplete window

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=14091
Printed Date: 29 April 2024 at 10:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Small bug with autocomplete window
Posted By: peerschindel
Subject: Small bug with autocomplete window
Date Posted: 21 April 2009 at 6:14am
Hello Syntax Edit team,
 
There's a small bug in autocomplete window.
The function "CXTPSyntaxEditAutoCompleteWnd::Show"
does NOT set the member variable "m_bHighLight".
This means it's random whether the first line of the list in auto-complete-window
is selected when opening the list or not. (Actually it depends how the auto-complete-window
was closed the previous time: With a selection because the last typed character was for
a string in the list or not).
What makes it even more random is the fact, that the member variable "m_bHighLight"
is NOT initialized at all in the constructor of "CXTPSyntaxEditAutoCompleteWnd".
(So the very first time it's totally random and can be e.g. different in Debug and Release).
 
Here my proposal for a bug fix in file "XTPSyntaxEditAutoCompleteWnd.cpp"
in function "CXTPSyntaxEditAutoCompleteWnd::Show" ca. in line 143:
 
Replace:
 
    ...
    int nSearch = Search(strSearch);
    m_nHighLightLine = nSearch;

    ScrollTo(nSearch);
    ...
 
with
 
    ...
    int nSearch = Search(strSearch);
    m_nHighLightLine = nSearch;
    // 21.04.09, initialize "m_bHighLight" when showing auto complete window
    // so that it's not random any more if something is highlighted when opening it or not
    m_bHighLight = m_nHighLightLine >= 0 ;

    ScrollTo(nSearch);
    ...
 
Best regards
 
P.S.:
I really don't know how the people could use the ActiveX variant without the possibility
to inspect/modify the source code...
I just want to make a proposal for the following effect (what - I think - is a bug).




Replies:
Posted By: mdoubson
Date Posted: 21 April 2009 at 4:15pm
Thanks, I will check this proposal and update SVN after.
BTW - flag m_bHighLight set to TRUE in All Mouse Button Handlers according to HitTest and also inside   CXTPSyntaxEditAutoCompleteWnd::OnKeyDown
 


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 21 April 2009 at 4:22pm
Sorry - don't see differences with and without your changes. Could you make some sample case where we can see such differences in action please?

-------------
Mark Doubson, Ph.D.


Posted By: peerschindel
Date Posted: 24 April 2009 at 3:33am
Hello,
 
To reproduce the strange behavior:
1. Open the auto complete list in an empty line.
2. Type a character which is NOT in the list. As result NOTHING is highlighed in the list.
3. Close the autocomplete window (but NOT with the keyboard, but e.g. by clicking somewhere in the view)

So "m_bHighLight" is FALSE from the action in 2.
The NEXT time you open the auto complete window (with ...::Show) NOTHING is highlighted in the begining.
 
Now when you do it different:
1. Open the auto complete list in an empty line.
2. Type a character which IS in the list. As result SOMETHING is highlighed in the list.
3. Close the autocomplete window.
 
So "m_bHighLight" is TRUE from the action in 2. (or 3., if you closed it with a key)
The NEXT time you open the auto complete window (with ...::Show) SOMETHING is highlighted in the begining.
 
Best regards
 


Posted By: mdoubson
Date Posted: 24 April 2009 at 10:53am
Thanks - it really works

-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net