Code::Blocks Forums

User forums => Help => Topic started by: thecheeselover on November 19, 2012, 03:24:32 am

Title: Code::Blocks autocompletion not working
Post by: thecheeselover on November 19, 2012, 03:24:32 am
Hi,

     I don't understand why autocompletion works for a day and the other it doesn't. In VS, intellisense allows you to check the members/functions of the variable you are pointing at by pressing ''shift + space''. Sometimes it works in CB if I delete the dot before a variable and write it back. Now it doesn't I checked the autocompletion properties and didn't find anything good.

Is there a way to show the members/functions of a variable if I write a dot after it in CB?

Thank you,
thecheeselover
Title: Re: Code::Blocks autocompletion not working
Post by: stahta01 on November 19, 2012, 05:13:05 am
http://wiki.codeblocks.org/index.php?title=FAQ-Issues_and_Workarounds#Q:_I_posted_on_the_forums_that_Code::Blocks_was_not_working.2C_but_no_one_could_help_me.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Issues_and_Workarounds#Q:_I_posted_on_the_forums_that_Code::Blocks_was_not_working.2C_but_no_one_could_help_me.3F)
Title: Re: Code::Blocks autocompletion not working
Post by: thecheeselover on November 19, 2012, 12:27:27 pm
It doesn't answer to my question at all. I still don't know how to trigger autocompletion to check members/functions.
Title: Re: Code::Blocks autocompletion not working
Post by: stahta01 on November 19, 2012, 05:36:00 pm
It doesn't answer to my question at all. I still don't know how to trigger autocompletion to check members/functions.

Since, you give no real info; expect no real help.
Edit: I am not a code completion user; so, not likely to be able to answer even when you give the needed info.
But, you have yet to post anything that gives needed info; you are starting to look like a troll.

Tim S.
Title: Re: Code::Blocks autocompletion not working
Post by: thecheeselover on November 21, 2012, 04:26:55 pm
Hello again,

     What informations would you like? I'm telling you what I know: I'd like Code::Blocks to do like intellisense and show members/functions. For now, Code::Blocks shows me nothing so I have to memorize my code and the code of the libraries I use. I'm sorry if may look like a troll, but it isn't the case. It's only because CB is cross-platform that I don't switch to Visual Studio.
Title: Re: Code::Blocks autocompletion not working
Post by: ollydbg on November 21, 2012, 04:34:56 pm
I'd like Code::Blocks to do like intellisense and show members/functions. For now, Code::Blocks shows me nothing
show us sample code and tell us how to reproduce your issue.
Title: Re: Code::Blocks autocompletion not working
Post by: thecheeselover on November 22, 2012, 12:31:22 pm
The code is a little dirty, but I'll guide you.

Code
#define GLEW_STATIC
#include <glew.h>

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>

#include "../UnforeseenCosmosCore/Math/Matrix4x4.h"
#include "../UnforeseenCosmosCore/Math/Vector3.h"

#define PI 3.14159

int main()
{
    sf::WindowSettings Settings;
Settings.DepthBits         = 24; // Request a 24 bits depth buffer
Settings.StencilBits       = 8;  // Request a 8 bits stencil buffer
Settings.AntialiasingLevel = 2;  // Request 2 levels of antialiasing

    // Create the main window
    sf::RenderWindow App(sf::VideoMode(600, 600, 32), "SFML window", sf::Style::Close, Settings);
   // App.PreserveOpenGLStates(true);
    App.UseVerticalSync(false);
    App.SetActive();

    // Load a sprite to display
    sf::Image Image;
    if (!Image.LoadFromFile("cb.bmp"))
        return EXIT_FAILURE;

    sf::Font MyFont;

    // Load from a font file on disk
    if (!MyFont.LoadFromFile("uni05_54.ttf"))
    {
        // Error...
    }

    sf::String text("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's\n"
                    "sktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", MyFont, 16);

    sf::Sprite Sprite(Image); // HERE

    Sprite.SetPosition(400.f - Sprite.GetSize().x / 2.f, 300.f - Sprite.GetSize().y / 2.f);

    // Set color and depth clear value

glClearColor(0.f, 0.f, 0.f, 0.f);

// Enable Z-buffer read and write
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR);
glDepthMask(GL_TRUE);
glClearDepth(1.f);

