コード例 #1
0
void
CBSymbolSRDirector::BuildWindow
	(
	CBSymbolList*	symbolList,
	const JBoolean	focus
	)
{
// begin JXLayout

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

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

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

// end JXLayout

	window->LockCurrentMinSize();

	if (focus)
		{
		window->ShouldFocusWhenShow(kJTrue);
		}

	itsSymbolTable =
		new CBSymbolTable(itsMainSymDir, symbolList,
						  scrollbarSet, scrollbarSet->GetScrollEnclosure(),
						  JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 10,10);
	assert( itsSymbolTable != NULL );
	itsSymbolTable->FitToEnclosure();

	itsActionsMenu = menuBar->AppendTextMenu(kActionsMenuTitleStr);
	itsActionsMenu->SetMenuItems(kActionsMenuStr, "CBSymbolSRDirector");
	itsActionsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsActionsMenu);

	itsActionsMenu->SetItemImage(kShowCTreeCmd,    jcc_show_c_tree);
	itsActionsMenu->SetItemImage(kShowJavaTreeCmd, jcc_show_java_tree);
	itsActionsMenu->SetItemImage(kShowPHPTreeCmd,  jcc_show_php_tree);

	itsCmdMenu =
		new CBCommandMenu(itsProjDoc, NULL, menuBar,
						  JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert( itsCmdMenu != NULL );
	menuBar->AppendMenu(itsCmdMenu);
	ListenTo(itsCmdMenu);
}
コード例 #2
0
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);
}
コード例 #3
0
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;

	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,
			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);

	itsFileMenu->SetItemImage(kNewCmd, filenew);
	itsFileMenu->SetItemImage(kNewMBox, envelopes);
	itsFileMenu->SetItemImage(kOpenCmd, fileopen);
	itsFileMenu->SetItemImage(kSaveCmd, filefloppy);
	itsFileMenu->SetItemImage(kPrintCmd, fileprint);
	itsFileMenu->SetItemImage(kShowNextCmd, mini_right);
	itsFileMenu->SetItemImage(kDeleteShowNextCmd, mini_del_right);
	itsFileMenu->SetItemImage(kShowPrevCmd, mini_left);

	itsMessageMenu->SetItemImage(kDecryptCmd, unlock_xpm);
	itsMessageMenu->SetItemImage(kSaveAttachCmd, paperclip);
	itsMessageMenu->SetItemImage(kReplyCmd, reply_xpm);
	itsMessageMenu->SetItemImage(kReplySenderCmd, reply_sender_xpm);
	itsMessageMenu->SetItemImage(kReplyAllCmd, reply_all_xpm);
	itsMessageMenu->SetItemImage(kForwardCmd, forward_xpm);
	itsMessageMenu->SetItemImage(kRedirectCmd, redirect_xpm);

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

	itsToolBar->LoadPrefs();

	if (itsToolBar->IsEmpty())
		{
		itsToolBar->AppendButton(itsFileMenu, kNewCmd);
		itsToolBar->AppendButton(itsFileMenu, kOpenCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kSaveCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kPrintCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kShowNextCmd);
		itsToolBar->AppendButton(itsFileMenu, kShowPrevCmd);
		itsToolBar->AppendButton(itsFileMenu, kDeleteShowNextCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsMessageMenu, kReplyCmd);
		itsToolBar->AppendButton(itsMessageMenu, kReplySenderCmd);
		itsToolBar->AppendButton(itsMessageMenu, kReplyAllCmd);
		itsToolBar->AppendButton(itsMessageMenu, kForwardCmd);
		itsToolBar->AppendButton(itsMessageMenu, kRedirectCmd);
		}

	itsMenuIcon = new JXImage(window->GetDisplay(), jx_plain_file_small);
	assert(itsMenuIcon != NULL);
	itsMenuIcon->ConvertToRemoteStorage();
}
コード例 #4
0
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);
	assert( windowListMenu != NULL );
	menuBar->AppendMenu(windowListMenu);

	itsExportMenu = jnew JXTextMenu(itsFileMenu, kExportCmd, menuBar);
	assert( itsExportMenu != NULL );
	itsExportMenu->SetMenuItems(kExportMenuStr);
	itsExportMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsExportMenu);

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

	image = jnew JXImage(GetDisplay(), JXPM(manual));
	assert(image != NULL);
	itsHelpMenu->SetItemImage(kTOCCmd, image, kJTrue);

	toolBar->LoadPrefs();
	if (toolBar->IsEmpty())
		{
		toolBar->AppendButton(itsFileMenu, kNewCmd);
		toolBar->AppendButton(itsFileMenu, kOpenCmd);
		toolBar->AppendButton(itsFileMenu, kSaveCmd);
		toolBar->NewGroup();
		toolBar->AppendButton(itsFileMenu, kPrintCmd);

		itsTable->LoadDefaultToolButtons(toolBar);

		toolBar->NewGroup();
		toolBar->AppendButton(itsHelpMenu, kTOCCmd);
		}
}
コード例 #5
0
void
CMRegistersDir::BuildWindow()
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 450,500, "");
	assert( window != NULL );

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

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

