mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CStringInput: Make saveScreen changeable with forceSaveScreen()
This commit is contained in:
@@ -150,6 +150,8 @@ void CStringInput::init()
|
|||||||
y = getScreenStartY(height);
|
y = getScreenStartY(height);
|
||||||
selected = 0;
|
selected = 0;
|
||||||
smstimer = 0;
|
smstimer = 0;
|
||||||
|
force_saveScreen = false;
|
||||||
|
pixBuf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStringInput::NormalKeyPressed(const neutrino_msg_t key)
|
void CStringInput::NormalKeyPressed(const neutrino_msg_t key)
|
||||||
@@ -377,6 +379,15 @@ std::string &CStringInput::getValue(void)
|
|||||||
return *valueString;
|
return *valueString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CStringInput::forceSaveScreen(bool enable)
|
||||||
|
{
|
||||||
|
force_saveScreen = enable;
|
||||||
|
if (!enable && pixBuf) {
|
||||||
|
delete[] pixBuf;
|
||||||
|
pixBuf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int CStringInput::exec( CMenuTarget* parent, const std::string & )
|
int CStringInput::exec( CMenuTarget* parent, const std::string & )
|
||||||
{
|
{
|
||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
@@ -392,11 +403,12 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
|
|||||||
if (size > (int) valueString->length())
|
if (size > (int) valueString->length())
|
||||||
valueString->append(size - valueString->length(), ' ');
|
valueString->append(size - valueString->length(), ' ');
|
||||||
|
|
||||||
fb_pixel_t * pixbuf = NULL;
|
if (pixBuf)
|
||||||
if (!parent) {
|
delete[] pixBuf;
|
||||||
pixbuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)];
|
if (!parent || force_saveScreen) {
|
||||||
if (pixbuf)
|
pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)];
|
||||||
frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf);
|
if (pixBuf)
|
||||||
|
frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
paint();
|
paint();
|
||||||
@@ -517,10 +529,11 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pixbuf)
|
if (pixBuf)
|
||||||
{
|
{
|
||||||
frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf);
|
frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixBuf);
|
||||||
delete[] pixbuf;//Mismatching allocation and deallocation: pixbuf
|
delete[] pixBuf;
|
||||||
|
pixBuf = NULL;
|
||||||
frameBuffer->blit();
|
frameBuffer->blit();
|
||||||
} else
|
} else
|
||||||
hide();
|
hide();
|
||||||
|
@@ -61,6 +61,8 @@ class CStringInput : public CMenuTarget
|
|||||||
int size;
|
int size;
|
||||||
int selected;
|
int selected;
|
||||||
CChangeObserver * observ;
|
CChangeObserver * observ;
|
||||||
|
bool force_saveScreen;
|
||||||
|
fb_pixel_t *pixBuf;
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
|
|
||||||
@@ -91,6 +93,8 @@ class CStringInput : public CMenuTarget
|
|||||||
int exec( CMenuTarget* parent, const std::string & actionKey );
|
int exec( CMenuTarget* parent, const std::string & actionKey );
|
||||||
void setMinMax(const int min_value, const int max_value);
|
void setMinMax(const int min_value, const int max_value);
|
||||||
virtual std::string &getValue(void);
|
virtual std::string &getValue(void);
|
||||||
|
|
||||||
|
void forceSaveScreen(bool enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CStringInputSMS : public CStringInput
|
class CStringInputSMS : public CStringInput
|
||||||
|
Reference in New Issue
Block a user