本文整理汇总了C++中JXWindow::SetWMWindowType方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::SetWMWindowType方法的具体用法?C++ JXWindow::SetWMWindowType怎么用?C++ JXWindow::SetWMWindowType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::SetWMWindowType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JXBorderRect
void
JXHintDirector::BuildWindow
(
const JRect& frameR,
const JCharacter* text
)
{
// create window and contents
JXWindow* window = jnew JXWindow(this, 10,10, "", kJTrue);
assert( window != NULL );
window->SetWMWindowType(JXWindow::kWMTooltipType);
JXBorderRect* border =
jnew JXBorderRect(window, JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 10,10);
assert( border != NULL );
border->FitToEnclosure();
JXStaticText* textWidget =
jnew JXStaticText(text, border,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
kHMargin, kVMargin, 0,0);
assert( textWidget != NULL );
JCoordinate ascent = 0, descent = 0;
if (!JStringEmpty(text))
{
(textWidget->GetFont(1)).GetLineHeight(&ascent, &descent);
}
const JCoordinate w = 2*kHMargin + textWidget->GetFrameWidth();
const JCoordinate h = 2*kVMargin + ascent + descent;
window->SetSize(w,h);
// place window
const JRect rootBounds = GetDisplay()->GetBounds();
JCoordinate x = frameR.left + 1;
JCoordinate y = frameR.bottom + 1;
if (x + w > rootBounds.right)
{
x = rootBounds.right - w - 1;
}
if (x < 0)
{
x = rootBounds.left + 1;
}
if (y + h > rootBounds.bottom)
{
y = frameR.top - h - 1;
}
window->Place(x,y);
// use standard background color
JColorIndex backColorIndex = GetColormap()->JColormap::GetColor(kBackColor);
window->SetBackColor(backColorIndex);
border->SetBackColor(backColorIndex);
textWidget->SetBackgroundColor(backColorIndex);
}