Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: ANtlord on June 29, 2012, 08:23:05 pm

Title: CodeCompletion wxWidgets
Post by: ANtlord on June 29, 2012, 08:23:05 pm
Hello to all!
Can somebody help me with next problem? CodeCompletion doesn't work in wxWidgets's projects. And code's auto-completion doesn't work with wx libs not only. It doesn't work with OpenGL's librarys, OpenAL, STL etc.
But If I create Console project or Glut project, than CodeCompletion work very nice.
I use CodeBlocks 10.05, wxWidgets 2.9.3, Linux Mint 12.

Regards.
Title: Re: CodeCompletion wxWidgets
Post by: MortenMacFly on June 29, 2012, 09:13:26 pm
Test case to reproduce? Works dine here...
Title: Re: CodeCompletion wxWidgets
Post by: ANtlord on June 29, 2012, 10:27:23 pm
Excuse me, maybe I don't know some tools. And I don't understand, what you mean. Can you explain? What I should do?
Title: Re: CodeCompletion wxWidgets
Post by: ouch on June 29, 2012, 10:59:57 pm
Works fine for me too. Have you added the header files that you want parsed to your project?
Title: Re: CodeCompletion wxWidgets
Post by: ANtlord on June 29, 2012, 11:51:37 pm
Should I add every file for parse? Or can I add them in groups? And how do it? Settings->Compiler and debugger->Search directories->Compiler here?

P.S. "Parse preprocessor derctives" is enabled in Settings->Editor->Code-completion and symbols browser->C/C++ parser
Title: Re: CodeCompletion wxWidgets
Post by: ANtlord on July 02, 2012, 02:51:17 am
Did I ask question incorrent? Or problem has no solution?
I forgot send some details. I have some code completion,  but it has methods and variables from my files (which I create myself). And it has some constants from wxWidget's libraries. But it hasn't important methods (example: GetSize, Create, GetVaue,  etc).
Title: Re: CodeCompletion wxWidgets
Post by: ollydbg on July 02, 2012, 04:08:18 am
Did I ask question incorrent? Or problem has no solution?
I forgot send some details. I have some code completion,  but it has methods and variables from my files (which I create myself). And it has some constants from wxWidget's libraries. But it hasn't important methods (example: GetSize, Create, GetVaue,  etc).
Tell us how to reproduce your bugs. Otherwise, how can we help you???
I don't have such issue. But please note that the C++ parser in our CodeCompletion is not 100% good enough.
Title: Re: CodeCompletion wxWidgets
Post by: eranif on July 02, 2012, 06:41:49 am
Tell us how to reproduce your bugs. Otherwise, how can we help you???
I don't have such issue. But please note that the C++ parser in our CodeCompletion is not 100% good enough.
The OP has given you all the information that you need. The important bit was that he is using wx2.9.3

Here is my guess:

Since wxWidgets 2.9.3, the wx team changed the inheritance of their base classes.
If in wx < 2.9.3 the inheritance was something like this:

wxPanel -> wxPanelbase -> wxWindow -> ...

it is now has become:

wxPanel -> wxPanelBase -> wxNavigationEnabled<wxWindow>

So C::B should be able to handle this kind of inheritance, otherwise all the basic wxWindow functions will not be available (like: GetSizer(), GetSize(), Create(), SetBackgroundColour() etc. which are all members of wxWindow)

HTH,
Eran

Title: Re: CodeCompletion wxWidgets
Post by: ANtlord on July 02, 2012, 01:47:10 pm
Quote
Tell us how to reproduce your bugs. Otherwise, how can we help you???
I don't have such issue. But please note that the C++ parser in our CodeCompletion is not 100% good enough.
Sorry. This is easy Example:
I create wxWidgets's project an I want get window's width. For this I write in сonstructor "this->", press Ctrl+Space and I don't detect in popup list method "GetSize".

Eran, if  CodeBlocks isn't able for this, do you have idea, how fix this?

P.S. I thinked all developers use wxWidgets 2.9.3. Am I wrong?
Title: Re: CodeCompletion wxWidgets
Post by: Jenna on July 02, 2012, 01:50:24 pm
P.S. I thinked all developers use wxWidgets 2.9.3. Am I wrong?
Yes !
Title: Re: CodeCompletion wxWidgets
Post by: ollydbg on July 02, 2012, 05:13:52 pm
Tell us how to reproduce your bugs. Otherwise, how can we help you???
I don't have such issue. But please note that the C++ parser in our CodeCompletion is not 100% good enough.
The OP has given you all the information that you need. The important bit was that he is using wx2.9.3

Here is my guess:

Since wxWidgets 2.9.3, the wx team changed the inheritance of their base classes.
If in wx < 2.9.3 the inheritance was something like this:

wxPanel -> wxPanelbase -> wxWindow -> ...

it is now has become:

wxPanel -> wxPanelBase -> wxNavigationEnabled<wxWindow>

So C::B should be able to handle this kind of inheritance, otherwise all the basic wxWindow functions will not be available (like: GetSizer(), GetSize(), Create(), SetBackgroundColour() etc. which are all members of wxWindow)

HTH,
Eran


Thanks, I just test it, and I see that CC's parser does not handle wxNavigationEnabled<wxWindow> correctly under wx 2.9.x.

I see some code like:

Code
// The template parameter W must be a wxWindow-derived class.
template <class W>
class wxNavigationEnabled : public W
{
public:
    typedef W BaseWindowClass;


So, wxNavigationEnabled<wxWindow>  is in fact a descendant of wxWindow.
Title: Re: CodeCompletion wxWidgets
Post by: ANtlord on July 02, 2012, 05:23:35 pm
So, Have I only one solution? Use wxWidgets 2.8 ?
Title: Re: CodeCompletion wxWidgets
Post by: ANtlord on July 08, 2012, 03:01:15 pm
So... I go to downgrade) Solved!
Title: Re: CodeCompletion wxWidgets
Post by: ollydbg on July 08, 2012, 03:26:06 pm
So... I go to downgrade) Solved!
I'm going to implement this.
Currently, I have add the solving of expression statement in our parsertest.
The ongoing work was to implement better template handling( template type replacement )
You can follow the thread:
Intergrate the nativeparser_base to our parsertest project (http://forums.codeblocks.org/index.php/topic,16559.msg112342.html#msg112342)