Changeset 15261


Ignore:
Timestamp:
04/14/12 13:00:04 (11 years ago)
Author:
nit
Message:

[titan] extend menulist

Location:
titan/titan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/ipkg.h

    r15249 r15261  
    553553
    554554                        tmpmlist = addmenulist(&mlist, tmpstr, tmpinfo, tmppic, 0, 0);
    555                         changemenulistparam(tmpmlist, node->showname);
     555                        changemenulistparam(tmpmlist, node->showname, NULL);
    556556                        free(tmpstr); tmpstr = NULL;
    557557                        free(tmpinfo); tmpinfo = NULL;
  • titan/titan/menulist.h

    r15253 r15261  
    2626                                free(prev->param);
    2727                                prev->param = NULL;
     28
     29                                free(prev->param1);
     30                                prev->param1 = NULL;
    2831                        }
    2932
     
    3538}
    3639
    37 void changemenulistparam(struct menulist* mlist, char* param)
     40void changemenulistparam(struct menulist* mlist, char* param, char* param1)
    3841{
    3942        if(mlist != NULL)
     
    4144                free(mlist->param);
    4245                mlist->param = ostrcat(param, NULL, 0, 0);
     46
     47                free(mlist->param1);
     48                mlist->param1 = ostrcat(param1, NULL, 0, 0);
    4349        }
    4450}
     
    114120// showpng = 2 (big icon)
    115121//flag 1: rcgreen = subchannel
    116 struct menulist* menulistbox(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* defaultpic, int showpng, int flag)
     122struct menulist* menulistboxext(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* defaultpic, int showpng, int* rcreturn, int flag)
    117123{
    118124        debug(1000, "in");
     
    126132        char* tmppic = NULL;
    127133        char* tmpstr = NULL;
    128 
    129         if(mlist == NULL) return 0;
    130134
    131135        if(pthread_self() != status.mainthread)
     
    249253        addscreenrc(screen, listbox);
    250254
    251         while (1)
     255        while(1)
    252256        {
    253257                rcret = waitrc(screen, 0, 0);
    254 
    255                 if(rcret==getrcconfigint("rcexit", NULL)) break;
    256                 if(flag == 1 && rcret==getrcconfigint("rcgreen", NULL))
     258                if(rcreturn != NULL) *rcreturn = rcret;
     259
     260                if(rcret == getrcconfigint("rcexit", NULL)) break;
     261                if(flag == 1 && rcret == getrcconfigint("rcgreen", NULL))
    257262                {
    258263                        clearscreen(screen);
     
    260265                        break;
    261266                }
    262                 if(listbox->select != NULL && rcret==getrcconfigint("rcok", NULL))
     267                if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rcred", NULL) || rcret == getrcconfigint("rcgreen", NULL) || rcret == getrcconfigint("rcyellow", NULL) || rcret == getrcconfigint("rcblue", NULL))
    263268                {
    264                         ret = (struct menulist*)listbox->select->handle;
     269                        if(rcreturn == NULL && rcret != getrcconfigint("rcok", NULL))
     270                                continue;
     271
     272                        if(listbox->select != NULL)
     273                                ret = (struct menulist*)listbox->select->handle;
    265274                        break;
    266275                }
     
    290299}
    291300
     301struct menulist* menulistbox(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* defaultpic, int showpng, int flag)
     302{
     303        return menulistboxext(mlist, paramskinname, skintitle, paramskinpath, defaultpic, showpng, NULL, flag);
     304}
    292305#endif
  • titan/titan/struct.h

    r15182 r15261  
    178178        char* pic;
    179179        char* param;
     180        char* param1;
    180181        int deaktiv;
    181182        int defaultentry;
Note: See TracChangeset for help on using the changeset viewer.