Changeset 91467d76d94763ea2b01d1f1e06642838293954c

Show
Ignore:
Timestamp:
07/06/08 02:24:04 (2 months ago)
Author:
Felix Paul Kühne <fkuehne@videolan.org>
git-committer:
Felix Paul Kühne <fkuehne@videolan.org> 1215303844 +0200
git-parent:

[189d534ff508044cf0d22886f4160cfb50b7e29f]

git-author:
Felix Paul Kühne <fkuehne@videolan.org> 1215303844 +0200
Message:

Show tooltips on virtually all labels (except for the min/max ones next to sliders)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/macosx/prefs_widgets.m

    r3561b9b r91467d7  
    249249} 
    250250 
    251 #define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label )      \ 
     251#define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label,       \ 
     252    tooltip )                                                               \ 
    252253{                                                                           \ 
    253254    NSRect s_rc = superFrame;                                               \ 
     
    261262    [o_label setSelectable: NO];                                            \ 
    262263    [o_label setStringValue: label];                                        \ 
     264    [o_label setToolTip: tooltip];                                          \ 
    263265    [o_label setFont:[NSFont systemFontOfSize:0]];                          \ 
    264266    [o_label sizeToFit];                                                    \ 
     
    990992    { 
    991993        i_view_type = CONFIG_ITEM_STRING; 
     994        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
     995                              [[VLCMain sharedInstance] localizedString: (char *)p_item->psz_longtext] 
     996                                                          toWidth: PREFS_WRAP]; 
     997 
    992998        /* add the label */ 
    993999        if( p_item->psz_text ) 
     
    9961002        else 
    9971003            o_labelString = [NSString stringWithString:@""]; 
    998         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     1004        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip
    9991005        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    10001006        [self addSubview: o_label]; 
    10011007 
    10021008        /* build the textfield */ 
    1003         o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
    1004             [[VLCMain sharedInstance] localizedString: (char *)p_item->psz_longtext] 
    1005                                          toWidth: PREFS_WRAP]; 
    10061009        if( p_item->value.psz ) 
    10071010            o_textfieldString = [[VLCMain sharedInstance] 
     
    10601063        int i_index; 
    10611064        i_view_type = CONFIG_ITEM_STRING_LIST; 
     1065 
     1066        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
     1067                              [[VLCMain sharedInstance] 
     1068                               localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
     1069 
    10621070        /* add the label */ 
    10631071        if( p_item->psz_text ) 
     
    10661074        else 
    10671075            o_labelString = [NSString stringWithString:@""]; 
    1068         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     1076        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip
    10691077        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    10701078        [self addSubview: o_label]; 
    10711079 
    10721080        /* build the textfield */ 
    1073         o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
    1074             [[VLCMain sharedInstance] 
    1075                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    10761081        ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width, 
    10771082            -2, 0, o_textfieldTooltip ) 
     
    11381143{ 
    11391144    NSRect mainFrame = [o_parent_view frame]; 
    1140     NSString *o_labelString, *o_buttonTooltip, *o_textfieldString; 
    1141     NSString *o_textfieldTooltip; 
     1145    NSString *o_labelString, *o_itemTooltip, *o_textfieldString; 
    11421146    mainFrame.size.height = 46; 
    11431147    mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN; 
     
    11481152    { 
    11491153        i_view_type = CONFIG_ITEM_FILE; 
     1154 
     1155        o_itemTooltip = [[VLCMain sharedInstance] 
     1156                           wrapString: [[VLCMain sharedInstance] 
     1157                                        localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    11501158 
    11511159        /* is it a directory */ 
     
    11581166        else 
    11591167            o_labelString = [NSString stringWithString:@""]; 
    1160         ADD_LABEL( o_label, mainFrame, 0, 3, o_labelString
     1168        ADD_LABEL( o_label, mainFrame, 0, 3, o_labelString, o_itemTooltip
    11611169        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    11621170        [self addSubview: o_label]; 
    11631171 
    11641172        /* build the button */ 
    1165         o_buttonTooltip = [[VLCMain sharedInstance] 
    1166                 wrapString: [[VLCMain sharedInstance] 
    1167                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    1168         ADD_RIGHT_BUTTON( o_button, mainFrame, 0, 0, o_buttonTooltip, 
     1173        ADD_RIGHT_BUTTON( o_button, mainFrame, 0, 0, o_itemTooltip, 
    11691174                            _NS("Browse...") ) 
    11701175        [o_button setAutoresizingMask:NSViewMinXMargin ]; 
     
    11721177 
    11731178        /* build the textfield */ 
    1174         o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
    1175             [[VLCMain sharedInstance] 
    1176                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    11771179        if( p_item->value.psz ) 
    11781180            o_textfieldString = [NSString stringWithFormat: @"%s", (char *)p_item->value.psz]; 
     
    11811183        ADD_TEXTFIELD( o_textfield, mainFrame, 12, 2, mainFrame.size.width - 
    11821184                        8 - [o_button frame].size.width, 
    1183                         o_textfieldTooltip, o_textfieldString ) 
     1185                        o_itemTooltip, o_textfieldString ) 
    11841186        [o_textfield setAutoresizingMask:NSViewWidthSizable ]; 
    11851187        [self addSubview: o_textfield]; 
     
    12581260        i_view_type = CONFIG_ITEM_MODULE; 
    12591261 
     1262        o_popupTooltip = [[VLCMain sharedInstance] wrapString: 
     1263                          [[VLCMain sharedInstance] 
     1264                           localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
     1265 
    12601266        /* add the label */ 
    12611267        if( p_item->psz_text ) 
     
    12641270        else 
    12651271            o_labelString = [NSString stringWithString:@""]; 
    1266         ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString
     1272        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString, o_popupTooltip
    12671273        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    12681274        [self addSubview: o_label]; 
    12691275 
    12701276        /* build the popup */ 
    1271         o_popupTooltip = [[VLCMain sharedInstance] wrapString: 
    1272             [[VLCMain sharedInstance] 
    1273                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    12741277        ADD_POPUP( o_popup, mainFrame, [o_label frame].size.width, 
    12751278            -2, 0, o_popupTooltip ) 
     
    14331436        else 
    14341437            o_labelString = [NSString stringWithString:@""]; 
    1435         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     1438        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip
    14361439        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    14371440        [self addSubview: o_label]; 
     
    15151518        i_view_type = CONFIG_ITEM_STRING_LIST; 
    15161519 
     1520        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
     1521                              [[VLCMain sharedInstance] 
     1522                               localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];         
     1523 
    15171524        /* add the label */ 
    15181525        if( p_item->psz_text ) 
     
    15211528        else 
    15221529            o_labelString = [NSString stringWithString:@""]; 
    1523         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     1530        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip
    15241531        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    15251532        [self addSubview: o_label]; 
    15261533 
    15271534        /* build the textfield */ 
    1528         o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: 
    1529             [[VLCMain sharedInstance] 
    1530                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    15311535        ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width, 
    15321536            -2, 0, o_textfieldTooltip ) 
     
    16041608        i_view_type = CONFIG_ITEM_RANGED_INTEGER; 
    16051609 
     1610        o_tooltip = [[VLCMain sharedInstance] wrapString: 
     1611                     [[VLCMain sharedInstance] 
     1612                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
     1613 
    16061614        /* add the label */ 
    16071615        if( p_item->psz_text ) 
     
    16101618        else 
    16111619            o_labelString = [NSString stringWithString:@""]; 
    1612         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     1620        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip
    16131621        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    16141622        [self addSubview: o_label]; 
    16151623 
    16161624        /* build the textfield */ 
    1617         o_tooltip = [[VLCMain sharedInstance] wrapString: 
    1618             [[VLCMain sharedInstance] 
    1619                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    16201625        ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2, 
    16211626            28, 49, o_tooltip, @"" ) 
     
    16301635 
    16311636        /* build the mintextfield */ 
    1632         ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888"
     1637        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888", @""
    16331638        [o_textfield_min setIntValue: p_item->min.i]; 
    16341639        [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ]; 
     
    16381643        /* build the maxtextfield */ 
    16391644        ADD_LABEL( o_textfield_max, mainFrame, 
    1640                     mainFrame.size.width - 31, -30, @"8888"
     1645                    mainFrame.size.width - 31, -30, @"8888", @""
    16411646        [o_textfield_max setIntValue: p_item->max.i]; 
    16421647        [o_textfield_max setAutoresizingMask:NSViewMinXMargin ]; 
     
    17241729        else 
    17251730            o_labelString = [NSString stringWithString:@""]; 
    1726         ADD_LABEL( o_label, mainFrame, 0, -2, o_labelString
     1731        ADD_LABEL( o_label, mainFrame, 0, -2, o_labelString, o_tooltip
    17271732        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    17281733        [self addSubview: o_label]; 
     
    18041809        i_view_type = CONFIG_ITEM_RANGED_INTEGER; 
    18051810 
     1811        o_tooltip = [[VLCMain sharedInstance] wrapString: 
     1812                     [[VLCMain sharedInstance] 
     1813                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];         
     1814 
    18061815        /* add the label */ 
    18071816        if( p_item->psz_text ) 
     
    18101819        else 
    18111820            o_labelString = [NSString stringWithString:@""]; 
    1812         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     1821        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip
    18131822        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    18141823        [self addSubview: o_label]; 
    18151824 
    18161825        /* build the textfield */ 
    1817         o_tooltip = [[VLCMain sharedInstance] wrapString: 
    1818             [[VLCMain sharedInstance] 
    1819                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    18201826        ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2, 
    18211827            28, 49, o_tooltip, @"" ) 
     
    18301836 
    18311837        /* build the mintextfield */ 
    1832         ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888"
     1838        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888", @""
    18331839        [o_textfield_min setFloatValue: p_item->min.f]; 
    18341840        [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ]; 
     
    18381844        /* build the maxtextfield */ 
    18391845        ADD_LABEL( o_textfield_max, mainFrame, mainFrame.size.width - 31, 
    1840             -30, @"8888"
     1846            -30, @"8888", @""
    18411847        [o_textfield_max setFloatValue: p_item->max.f]; 
    18421848        [o_textfield_max setAutoresizingMask:NSViewMinXMargin ]; 
     
    19301936        else 
    19311937            o_labelString = [NSString stringWithString:@""]; 
    1932         ADD_LABEL( o_label, mainFrame, [o_checkbox frame].size.width, 0, o_labelString
     1938        ADD_LABEL( o_label, mainFrame, [o_checkbox frame].size.width, 0, o_labelString, o_tooltip
    19331939        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    19341940        [self addSubview: o_label]; 
     
    19651971        i_view_type = CONFIG_ITEM_KEY_AFTER_10_3; 
    19661972 
     1973        o_tooltip = [[VLCMain sharedInstance] wrapString: 
     1974                     [[VLCMain sharedInstance] 
     1975                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
     1976 
    19671977        /* add the label */ 
    19681978        if( p_item->psz_text ) 
     
    19711981        else 
    19721982            o_labelString = [NSString stringWithString:@""]; 
    1973         ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString
     1983        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString, o_tooltip
    19741984        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    19751985        [self addSubview: o_label]; 
    19761986 
    19771987        /* build the popup */ 
    1978         o_tooltip = [[VLCMain sharedInstance] wrapString: 
    1979             [[VLCMain sharedInstance] 
    1980                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    19811988        ADD_POPUP( o_popup, mainFrame, [o_label frame].origin.x + 
    19821989            [o_label frame].size.width + 3, 
     
    20952102        i_view_type = CONFIG_ITEM_MODULE_LIST; 
    20962103 
     2104        o_tooltip = [[VLCMain sharedInstance] wrapString: 
     2105                     [[VLCMain sharedInstance] 
     2106                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
     2107 
    20972108        /* add the label */ 
    20982109        if( p_item->psz_text ) 
     
    21012112        else 
    21022113            o_labelString = [NSString stringWithString:@""]; 
    2103         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString
     2114        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip
    21042115        [o_label setAutoresizingMask:NSViewNotSizable ]; 
    21052116        [self addSubview: o_label]; 
    21062117 
    21072118        /* build the textfield */ 
    2108         o_tooltip = [[VLCMain sharedInstance] wrapString: 
    2109             [[VLCMain sharedInstance] 
    2110                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; 
    21112119        if( p_item->value.psz ) 
    21122120            o_textfieldString = [[VLCMain sharedInstance]