// end JXLayout

	window->SetTitle(JGetString("WindowTitleSuffix::CMRegistersDir"));
	window->SetCloseAction(JXWindow::kDeactivateDirector);
	window->SetMinSize(150, 150);
	window->ShouldFocusWhenShow(kJTrue);
	window->SetWMClass(CMGetWMClassInstance(), CMGetRegistersWindowClass());
	(CMGetPrefsManager())->GetWindowSize(kRegistersWindowSizeID, window);

	JXDisplay* display = GetDisplay();
	JXImage* icon      = new JXImage(display, medic_registers_window);
	assert( icon != NULL );
	window->SetIcon(icon);

	itsWidget =
		new JXStaticText("", kJFalse, kJTrue,
						 scrollbarSet, scrollbarSet->GetScrollEnclosure(),
						 JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
	assert(itsWidget != NULL);
	itsWidget->FitToEnclosure();

	JString name;
	JSize size;
	(CMGetPrefsManager())->GetDefaultFont(&name, &size);
	itsWidget->SetFont(name, size);

	// menus

	itsFileMenu = menuBar->PrependTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr, "CMThreadsDir");
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	itsFileMenu->SetItemImage(kOpenCmd, jx_file_open);

	itsWidget->AppendEditMenu(menuBar);

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

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

	itsHelpMenu->SetItemImage(kTOCCmd,        jx_help_toc);
	itsHelpMenu->SetItemImage(kThisWindowCmd, jx_help_specific);
}
コード例 #6
0
void
CMLocalVarsDir::BuildWindow()
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 450,500, "");
	assert( window != NULL );

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

	JXScrollbarSet* scrollbarSet =
		jnew JXScrollbarSet(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 450,470);
	assert( scrollbarSet != NULL );

