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


C++ JXScrollbarSet::FitToEnclosure方法代码示例

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


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

示例1: JXMenuBar


//.........这里部分代码省略.........

	const JFontManager* fm	= window->GetFontManager();
	JSize lineHeight =
		fm->GetLineHeight(GGetPrefsMgr()->GetDefaultMonoFont(),
						  GGetPrefsMgr()->GetDefaultFontSize(),
						  JFontStyle());


	const JCoordinate headerheight  = (lineHeight * 4) + (lineHeight/2); //58;

	JArray<JCoordinate> sizes;
	JArray<JCoordinate> minSizes;

	sizes.AppendElement(headerheight);
	minSizes.AppendElement(20);
	sizes.AppendElement(w - headerheight);
	minSizes.AppendElement(50);
	JIndex elasticIndex = 2;

	itsPart =
		new JXVertPartition(sizes, elasticIndex,
			minSizes, itsToolBar->GetWidgetEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, 0,
			w, newHeight);
	assert(itsPart != NULL);

	itsSBSet =
		new JXScrollbarSet(itsPart->GetCompartment(2),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,
			100,100);
	assert(itsSBSet != NULL);
	itsSBSet->FitToEnclosure(kJTrue, kJTrue);

	itsView =
		new GMessageView(menuBar, itsSBSet, itsSBSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,10,10);
	assert (itsView != NULL);
	itsView->FitToEnclosure(kJTrue, kJTrue);
	itsView->SetPTPrinter(GMGetAltPTPrinter());

	window->InstallShortcuts(itsView, "#_");
	ListenTo(itsView);

	JXScrollbarSet* sbs =
		new JXScrollbarSet(itsPart->GetCompartment(1),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,
			100,50);
	assert(sbs != NULL);
	sbs->FitToEnclosure(kJTrue, kJTrue);

	itsHeader =
		new GMessageView(sbs, sbs->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,10,10);
	assert (itsHeader != NULL);
	itsHeader->FitToEnclosure(kJTrue, kJTrue);

	itsHeader->ShareEditMenu(itsView);
	itsHeader->ShareSearchMenu(itsView);

	GMDirectorMenu* menu =
		new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:67,代码来源:GMessageViewDir.cpp

示例2: JXMenuBar

void
GPMMainDirector::BuildWindow()
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 530,350, "");
	assert( window != NULL );

	JXMenuBar* menuBar =
		new JXMenuBar(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 540,30);
	assert( menuBar != NULL );

	itsToolBar =
		new JXToolBar(GPMGetPrefsManager(), kGPMMainToolBarID, menuBar, 540, 250, window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 530,300);
	assert( itsToolBar != NULL );

	itsFullCmdDisplay =
		new JXStaticText("", kJFalse, kJTrue, NULL, window,
					JXWidget::kHElastic, JXWidget::kFixedBottom, 0,330, 530,20);
	assert( itsFullCmdDisplay != NULL );

