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


C++ JXMenuBar类代码示例

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


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

示例1: JXWindow

JXScrollbarSet*
CBFnListDirector::BuildWindow()
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 170,250, "");
	assert( window != NULL );

	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 170,220);
	assert( scrollbarSet != NULL );

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

// end JXLayout

	window->SetMinSize(150,150);

	itsActionsMenu = menuBar->AppendTextMenu(kActionsMenuTitleStr);
	itsActionsMenu->SetMenuItems(kActionsMenuStr, "CBFnListDirector");
	ListenTo(itsActionsMenu);

	return scrollbarSet;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:28,代码来源:CBFnListDirector.cpp

示例2: GMManagedDirector

SMTPDebugDir::SMTPDebugDir
	(
	JXDirector* supervisor
	)
	:
	GMManagedDirector(supervisor)
{
	JSize w = 400;
	JSize h = 300;
	JXWindow* window = new JXWindow(this, w,h, "Debug Window");
    assert( window != NULL );
    SetWindow(window);
    window->SetCloseAction(JXWindow::kDeactivateDirector);

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

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	GMDirectorMenu* menu =
		new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
			JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert(menu != NULL);
	menuBar->AppendMenu(menu);

	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(window,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,kJXStdMenuBarHeight,w,h - kJXStdMenuBarHeight);
	assert ( scrollbarSet != NULL );

	itsText =
		new JXStaticText("", kJFalse, kJTrue,
			scrollbarSet, scrollbarSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,w,h - kJXStdMenuBarHeight);
	assert (itsText != NULL);

	itsMenuIcon = new JXImage(window->GetDisplay(), window->GetColormap(), JXPM(debug_xpm));
	assert(itsMenuIcon != NULL);
	itsMenuIcon->ConvertToRemoteStorage();

	GGetDirMgr()->DirectorCreated(this);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:49,代码来源:SMTPDebugDir.cpp

示例3: JXWindow

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

    JXWindow* window = new JXWindow(this, 600,400, "");
    assert( window != NULL );

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

    itsPlotWidget =
        new JX2DPlotWidget(menuBar, window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 600,370);
    assert( itsPlotWidget != NULL );

// end JXLayout

	window->SetMinSize(300, 200);

	itsPSPrinter = new JXPSPrinter(GetDisplay());
	assert( itsPSPrinter != NULL );
	itsPlotWidget->SetPSPrinter(itsPSPrinter);

	itsEPSPrinter = new JX2DPlotEPSPrinter(GetDisplay());
	assert( itsEPSPrinter != NULL );
	itsPlotWidget->SetEPSPrinter(itsEPSPrinter);

	ListenTo(itsPlotWidget);

	itsActionsMenu = menuBar->PrependTextMenu(kActionsMenuTitleStr);
	itsActionsMenu->SetMenuItems(kActionsMenuStr);
	itsActionsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsActionsMenu);

	// do this after everything is constructed so Receive() doesn't crash

	itsPlotWidget->SetTitle("New plot");
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:41,代码来源:Test2DPlotDirector.cpp

示例4: JXWindow

void
MenuHelloDir::BuildWindow()
{
	// Create the window and give it to the director.
	JXWindow* window = new JXWindow(this, 200,100, "Hello World Program");
    assert( window != NULL );
    SetWindow(window);

	// This sets the minimum and maximum size to be the
	// current size.
    window->LockCurrentSize();

    // Create the menu bar so that it stays on top, but expands as the window
    // expands. 
    JXMenuBar* menuBar = 
    	new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop, 
    					0,0, 200,kJXDefaultMenuBarHeight);
    assert( menuBar != NULL );
    
    // Attach our menu to the menu bar.
    itsTextMenu = menuBar->AppendTextMenu(kTextMenuTitleStr);
    
    // Set the menu items in our menu.
    itsTextMenu->SetMenuItems(kTextMenuStr);
    
    // Set the menu to never disable the menu items.
    itsTextMenu->SetUpdateAction(JXMenu::kDisableNone);
    
    // The director needs to listen to the menu for messages. The message
    // we care about is JXMenu::kItemSelected.
	ListenTo(itsTextMenu);
	
	// Create the object to display the text. This time, we need to keep a 
	// pointer to it so we can change the text later.
	itsText = 
		new JXStaticText("Hello world!", window, 
			JXWidget::kFixedLeft, JXWidget::kFixedTop,
			20, 40, 160, 20);
	assert( itsText != NULL );
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:40,代码来源:MenuHelloDir.cpp

示例5: JXWindow

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

	JXWindow* window = new JXWindow(this, 260,300, "");
	assert( window != NULL );

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

	itsNetlistText =
		new JXStaticText("", kJFalse, kJTrue, NULL, JGetString("itsNetlistText::SCCircuitDocument::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 260,270);
	assert( itsNetlistText != NULL );

// end JXLayout

	window->SetCloseAction(JXWindow::kQuitApp);
	window->SetMinSize(100,100);

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	itsAnalysisMenu = menuBar->AppendTextMenu(kAnalysisMenuTitleStr);
	itsAnalysisMenu->SetMenuItems(kAnalysisMenuStr);
	itsAnalysisMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsAnalysisMenu);

	itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
	itsHelpMenu->SetMenuItems(kHelpMenuStr);
	itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsHelpMenu);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:38,代码来源:SCCircuitDocument.cpp

