cancel
Showing results for 
Search instead for 
Did you mean: 

Don't reconized ScalableImage in MainScreenViewBase.hpp

MSzła.1
Associate III

Hello all,

Maybe someone knows, why the STM32CubeIDE don,t reconize touchgfx::ScalableImage bat_img_w image?

The error message is "Write occurrence of 'ScalableImage'". Of course I genererate code on TouchGFXDesigner and after in STM32CubeIDE. The Image objects ale reconized correctly but ScalableImage don't. I can't use not reconized object in MainScreenView. Below generated code from TouchGFX.

 

 

 

/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#ifndef MAINSCREENVIEWBASE_HPP
#define MAINSCREENVIEWBASE_HPP

#include <gui/common/FrontendApplication.hpp>
#include <mvp/View.hpp>
#include <gui/mainscreen_screen/MainScreenPresenter.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/widgets/Image.hpp>
#include <touchgfx/widgets/ScalableImage.hpp>

class MainScreenViewBase : public touchgfx::View<MainScreenPresenter>
{
public:
    MainScreenViewBase();
    virtual ~MainScreenViewBase();
    virtual void setupScreen();
    virtual void handleTickEvent();
    virtual void handleKeyEvent(uint8_t key);

    /*
     * Virtual Action Handlers
     */
    virtual void tickSlot()
    {
        // Override and implement this function in MainScreen
    }
    virtual void toLightScreen()
    {
        // Override and implement this function in MainScreen
    }
    virtual void toDarkScreen()
    {
        // Override and implement this function in MainScreen
    }

protected:
    FrontendApplication& application() {
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
    }

    /*
     * Member Declarations
     */
    touchgfx::Box __background;
    touchgfx::Image light_background;
    touchgfx::Image dark_background;
    touchgfx::ScalableImage bat_img_w;

private:

};

#endif // MAINSCREENVIEWBASE_HPP

 

 

Thanks for helping me 🙂

 

Some example from STM32CubeIDE:

Zrzut ekranu 2023-12-02 225552.png

Code on simulator and STM32 Discovery works fine, but STM32CubeIDE don't suggests any functions after pressing ALT + Space

1 ACCEPTED SOLUTION

Accepted Solutions
MSzła.1
Associate III

Hello

I fix it by rebuild index. In STM32IDE,  project -> C/C++ index -> rebuild

View solution in original post

3 REPLIES 3

Hello @MSzła.1 ,

It is possible that sometimes when you modify your project and add new code to it, the project in CubeIDE or Visual Studio do not update correctly to accommodate your new code. First please make a backup of your project, then remove your project from the CubeIDE workspace (by right-clicking and selecting delete).Removing Project from WorkspaceRemoving Project from Workspace

After that, delete the build, config, and generated folders from your TouchGFX folder, and finally, regenerate code from the TouchGFX designer. Now, if you open your project again in CubeIDE, the Scalable image should be recognized.
Please update us with the result of this solution.
Good luck

Mohammad MORADI
ST Software Developer | TouchGFX
MSzła.1
Associate III

Hello

I fix it by rebuild index. In STM32IDE,  project -> C/C++ index -> rebuild

Oh nice, good to know.
Thanks for sharing 

Mohammad MORADI
ST Software Developer | TouchGFX