cancel
Showing results for 
Search instead for 
Did you mean: 

I created a custom keyboard (as seen as in the TouchGFX examples), but even before I enter the last Screen, where it should be visible, it appears on the screen before. But why?

MWetter
Associate III

Screen3View.hpp (Where the keyboard should be visible)

#ifndef SCREEN3VIEW_HPP
 
#define SCREEN3VIEW_HPP
 
 
#include <gui_generated/screen3_screen/Screen3ViewBase.hpp>
 
#include <gui/screen3_screen/Screen3Presenter.hpp>
 
#include <gui_generated/screen3_screen/Screen3ViewBase.hpp>
 
#include <gui/screen3_screen/Screen3Presenter.hpp>
 
#include <gui/common/CustomKeyboard.hpp>
 
#include <touchgfx/widgets/ButtonWithLabel.hpp>
 
 
class Screen3View : public Screen3ViewBase
 
{
 
public:
 
   Screen3View();
 
   virtual ~Screen3View() {}
 
   virtual void setupScreen();
 
   virtual void tearDownScreen();
 
protected:
 
 
   CustomKeyboard keyboard;
 
 
};
 
 
#endif // SCREEN3VIEW_HPP

```

Screen3View.cpp

Screen3View::Screen3View()
 
{
 
   keyboard.setPosition(16, 16, 400, 240);
 
   add(keyboard);
 
}

Screen4View.hpp (where the keyboard should **not** be visible)

#ifndef SCREEN4VIEW_HPP
 
#define SCREEN4VIEW_HPP
 
 
#include <gui_generated/screen4_screen/Screen4ViewBase.hpp>
 
#include <gui/screen4_screen/Screen4Presenter.hpp>
 
 
class Screen4View : public Screen4ViewBase
 
{
 
public:
 
   Screen4View();
 
   virtual ~Screen4View() {}
 
   virtual void setupScreen();
 
   virtual void tearDownScreen();
 
protected:
 
};
 
 
#endif // SCREEN4VIEW_HPP
 
```
 
 

Screen4View.cpp

Screen4View::Screen4View()
 
{
 
 
}
 
 
 

all other.cpp of the TouchGFX files "say" the exact same thing.

Just Screen 3 should have this keyboard, and not Screen 4 too.

So if anybody has an idea why it is like that please answer. :)

Thank you very much.

1 REPLY 1
Martin KJELDSEN
Chief III

Hi,

Am i to understand that Screen 4 is just an empty canvas?

Imagine what happens if you "switch to a screen" that renders nothing - What would you expect to be in the framebuffer? (Hint: A Blank canvas is like looking out of your window).

/Martin