Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Syntax Edit
  New Posts New Posts RSS Feed - Small bug with autocomplete window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Small bug with autocomplete window

 Post Reply Post Reply
Author
Message
peerschindel View Drop Down
Groupie
Groupie


Joined: 12 July 2008
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote peerschindel Quote  Post ReplyReply Direct Link To This Post Topic: Small bug with autocomplete window
    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).

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
peerschindel View Drop Down
Groupie
Groupie


Joined: 12 July 2008
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote peerschindel Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2009 at 10:53am
Thanks - it really works
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.