News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to resize code completion window?

Started by coolcoolcat, October 26, 2010, 05:12:12 PM

Previous topic - Next topic

coolcoolcat

Hi , I'm new to code::block

I download the "codeblocks-10.05mingw-setup.exe" and choose full install.

Everything works well, but when I use the code completion, the popup window is too small that I can't see complete word

Just like this picture


I can't find resize setting in settings->Editor->Code-completion and symbols browser

OS: windows 7
compiler: MinGW
code::blocks version: 10.5
debugger: gdb

Could someone help me?

best regards

Kevin

Calmarius

Same problem here.

I think the code completion plugin incorrectly calculates the window's size, that's why you get the ellipsis.

I think the developer does not using proportional fonts for development, because the plugin works fine if you set fixed width font for your editor.


ollydbg

Quote from: Calmarius on April 16, 2011, 04:23:09 PM
Same problem here.

I think the code completion plugin incorrectly calculates the window's size, that's why you get the ellipsis.

I think the developer does not using proportional fonts for development, because the plugin works fine if you set fixed width font for your editor.


I review the code, and found that the window size is set inside the scintilla control.
see:
http://www.scintilla.org/ScintillaDoc.html#SCI_AUTOCSETMAXHEIGHT

So, this can be changed. :D

and there are some interface in the wxScintilla, see:

// Set the maximum width, in characters, of auto-completion and user lists.
// Set to 0 to autosize to fit longest item, which is the default.
void wxScintilla::AutoCompSetMaxWidth (int characterCount)
{
    SendMsg(SCI_AUTOCSETMAXWIDTH, characterCount, 0);
}

// Get the maximum width, in characters, of auto-completion and user lists.
int wxScintilla::AutoCompGetMaxWidth() const
{
    return SendMsg(SCI_AUTOCGETMAXWIDTH, 0, 0);
}

// Set the maximum height, in rows, of auto-completion and user lists.
// The default is 5 rows.
void wxScintilla::AutoCompSetMaxHeight (int rowCount)
{
    SendMsg(SCI_AUTOCSETMAXHEIGHT, rowCount, 0);
}

// Set the maximum height, in rows, of auto-completion and user lists.
int wxScintilla::AutoCompGetMaxHeight() const
{
    return SendMsg(SCI_AUTOCGETMAXHEIGHT, 0, 0);
}


So, you can change it easily. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.