void enableWidget(boolean enabled) { if (OS.COMCTL32_MAJOR >= 6) { LITEM item = new LITEM(); item.mask = OS.LIF_ITEMINDEX | OS.LIF_STATE; item.stateMask = OS.LIS_ENABLED; item.state = enabled ? OS.LIS_ENABLED : 0; while (OS.SendMessage(handle, OS.LM_SETITEM, 0, item) != 0) { item.iLink++; } } else { TextStyle linkStyle = new TextStyle(null, enabled ? linkColor : disabledColor, null); linkStyle.underline = true; for (int i = 0; i < offsets.length; i++) { Point point = offsets[i]; layout.setStyle(linkStyle, point.x, point.y); } redraw(); } /* * Feature in Windows. For some reason, setting * LIS_ENABLED state using LM_SETITEM causes the * SysLink to become enabled. To be specific, * calling IsWindowEnabled() returns true. The * fix is disable the SysLink after LM_SETITEM. */ super.enableWidget(enabled); }
@Override void enableWidget(boolean enabled) { super.enableWidget(enabled); if (isDisposed()) return; TextStyle linkStyle = new TextStyle(null, enabled ? linkColor : disabledColor, null); linkStyle.underline = true; for (int i = 0; i < offsets.length; i++) { Point point = offsets[i]; layout.setStyle(linkStyle, point.x, point.y); } redraw(); }
void enableWidget(boolean enabled) { super.enableWidget(enabled); if (formHandle != 0) enableHandle(enabled, formHandle); if (scrolledHandle != 0) enableHandle(enabled, scrolledHandle); }