本文整理了Java中org.eclipse.swt.widgets.Text.getBorderWidthInPixels()
方法的一些代码示例,展示了Text.getBorderWidthInPixels()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.getBorderWidthInPixels()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Text
类名称:Text
方法名:getBorderWidthInPixels
暂无
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
Point getCaretLocationInPixels () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
int index = OS.gtk_editable_get_position (handle);
index = OS.gtk_entry_text_index_to_layout_index (handle, index);
int [] offset_x = new int [1], offset_y = new int [1];
OS.gtk_entry_get_layout_offsets (handle, offset_x, offset_y);
long /*int*/ layout = OS.gtk_entry_get_layout (handle);
PangoRectangle pos = new PangoRectangle ();
OS.pango_layout_index_to_pos (layout, index, pos);
int x = offset_x [0] + OS.PANGO_PIXELS (pos.x) - getBorderWidthInPixels ();
int y = offset_y [0] + OS.PANGO_PIXELS (pos.y);
return new Point (x, y);
}
byte [] position = new byte [ITER_SIZEOF];
long /*int*/ mark = OS.gtk_text_buffer_get_insert (bufferHandle);
OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, position, mark);
GdkRectangle rect = new GdkRectangle ();
OS.gtk_text_view_get_iter_location (handle, position, rect);
int [] x = new int [1];
int [] y = new int [1];
OS.gtk_text_view_buffer_to_window_coords (handle, OS.GTK_TEXT_WINDOW_TEXT, rect.x, rect.y, x, y);
return new Point (x [0], y [0]);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
Point getCaretLocationInPixels () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
int index = OS.gtk_editable_get_position (handle);
index = OS.gtk_entry_text_index_to_layout_index (handle, index);
int [] offset_x = new int [1], offset_y = new int [1];
OS.gtk_entry_get_layout_offsets (handle, offset_x, offset_y);
int /*long*/ layout = OS.gtk_entry_get_layout (handle);
PangoRectangle pos = new PangoRectangle ();
OS.pango_layout_index_to_pos (layout, index, pos);
int x = offset_x [0] + OS.PANGO_PIXELS (pos.x) - getBorderWidthInPixels ();
int y = offset_y [0] + OS.PANGO_PIXELS (pos.y);
return new Point (x, y);
}
byte [] position = new byte [ITER_SIZEOF];
int /*long*/ mark = OS.gtk_text_buffer_get_insert (bufferHandle);
OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, position, mark);
GdkRectangle rect = new GdkRectangle ();
OS.gtk_text_view_get_iter_location (handle, position, rect);
int [] x = new int [1];
int [] y = new int [1];
OS.gtk_text_view_buffer_to_window_coords (handle, OS.GTK_TEXT_WINDOW_TEXT, rect.x, rect.y, x, y);
return new Point (x [0], y [0]);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
Point getCaretLocationInPixels () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) {
int index = OS.gtk_editable_get_position (handle);
index = OS.gtk_entry_text_index_to_layout_index (handle, index);
int [] offset_x = new int [1], offset_y = new int [1];
OS.gtk_entry_get_layout_offsets (handle, offset_x, offset_y);
int /*long*/ layout = OS.gtk_entry_get_layout (handle);
PangoRectangle pos = new PangoRectangle ();
OS.pango_layout_index_to_pos (layout, index, pos);
int x = offset_x [0] + OS.PANGO_PIXELS (pos.x) - getBorderWidthInPixels ();
int y = offset_y [0] + OS.PANGO_PIXELS (pos.y);
return new Point (x, y);
}
byte [] position = new byte [ITER_SIZEOF];
int /*long*/ mark = OS.gtk_text_buffer_get_insert (bufferHandle);
OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, position, mark);
GdkRectangle rect = new GdkRectangle ();
OS.gtk_text_view_get_iter_location (handle, position, rect);
int [] x = new int [1];
int [] y = new int [1];
OS.gtk_text_view_buffer_to_window_coords (handle, OS.GTK_TEXT_WINDOW_TEXT, rect.x, rect.y, x, y);
return new Point (x [0], y [0]);
}
内容来源于网络,如有侵权,请联系作者删除!