text screen save: try to rework screen save behavior for textbox objects

Screen save now always disabled by default and can be controlled
outside of relevant objects.
This commit is contained in:
2016-01-21 10:56:30 +01:00
parent 9775f1f43a
commit 9d72b086a2
16 changed files with 177 additions and 36 deletions

View File

@@ -35,6 +35,7 @@
#include <gui/components/cc_frm.h>
#include <gui/components/cc_item_progressbar.h>
#include <gui/components/cc_item_text.h>
#include <gui/components/cc_text_screen.h>
#include <zapit/include/zapit/frontend_c.h>
#include <driver/neutrinofonts.h>
@@ -47,7 +48,7 @@ CSignalBar() and their sub classes based up CComponentsForm() and are usable lik
CSignalBar() is intended to show signal rate.
*/
class CSignalBar : public CComponentsForm
class CSignalBar : public CComponentsForm, public CCTextScreen
{
public:
///refresh current item properties, use this before paintScale().
@@ -141,6 +142,27 @@ class CSignalBar : public CComponentsForm
//returns the current signal value
uint16_t getValue(void) { return sb_signal; }
/**Member to modify background behavior of embeded caption objects (value, name)
* @param[in] mode
* @li bool, default = true
* @return
* void
* @see
* Parent member: CCTextScreen::enableTboxSaveScreen()
* CTextBox::enableSaveScreen()
* disableTboxSaveScreen()
*/
void enableTboxSaveScreen(bool mode)
{
if (cc_txt_save_screen == mode)
return;
cc_txt_save_screen = mode;
for(size_t i=0; i<v_cc_items.size(); i++){
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL)
static_cast<CComponentsLabel*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
}
}
};
/// Sub class of CSignalBar()
@@ -237,7 +259,7 @@ void CSampleClass::hide ()
*/
class CSignalBox : public CComponentsForm
class CSignalBox : public CComponentsForm, public CCTextScreen
{
private:
///object: current frontend
@@ -289,8 +311,27 @@ class CSignalBox : public CComponentsForm
///return current snr value
uint16_t getSNRValue(void) { return snrbar->getValue();}
///return current snr value
/**Member to modify background behavior of embeded caption objects (value, name)
* @param[in] mode
* @li bool, default = true
* @return
* void
* @see
* Parent member: CCTextScreen::enableTboxSaveScreen()
* CTextBox::enableSaveScreen()
* disableTboxSaveScreen()
*/
void enableTboxSaveScreen(bool mode)
{
if (cc_txt_save_screen == mode)
return;
cc_txt_save_screen = mode;
for(size_t i=0; i<v_cc_items.size(); i++){
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_FRM_SIGNALBAR)
static_cast<CSignalBar*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
}
};
};
#endif