optionBoxes[selectedOption]->setActive(1);
return 1;
}
- else
+ else if (selectedOption == 0)
{
optionBoxes[selectedOption--]->setActive(0);
return 4; // Signal return control to parent
}
+ else if (selectedOption == -1) // Allow UP when inactive, start at the last optionBox
+ {
+ selectedOption = numOptions - 1;
+ optionBoxes[selectedOption]->setActive(1);
+ return 1;
+ }
}
case Remote::DF_DOWN:
case Remote::DOWN:
case Remote::DOWN:
case Remote::DF_DOWN:
{
- buttonBarActive = false;
- tabs[visiblePane].button->dim();
- symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND;
- symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND;
- if (tabs[visiblePane].pane->handleCommand(command) == 1) // shouldn't return anything else at this point?!
+ int handleResult = tabs[visiblePane].pane->handleCommand(command);
+ // A WOptionPane will accept control being passed into it from inactive, up or down (== 1).
+ // A WTextBox will only accept control if it will scroll (== 1). It will refuse if not (== 4).
+
+ if (handleResult == 1)
{
+ buttonBarActive = false;
+ tabs[visiblePane].button->dim();
+ symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND;
+ symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND;
draw();
return 1;
}
- }
+ else if (handleResult == 4)
+ {
+ // Do nothing.
+ return 2;
+ }
+ else
+ {
+ Log::getInstance()->log("WTabBar", Log::ERR, "Up/Down client returned not 1 or 4");
+ }
+ }
}
}
return 0;