Changeset 256

Show
Ignore:
Timestamp:
07/03/07 19:17:14 (1 year ago)
Author:
ajps
Message:

Added caseless tag selections to menu code - used new flag in the main options menu.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cmd4.c

    r254 r256  
    41474147        menu->title = "Options Menu"; 
    41484148        menu->menu_data = option_actions; 
     4149        menu->flags = MN_CASELESS_TAGS; 
    41494150        menu->cmd_keys = cmd_keys; 
    41504151        menu->count = N_ELEMENTS(option_actions); 
  • trunk/src/ui.c

    r220 r256  
    495495        int n = menu->filter_count; 
    496496 
     497        if (MN_CASELESS_TAGS) 
     498                key = toupper((unsigned char) key); 
     499 
    497500        if (menu->flags & MN_NO_TAGS) 
    498501        { 
     
    504507                { 
    505508                        char c = menu->skin->get_tag(menu, i); 
     509 
     510                        if ((menu->flags & MN_CASELESS_TAGS) && c) 
     511                                c = toupper((unsigned char) c); 
     512 
    506513                        if (c && c == key) 
    507514                                return i + menu->top; 
     
    512519                for (i = 0; menu->selections[i]; i++) 
    513520                { 
    514                         if (menu->selections[i] == key) 
     521                        char c = menu->selections[i]; 
     522 
     523                        if (menu->flags & MN_CASELESS_TAGS) 
     524                                c = toupper((unsigned char) c); 
     525 
     526                        if (c == key) 
    515527                                return i; 
    516528                } 
     
    522534                        int oid = menu->object_list ? menu->object_list[i] : i; 
    523535                        char c = menu->row_funcs->get_tag(menu, oid); 
     536 
     537                        if ((menu->flags & MN_CASELESS_TAGS) && c) 
     538                                c = toupper((unsigned char) c); 
     539 
    524540                        if (c && c == key) 
    525541                                return i; 
  • trunk/src/ui.h

    r254 r256  
    221221        MN_NO_TAGS      = 0x0200, /* No tags -- movement key and mouse browsing only */ 
    222222        MN_PVT_TAGS = 0x0400, /* Tags to be generated by the display function */ 
     223        MN_CASELESS_TAGS = 0x0800, /* Tag selections can be made regardless of the case of the key pressed. - i.e. 'a' activates the line tagges 'A'. */ 
    223224 
    224225        MN_DBL_TAP      = 0x1000, /* double tap for selection; single tap is cursor movement */ 
     
    234235        MN_SELECTABLE   = 0x0800000,    /* Row is permitted to be selected */ 
    235236        MN_HIDDEN               = 0x1000000             /* Row is hidden, but may be selected via */ 
    236                                                                         /* key-binding. (Useful for lower case alternante) */ 
     237                                                                        /* key-binding. */ 
    237238} menu_flags; 
    238239