Author Topic: code completion does not get focus  (Read 30496 times)

Offline Jorg

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: code completion does not get focus
« Reply #15 on: November 22, 2005, 09:05:24 am »
I have been pointed to this thread from my original one. This is my config:

KDE3.4 (I think)
Suse 10
CodeBlocks from SUSE10, CVS build rpm

Just to think along (as I am a wxWidgets developer too) what window do you use ? Is it a normal window? I assume you are using wxSTC or wxScintilla for your source display, right ? Maybe it helps if that has a method to display the code completion list. Also making the window show modal (if that is desired I do not know) might solve your problem as it will not switch focus to the disabled parent.

- Jorgen



Offline Jorg

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: code completion does not get focus
« Reply #16 on: November 23, 2005, 08:52:25 am »
Ok I think I found a way around it. Sorry to dissapoint all KDE guys, but Gnome seems to behave MUCH better with Code::Blocks in many ways.. The search dialog for example also did not show the focus on the text ctrl which is also nice if one would like to quickly find something. In Gnome the focus is properly set to the code completion box, and the search box. Also the code completion box could be properly resized and moved without problems.

It is definately a window manager issue. I have abandoned KDE for now, as I am more into minimalism anyway, and Gnome works faster.

Besides this minor inconsistency between Windowmanagers (which I truely believe cannot be Code::Blocks fault) I am very-very pleased with this IDE. It works great in debugging, building and coding .. :-) Keep up the good work guys!

- Jorgen

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: code completion does not get focus
« Reply #17 on: November 25, 2005, 06:05:45 pm »
Good news: It seems as I have found a solution for this problem - it at least works on enlightenment e16 now.
The only necessary change is adding the flag wxFRAME_FLOAT_ON_PARENT to the style list the constructor of CCList passes to the constructor of its base class 'wxFrame'. This takes place on line 65 of the file 'src/plugins/codecompletion/cclist.cpp'. (I used the version which was available from cvs today).
Maybe some other guys could test this with other window managers and report if it works there, too.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline Jorg

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: code completion does not get focus
« Reply #18 on: November 26, 2005, 02:40:29 pm »
It would be great if I could get a RPM or a precompiled binary to try ;-) I think building C::B from CVS is a bit too much for me..
I am now using C:: with Gnome, but it seems KDE works better under Suse (I bet that is why they made it default) and I am also experiencing some weird GUI hangups and error sometimes (not C::B related).

Thanks in advance,
- Jorgen

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: code completion does not get focus
« Reply #19 on: November 30, 2005, 01:06:11 pm »
*push*
Did anyone test my solution yet? Would be nice to know if this works one more than just one window manager...
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline Jorg

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: code completion does not get focus
« Reply #20 on: November 30, 2005, 01:10:28 pm »
I would like to but i cannot compile C::B from CVS, I get weird errors with wx2.6.2 like wxWindow::SetTitle() undefined, which is correct, because a grep on it did not show any hints. What wx version is C::B using anyway?

I also got weird linker errors, so I could not continue trying to build it. I tried configuring C::B with disable-shared to make a static build but to no avail.

- Jorgen

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: code completion does not get focus
« Reply #21 on: November 30, 2005, 01:37:59 pm »
Which compiler did you use? I got lots of errors, too, when I tried to compile Code::Blocks with gcc 3.3.6. With gcc 3.4.4 (and wxGTK-2.6.1) I was able to compile the svn-version from the last weekend without any problems using the following commands:
Code
./bootstrap
./configure --enable-contrib --with-wx-config=wx-config-2.6
make
make install
(The last one of course requires root-privileges.)
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: code completion does not get focus
« Reply #22 on: December 01, 2005, 02:20:58 pm »
Your build problems are probably due to a bug in the makefile. Look here http://forums.codeblocks.org/index.php?topic=1429.msg10768#msg10768 for an explanation how I got around it. The bug is a sneaky one because if you have successfully built a recent version of C::B it won't show up, otherwise you get all sorts of wierd link errors.

Anyway, back on topic. I just tried the latest CVS head.
GNOME:
Works perfectly

IceWM
Works OK but window disappears as soon as you try to resize it

KDE
Window does not get the focus but at least it does not disappear when you click on it now.
Window disappears if you try to resize it

WindowMaker
Window gets the focus but if you move the mouse over it then off of it the window disappears (focus follows mouse?)
Window disappears if you try to resize it

All of these are on Mandriva 2006
« Last Edit: December 01, 2005, 02:23:48 pm by lesnewell »

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: code completion does not get focus
« Reply #23 on: December 01, 2005, 03:51:42 pm »
Did you test with my solution or just the source which is currently in the svn repository? If it was just the source code from svn then could you please repeat your test on KDE with the modification I described in this post? Because this fixes the focus-problem on enlightenment e16 and it would be nice to know if it works on KDE, too.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: code completion does not get focus
« Reply #24 on: December 01, 2005, 10:22:06 pm »
Sorry, I thought it had been committed. OK, tried it and it make no difference on KDE. Can't currently try the other window managers. Hmm, GNOME is looking like a good idea ;-)