Changeset 91467d76d94763ea2b01d1f1e06642838293954c
- 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
| r3561b9b |
r91467d7 |
|
| 249 | 249 | } |
|---|
| 250 | 250 | |
|---|
| 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 ) \ |
|---|
| 252 | 253 | { \ |
|---|
| 253 | 254 | NSRect s_rc = superFrame; \ |
|---|
| … | … | |
| 261 | 262 | [o_label setSelectable: NO]; \ |
|---|
| 262 | 263 | [o_label setStringValue: label]; \ |
|---|
| | 264 | [o_label setToolTip: tooltip]; \ |
|---|
| 263 | 265 | [o_label setFont:[NSFont systemFontOfSize:0]]; \ |
|---|
| 264 | 266 | [o_label sizeToFit]; \ |
|---|
| … | … | |
| 990 | 992 | { |
|---|
| 991 | 993 | 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 | |
|---|
| 992 | 998 | /* add the label */ |
|---|
| 993 | 999 | if( p_item->psz_text ) |
|---|
| … | … | |
| 996 | 1002 | else |
|---|
| 997 | 1003 | 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 ) |
|---|
| 999 | 1005 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1000 | 1006 | [self addSubview: o_label]; |
|---|
| 1001 | 1007 | |
|---|
| 1002 | 1008 | /* build the textfield */ |
|---|
| 1003 | | o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1004 | | [[VLCMain sharedInstance] localizedString: (char *)p_item->psz_longtext] |
|---|
| 1005 | | toWidth: PREFS_WRAP]; |
|---|
| 1006 | 1009 | if( p_item->value.psz ) |
|---|
| 1007 | 1010 | o_textfieldString = [[VLCMain sharedInstance] |
|---|
| … | … | |
| 1060 | 1063 | int i_index; |
|---|
| 1061 | 1064 | 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 | |
|---|
| 1062 | 1070 | /* add the label */ |
|---|
| 1063 | 1071 | if( p_item->psz_text ) |
|---|
| … | … | |
| 1066 | 1074 | else |
|---|
| 1067 | 1075 | 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 ) |
|---|
| 1069 | 1077 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1070 | 1078 | [self addSubview: o_label]; |
|---|
| 1071 | 1079 | |
|---|
| 1072 | 1080 | /* build the textfield */ |
|---|
| 1073 | | o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1074 | | [[VLCMain sharedInstance] |
|---|
| 1075 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1076 | 1081 | ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width, |
|---|
| 1077 | 1082 | -2, 0, o_textfieldTooltip ) |
|---|
| … | … | |
| 1138 | 1143 | { |
|---|
| 1139 | 1144 | 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; |
|---|
| 1142 | 1146 | mainFrame.size.height = 46; |
|---|
| 1143 | 1147 | mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN; |
|---|
| … | … | |
| 1148 | 1152 | { |
|---|
| 1149 | 1153 | 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]; |
|---|
| 1150 | 1158 | |
|---|
| 1151 | 1159 | /* is it a directory */ |
|---|
| … | … | |
| 1158 | 1166 | else |
|---|
| 1159 | 1167 | 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 ) |
|---|
| 1161 | 1169 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1162 | 1170 | [self addSubview: o_label]; |
|---|
| 1163 | 1171 | |
|---|
| 1164 | 1172 | /* 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, |
|---|
| 1169 | 1174 | _NS("Browse...") ) |
|---|
| 1170 | 1175 | [o_button setAutoresizingMask:NSViewMinXMargin ]; |
|---|
| … | … | |
| 1172 | 1177 | |
|---|
| 1173 | 1178 | /* build the textfield */ |
|---|
| 1174 | | o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1175 | | [[VLCMain sharedInstance] |
|---|
| 1176 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1177 | 1179 | if( p_item->value.psz ) |
|---|
| 1178 | 1180 | o_textfieldString = [NSString stringWithFormat: @"%s", (char *)p_item->value.psz]; |
|---|
| … | … | |
| 1181 | 1183 | ADD_TEXTFIELD( o_textfield, mainFrame, 12, 2, mainFrame.size.width - |
|---|
| 1182 | 1184 | 8 - [o_button frame].size.width, |
|---|
| 1183 | | o_textfieldTooltip, o_textfieldString ) |
|---|
| | 1185 | o_itemTooltip, o_textfieldString ) |
|---|
| 1184 | 1186 | [o_textfield setAutoresizingMask:NSViewWidthSizable ]; |
|---|
| 1185 | 1187 | [self addSubview: o_textfield]; |
|---|
| … | … | |
| 1258 | 1260 | i_view_type = CONFIG_ITEM_MODULE; |
|---|
| 1259 | 1261 | |
|---|
| | 1262 | o_popupTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| | 1263 | [[VLCMain sharedInstance] |
|---|
| | 1264 | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| | 1265 | |
|---|
| 1260 | 1266 | /* add the label */ |
|---|
| 1261 | 1267 | if( p_item->psz_text ) |
|---|
| … | … | |
| 1264 | 1270 | else |
|---|
| 1265 | 1271 | 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 ) |
|---|
| 1267 | 1273 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1268 | 1274 | [self addSubview: o_label]; |
|---|
| 1269 | 1275 | |
|---|
| 1270 | 1276 | /* build the popup */ |
|---|
| 1271 | | o_popupTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1272 | | [[VLCMain sharedInstance] |
|---|
| 1273 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1274 | 1277 | ADD_POPUP( o_popup, mainFrame, [o_label frame].size.width, |
|---|
| 1275 | 1278 | -2, 0, o_popupTooltip ) |
|---|
| … | … | |
| 1433 | 1436 | else |
|---|
| 1434 | 1437 | 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 ) |
|---|
| 1436 | 1439 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1437 | 1440 | [self addSubview: o_label]; |
|---|
| … | … | |
| 1515 | 1518 | i_view_type = CONFIG_ITEM_STRING_LIST; |
|---|
| 1516 | 1519 | |
|---|
| | 1520 | o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| | 1521 | [[VLCMain sharedInstance] |
|---|
| | 1522 | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| | 1523 | |
|---|
| 1517 | 1524 | /* add the label */ |
|---|
| 1518 | 1525 | if( p_item->psz_text ) |
|---|
| … | … | |
| 1521 | 1528 | else |
|---|
| 1522 | 1529 | 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 ) |
|---|
| 1524 | 1531 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1525 | 1532 | [self addSubview: o_label]; |
|---|
| 1526 | 1533 | |
|---|
| 1527 | 1534 | /* build the textfield */ |
|---|
| 1528 | | o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1529 | | [[VLCMain sharedInstance] |
|---|
| 1530 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1531 | 1535 | ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width, |
|---|
| 1532 | 1536 | -2, 0, o_textfieldTooltip ) |
|---|
| … | … | |
| 1604 | 1608 | i_view_type = CONFIG_ITEM_RANGED_INTEGER; |
|---|
| 1605 | 1609 | |
|---|
| | 1610 | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| | 1611 | [[VLCMain sharedInstance] |
|---|
| | 1612 | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| | 1613 | |
|---|
| 1606 | 1614 | /* add the label */ |
|---|
| 1607 | 1615 | if( p_item->psz_text ) |
|---|
| … | … | |
| 1610 | 1618 | else |
|---|
| 1611 | 1619 | 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 ) |
|---|
| 1613 | 1621 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1614 | 1622 | [self addSubview: o_label]; |
|---|
| 1615 | 1623 | |
|---|
| 1616 | 1624 | /* build the textfield */ |
|---|
| 1617 | | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1618 | | [[VLCMain sharedInstance] |
|---|
| 1619 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1620 | 1625 | ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2, |
|---|
| 1621 | 1626 | 28, 49, o_tooltip, @"" ) |
|---|
| … | … | |
| 1630 | 1635 | |
|---|
| 1631 | 1636 | /* build the mintextfield */ |
|---|
| 1632 | | ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888" ) |
|---|
| | 1637 | ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888", @"" ) |
|---|
| 1633 | 1638 | [o_textfield_min setIntValue: p_item->min.i]; |
|---|
| 1634 | 1639 | [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ]; |
|---|
| … | … | |
| 1638 | 1643 | /* build the maxtextfield */ |
|---|
| 1639 | 1644 | ADD_LABEL( o_textfield_max, mainFrame, |
|---|
| 1640 | | mainFrame.size.width - 31, -30, @"8888" ) |
|---|
| | 1645 | mainFrame.size.width - 31, -30, @"8888", @"" ) |
|---|
| 1641 | 1646 | [o_textfield_max setIntValue: p_item->max.i]; |
|---|
| 1642 | 1647 | [o_textfield_max setAutoresizingMask:NSViewMinXMargin ]; |
|---|
| … | … | |
| 1724 | 1729 | else |
|---|
| 1725 | 1730 | 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 ) |
|---|
| 1727 | 1732 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1728 | 1733 | [self addSubview: o_label]; |
|---|
| … | … | |
| 1804 | 1809 | i_view_type = CONFIG_ITEM_RANGED_INTEGER; |
|---|
| 1805 | 1810 | |
|---|
| | 1811 | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| | 1812 | [[VLCMain sharedInstance] |
|---|
| | 1813 | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| | 1814 | |
|---|
| 1806 | 1815 | /* add the label */ |
|---|
| 1807 | 1816 | if( p_item->psz_text ) |
|---|
| … | … | |
| 1810 | 1819 | else |
|---|
| 1811 | 1820 | 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 ) |
|---|
| 1813 | 1822 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1814 | 1823 | [self addSubview: o_label]; |
|---|
| 1815 | 1824 | |
|---|
| 1816 | 1825 | /* build the textfield */ |
|---|
| 1817 | | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1818 | | [[VLCMain sharedInstance] |
|---|
| 1819 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1820 | 1826 | ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2, |
|---|
| 1821 | 1827 | 28, 49, o_tooltip, @"" ) |
|---|
| … | … | |
| 1830 | 1836 | |
|---|
| 1831 | 1837 | /* build the mintextfield */ |
|---|
| 1832 | | ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888" ) |
|---|
| | 1838 | ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888", @"" ) |
|---|
| 1833 | 1839 | [o_textfield_min setFloatValue: p_item->min.f]; |
|---|
| 1834 | 1840 | [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ]; |
|---|
| … | … | |
| 1838 | 1844 | /* build the maxtextfield */ |
|---|
| 1839 | 1845 | ADD_LABEL( o_textfield_max, mainFrame, mainFrame.size.width - 31, |
|---|
| 1840 | | -30, @"8888" ) |
|---|
| | 1846 | -30, @"8888", @"" ) |
|---|
| 1841 | 1847 | [o_textfield_max setFloatValue: p_item->max.f]; |
|---|
| 1842 | 1848 | [o_textfield_max setAutoresizingMask:NSViewMinXMargin ]; |
|---|
| … | … | |
| 1930 | 1936 | else |
|---|
| 1931 | 1937 | 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 ) |
|---|
| 1933 | 1939 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1934 | 1940 | [self addSubview: o_label]; |
|---|
| … | … | |
| 1965 | 1971 | i_view_type = CONFIG_ITEM_KEY_AFTER_10_3; |
|---|
| 1966 | 1972 | |
|---|
| | 1973 | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| | 1974 | [[VLCMain sharedInstance] |
|---|
| | 1975 | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| | 1976 | |
|---|
| 1967 | 1977 | /* add the label */ |
|---|
| 1968 | 1978 | if( p_item->psz_text ) |
|---|
| … | … | |
| 1971 | 1981 | else |
|---|
| 1972 | 1982 | 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 ) |
|---|
| 1974 | 1984 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 1975 | 1985 | [self addSubview: o_label]; |
|---|
| 1976 | 1986 | |
|---|
| 1977 | 1987 | /* build the popup */ |
|---|
| 1978 | | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 1979 | | [[VLCMain sharedInstance] |
|---|
| 1980 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 1981 | 1988 | ADD_POPUP( o_popup, mainFrame, [o_label frame].origin.x + |
|---|
| 1982 | 1989 | [o_label frame].size.width + 3, |
|---|
| … | … | |
| 2095 | 2102 | i_view_type = CONFIG_ITEM_MODULE_LIST; |
|---|
| 2096 | 2103 | |
|---|
| | 2104 | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| | 2105 | [[VLCMain sharedInstance] |
|---|
| | 2106 | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| | 2107 | |
|---|
| 2097 | 2108 | /* add the label */ |
|---|
| 2098 | 2109 | if( p_item->psz_text ) |
|---|
| … | … | |
| 2101 | 2112 | else |
|---|
| 2102 | 2113 | 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 ) |
|---|
| 2104 | 2115 | [o_label setAutoresizingMask:NSViewNotSizable ]; |
|---|
| 2105 | 2116 | [self addSubview: o_label]; |
|---|
| 2106 | 2117 | |
|---|
| 2107 | 2118 | /* build the textfield */ |
|---|
| 2108 | | o_tooltip = [[VLCMain sharedInstance] wrapString: |
|---|
| 2109 | | [[VLCMain sharedInstance] |
|---|
| 2110 | | localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP]; |
|---|
| 2111 | 2119 | if( p_item->value.psz ) |
|---|
| 2112 | 2120 | o_textfieldString = [[VLCMain sharedInstance] |
|---|