Author Topic: CodeCompletion wxWidgets  (Read 19295 times)

Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
CodeCompletion wxWidgets
« 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CodeCompletion wxWidgets
« Reply #1 on: June 29, 2012, 09:13:26 pm »
Test case to reproduce? Works dine here...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeCompletion wxWidgets
« Reply #2 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?

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: CodeCompletion wxWidgets
« Reply #3 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?

Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeCompletion wxWidgets
« Reply #4 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
« Last Edit: June 30, 2012, 12:28:57 am by ANtlord »

Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeCompletion wxWidgets
« Reply #5 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).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CodeCompletion wxWidgets
« Reply #6 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.
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.

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: CodeCompletion wxWidgets
« Reply #7 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


Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeCompletion wxWidgets
« Reply #8 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?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CodeCompletion wxWidgets
« Reply #9 on: July 02, 2012, 01:50:24 pm »
P.S. I thinked all developers use wxWidgets 2.9.3. Am I wrong?
Yes !

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CodeCompletion wxWidgets
« Reply #10 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.
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.

Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeCompletion wxWidgets
« Reply #11 on: July 02, 2012, 05:23:35 pm »
So, Have I only one solution? Use wxWidgets 2.8 ?
« Last Edit: July 02, 2012, 05:33:35 pm by ANtlord »

Offline ANtlord

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeCompletion wxWidgets
« Reply #12 on: July 08, 2012, 03:01:15 pm »
So... I go to downgrade) Solved!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CodeCompletion wxWidgets
« Reply #13 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
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.