示例6: JXWindow

void
GMessageViewDir::BuildWindow
	(
	const JString& mailfile
	)
{
	JSize w = 500;
	JSize h = 300;
	JXWindow* window = new JXWindow(this, w,h, mailfile);
    assert( window != NULL );

	window->SetWMClass(GMGetWMClassInstance(), GMGetViewWindowClass());
    GGetPrefsMgr()->GetViewWindowSize(window);
	w = window->GetFrameWidth();
	h = window->GetFrameHeight();

    window->SetMinSize(w, 150);
    window->ShouldFocusWhenShow(kJTrue);

	JXMenuBar* menuBar =
		new JXMenuBar(window,
			JXWidget::kHElastic, JXWidget::kFixedTop,
			0, 0, w - kJXDefaultMenuBarHeight, kJXDefaultMenuBarHeight);
	assert(menuBar != NULL);

	JXEngravedRect* eRect =
		new JXEngravedRect(window,
			JXWidget::kFixedRight, JXWidget::kFixedTop,
			w - kJXDefaultMenuBarHeight, 0, kJXDefaultMenuBarHeight, kJXDefaultMenuBarHeight);
	assert(eRect != NULL);

	GMMessageDragSource* mds =
		new GMMessageDragSource(this, window,
			JXWidget::kFixedRight, JXWidget::kFixedTop,
			w - kJXDefaultMenuBarHeight + kJXDefaultBorderWidth,
			0 + kJXDefaultBorderWidth,
			kJXDefaultMenuBarHeight - 2 * kJXDefaultBorderWidth + 1,
			kJXDefaultMenuBarHeight - 2 * kJXDefaultBorderWidth + 1);
	assert(mds != NULL);

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	JPtrArray<JString> nodes(JPtrArrayT::kDeleteAll);
	GGetMailboxTreeDir()->GetTopLevelNodes(&nodes);

	itsTransferMenu = new JXFSDirMenu(nodes, itsFileMenu, kTransferToCmd, menuBar);
	assert(itsTransferMenu != NULL);
	ListenTo(itsTransferMenu);

	JDirInfo* info;
	if (itsTransferMenu->GetDirInfo(&info))
		{
		info->SetContentFilter(GMGetMailRegexStr());
		}

	itsCopyMenu = new JXFSDirMenu(nodes, itsFileMenu, kCopyToCmd, menuBar);
	assert(itsCopyMenu != NULL);
	ListenTo(itsCopyMenu);

	if (itsCopyMenu->GetDirInfo(&info))
		{
		info->SetContentFilter(GMGetMailRegexStr());
		}

	ListenTo(GGetMailboxTreeDir());

	itsMessageMenu = menuBar->AppendTextMenu(kMessageMenuTitleStr);
	itsMessageMenu->SetMenuItems(kMessageMenuStr);
	itsMessageMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsMessageMenu);

	itsToolBar =
		new JXToolBar(GGetPrefsMgr(), kGViewToolBarID,
			menuBar, w, 150, window,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
	assert(itsToolBar != NULL);

	const JSize newHeight	= itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();

	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;
//.........这里部分代码省略.........
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:101,代码来源:GMessageViewDir.cpp

示例7: JXWindow

void
GXDataDocument::BuildWindow()
{
	JSize w = 453;
	JSize h = 360;

	JXWindow* window = jnew JXWindow(this, w,h, "");
	assert( window != NULL );

	JXMenuBar* menuBar =
		jnew JXMenuBar(window,
					JXWidget::kHElastic, JXWidget::kFixedTop,
					0,0, w, kJXDefaultMenuBarHeight);
	assert( menuBar != NULL );

	JXToolBar* toolBar =
		jnew JXToolBar(GetPrefsMgr(), kDataToolBarID, menuBar,
					window,
					JXWidget::kHElastic, JXWidget::kVElastic,
					0,kJXDefaultMenuBarHeight,
					w,h - kJXDefaultMenuBarHeight);
	assert( toolBar != NULL );

	window->SetMinSize(150, 150);

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	ListenTo(itsFileMenu);

	JXImage* image = jnew JXImage(GetDisplay(), JXPM(filenew));
	assert(image != NULL);
	itsFileMenu->SetItemImage(kNewCmd, image, kJTrue);

	image = jnew JXImage(GetDisplay(), JXPM(fileopen));
	assert(image != NULL);
	itsFileMenu->SetItemImage(kOpenCmd, image, kJTrue);

	image = jnew JXImage(GetDisplay(), JXPM(filefloppy));
	assert(image != NULL);
	itsFileMenu->SetItemImage(kSaveCmd, image, kJTrue);

	image = jnew JXImage(GetDisplay(), JXPM(fileprint));
	assert(image != NULL);
	itsFileMenu->SetItemImage(kPrintCmd, image, kJTrue);

	const JCoordinate scrollheight =
		toolBar->GetWidgetEnclosure()->GetBoundsHeight();

	itsScrollbarSet =
		jnew JXScrollbarSet(toolBar->GetWidgetEnclosure(),
					JXWidget::kHElastic, JXWidget::kVElastic,
					0,0,
					w, scrollheight);
	assert( itsScrollbarSet != NULL );

	AdjustWindowTitle();

	// layout table and headers

	const JCoordinate kRowHeaderWidth  = 30;
	const JCoordinate kColHeaderHeight = 20;

	JXContainer* encl = itsScrollbarSet->GetScrollEnclosure();
	JRect enclApG     = encl->GetApertureGlobal();

	JXTextButton* okButton =
		jnew JXTextButton("OK", encl,
						JXWidget::kFixedLeft, JXWidget::kFixedTop,
						0, 0, kRowHeaderWidth-2, kColHeaderHeight-2);
	assert(okButton != NULL);

	itsTable =
		jnew GXRaggedFloatTable(this, okButton, itsData, 6,
							menuBar, itsScrollbarSet, encl,
							JXWidget::kHElastic, JXWidget::kVElastic,
							kRowHeaderWidth,kColHeaderHeight,
							enclApG.width()  - kRowHeaderWidth,
							enclApG.height() - kColHeaderHeight);
	assert( itsTable != NULL );

	enclApG = encl->GetApertureGlobal();	// JXScrollableWidget forces a change in this

	GXRowHeaderWidget* rowHeader =
		jnew GXRowHeaderWidget(itsTable, itsScrollbarSet, encl,
							  JXWidget::kFixedLeft, JXWidget::kVElastic,
							  0,kColHeaderHeight, kRowHeaderWidth,
							  enclApG.height() - kColHeaderHeight);
	assert( rowHeader != NULL );

	GXColHeaderWidget* colHeader =
		jnew GXColHeaderWidget(itsTable, itsScrollbarSet, encl,
							  JXWidget::kHElastic, JXWidget::kFixedTop,
							  kRowHeaderWidth,0, enclApG.width() - kRowHeaderWidth,
							  kColHeaderHeight);
	colHeader->TurnOnColResizing(20);
	assert( colHeader != NULL );

	JXDocumentMenu* windowListMenu =
		jnew JXDocumentMenu(kWindowListMenuTitleStr, menuBar,
			JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:GXDataDocument.cpp

示例8: JXWindow

void
GLFitDirector::BuildWindow()
{
	JCoordinate w = 600;
	JCoordinate h = 420;
	JXWindow* window = new JXWindow(this, w,h, "Fit");
    assert( window != NULL );
	window->SetCloseAction(JXWindow::kDeactivateDirector);
    
	JXMenuBar* menuBar =
		new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop, 
			0,0, w,kJXDefaultMenuBarHeight);
	assert( menuBar != NULL );

	itsToolBar =
		new JXToolBar(GetPrefsMgr(), kFitToolBarID,
			menuBar, w, h,
			window, JXWidget::kHElastic, JXWidget::kVElastic, 
			0,kJXDefaultMenuBarHeight, w,h - kJXDefaultMenuBarHeight);
	assert( itsToolBar != NULL );

	JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();

	const JCoordinate kPartitionHandleWidth	= 5;
	const JCoordinate kFitListWidth			= 155;

	JArray<JCoordinate> widths(2);
	widths.AppendElement(kFitListWidth);
	widths.AppendElement(w - kFitListWidth - kPartitionHandleWidth);

	JIndex elasticIndex = 2;

	JArray<JCoordinate> minWidths(2);
	minWidths.AppendElement(100);
	minWidths.AppendElement(300);

	itsMainPartition =
		new JXHorizPartition(widths, elasticIndex, minWidths,
							 itsToolBar->GetWidgetEnclosure(), 
							 JXWidget::kHElastic,JXWidget::kVElastic,
							 0, 0, w, newHeight);
	assert( itsMainPartition != NULL );

	// This is the first column the contains the curve and fit lists.
	
	JXContainer* container = itsMainPartition->GetCompartment(1);

	const JCoordinate kCurveListHeight	= 100;
	const JCoordinate kColHeaderHeight	= 20;
	const JCoordinate kExprHeight		= 50;
	const JCoordinate kFitListHeight	= newHeight - kCurveListHeight - 2 * kPartitionHandleWidth - kExprHeight;
	
	JArray<JCoordinate> heights(3);
	heights.AppendElement(kCurveListHeight);
	heights.AppendElement(kFitListHeight);
	heights.AppendElement(kExprHeight);

	elasticIndex = 2;

	JArray<JCoordinate> minHeights(3);
	minHeights.AppendElement(50);	
	minHeights.AppendElement(100);
	minHeights.AppendElement(40);

	itsListPartition =
		new JXVertPartition(heights, elasticIndex, minHeights, container,
			JXWidget::kHElastic, JXWidget::kVElastic, 0, 0, kFitListWidth, newHeight);
    assert( itsListPartition != NULL );

	container = itsListPartition->GetCompartment(1);
	
	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(container, 
						   JXWidget::kHElastic,JXWidget::kVElastic,
						   0, kColHeaderHeight,
						   kFitListWidth, kCurveListHeight - kColHeaderHeight);
	assert( scrollbarSet != NULL );

	// This will be the curve list

	itsCurveList	= 
		new GLCurveNameList(itsDir, itsPlot, 
			scrollbarSet, scrollbarSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, 0,  kFitListWidth, kCurveListHeight - kColHeaderHeight);
	assert(itsCurveList != NULL);
	ListenTo(itsCurveList);

	JXColHeaderWidget* header =
		new JXColHeaderWidget(itsCurveList, scrollbarSet,
			container,
			JXWidget::kHElastic, JXWidget::kFixedTop,
			0, 0,  
			kFitListWidth, 
			kColHeaderHeight);
	assert(header != NULL);

	header->SetColTitle(1, "Curves");
	
	container = itsListPartition->GetCompartment(2);
//.........这里部分代码省略.........
开发者ID:raorn,项目名称:jx_application_framework,代码行数:101,代码来源:GLFitDirector.cpp

示例9: CBTextDocument

CBExecOutputDocument::CBExecOutputDocument
	(
	const CBTextFileType	fileType,
	const JCharacter*		helpSectionName,
	const JBoolean			focusToCmd,
	const JBoolean			allowStop
	)
	:
	CBTextDocument(fileType, helpSectionName, kJFalse),
	itsFocusToCmdFlag(focusToCmd)
{
	itsProcess            = NULL;
	itsRecordLink         = NULL;
	itsDataLink           = NULL;
	itsCmdStream          = NULL;
	itsReceivedDataFlag   = kJFalse;
	itsProcessPausedFlag  = kJFalse;
	itsClearWhenStartFlag = kJTrue;
	itsUseCount           = 0;
	itsDontCloseMsg       = JGetString("WaitCloseMsg::CBExecOutputDocument");

	// buttons in upper right

	JXWindow* window = GetWindow();
	const JRect rect = window->GetBounds();

	JXMenuBar* menuBar = GetMenuBar();
	const JSize h      = menuBar->GetFrameHeight();

	const JCoordinate x = (allowStop ? 3 : 2) * kMenuButtonWidth;

	itsPauseButton =
		jnew JXTextButton(JGetString("PauseLabel::CBExecOutputDocument"), window,
						  JXWidget::kFixedRight, JXWidget::kFixedTop,
						  rect.right - x,0, kMenuButtonWidth,h);
	assert( itsPauseButton != NULL );
	ListenTo(itsPauseButton);
	itsPauseButton->SetShortcuts("^Z");
	itsPauseButton->SetHint(JGetString("PauseButtonHint::CBExecOutputDocument"));

	if (allowStop)
		{
		itsStopButton =
			jnew JXTextButton(JGetString("StopLabel::CBExecOutputDocument"), window,
							  JXWidget::kFixedRight, JXWidget::kFixedTop,
							  rect.right - 2*kMenuButtonWidth,0, kMenuButtonWidth,h);
		assert( itsStopButton != NULL );
		ListenTo(itsStopButton);
		itsStopButton->SetShortcuts("^C#.");
		itsStopButton->SetHint(JGetString("StopButtonHint::CBExecOutputDocument"));
		}
	else
		{
		itsStopButton = NULL;
		}

	itsKillButton =
		jnew JXTextButton(JGetString("KillLabel::CBExecOutputDocument"), window,
						  JXWidget::kFixedRight, JXWidget::kFixedTop,
						  rect.right - kMenuButtonWidth,0, kMenuButtonWidth,h);
	assert( itsKillButton != NULL );
	ListenTo(itsKillButton);

	if (!allowStop)
		{
		itsKillButton->SetShortcuts("^C#.");
		itsKillButton->SetHint(JGetString("StopButtonHint::CBExecOutputDocument"));
		}

	menuBar->AdjustSize(-x, 0);

	// command line input

	JXWidget::HSizingOption hSizing;
	JXWidget::VSizingOption vSizing;
	GetFileDisplayInfo(&hSizing, &vSizing);

	itsCmdPrompt =
		jnew JXStaticText(JGetString("CmdPrompt::CBExecOutputDocument"), window,
						  JXWidget::kFixedLeft, vSizing,
						  -1000, -1000, 0, 500);
	assert( itsCmdPrompt != NULL );
	itsCmdPrompt->SetToLabel();
	itsCmdPrompt->Hide();

	itsCmdInput =
		jnew CBCmdLineInput(this, window, hSizing, vSizing,
							-1000, -1000, 500, 500);
	assert( itsCmdInput != NULL );
	itsCmdInput->ShareEditMenu(GetTextEditor());
	itsCmdInput->Hide();

	itsEOFButton =
		jnew JXTextButton(JGetString("EOFButtonTitle::CBExecOutputDocument"), window,
						  JXWidget::kFixedRight, vSizing,
						  -1000, -1000, 500, 500);
	assert( itsEOFButton != NULL );
	itsEOFButton->SetShortcuts("^D");
	itsEOFButton->Hide();
	ListenTo(itsEOFButton);
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:CBExecOutputDocument.cpp

示例10: JXWindow

void
TestPartitionDirector::BuildWindow()
{
JIndex i;

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

	for (i=1; i<=kInitCompartmentCount; i++)
		{
		sizes.AppendElement(kInitSize);
		minSizes.AppendElement(kMinSize);
		}

// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 310,340, "");
	assert( window != NULL );

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

	itsHorizPartition =
		jnew JXHorizPartition(sizes, kInitElasticIndex, minSizes, window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 310,310);
	assert( itsHorizPartition != NULL );

// end JXLayout

	itsVertPartition =
		jnew JXVertPartition(sizes, kInitElasticIndex, minSizes,
					itsHorizPartition->GetCompartment(kInitElasticIndex),
					JXWidget::kHElastic, JXWidget::kVElastic,
					0,0, 10,315);
	assert( itsVertPartition != NULL );
	itsVertPartition->FitToEnclosure(kJTrue, kJTrue);

	window->SetTitle("Test Partitions");
	window->SetWMClass("testjx", "TestPartitionDirector");
	AdjustMinWindowSize();

	itsHorizMenu = menuBar->AppendTextMenu(kHorizMenuTitleStr);
	itsHorizMenu->SetShortcuts(kHorizMenuShortcuts);
	itsHorizMenu->SetMenuItems(kHorizMenuStr);
	itsHorizMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsHorizMenu);

	itsVertMenu = menuBar->AppendTextMenu(kVertMenuTitleStr);
	itsVertMenu->SetShortcuts(kVertMenuShortcuts);
	itsVertMenu->SetMenuItems(kVertMenuStr);
	itsVertMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsVertMenu);

	for (i=1; i<=kInitCompartmentCount; i++)
		{
		if (i != kInitElasticIndex)
			{
			CreateTestWidget(itsHorizPartition, i);
			}
		CreateTestWidget(itsVertPartition, i);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:64,代码来源:TestPartitionDirector.cpp

示例11: JXWindow

void
GAddressBookTreeDir::BuildWindow()
{
	JCoordinate w 		= 300;
	JCoordinate minW	= 250;
	JCoordinate h 		= 500;
	JCoordinate minH	= 250;

	JXWindow* window = new JXWindow(this, w,h, "Addresses");
    assert( window != NULL );

	window->SetWMClass(GMGetWMClassInstance(), GMGetAddressBookWindowClass());
	window->SetCloseAction(JXWindow::kDeactivateDirector);
    window->PlaceAsDialogWindow();
	window->ShouldFocusWhenShow(kJTrue);
    //window->SetMinSize(200, 300);
	//window->LockCurrentMinSize();

	JXMenuBar* menuBar =
		new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
			0,0, w - kCloseButtonWidth,kJXDefaultMenuBarHeight);
	assert( menuBar != NULL );

    itsCloseButton =
        new JXTextButton("Close", window,
                    JXWidget::kFixedRight, JXWidget::kFixedTop,
                    w - kCloseButtonWidth,0,
                    kCloseButtonWidth,kJXDefaultMenuBarHeight);
    assert( itsCloseButton != NULL );
    itsCloseButton->SetShortcuts("#W"); //^[
    ListenTo(itsCloseButton);

	itsToolBar =
		new JXToolBar(GGetPrefsMgr(), kGAddressToolBarID,
			menuBar, minW, minH, window,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
	assert(itsToolBar != NULL);

	const JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();

	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
						   JXWidget::kHElastic,JXWidget::kVElastic,
						   0, 0,
						   w, newHeight);
	assert( scrollbarSet != NULL );

    JNamedTreeNode* base = new JNamedTreeNode(NULL, "");
    assert(base != NULL);
    itsTree = new JTree(base);
    assert(itsTree != NULL);
    JNamedTreeList* list = new JNamedTreeList(itsTree);

    itsWidget =
		new GAddressBookTreeWidget(itsTree, list,  menuBar,
									scrollbarSet, scrollbarSet->GetScrollEnclosure(),
									JXWidget::kHElastic, JXWidget::kVElastic,
									0,0,w,newHeight);
    assert(itsWidget != NULL);

	GMDirectorMenu* menu =
		new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
			JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert(menu != NULL);
	menuBar->AppendMenu(menu);

	itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
	itsHelpMenu->SetMenuItems(kHelpMenuStr);
	itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsHelpMenu);

	itsHelpMenu->SetItemImage(kTOCCmd, JXPM(jx_help_toc));
	itsHelpMenu->SetItemImage(kThisWindowCmd, JXPM(jx_help_specific));

	itsToolBar->LoadPrefs();

	if (itsToolBar->IsEmpty())
		{
		itsWidget->AddDefaultButtcons(itsToolBar);
		itsToolBar->AppendButton(itsHelpMenu, kTOCCmd);
		itsToolBar->AppendButton(itsHelpMenu, kThisWindowCmd);
		}

	itsMenuIcon = new JXImage(window->GetDisplay(), address_entry);
	assert(itsMenuIcon != NULL);
	itsMenuIcon->ConvertToRemoteStorage();
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:88,代码来源:GAddressBookTreeDir.cpp

示例12: JXWindow

void
GMailboxTreeDir::BuildWindow()
{
	JCoordinate w = 360;
	JCoordinate h = 500;

	JXWindow* window = new JXWindow(this, w,h, "Mailbox window");
    assert( window != NULL );

	window->SetWMClass(GMGetWMClassInstance(), GMGetMailboxWindowClass());
	window->SetCloseAction(JXWindow::kDeactivateDirector);
    window->PlaceAsDialogWindow();
    window->ShouldFocusWhenShow(kJTrue);
    window->LockCurrentMinSize();

	JXMenuBar* menuBar =
		new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
			0,0, w - kCloseButtonWidth,kJXDefaultMenuBarHeight);
	assert( menuBar != NULL );

    itsCloseButton =
        new JXTextButton("Close", window,
                    JXWidget::kFixedRight, JXWidget::kFixedTop,
                    w - kCloseButtonWidth,0,
                    kCloseButtonWidth,kJXDefaultMenuBarHeight);
    assert( itsCloseButton != NULL );
    itsCloseButton->SetShortcuts("#W"); //^[
    ListenTo(itsCloseButton);

	itsToolBar =
		new JXToolBar(GGetPrefsMgr(), kGMailboxToolBarID,
			menuBar, w, h, window,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
	assert(itsToolBar != NULL);

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	GMPOPRetrieverMenu* popmenu =
		new GMPOPRetrieverMenu(itsFileMenu, kCheckAccountCmd, menuBar);
	assert(popmenu != NULL);

	itsFileMenu->SetItemImage(kNewCmd, filenew);
	itsFileMenu->SetItemImage(kOpenCmd, fileopen);
	itsFileMenu->SetItemImage(kCheckMailCmd, check_mail);

	const JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();

	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
						   JXWidget::kHElastic,JXWidget::kVElastic,
						   0, 0,
						   w, newHeight);
	assert( scrollbarSet != NULL );

    GMTreeRootNode* base = new GMTreeRootNode();
    assert(base != NULL);
    JDirInfo* info;
    if (base->GetDirInfo(&info))
		{
		JString regex("^$|");
		regex += GMGetMailRegexStr();
		info->SetContentFilter(regex);
		}
    itsTree = new GMFileTree(base);
    assert(itsTree != NULL);
    JNamedTreeList* list = new JNamedTreeList(itsTree);

    itsWidget =
		new GMailboxTreeWidget(itsTree, list,  menuBar,
								scrollbarSet, scrollbarSet->GetScrollEnclosure(),
								JXWidget::kHElastic, JXWidget::kVElastic,
								0,0,w,newHeight);
    assert(itsWidget != NULL);

	GMDirectorMenu* menu =
		new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
			JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert(menu != NULL);
	menuBar->AppendMenu(menu);

	itsPrefsMenu = menuBar->AppendTextMenu(kPrefsMenuTitleStr);
	itsPrefsMenu->SetMenuItems(kPrefsMenuStr);
	itsPrefsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsPrefsMenu);

	itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
	itsHelpMenu->SetMenuItems(kHelpMenuStr);
	itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsHelpMenu);

	itsHelpMenu->SetItemImage(kTOCCmd, JXPM(jx_help_toc));
	itsHelpMenu->SetItemImage(kThisWindowCmd, JXPM(jx_help_specific));

	itsToolBar->LoadPrefs();

	if (itsToolBar->IsEmpty())
//.........这里部分代码省略.........
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:101,代码来源:GMailboxTreeDir.cpp

示例13: JXWindow

void
TestDirector::BuildWindow
	(
	const JBoolean isMaster,
	const JBoolean bufferTestWidget,
	const JBoolean testWidgetIsImage
	)
{
	JXDisplay* display   = (JXGetApplication())->GetCurrentDisplay();
	JXColormap* colormap = display->GetColormap();

// begin JXLayout

    JXWindow* window = new JXWindow(this, 400,330, "");
    assert( window != NULL );

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

    JXScrollbarSet* scrollbarSet =
        new JXScrollbarSet(window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 400,300);
    assert( scrollbarSet != NULL );

// end JXLayout

	window->SetTitle("Test Director");
	window->SetWMClass("testjx", "TestDirector");

	window->SetMinSize(150,150);
	if (isMaster)
		{
		window->SetCloseAction(JXWindow::kQuitApp);
		}
	else
		{
		window->SetCloseAction(JXWindow::kCloseDisplay);
		}

	itsAnimIconTask = new AnimateWindowIconTask(GetWindow());
	assert( itsAnimIconTask != NULL );
	ListenTo(window);		// for icon animation

	// menus

	JXImage* aboutTitleImage =
		new JXImage(display, kSmileyBitmap[ kHappySmileyIndex ], colormap->GetRedColor());
	assert( aboutTitleImage != NULL );
	itsAboutMenu = menuBar->AppendTextMenu(aboutTitleImage, kJTrue);
	itsAboutMenu->SetShortcuts(kAboutMenuShortcuts);
	itsAboutMenu->SetMenuItems(kAboutMenuStr, "TestDirector");
	itsAboutMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsAboutMenu);

	itsAnimHelpTask = new AnimateHelpMenuTask(itsAboutMenu, kHelpCmd);
	assert( itsAnimHelpTask != NULL );

	itsPrintPSMenu = new JXTextMenu(itsAboutMenu, kPrintPSMenuCmd, menuBar);
	assert( itsPrintPSMenu != NULL );
	itsPrintPSMenu->SetMenuItems(kPrintPSMenuStr);
	itsPrintPSMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsPrintPSMenu);

	itsTestMenu = menuBar->AppendTextMenu(kTestMenuTitleStr);
	itsTestMenu->SetMenuItems(kTestMenuStr);
	itsTestMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsTestMenu);

	itsUNMenu = new JXTextMenu(itsTestMenu, kTestUserNotifyMenuCmd, menuBar);
	assert( itsUNMenu != NULL );
	itsUNMenu->SetMenuItems(kUserNotificationMenuStr);
	itsUNMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsUNMenu);

	itsCSFMenu = new JXTextMenu(itsTestMenu, kTestChooseSaveFileMenuCmd, menuBar);
	assert( itsCSFMenu != NULL );
	itsCSFMenu->SetMenuItems(kChooseSaveFileMenuStr);
	itsCSFMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsCSFMenu);

	itsPGMenu = new JXTextMenu(itsTestMenu, kTestPGMenuCmd, menuBar);
	assert( itsPGMenu != NULL );
	itsPGMenu->SetMenuItems(kProgressDisplayMenuStr);
	itsPGMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsPGMenu);

	if (isMaster)
		{
		itsDisplayMenu =
			new JXDisplayMenu(kDisplayMenuName, menuBar,
							  JXWidget::kFixedLeft, JXWidget::kFixedTop,
							  0,0, 10,10);
		assert( itsDisplayMenu != NULL );
		menuBar->AppendMenu(itsDisplayMenu);
		}
	else
		{
		itsDisplayMenu = NULL;
//.........这里部分代码省略.........
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:101,代码来源:TestDirector.cpp

示例14: JXDocument

PlotDir::PlotDir
	(
	JXDirector*       supervisor,
	JXFileDocument*   notifySupervisor,
	const JCharacter* filename,
	const JBoolean    hideOnClose
	)
	:
	JXDocument(supervisor),
	itsFileName(filename)
{
	itsSupervisor       = notifySupervisor;
	itsHideOnClose      = hideOnClose;
	itsPlotIsClosing	= kJFalse;

	itsPrinter          = NULL;

	JCoordinate w 		= 500;
	JCoordinate h       = 400;
	JCoordinate minW	= 400;
	JCoordinate minH    = 300;

	JXWindow* window = jnew JXWindow(this, w,h, filename);
	assert( window != NULL );

	window->SetMinSize(minW,minH);
	if (hideOnClose)
		{
		window->SetCloseAction(JXWindow::kDeactivateDirector);
		}

	JXMenuBar* menuBar =
		jnew JXMenuBar(window,
			JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, w, kJXDefaultMenuBarHeight);
	assert( menuBar != NULL );

	itsPlotMenu = menuBar->AppendTextMenu(kPlotMenuTitleStr);
	itsPlotMenu->SetMenuItems(kPlotMenuStr);
	itsPlotMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsPlotMenu);

	itsAnalysisMenu = menuBar->AppendTextMenu(kAnalysisMenuTitleStr);
	itsAnalysisMenu->SetMenuItems(kAnalysisMenuStr);
	itsAnalysisMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsAnalysisMenu);

	itsFitParmsMenu = jnew JXTextMenu(itsAnalysisMenu, kFitParmsCmd, menuBar);
	assert( itsFitParmsMenu != NULL );
	itsFitParmsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFitParmsMenu);
	itsAnalysisMenu->DisableItem(kFitParmsCmd);

	itsDiffMenu = jnew JXTextMenu(itsAnalysisMenu, kDiffPlotCmd, menuBar);
	assert( itsDiffMenu != NULL );
	itsDiffMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsDiffMenu);
	itsAnalysisMenu->DisableItem(kDiffPlotCmd);

	itsSessionDir =
		jnew GloveHistoryDir(JXGetApplication());
	assert(itsSessionDir != NULL);
	JXGetDocumentManager()->DocumentMustStayOpen(itsSessionDir, kJTrue);
	ListenTo(itsSessionDir);

	itsPlot =
		jnew GlovePlotter(itsSessionDir, menuBar, window,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, 30, w, h - kJXDefaultMenuBarHeight);
	assert( itsPlot != NULL );

	ListenTo(itsPlot);

	JXDocumentMenu* windowListMenu =
		jnew JXDocumentMenu(kWindowListMenuTitleStr, menuBar,
			JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert( windowListMenu != NULL );
	menuBar->AppendMenu(windowListMenu);

	itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
	itsHelpMenu->SetMenuItems(kHelpMenuStr);
	itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsHelpMenu);

	itsVarList	 = jnew GVarList();
	itsVarList->AddVariable("x",0);
	itsXVarIndex = 1;
	itsFunctionDialog = NULL;
	itsFitModuleDialog = NULL;

	itsFits = jnew JPtrArray<JFitBase>(JPtrArrayT::kForgetAll);
	assert( itsFits != NULL );
	ListenTo(itsFits);
	itsFitParmsDir = jnew FitParmsDir(this, itsFits);
	assert( itsFitParmsDir != NULL );
	itsCurveStats = jnew JArray<CurveStats>;
	assert( itsCurveStats != NULL );
	itsCurrentCurveType = kGDataCurve;

	itsDiffDirs = jnew JPtrArray<PlotDir>(JPtrArrayT::kForgetAll);
	assert( itsDiffDirs != NULL );
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:PlotDir.cpp

