mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
CExtendedInput: Add saveScreen & restoreScreen() functions
Origin commit data
------------------
Commit: f396037078
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-10-26 (Wed, 26 Oct 2016)
This commit is contained in:
@@ -92,6 +92,9 @@ void CExtendedInput::Init(void)
|
|||||||
|
|
||||||
x = getScreenStartX(width);
|
x = getScreenStartX(width);
|
||||||
y = getScreenStartY(height);
|
y = getScreenStartY(height);
|
||||||
|
|
||||||
|
savescreen = false;
|
||||||
|
background = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CExtendedInput::~CExtendedInput()
|
CExtendedInput::~CExtendedInput()
|
||||||
@@ -136,6 +139,34 @@ void CExtendedInput::calculateDialog()
|
|||||||
y = getScreenStartY(height);
|
y = getScreenStartY(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CExtendedInput::saveScreen()
|
||||||
|
{
|
||||||
|
if(!savescreen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
delete[] background;
|
||||||
|
|
||||||
|
background = new fb_pixel_t [width * height];
|
||||||
|
if(background)
|
||||||
|
frameBuffer->SaveScreen(x, y, width, height, background);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CExtendedInput::restoreScreen()
|
||||||
|
{
|
||||||
|
if(background) {
|
||||||
|
if(savescreen)
|
||||||
|
frameBuffer->RestoreScreen(x, y, width, height, background);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CExtendedInput::enableSaveScreen(bool enable)
|
||||||
|
{
|
||||||
|
savescreen = enable;
|
||||||
|
if (!enable && background) {
|
||||||
|
delete[] background;
|
||||||
|
background = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int CExtendedInput::exec( CMenuTarget* parent, const std::string & )
|
int CExtendedInput::exec( CMenuTarget* parent, const std::string & )
|
||||||
{
|
{
|
||||||
@@ -151,6 +182,8 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & )
|
|||||||
|
|
||||||
std::string oldval = *valueString;
|
std::string oldval = *valueString;
|
||||||
std::string dispval = *valueString;
|
std::string dispval = *valueString;
|
||||||
|
if (savescreen)
|
||||||
|
saveScreen();
|
||||||
paint();
|
paint();
|
||||||
frameBuffer->blit();
|
frameBuffer->blit();
|
||||||
|
|
||||||
@@ -285,7 +318,10 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & )
|
|||||||
|
|
||||||
void CExtendedInput::hide()
|
void CExtendedInput::hide()
|
||||||
{
|
{
|
||||||
frameBuffer->paintBackgroundBoxRel(x, y, width, height);
|
if (savescreen && background)
|
||||||
|
restoreScreen();
|
||||||
|
else
|
||||||
|
frameBuffer->paintBackgroundBoxRel(x, y, width, height);
|
||||||
frameBuffer->blit();
|
frameBuffer->blit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,6 +70,11 @@ class CExtendedInput : public CMenuTarget
|
|||||||
CChangeObserver* observ;
|
CChangeObserver* observ;
|
||||||
bool* cancel;
|
bool* cancel;
|
||||||
|
|
||||||
|
fb_pixel_t *background;
|
||||||
|
bool savescreen;
|
||||||
|
void saveScreen();
|
||||||
|
void restoreScreen();
|
||||||
|
|
||||||
virtual void paint();
|
virtual void paint();
|
||||||
virtual void onBeforeExec(){};
|
virtual void onBeforeExec(){};
|
||||||
virtual void onAfterExec(){};
|
virtual void onAfterExec(){};
|
||||||
@@ -85,6 +90,8 @@ class CExtendedInput : public CMenuTarget
|
|||||||
void calculateDialog();
|
void calculateDialog();
|
||||||
|
|
||||||
void addInputField( CExtendedInput_Item* );
|
void addInputField( CExtendedInput_Item* );
|
||||||
|
|
||||||
|
void enableSaveScreen(bool enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user