Code completion with Fox Toolkit

General questions regarding the usage of CodeLite
doctor_vitus
CodeLite Curious
Posts: 5
Joined: Fri Dec 11, 2009 9:01 pm
Genuine User: Yes
IDE Question: C++
Contact:

Code completion with Fox Toolkit

Post by doctor_vitus »

Hi,

has anybody managed to get code completion of CodeLite to work for the Fox Toolkit library (current stable version 1.6.37, http://fox-toolkit.org/)?

Operating system is a current Arch Linux x86_64, Fox Toolkit from the repositories, self-compiled CodeLite v2.0.0.3431.

I created a new Simple Executable (g++) project, set -g;$(shell fox-config --cflags) as the compiler options and -g;$(shell fox-config --libs) as the linker options.

The Hello World example from http://en.wikipedia.org/wiki/Fox_toolkit compiles just fine, but there is no code completion.

Any hints?

Thanks in advance and best regards,
doctor_vitus
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion with Fox Toolkit

Post by eranif »

You need to add the paths of FOX to the code-completion parser.

Read this:

http://codelite.org/LiteEditor/CodeCompletion
and this:
http://codelite.org/LiteEditor/SettingUpCodeCompletion

If you still got some problems - post again
Eran
Make sure you have read the HOW TO POST thread
doctor_vitus
CodeLite Curious
Posts: 5
Joined: Fri Dec 11, 2009 9:01 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion with Fox Toolkit

Post by doctor_vitus »

Hi Eran,

thanks for your reply. I added /usr/include/fox-1.6 to the workspace's parser include paths and retagged the workspace. Unfortunately it did not make any difference. Also restarting CodeLite and rebuilding the project didn't help.

I tried to include one class header file explicitely (instead of including only fx.h) using

Code: Select all

#include "FXButton.h"
assigning the Button from the sample code to a variable

Code: Select all

FXButton *b=new FXButton(main, "&Hello, World!", NULL, &application, FXApp::ID_QUIT);
It all compiles fine, but if i try to run code completion for b, nothing happens.

Best regards,
doctor_vitus
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion with Fox Toolkit

Post by eranif »

Ok, I downloaded the FOX toolkit, I set up the following and it is working:

- I added the following path the parser include files:

Code: Select all

C:\Development\C++\fox-1.6.37\include
Notice the 'include' since this is where FXButton.h really exist.

- Open the tags settings dialog (from the menu: 'Settings -> Tags Settings') and select the 'Advanced tab.
Open the pre-processor list, and add this at the bottom:

Code: Select all

FXAPI
FXDECLARE
- Retag your workspace (from the menu: "Workspace -> Retag Workspace (FULL)")

Should be working now (see attachment)
fox-cc.png
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
doctor_vitus
CodeLite Curious
Posts: 5
Joined: Fri Dec 11, 2009 9:01 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion with Fox Toolkit

Post by doctor_vitus »

Now it's working for me, too.

The first problem was that I did not specify the FX namespace. GCC does not seem to care about this, but code completion does not work unless you either use the FX:: prefix on the variable declaration or add

Code: Select all

using namespace FX;
The second problem was that the Hello World example from Wikipedia which I used for testing uses main as the variable name for the main window object. Even with the above, code completion did not work for this, as (I suppose) main is treated as a reserved keyword. As soon as I changed the name to w, this worked for me, too.

Thanks a lot for your efforts and your great support, Eran. Have a nice weekend.
Post Reply