Skip to main content
MSzła.1
Associate III
December 2, 2023
Solved

Don't reconized ScalableImage in MainScreenViewBase.hpp

  • December 2, 2023
  • 2 replies
  • 2170 views

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

This topic has been closed for replies.
Best answer by MSzła.1

Hello

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

2 replies

ST Employee
December 13, 2023

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 MORADIST Software Developer | TouchGFX
MSzła.1
MSzła.1AuthorBest answer
Associate III
December 16, 2023

Hello

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

ST Employee
December 18, 2023

Oh nice, good to know.
Thanks for sharing 

Mohammad MORADIST Software Developer | TouchGFX