// end JXLayout

	window->SetTitle(kWindowTitleSuffix);
	window->SetCloseAction(JXWindow::kDeactivateDirector);
	window->SetMinSize(150, 150);
	window->ShouldFocusWhenShow(kJTrue);
	window->SetWMClass(CMGetWMClassInstance(), CMGetVariableWindowClass());
	CMGetPrefsManager()->GetWindowSize(kLocalVarWindSizeID, window);

	JXDisplay* display = GetDisplay();
	JXImage* icon      = jnew JXImage(display, medic_local_variables_window);
	assert( icon != NULL );
	window->SetIcon(icon);

	CMVarNode* root = itsLink->CreateVarNode(kJFalse);
	assert( root != NULL );
	itsTree = jnew JTree(root);
	assert( itsTree != NULL );
	JNamedTreeList* treeList = jnew JNamedTreeList(itsTree);
	assert( treeList != NULL );

	itsWidget =
		jnew CMVarTreeWidget(itsCommandDir, kJFalse, menuBar, itsTree, treeList,
							scrollbarSet, scrollbarSet->GetScrollEnclosure(),
							JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
	assert(itsWidget != NULL);
	itsWidget->FitToEnclosure();

	itsGetLocalsCmd = itsLink->CreateGetLocalVars(root);

	// menus

	itsFileMenu = menuBar->PrependTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr, "CMThreadsDir");
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	itsFileMenu->SetItemImage(kOpenCmd, jx_file_open);

	itsActionMenu = menuBar->AppendTextMenu(kActionMenuTitleStr);
	menuBar->InsertMenu(3, itsActionMenu);
	itsActionMenu->SetMenuItems(kActionMenuStr, "CMLocalVarsDir");
	ListenTo(itsActionMenu);

	itsActionMenu->SetItemImage(kDisplay1DArrayCmd, medic_show_1d_array);
	itsActionMenu->SetItemImage(kPlot1DArrayCmd,    medic_show_2d_plot);
	itsActionMenu->SetItemImage(kDisplay2DArrayCmd, medic_show_2d_array);
	itsActionMenu->SetItemImage(kExamineMemCmd,     medic_show_memory);

	JXWDMenu* wdMenu =
		jnew JXWDMenu(kWindowsMenuTitleStr, menuBar,
					 JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert( wdMenu != NULL );
	menuBar->AppendMenu(wdMenu);

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

	itsHelpMenu->SetItemImage(kTOCCmd,        jx_help_toc);
	itsHelpMenu->SetItemImage(kThisWindowCmd, jx_help_specific);
}
コード例 #7
0
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;
		}

	itsWidget =
		new TestWidget(isMaster, testWidgetIsImage,
					   menuBar, scrollbarSet,
					   scrollbarSet->GetScrollEnclosure(),
					   JXWidget::kHElastic, JXWidget::kVElastic,
					   0,0, 10,10);
	assert( itsWidget != NULL );
	itsWidget->FitToEnclosure(kJTrue, kJTrue);
	itsWidget->SetSingleFocusWidget();

	BuildIconMenus(window, menuBar);

	// do this -after- constructing JXScrollableWidget

	(GetWindow())->BufferDrawing(bufferTestWidget);
}
コード例 #8
0
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 );
	ListenTo(itsDiffDirs);

	itsPrinter = jnew JXPSPrinter(GetDisplay());
	assert( itsPrinter != NULL );
	itsPrinter->SetOrientation(JPSPrinter::kLandscape);

	itsEPSPrinter	= jnew JX2DPlotEPSPrinter(GetDisplay());
	assert(itsEPSPrinter != NULL);
	itsPlot->SetEPSPrinter(itsEPSPrinter);

	ListenTo(itsPrinter);
}
コード例 #9
0
void
CMArray1DDir::BuildWindow()
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 300,500, "");
	assert( window != NULL );

	itsExprInput =
		jnew CMArrayExprInput(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 110,40, 170,20);
	assert( itsExprInput != NULL );

	JXStaticText* startLabel =
		jnew JXStaticText(JGetString("startLabel::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,70, 90,20);
	assert( startLabel != NULL );
	startLabel->SetToLabel();

	JXStaticText* endLabel =
		jnew JXStaticText(JGetString("endLabel::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,100, 90,20);
	assert( endLabel != NULL );
	endLabel->SetToLabel();

	itsStopButton =
		jnew JXTextButton(JGetString("itsStopButton::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 200,85, 60,20);
	assert( itsStopButton != NULL );
	itsStopButton->SetShortcuts(JGetString("itsStopButton::CMArray1DDir::shortcuts::JXLayout"));

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

	JXScrollbarSet* scrollbarSet =
		jnew JXScrollbarSet(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,130, 300,370);
	assert( scrollbarSet != NULL );

	itsStartIndex =
		jnew CMArrayIndexInput(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 110,70, 60,20);
	assert( itsStartIndex != NULL );

	itsEndIndex =
		jnew CMArrayIndexInput(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 110,100, 60,20);
	assert( itsEndIndex != NULL );

	JXStaticText* exprLabel =
		jnew JXStaticText(JGetString("exprLabel::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,40, 90,20);
	assert( exprLabel != NULL );
	exprLabel->SetToLabel();

// end JXLayout

	window->SetMinSize(300, 200);
	window->ShouldFocusWhenShow(kJTrue);
	window->SetWMClass(CMGetWMClassInstance(), CMGetArray1DWindowClass());

	UpdateWindowTitle();

	JXDisplay* display = GetDisplay();
	JXImage* icon      = jnew JXImage(display, medic_1d_array_window);
	assert( icon != NULL );
	window->SetIcon(icon);

	CMGetPrefsManager()->GetWindowSize(kArray1DWindSizeID, window, kJTrue);

	CMVarNode* root = itsLink->CreateVarNode();
	assert( root != NULL );
	itsTree = jnew JTree(root);
	assert( itsTree != NULL );
	JNamedTreeList* treeList = jnew JNamedTreeList(itsTree);
	assert( treeList != NULL );

	itsWidget =
		jnew CMVarTreeWidget(itsCommandDir, kJFalse, menuBar, itsTree, treeList,
							scrollbarSet, scrollbarSet->GetScrollEnclosure(),
							JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
	assert(itsWidget != NULL);
	itsWidget->FitToEnclosure();

	itsExprInput->SetText(itsExpr);
	itsExprInput->SetIsRequired();
	ListenTo(itsExprInput);

	itsStartIndex->SetValue(itsRequestRange.first);
	ListenTo(itsStartIndex);

	itsEndIndex->SetValue(itsRequestRange.last);
	ListenTo(itsEndIndex);

	itsStopButton->Hide();
	ListenTo(itsStopButton);

	// menus

	itsFileMenu = menuBar->PrependTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr, "CMThreadsDir");
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	itsFileMenu->SetItemImage(kOpenCmd, jx_file_open);

	JXTEBase* te = itsWidget->GetEditMenuHandler();
	itsExprInput->ShareEditMenu(te);
	itsStartIndex->ShareEditMenu(te);
	itsEndIndex->ShareEditMenu(te);

	itsActionMenu = menuBar->AppendTextMenu(kActionMenuTitleStr);
	menuBar->InsertMenu(3, itsActionMenu);
	itsActionMenu->SetMenuItems(kActionMenuStr, "CMArray1DDir");
	ListenTo(itsActionMenu);

	itsActionMenu->SetItemImage(kDisplay1DArrayCmd, medic_show_1d_array);
	itsActionMenu->SetItemImage(kPlot1DArrayCmd,    medic_show_2d_plot);
	itsActionMenu->SetItemImage(kDisplay2DArrayCmd, medic_show_2d_array);
	itsActionMenu->SetItemImage(kExamineMemCmd,     medic_show_memory);

	JXWDMenu* wdMenu =
		jnew JXWDMenu(kWindowsMenuTitleStr, menuBar,
					 JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert( wdMenu != NULL );
	menuBar->AppendMenu(wdMenu);

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

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

	(GetDisplay()->GetWDManager())->DirectorCreated(this);
}
コード例 #10
0
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();
}
コード例 #11
0
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");
	itsColHeader->SetColTitle(5, "Subject");
	itsColHeader->SetColTitle(6, "Date");
	itsColHeader->SetColTitle(7, "Size");

	const JCoordinate pathwidth = w - 150;

	itsPath =
		new JXStaticText(mailfile, itsToolBar->GetWidgetEnclosure(),
			JXWidget::kHElastic, JXWidget::kFixedBottom,
			0,scrollheight,pathwidth,pathheight);
	assert(itsPath != NULL);
	itsPath->SetBorderWidth(1);

	itsMessageCount =
		new JXStaticText("", itsToolBar->GetWidgetEnclosure(),
			JXWidget::kFixedRight, JXWidget::kFixedBottom,
			pathwidth,scrollheight,w-pathwidth,pathheight);
	assert(itsMessageCount != NULL);
	itsMessageCount->SetBorderWidth(1);

	itsNoMailIcon = new JXImage(itsWindow->GetDisplay(), nomail_xpm);
	itsNoMailIcon->ConvertToRemoteStorage();

	itsNewMailIcon = new JXImage(itsWindow->GetDisplay(), newmail_xpm);
	itsNewMailIcon->ConvertToRemoteStorage();

	itsSmallNewMailIcon = new JXImage(itsWindow->GetDisplay(), newmail_small_xpm);
	itsSmallNewMailIcon->ConvertToRemoteStorage();

	itsHaveMailIcon = new JXImage(itsWindow->GetDisplay(), havemail_xpm);
	itsHaveMailIcon->ConvertToRemoteStorage();

	JXImage* icon	= new JXImage(*itsNoMailIcon);
	assert(icon != NULL);
	itsWindow->SetIcon(icon);

	itsIndicator =
        new JXProgressIndicator(itsToolBar->GetWidgetEnclosure(),
	JXWidget::kHElastic, JXWidget::kFixedBottom,
			5,scrollheight+5,pathwidth-10,pathheight/2);
	assert(itsIndicator != NULL);
	itsIndicator->Hide();

	itsPG = new GXBlockingPG(NULL, NULL, itsIndicator);
	assert(itsPG != NULL);
//	itsPG->SetItems(NULL, NULL, itsIndicator);
// begin JXLayout

	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);

	itsFileMenu->SetItemImage(kNewCmd, filenew);
	itsFileMenu->SetItemImage(kNewMBox, envelopes);
	itsFileMenu->SetItemImage(kOpenCmd, fileopen);
	itsFileMenu->SetItemImage(kSaveMsgCmd, filefloppy);
	itsFileMenu->SetItemImage(kPrintMsgCmd, fileprint);
	itsFileMenu->SetItemImage(kCheckMailCmd, check_mail);
//	itsFileMenu->SetItemImage(kOpenCmd, fileopen);

	itsInboxMenu->SetItemImage(kAddInboxCmd, newmail_small_plus);
	itsInboxMenu->SetItemImage(kRemoveInboxCmd, newmail_small_minus);

	itsHelpMenu->SetItemImage(kTOCCmd, manual);
	itsHelpMenu->SetItemImage(kThisWindowCmd, jx_help_specific);

	itsDummyPrintText =
		new GMDummyText(GMGetAltPTPrinter(), "", itsWindow,
			JXWidget::kHElastic, JXWidget::kFixedBottom,
			0,0,500,10);
	assert(itsDummyPrintText != NULL);

	itsToolBar->LoadPrefs();

	if (itsToolBar->IsEmpty())
		{
		itsToolBar->AppendButton(itsFileMenu, kNewCmd);
		itsToolBar->AppendButton(itsFileMenu, kNewMBox);
		itsToolBar->AppendButton(itsFileMenu, kOpenCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kSaveMsgCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kPrintMsgCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kCheckMailCmd);
		itsToolBar->NewGroup();

		JString id;
		if (GGetMailboxTreeDir()->GetID(&id))
			{
			itsToolBar->AppendButton(menu, id);
			}
		if (GMGetAddressBookDir()->GetID(&id))
			{
			itsToolBar->AppendButton(menu, id);
			}			
		itsToolBar->NewGroup();
		
		itsToolBar->AppendButton(itsHelpMenu, kTOCCmd);
		itsToolBar->AppendButton(itsHelpMenu, kThisWindowCmd);
		}

	itsMenuIcon = new JXImage(itsWindow->GetDisplay(), envelopes);
	assert(itsMenuIcon != NULL);
	itsMenuIcon->ConvertToRemoteStorage();
}
コード例 #12
0
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())
		{
		itsToolBar->AppendButton(itsFileMenu, kNewCmd);
		itsToolBar->AppendButton(itsFileMenu, kOpenCmd);
		itsToolBar->NewGroup();
		itsToolBar->AppendButton(itsFileMenu, kCheckMailCmd);
		itsToolBar->NewGroup();
		itsWidget->AddDefaultButtcons(itsToolBar);
		itsToolBar->AppendButton(itsHelpMenu, kTOCCmd);
		itsToolBar->AppendButton(itsHelpMenu, kThisWindowCmd);
		}

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

}