Author Topic: How to resize code completion window?  (Read 6528 times)

coolcoolcat

  • Guest
How to resize code completion window?
« on: October 26, 2010, 05:12:12 pm »
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

Offline Calmarius

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: How to resize code completion window?
« Reply #1 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.


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How to resize code completion window?
« Reply #2 on: April 16, 2011, 04:53:54 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:
Code
// 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.