// Setup a perspective projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
gluPerspective(90.f, 1.f, 0.1f, 5000.f);
gluLookAt(50.f, 50.f, 50.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f);

/*const float vertices[] =
{
    20.f, 0.f, 10.f,
    30.f, 20.f, 10.f,
    40.f, 0.f, 10.f
};*/

UCC::Vector3<float> v1(0.f, 10.f, 0.f), v2(10.f,  -10.f, 0.f), v3( -10.f,  -10.f, 0.f);
UCC::Matrix4x4<float> matrix;
matrix = UCC::Matrix4x4<float>::CreateFromRotationXYZ_S(PI / 6000.f, PI / 6000.f, PI / 6000.f);

// Start the game loop
    while (App.IsOpened())
    {
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Draw the sprite
       // App.Draw(Sprite);
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR);
glDepthMask(GL_TRUE);
glClearDepth(1.f);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
gluPerspective(90.f, 1.f, 0.1f, 5000.f);
gluLookAt(50.f, 50.f, 50.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glBegin(GL_TRIANGLES);

    glColor3d(1.0, 0.0, 0.0);
    glVertex3f(v1.x, v1.y, v1.z);
    glColor3d(0.0, 1.0, 0.0);
    glVertex3f(v2.x, v2.y, v2.z);
    glColor3d(0.0, 0.0, 1.0);
    glVertex3f(v3.x, v3.y, v3.z);

glEnd();

v1.Transform(matrix);
v2.Transform(matrix);
v3.Transform(matrix);

App.Draw(Sprite);
        // Update the window
        App.Display();
    }

    return EXIT_SUCCESS;
}

     If you take the variable App for exemple, you'll notice that I use two functions: Draw() and Display(). I had to search them on Internet because CB wasn't telling me the members/functions of App. Usually, in CB, you can call auto-completion with ctrl-j or sometimes with ctrl-space. It just doesn't work for me because, as I explained, I can't see members/functions, except for static ones. For exemple, before I write anything, I can see members/functions in the function main. As an other exemple, I can search with auto-complete the variable App, but not its members/functions.

Thank you,
thecheeeselover
Title: Re: Code::Blocks autocompletion not working
Post by: Ryval on April 11, 2015, 11:10:55 pm
This user is looking for something like this to take place when he types a "." or "->" to access the member variables or member functions.

http://i.imgur.com/ig1TkB2.png

He wishes for autocomplete to make use of a dropdown tooltip box and show the available member functions and variables.

Why that was so hard for stahta01 to understand and be mean about it? I don't know.

But yeah, this is what the OP is looking for, and so am I as a new user of Code Blocks coming from VS.

If anyone has any idea how to solve this issue, please respond here or message me.
Title: Re: Code::Blocks autocompletion not working
Post by: ollydbg on April 14, 2015, 07:01:42 am
This user is looking for something like this to take place when he types a "." or "->" to access the member variables or member functions.

http://i.imgur.com/ig1TkB2.png

He wishes for autocomplete to make use of a dropdown tooltip box and show the available member functions and variables.

Why that was so hard for stahta01 to understand and be mean about it? I don't know.

But yeah, this is what the OP is looking for, and so am I as a new user of Code Blocks coming from VS.

If anyone has any idea how to solve this issue, please respond here or message me.
Hi, Ryval, welcome to our forum. I just create a simple sfml project by our wizard, and I get the following auto completion.
See image shot below:
(http://imagizer.imageshack.us/v2/1186x647q90/910/8XBHoM.png)
In-fact, I'm using my local build C::B with some of my patches applied against trunk head.

Can you try the latest nightly build version of C::B.