本文整理了Java中org.eclipse.swt.widgets.DateTime.computeNativeSize()
方法的一些代码示例,展示了DateTime.computeNativeSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime.computeNativeSize()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.DateTime
类名称:DateTime
方法名:computeNativeSize
暂无
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
private int calculateCalendarYpos (Point containerBounds, Rectangle coordsRelativeToScreen, int height,
Rectangle displayRect) {
int dateEntryHeight = computeNativeSize (containerHandle, SWT.DEFAULT, SWT.DEFAULT, false).y;
int y = coordsRelativeToScreen.y + containerBounds.y/2 + dateEntryHeight/2;
//Put Calendar above control if it would be cut off at the bottom.
if (y + height > displayRect.y + displayRect.height) {
y -= (height + dateEntryHeight);
}
return y;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
private int calculateCalendarYpos (Point containerBounds, Rectangle coordsRelativeToScreen, int height,
Rectangle displayRect) {
int dateEntryHeight = computeNativeSize (containerHandle, SWT.DEFAULT, SWT.DEFAULT, false).y;
int y = coordsRelativeToScreen.y + containerBounds.y/2 + dateEntryHeight/2;
//Put Calendar above control if it would be cut off at the bottom.
if (y + height > displayRect.y + displayRect.height) {
y -= (height + dateEntryHeight);
}
return y;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
private int calculateCalendarYpos (Point containerBounds, Rectangle coordsRelativeToScreen, int height,
Rectangle displayRect) {
int dateEntryHeight = computeNativeSize (containerHandle, SWT.DEFAULT, SWT.DEFAULT, false).y;
int y = coordsRelativeToScreen.y + containerBounds.y/2 + dateEntryHeight/2;
//Put Calendar above control if it would be cut off at the bottom.
if (y + height > displayRect.y + displayRect.height) {
y -= (height + dateEntryHeight);
}
return y;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Usually called when control is resized or first initialized.
*/
private void setDropDownButtonSize () {
Rectangle rect = getClientAreaInPixels ();
int parentWidth = rect.width;
int parentHeight = rect.height;
Point buttonSize = down.computeSizeInPixels (SWT.DEFAULT, parentHeight);
//TAG_GTK3__NO_VERTICAL_FILL_ADJUSTMENT
int dateEntryHeight = computeNativeSize (textEntryHandle, SWT.DEFAULT, SWT.DEFAULT, false).y;
int newHeight = dateEntryHeight;
//Move button a little closer to entry field, by amount of padding.
int newXpos = parentWidth - buttonSize.x;
int newYPos = parentHeight/2 - dateEntryHeight/2;
down.setBoundsInPixels (newXpos, newYPos, buttonSize.x, newHeight);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Usually called when control is resized or first initialized.
*/
private void setDropDownButtonSize () {
Rectangle rect = getClientAreaInPixels ();
int parentWidth = rect.width;
int parentHeight = rect.height;
Point buttonSize = down.computeSizeInPixels (SWT.DEFAULT, parentHeight);
//TAG_GTK3__NO_VERTICAL_FILL_ADJUSTMENT
int dateEntryHeight = computeNativeSize (textEntryHandle, SWT.DEFAULT, SWT.DEFAULT, false).y;
int newHeight = dateEntryHeight;
//Move button a little closer to entry field, by amount of padding.
int newXpos = parentWidth - buttonSize.x;
int newYPos = parentHeight/2 - dateEntryHeight/2;
down.setBoundsInPixels (newXpos, newYPos, buttonSize.x, newHeight);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Usually called when control is resized or first initialized.
*/
private void setDropDownButtonSize () {
Rectangle rect = getClientAreaInPixels ();
int parentWidth = rect.width;
int parentHeight = rect.height;
Point buttonSize = down.computeSizeInPixels (SWT.DEFAULT, parentHeight);
//TAG_GTK3__NO_VERTICAL_FILL_ADJUSTMENT
int dateEntryHeight = computeNativeSize (textEntryHandle, SWT.DEFAULT, SWT.DEFAULT, false).y;
int newHeight = dateEntryHeight;
//Move button a little closer to entry field, by amount of padding.
int newXpos = parentWidth - buttonSize.x;
int newYPos = parentHeight/2 - dateEntryHeight/2;
down.setBoundsInPixels (newXpos, newYPos, buttonSize.x, newHeight);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
Point size = computeNativeSize (containerHandle, wHint, hHint, changed);
width = size.x;
height = size.y;
} else {
Point textSize = computeNativeSize (textEntryHandle, wHint, hHint, changed);
Rectangle trim = computeTrimInPixels (0,0, textSize.x,textSize.y);
if (isDateWithDropDownButton ()){
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
Point size = computeNativeSize (containerHandle, wHint, hHint, changed);
width = size.x;
height = size.y;
} else {
Point textSize = computeNativeSize (textEntryHandle, wHint, hHint, changed);
Rectangle trim = computeTrimInPixels (0,0, textSize.x,textSize.y);
if (isDateWithDropDownButton ()){
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
Point size = computeNativeSize (containerHandle, wHint, hHint, changed);
width = size.x;
height = size.y;
} else {
Point textSize = computeNativeSize (textEntryHandle, wHint, hHint, changed);
Rectangle trim = computeTrimInPixels (0,0, textSize.x,textSize.y);
if (isDateWithDropDownButton ()){
内容来源于网络,如有侵权,请联系作者删除!