// end JXLayout

	window->SetTitle("Drakon Process Manager");
	window->SetCloseAction(JXWindow::kQuitApp);
	window->SetWMClass(GPMGetWMClassInstance(), GPMGetMainWindowClass());

	JXImage* image = new JXImage(GetDisplay(), gpm_main_window_icon);
	assert( image != NULL );
	window->SetIcon(image);

	// system stats

	itsSystemStats =
		new GPMSystemStats(itsProcessList, itsToolBar->GetWidgetEnclosure(),
					   JXWidget::kHElastic, JXWidget::kFixedTop,
					   0,kStatusMargin, 100,kStatusHeight);
	assert( itsSystemStats != NULL );
	itsSystemStats->FitToEnclosure(kJTrue, kJFalse);

	// tab group

	itsTabGroup =
		new JXTabGroup(itsToolBar->GetWidgetEnclosure(),
					   JXWidget::kHElastic, JXWidget::kVElastic,
					   0,0, 100,100);
	assert( itsTabGroup != NULL );
	itsTabGroup->FitToEnclosure();
	ListenTo(itsTabGroup->GetCardEnclosure());

	const JCoordinate statusHeight = kStatusHeight + 2*kStatusMargin;
	itsTabGroup->AdjustSize(0, -statusHeight);
	itsTabGroup->Move(0, statusHeight);

	JXWidgetSet* listTab = itsTabGroup->AppendTab("List");
	JXWidgetSet* treeTab = itsTabGroup->AppendTab("Tree");

	// list view

	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(listTab, JXWidget::kHElastic, JXWidget::kVElastic,
						   0,0, 100,100);
	assert( scrollbarSet != NULL );
	scrollbarSet->FitToEnclosure();

	const JCoordinate kHeaderHeight	= 25;
	const JCoordinate tableHeight   = scrollbarSet->GetScrollEnclosure()->GetBoundsHeight() - kHeaderHeight;

	itsProcessTable =
		new GPMProcessTable(itsProcessList, itsFullCmdDisplay,
			scrollbarSet, scrollbarSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,kHeaderHeight, 100,tableHeight);
	assert( itsProcessTable != NULL );
	itsProcessTable->FitToEnclosure(kJTrue, kJFalse);

	GPMListHeaderWidget* tableHeader =
		new GPMListHeaderWidget(itsProcessTable, itsProcessList,
			scrollbarSet, scrollbarSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kFixedTop,
			0,0, 100,kHeaderHeight);
	assert( tableHeader != NULL );
	tableHeader->FitToEnclosure(kJTrue, kJFalse);

	// tree view

	scrollbarSet =
		new JXScrollbarSet(treeTab, JXWidget::kHElastic, JXWidget::kVElastic,
						   0,0, 100,100);
	assert( scrollbarSet != NULL );
	scrollbarSet->FitToEnclosure();

	JNamedTreeList* treeList = new JNamedTreeList(itsProcessList->GetProcessTree());
	assert( treeList != NULL );

	itsProcessTree =
		new GPMProcessTreeList(itsProcessList, treeList, itsFullCmdDisplay,
			scrollbarSet, scrollbarSet->GetScrollEnclosure(),
//.........这里部分代码省略.........
开发者ID:raorn,项目名称:jx_application_framework,代码行数:101,代码来源:GPMMainDirector.cpp

示例3: JXMenuBar

void
CMSourceDirector::BuildWindow()
{
	const JIndex prefID = itsType == kMainSourceType ? kMainSrcToolBarID  :
						  itsType == kMainAsmType    ? kMainAsmToolBarID  :
						  itsType == kAsmType        ? kOtherAsmToolBarID :
						  kOtherSrcToolBarID;

// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 600,550, "");
	assert( window != NULL );

	itsMenuBar =
		jnew JXMenuBar(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 600,30);
	assert( itsMenuBar != NULL );

	itsToolBar =
		jnew JXToolBar(CMGetPrefsManager(), prefID, itsMenuBar, window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 600,500);
	assert( itsToolBar != NULL );

	itsFileDisplay =
		jnew JXFileNameDisplay("", window,
					JXWidget::kHElastic, JXWidget::kFixedBottom, 20,530, 580,20);
	assert( itsFileDisplay != NULL );

	CMFileDragSource* dragSource =
		jnew CMFileDragSource(this, window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 0,530, 20,20);
	assert( dragSource != NULL );

// end JXLayout

	window->SetTitle(JGetString(
		itsType == kMainAsmType ? "InitAsmWindowTitle::CMSourceDirector" :
								  "InitSourceWindowTitle::CMSourceDirector"));

	window->SetMinSize(300, 200);

	if (itsType == kMainSourceType)
		{
		window->SetCloseAction(JXWindow::kDeactivateDirector);

		window->SetWMClass(CMGetWMClassInstance(), CMGetMainSourceWindowClass());
		CMGetPrefsManager()->GetWindowSize(kMainCodeWindSizeID, window);

		JXDisplay* display = GetDisplay();
		JXImage* icon      = jnew JXImage(display, medic_current_source_window);
		assert( icon != NULL );
		window->SetIcon(icon);
		}
	else if (itsType == kMainAsmType)
		{
		window->SetCloseAction(JXWindow::kDeactivateDirector);

		window->SetWMClass(CMGetWMClassInstance(), CMGetMainAsmWindowClass());
		CMGetPrefsManager()->GetWindowSize(kMainAsmWindSizeID, window);

		JXDisplay* display = GetDisplay();
		JXImage* icon      = jnew JXImage(display, medic_current_asm_window);
		assert( icon != NULL );
		window->SetIcon(icon);
		}
	else if (itsType == kAsmType)
		{
		window->SetWMClass(CMGetWMClassInstance(), CMGetAsmViewWindowClass());
		CMGetPrefsManager()->GetWindowSize(kAsmWindSizeID, window, kJTrue);
		}
	else
		{
		window->SetWMClass(CMGetWMClassInstance(), CMGetSourceViewWindowClass());
		CMGetPrefsManager()->GetWindowSize(kCodeWindSizeID, window, kJTrue);
		}

	JCoordinate w = window->GetFrameWidth();

	itsFileMenu = itsMenuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr, "CMSourceDirector");
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	itsFileMenu->SetItemImage(kOpenCmd,  jx_file_open);
	itsFileMenu->SetItemImage(kPrintCmd, jx_file_print);

	// appends Edit & Search menus

	const JCoordinate kInitTableWidth = 50;

	JXScrollbarSet* scrollbarSet =
		jnew JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
						   JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
	assert( scrollbarSet != NULL );
	scrollbarSet->FitToEnclosure();

	JXContainer* encl = scrollbarSet->GetScrollEnclosure();

	itsText =
		jnew CMSourceText(this, itsCommandDir, itsMenuBar, scrollbarSet, encl,
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:CMSourceDirector.cpp


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