Page 1 of 1

wxStyledTextCtrl的代码补全被截断

Posted: Tue Jan 10, 2017 2:46 pm
by JacquesChen
我尝试用wxStyledTextCtrl里面的AutoComp做代码补全,我的代码如下:

Code: Select all

    int Pos = CodeEdit->GetCurrentPos();
    int Start = CodeEdit->WordStartPosition( Pos, true );
    if( Pos - Start > 2 && !CodeEdit->AutoCompActive() && IfAutoComp == true ) // require 3 characters to show auto-complete
    {
        wxString TrieStr = CodeEdit->GetTextRange( Start, Pos );
        Trie *CompWord = KeyWordTire->Query( TrieStr.mb_str(), KeyWordTire );
        if( CompWord != NULL )
        {
            wxString KeyList = KeyWordTire->GetKeyList( CompWord, TrieStr );
            CodeEdit->AutoCompShow( Pos - Start, KeyList );
        }
    }
但是不全列表总是被截断掉,我觉得是滚动条的宽度占用了几个字符的空间,请问有没有办法取消滚动条呢?AutoCompSetMaxWidth也完全起不到作用。截图如下:
11.png
11.png (10.51 KiB) Viewed 1308 times