示例15: JSplitPathAndName

void
GMessageTableDir::BuildWindow
	(
	const JString& mailfile
	)
{
	JSize w = 560;
	JSize h = 300;
	JString title;
	JString path;
	JSplitPathAndName(mailfile, &path, &title);

	itsWindow = new JXWindow(this, w,h, title);
	assert( itsWindow != NULL );

	itsWindow->SetWMClass(GMGetWMClassInstance(), GMGetTableWindowClass());
//	ListenTo(itsWindow);
    GGetPrefsMgr()->GetTableWindowSize(itsWindow);

	w = itsWindow->GetFrameWidth();
	h = itsWindow->GetFrameHeight();

	itsWindow->SetMinSize(w, 150);

	JXMenuBar* menuBar =
		new JXMenuBar(itsWindow,
			JXWidget::kHElastic, JXWidget::kFixedTop,
			0, 0, w, kJXDefaultMenuBarHeight);
	assert(menuBar != NULL);

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	JPtrArray<JString> nodes(JPtrArrayT::kDeleteAll);
	GGetMailboxTreeDir()->GetTopLevelNodes(&nodes);

	itsTransferMenu = new JXFSDirMenu(nodes, itsFileMenu, kTransferToCmd, menuBar);
	assert(itsTransferMenu != NULL);
	ListenTo(itsTransferMenu);

	JDirInfo* info;
	if (itsTransferMenu->GetDirInfo(&info))
		{
		info->SetContentFilter(GMGetMailRegexStr());
		}

	itsCopyMenu = new JXFSDirMenu(nodes, itsFileMenu, kCopyToCmd, menuBar);
	assert(itsCopyMenu != NULL);
	ListenTo(itsCopyMenu);

	if (itsCopyMenu->GetDirInfo(&info))
		{
		info->SetContentFilter(GMGetMailRegexStr());
		}

	ListenTo(GGetMailboxTreeDir());

	GMPOPRetrieverMenu* popmenu =
		new GMPOPRetrieverMenu(itsFileMenu, kCheckAccountCmd, menuBar);
	assert(popmenu != NULL);

//	itsInboxMenu = new JXTextMenu(itsFileMenu, kInboxCmd, menuBar);
	itsInboxMenu = menuBar->AppendTextMenu(kInboxMenuTitleStr);
	assert(itsInboxMenu != NULL);
	itsInboxMenu->SetMenuItems(kInboxMenuStr);
	itsInboxMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsInboxMenu);

	itsToolBar =
		new JXToolBar(GGetPrefsMgr(), kGTableToolBarID,
			menuBar, w, 150, itsWindow,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
	assert(itsToolBar != NULL);

	const JCoordinate pathheight = 20;
	const JCoordinate scrollheight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight() - pathheight;

	itsSBSet =
		new JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,w,scrollheight);
	assert(itsSBSet != NULL);

	itsTable =
		new GMessageTable(this, menuBar,
			itsSBSet, itsSBSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,20,w,scrollheight-20);
	assert (itsTable != NULL);

	itsColHeader =
		new GMessageColHeader(itsTable, itsSBSet, itsSBSet->GetScrollEnclosure(),
							  JXWidget::kHElastic, JXWidget::kFixedTop,
							  0,0,w,20);
	assert(itsColHeader != NULL);

	itsColHeader->SetColTitle(4, "From");
//.........这里部分代码省略.........
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:101,代码来源:GMessageTableDir.cpp


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