Ticket #3257: ui.patch

File ui.patch, 2.9 KB (added by craig@…, 17 years ago)
  • libs/libmyth/uitypes.cpp

     
    41344134    return false;
    41354135}
    41364136
     4137bool UIManagedTreeListType::moveUpByAmt(int number_up, bool do_refresh)
     4138{
     4139    if (!current_node)
     4140    {
     4141        return false;
     4142    }
     4143    //
     4144    //  Move the active node to the
     4145    //  current active node's previous
     4146    //  sibling
     4147    //
     4148
     4149    GenericTree *new_node = current_node->prevSibling(number_up, visual_order);
     4150    if (new_node)
     4151    {
     4152        current_node = new_node;
     4153        if (do_refresh)
     4154        {
     4155            if (show_whole_tree)
     4156            {
     4157                for(int i = active_bin; i <= bins; i++)
     4158                {
     4159                    emit requestUpdate(screen_corners[i]);
     4160                }
     4161            }
     4162            else
     4163            {
     4164                refresh();
     4165            }
     4166        }
     4167        emit nodeEntered(current_node->getInt(), current_node->getAttributes());
     4168        current_node->becomeSelectedChild();
     4169        return true;
     4170    }
     4171    return false;
     4172}
     4173
    41374174bool UIManagedTreeListType::moveDown(bool do_refresh)
    41384175{
    41394176    if (!current_node)
     
    41724209    return false;
    41734210}
    41744211
     4212bool UIManagedTreeListType::moveDownByAmt(int number_down, bool do_refresh)
     4213{
     4214    if (!current_node)
     4215    {
     4216        return false;
     4217    }
     4218
     4219    //
     4220    //  Move the active node to the
     4221    //  current active node's next
     4222    //  sibling
     4223    //
     4224
     4225    GenericTree *new_node = current_node->nextSibling(number_down, visual_order);
     4226    if (new_node)
     4227    {
     4228        current_node = new_node;
     4229        if (do_refresh)
     4230        {
     4231            if (show_whole_tree)
     4232            {
     4233                for(int i = active_bin; i <= bins; i++)
     4234                {
     4235                    emit requestUpdate(screen_corners[i]);
     4236                }
     4237            }
     4238            else
     4239            {
     4240                refresh();
     4241            }
     4242        }
     4243        emit nodeEntered(current_node->getInt(), current_node->getAttributes());
     4244        current_node->becomeSelectedChild();
     4245        return true;
     4246    }
     4247    return false;
     4248}
     4249
    41754250bool UIManagedTreeListType::incSearchStart(void)
    41764251{
    41774252    MythPopupBox *popup = new MythPopupBox(gContext->GetMainWindow(),
  • libs/libmyth/uitypes.h

     
    10941094    bool    popUp();
    10951095    bool    pushDown();
    10961096    bool    moveUp(bool do_refresh = true);
     1097    bool    moveUpByAmt(int number_up = 1, bool do_refresh = true);
    10971098    bool    moveDown(bool do_refresh = true);
     1099    bool    moveDownByAmt(int number_down = 1, bool do_refresh = true);
    10981100    bool    pageUp();
    10991101    bool    pageDown();
    11001102    bool    nextActive(bool wrap_around, bool traverse_up_down);