本文整理了Java中org.eclipse.swt.widgets.Canvas.getCaret()
方法的一些代码示例,展示了Canvas.getCaret()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.getCaret()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:getCaret
[英]Returns the caret.
The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time.
[中]返回插入符号。
当绘制或调整控件大小、获得或丢失焦点以及滚动控件时,控件的插入符号将自动隐藏和显示。为了避免在插入符号的顶部绘制,程序员必须在任何其他时间在窗口中绘制时隐藏和显示插入符号。
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void createWidget () {
isVisible = true;
if (parent.getCaret () == null) {
parent.setCaret (this);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
void releaseParent () {
super.releaseParent ();
if (this == parent.getCaret ()) parent.setCaret (null);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
void releaseParent () {
super.releaseParent ();
if (this == parent.getCaret ()) parent.setCaret (null);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
void releaseParent () {
super.releaseParent ();
if (this == parent.getCaret ()) parent.setCaret (null);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
void releaseParent () {
super.releaseParent ();
if (this == parent.getCaret ()) parent.setCaret (null);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void releaseParent () {
super.releaseParent ();
if (this == parent.getCaret ()) parent.setCaret (null);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void createWidget () {
super.createWidget ();
blinkRate = display.getCaretBlinkTime ();
isVisible = true;
if (parent.getCaret () == null) {
parent.setCaret (this);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
void createWidget (int index) {
super.createWidget (index);
blinkRate = display.getCaretBlinkTime ();
isVisible = true;
if (parent.getCaret () == null) {
parent.setCaret (this);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
void createWidget (int index) {
super.createWidget (index);
blinkRate = display.getCaretBlinkTime ();
isVisible = true;
if (parent.getCaret () == null) {
parent.setCaret (this);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
void createWidget (int index) {
super.createWidget (index);
blinkRate = display.getCaretBlinkTime ();
isVisible = true;
if (parent.getCaret () == null) {
parent.setCaret (this);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Sets or clears the caret in the "Example" widget.
*/
void setCaret () {
Caret oldCaret = canvas.getCaret ();
if (caretButton.getSelection ()) {
Caret newCaret = new Caret(canvas, SWT.NONE);
Font font = canvas.getFont();
newCaret.setFont(font);
GC gc = new GC(canvas);
gc.setFont(font);
newCaret.setBounds(1, 1, 1, gc.getFontMetrics().getHeight());
gc.dispose();
canvas.setCaret (newCaret);
canvas.setFocus();
} else {
canvas.setCaret (null);
}
if (oldCaret != null) oldCaret.dispose ();
}
内容来源于网络,如有侵权,请联系作者删除!