org.eclipse.swt.widgets.ScrollBar.setEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.eclipse.swt.widgets.ScrollBar.setEnabled()方法的一些代码示例,展示了ScrollBar.setEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollBar.setEnabled()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ScrollBar
类名称:ScrollBar
方法名:setEnabled

ScrollBar.setEnabled介绍

[英]Enables the receiver if the argument is true, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
[中]如果参数为[$0$],则启用接收器,否则禁用接收器。禁用的控件通常无法从用户界面中选择,并以非活动或“灰色”外观绘制。

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

@Override
void doSetBooleanValue(Object source, boolean value) {
  ((ScrollBar) source).setEnabled(value);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

displayFDC.xOffset = Math.min(horizontal.getSelection(), imageWidth - visibleWidth);
if (imageWidth <= visibleWidth) {
  horizontal.setEnabled(false);
  horizontal.setSelection(0);
} else {
  horizontal.setEnabled(true);
  horizontal.setValues(displayFDC.xOffset, 0, imageWidth, visibleWidth,
    8, visibleWidth);
displayFDC.yOffset = Math.min(vertical.getSelection(), imageHeight - visibleHeight);
if (imageHeight <= visibleHeight) {
  vertical.setEnabled(false);
  vertical.setSelection(0);
} else {
  vertical.setEnabled(true);
  vertical.setValues(displayFDC.yOffset, 0, imageHeight, visibleHeight,
    8, visibleHeight);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

if (width > canvasBounds.width) {
  horizontal.setEnabled(true);
  horizontal.setMaximum(width);
  horizontal.setThumb(canvasBounds.width);
} else {
  horizontal.setEnabled(false);
  if (ix != 0) {
if (height > canvasBounds.height) {
  vertical.setEnabled(true);
  vertical.setMaximum(height);
  vertical.setThumb(canvasBounds.height);
  vertical.setEnabled(false);
  if (iy != 0) {
  vertical.setEnabled(false);
} else { // indexed palette
  canvasBounds = paletteCanvas.getClientArea();
  int paletteHeight = imageData.palette.getRGBs().length * 10 + 20; // 10 pixels each index + 20 for margins.
  vertical.setEnabled(true);
  vertical.setMaximum(paletteHeight);
  vertical.setThumb(canvasBounds.height);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

horizontal.setVisible(true);
horizontal.setMinimum(0);
horizontal.setEnabled(false);
horizontal.addSelectionListener(widgetSelectedAdapter(event -> scrollHorizontally((ScrollBar)event.widget)));
ScrollBar vertical = imageCanvas.getVerticalBar();
vertical.setVisible(true);
vertical.setMinimum(0);
vertical.setEnabled(false);
vertical.addSelectionListener(widgetSelectedAdapter(event -> scrollVertically((ScrollBar)event.widget)));
vertical.setMinimum(0);
vertical.setIncrement(10);
vertical.setEnabled(false);
vertical.addSelectionListener(widgetSelectedAdapter(event -> scrollPalette((ScrollBar)event.widget)));

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

copyHBar.setEnabled(false);
copyHBar.addListener(SWT.Selection, e -> {
  if (copyImage[0] != null) {
copyVBar.setEnabled(false);
copyVBar.addListener(SWT.Selection, e -> {
  if (copyImage[0] != null) {
    copyVBar.setEnabled(true);
    copyHBar.setEnabled(true);
    copyOrigin.x = 0; copyOrigin.y = 0;
    Rectangle rect = copyImage[0].getBounds();
final Point pasteOrigin = new Point(0, 0);
final ScrollBar pasteHBar = pasteImageCanvas.getHorizontalBar();
pasteHBar.setEnabled(false);
pasteHBar.addListener(SWT.Selection, e -> {
  if (pasteImage[0] != null) {
pasteVBar.setEnabled(false);
pasteVBar.addListener(SWT.Selection, e -> {
  if (pasteImage[0] != null) {
    pasteVBar.setEnabled(true);
    pasteHBar.setEnabled(true);
    pasteOrigin.x = 0; pasteOrigin.y = 0;
    Rectangle rect = pasteImage[0].getBounds();

代码示例来源:origin: BiglySoftware/BiglyBT

if (max < tableSize) {
  vBar.setSelection(0);
  vBar.setEnabled(false);
  vBar.setVisible(false);
} else {
  if (!vBar.isVisible()) {
    vBar.setVisible(true);
    vBar.setEnabled(true);
  hBar.setEnabled(false);
  hBar.setVisible(false);
} else {
  if (!hBar.isVisible()) {
    hBar.setVisible(true);
    hBar.setEnabled(true);

相关文章