summaryrefslogtreecommitdiffstats
path: root/gui/listbox.cpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-02-07 23:58:09 +0100
committerGerrit Code Review <gerrit2@gerrit>2014-02-12 18:30:41 +0100
commitede51c528e5cebc7f1930d5c9da541e7d11c0138 (patch)
tree6ea3d7b2a5881cc0489f0b72ffeacd6d4adf7348 /gui/listbox.cpp
parentAllow recovery to be restored if backup=1 flag is present in recovery.fstab (diff)
downloadandroid_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.tar
android_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.tar.gz
android_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.tar.bz2
android_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.tar.lz
android_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.tar.xz
android_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.tar.zst
android_bootable_recovery-ede51c528e5cebc7f1930d5c9da541e7d11c0138.zip
Diffstat (limited to '')
-rw-r--r--gui/listbox.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index 626cbacf4..99e2dedf1 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -51,7 +51,7 @@ extern "C" {
#define SCROLLING_FLOOR 10
#define SCROLLING_MULTIPLIER 6
-GUIListBox::GUIListBox(xml_node<>* node)
+GUIListBox::GUIListBox(xml_node<>* node) : GUIObject(node)
{
xml_attribute<>* attr;
xml_node<>* child;
@@ -352,6 +352,9 @@ GUIListBox::~GUIListBox()
int GUIListBox::Render(void)
{
+ if(!isConditionTrue())
+ return 0;
+
// First step, fill background
gr_color(mBackgroundColor.red, mBackgroundColor.green, mBackgroundColor.blue, 255);
gr_fill(mRenderX, mRenderY + mHeaderH, mRenderW, mRenderH - mHeaderH);
@@ -522,6 +525,9 @@ int GUIListBox::Render(void)
int GUIListBox::Update(void)
{
+ if(!isConditionTrue())
+ return 0;
+
if (!mHeaderIsStatic) {
std::string newValue = gui_parse_text(mHeaderText);
if (mLastValue != newValue) {
@@ -602,6 +608,9 @@ int GUIListBox::GetSelection(int x, int y)
int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y)
{
+ if(!isConditionTrue())
+ return -1;
+
static int lastY = 0, last2Y = 0, fastScroll = 0;
int selection = 0;
@@ -753,6 +762,9 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y)
int GUIListBox::NotifyVarChange(std::string varName, std::string value)
{
+ if(!isConditionTrue())
+ return 0;
+
if (!mHeaderIsStatic) {
std::string newValue = gui_parse_text(mHeaderText);
if (mLastValue != newValue) {