Lines 1167-1172
Link Here
|
1167 |
gc.drawPolyline(shape); |
1167 |
gc.drawPolyline(shape); |
1168 |
} |
1168 |
} |
1169 |
} |
1169 |
} |
|
|
1170 |
public boolean forceFocus() { |
1171 |
if (selectedIndex > 0 && !items[selectedIndex].enabled) return false; |
1172 |
return super.forceFocus(); |
1173 |
} |
1170 |
/** |
1174 |
/** |
1171 |
* Returns <code>true</code> if the receiver's border is visible. |
1175 |
* Returns <code>true</code> if the receiver's border is visible. |
1172 |
* |
1176 |
* |
Lines 1870-1875
Link Here
|
1870 |
} |
1874 |
} |
1871 |
} |
1875 |
} |
1872 |
if (index < 0 || index >= count) return; |
1876 |
if (index < 0 || index >= count) return; |
|
|
1877 |
while (!items[index].enabled) { |
1878 |
index = index + offset; |
1879 |
if (index < 0 || index >= count) return; |
1880 |
} |
1873 |
setSelection (index, true); |
1881 |
setSelection (index, true); |
1874 |
forceFocus(); |
1882 |
forceFocus(); |
1875 |
} |
1883 |
} |
Lines 1932-1938
Link Here
|
1932 |
if (selectedIndex >= 0) { |
1940 |
if (selectedIndex >= 0) { |
1933 |
redraw(); |
1941 |
redraw(); |
1934 |
} else { |
1942 |
} else { |
1935 |
setSelection(0, true); |
1943 |
int index = 0; |
|
|
1944 |
int count = items.length; |
1945 |
for (index = 0; index < count; index++) { |
1946 |
if (items[index].enabled) break; |
1947 |
} |
1948 |
setSelection(index, true); |
1936 |
} |
1949 |
} |
1937 |
} |
1950 |
} |
1938 |
boolean onMnemonic (Event event, boolean doit) { |
1951 |
boolean onMnemonic (Event event, boolean doit) { |
Lines 1956-1962
Link Here
|
1956 |
(event.stateMask & SWT.BUTTON3) != 0) return; |
1969 |
(event.stateMask & SWT.BUTTON3) != 0) return; |
1957 |
Event e = new Event(); |
1970 |
Event e = new Event(); |
1958 |
e.item = getItem(new Point(event.x, event.y)); |
1971 |
e.item = getItem(new Point(event.x, event.y)); |
1959 |
if (e.item != null) { |
1972 |
if ((e.item != null) && ((CTabItem)e.item).enabled) { |
1960 |
notifyListeners(SWT.DefaultSelection, e); |
1973 |
notifyListeners(SWT.DefaultSelection, e); |
1961 |
} |
1974 |
} |
1962 |
} |
1975 |
} |
Lines 2034-2039
Link Here
|
2034 |
} |
2047 |
} |
2035 |
} |
2048 |
} |
2036 |
if (item != null) { |
2049 |
if (item != null) { |
|
|
2050 |
if (!item.enabled) return; |
2037 |
if (item.closeRect.contains(x,y)){ |
2051 |
if (item.closeRect.contains(x,y)){ |
2038 |
item.closeImageState = SELECTED; |
2052 |
item.closeImageState = SELECTED; |
2039 |
redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false); |
2053 |
redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false); |
Lines 2088-2093
Link Here
|
2088 |
CTabItem item = items[i]; |
2102 |
CTabItem item = items[i]; |
2089 |
close = false; |
2103 |
close = false; |
2090 |
if (item.getBounds().contains(x, y)) { |
2104 |
if (item.getBounds().contains(x, y)) { |
|
|
2105 |
if (!item.enabled) return; |
2091 |
close = true; |
2106 |
close = true; |
2092 |
if (item.closeRect.contains(x, y)) { |
2107 |
if (item.closeRect.contains(x, y)) { |
2093 |
if (item.closeImageState != SELECTED && item.closeImageState != HOT) { |
2108 |
if (item.closeImageState != SELECTED && item.closeImageState != HOT) { |
Lines 2184-2189
Link Here
|
2184 |
} |
2199 |
} |
2185 |
} |
2200 |
} |
2186 |
if (item != null) { |
2201 |
if (item != null) { |
|
|
2202 |
if (!item.enabled) return; |
2187 |
if (item.closeRect.contains(x,y)) { |
2203 |
if (item.closeRect.contains(x,y)) { |
2188 |
boolean selected = item.closeImageState == SELECTED; |
2204 |
boolean selected = item.closeImageState == SELECTED; |
2189 |
item.closeImageState = HOT; |
2205 |
item.closeImageState = HOT; |
Lines 2269-2274
Link Here
|
2269 |
} |
2285 |
} |
2270 |
} |
2286 |
} |
2271 |
} |
2287 |
} |
|
|
2288 |
while (!items[index].enabled && index != selectedIndex) { |
2289 |
index = (index + offset + count) % count; |
2290 |
} |
2272 |
} |
2291 |
} |
2273 |
setSelection (index, true); |
2292 |
setSelection (index, true); |
2274 |
} |
2293 |
} |
Lines 3220-3226
Link Here
|
3220 |
showItem(selection); |
3239 |
showItem(selection); |
3221 |
return; |
3240 |
return; |
3222 |
} |
3241 |
} |
3223 |
|
3242 |
if (!items[index].enabled) return; |
3224 |
int oldIndex = selectedIndex; |
3243 |
int oldIndex = selectedIndex; |
3225 |
selectedIndex = index; |
3244 |
selectedIndex = index; |
3226 |
if (oldIndex != -1) { |
3245 |
if (oldIndex != -1) { |
Lines 3244-3249
Link Here
|
3244 |
oldControl.setVisible(false); |
3263 |
oldControl.setVisible(false); |
3245 |
} |
3264 |
} |
3246 |
} |
3265 |
} |
|
|
3266 |
if (oldIndex != -1 && !items[oldIndex].enabled) { |
3267 |
if (oldControl != null && !oldControl.isDisposed() && !oldControl.isEnabled()) { |
3268 |
oldControl.setEnabled(items[oldIndex].controlEnabled); |
3269 |
} |
3270 |
} |
3247 |
showItem(selection); |
3271 |
showItem(selection); |
3248 |
redraw(); |
3272 |
redraw(); |
3249 |
} |
3273 |
} |
Lines 4022-4027
Link Here
|
4022 |
if (showChevron && chevronRect.contains(x, y)) return SWT.getMessage("SWT_ShowList"); //$NON-NLS-1$ |
4046 |
if (showChevron && chevronRect.contains(x, y)) return SWT.getMessage("SWT_ShowList"); //$NON-NLS-1$ |
4023 |
CTabItem item = getItem(new Point (x, y)); |
4047 |
CTabItem item = getItem(new Point (x, y)); |
4024 |
if (item == null) return null; |
4048 |
if (item == null) return null; |
|
|
4049 |
if (!item.enabled) return null; |
4025 |
if (!item.showing) return null; |
4050 |
if (!item.showing) return null; |
4026 |
if ((showClose || item.showClose) && item.closeRect.contains(x, y)) { |
4051 |
if ((showClose || item.showClose) && item.closeRect.contains(x, y)) { |
4027 |
return SWT.getMessage("SWT_Close"); //$NON-NLS-1$ |
4052 |
return SWT.getMessage("SWT_Close"); //$NON-NLS-1$ |