当前位置: 首页>>代码示例>>C++>>正文


C++ JXWindow::Place方法代码示例

本文整理汇总了C++中JXWindow::Place方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::Place方法的具体用法?C++ JXWindow::Place怎么用?C++ JXWindow::Place使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JXWindow的用法示例。


在下文中一共展示了JXWindow::Place方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetWindow

SVNMainDirector::SVNMainDirector
	(
	JXDirector*			supervisor,
	const JCharacter*	path
	)
	:
	JXWindowDirector(supervisor),
	itsPath(path)
{
	SVNMainDirectorX();

	JPoint desktopLoc;
	JCoordinate w,h;
	if ((SVNGetPrefsManager())->GetWindowSize(kSVNMainDirectorWindSizeID,
											  &desktopLoc, &w, &h))
		{
		JXWindow* window = GetWindow();
		window->Place(desktopLoc.x, desktopLoc.y);
		window->SetSize(w,h);
		}

	if (itsRepoWidget != NULL)
		{
		itsRepoWidget->RefreshContent();
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:26,代码来源:SVNMainDirector.cpp

示例2: GetWindow

void
JXSearchTextDialog::ReadSetup
	(
	istream& input
	)
{
	JFileVersion vers;
	input >> vers;
	assert( vers <= kCurrentSetupVersion );

	JXWindow* window = GetWindow();
	if (vers == 0)
		{
		JPoint pt;
		input >> pt;
		window->Place(pt.x, pt.y);
		}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:17,代码来源:JXSearchTextDialog.cpp

示例3: if

void
JXMenuDirector::BuildWindow
	(
	const JPoint&		leftPtR,
	const JPoint&		rightPtR,
	const JCoordinate	sourceHeight
	)
{
	(GetDisplay())->ShrinkDisplayBoundsToActiveScreen();

	itsMenuTable = CreateMenuTable();
	itsMenuTable->FitToEnclosure();
	itsMenuTable->SetSingleFocusWidget();

	const JCoordinate bw = itsMenuTable->GetBorderWidth();
	const JRect bounds   = itsMenuTable->GetBoundsGlobal();
	const JCoordinate w  = bounds.width()  + 2*bw;
	const JCoordinate h  = bounds.height() + 2*bw;

	const JRect rootBounds = (GetDisplay())->GetBounds();

	JCoordinate windowX, windowWidth = w;
	JPoint usedPtR = rightPtR;
	if (rightPtR.x + w <= rootBounds.right)
		{
		windowX = rightPtR.x;
		}
	else if (leftPtR.x - w >= rootBounds.left)
		{
		windowX = leftPtR.x - w;
		usedPtR = leftPtR;
		}
	else
		{
		windowX = rootBounds.right - w;
		}

	if (windowX + w > rootBounds.right)
		{
		windowX = rootBounds.right - w;
		}
	if (windowX < rootBounds.left)
		{
		windowX = rootBounds.left;
		if (windowX + w > rootBounds.right)
			{
			windowWidth = rootBounds.width();
			}
		}

	JCoordinate windowY, windowHeight = h;
	JBoolean scrollBottom = kJFalse;
	if (usedPtR.y + h <= rootBounds.bottom)
		{
		windowY = usedPtR.y;
		}
	else if (sourceHeight > 0 && rootBounds.top <= usedPtR.y - sourceHeight - h)
		{
		windowY = usedPtR.y - sourceHeight - h;
		}
	else if (sourceHeight > 0 &&
			 rootBounds.bottom - usedPtR.y > usedPtR.y - sourceHeight - rootBounds.top)
		{
		windowY      = usedPtR.y;
		windowHeight = rootBounds.bottom - usedPtR.y;
		}
	else if (sourceHeight > 0)
		{
		windowY      = rootBounds.top;
		windowHeight = usedPtR.y - sourceHeight - rootBounds.top;
		scrollBottom = kJTrue;
		}
	else
		{
		windowY = rootBounds.bottom - h;
		if (windowY < rootBounds.top)
			{
			windowY      = rootBounds.top;
			windowHeight = rootBounds.height();
			}
		}

	JXWindow* window = GetWindow();
	window->Place(windowX, windowY);
	window->SetSize(windowWidth, windowHeight);

	// if menu will scroll, might as well start at the bottom

	if (scrollBottom)
		{
		itsMenuTable->TableScrollToCell(JPoint(1, itsMenuTable->GetRowCount()));
		}

	(GetDisplay())->RestoreDisplayBounds();
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:95,代码来源:JXMenuDirector.cpp

示例4: 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);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:66,代码来源:JXHintDirector.cpp


注:本文中的JXWindow::Place方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。