void
JXDisplayMenu::BuildMenu()
{
	RemoveAllItems();

	JXApplication* app = JXGetApplication();
	const JSize count = app->GetDisplayCount();
	for (JIndex i=1; i<=count; i++)
		{
		JXDisplay* display = app->GetDisplay(i);
		AppendItem(display->GetName(), kRadioType);
		}

	ShowSeparatorAfter(count);
	AppendItem(kNewDisplayStr);
	itsNewDisplayIndex = count+1;

	SetUpdateAction(kDisableNone);

	const JBoolean found =
		(JXGetApplication())->GetDisplayIndex(GetDisplay(), &itsDisplayIndex);
	assert( found );

	ListenTo(this);
	ListenTo( (JXGetApplication())->GetDisplayList() );
}
int
main
	(
	int		argc,
	char*	argv[]
	)
{
	ParseTextOptions(&argc, argv);

	JXApplication* app = new JXApplication(&argc, argv, "testj2dplot", kDefaultStringData);
	assert( app != NULL );

	Test2DPlotDirector* dataDir = new Test2DPlotDirector(app);
	assert( dataDir != NULL );
	TestData(dataDir);

	Test2DPlotDirector* logDataDir = new Test2DPlotDirector(app);
	assert( logDataDir != NULL );
	TestLogData(logDataDir);

	Test2DPlotDirector* vectorDir = new Test2DPlotDirector(app);
	assert( vectorDir != NULL );
	TestVector(vectorDir);

	logDataDir->Activate();
	dataDir->Activate();
	vectorDir->Activate();
	app->Run();
	return 0;
}
int
main
	(
	int		argc,
	char*	argv[]
	)
{
	ParseTextOptions(&argc, argv);

	JXApplication* app = new JXApplication(&argc, argv, "testj3d", kDefaultStringData);
	assert( app != NULL );

	Test3DDirector* mainDir = new Test3DDirector(app);
	assert( mainDir != NULL );

	mainDir->Activate();
	app->Run();
	return 0;
}
JBoolean
JXDockDirector::Close()
{
	JXApplication* app = JXGetApplication();
	JXDockManager* mgr = JXGetDockManager();
	if (mgr->IsLastDock(this) && !app->IsQuitting() && HasWindows())
		{
		app->Quit();
		return kJFalse;
		}
	else
		{
		// We must close all windows before closing ourselves because
		// otherwise, we will get a Draw event after partially destructing
		// if a document needs to ask the user whether or not to close.

		return JI2B( CloseAllWindows() && JXWindowDirector::Close() );
		}
}
int
main
	(
	int		argc,
	char*	argv[]
	)
{
	JXApplication* app =
		new JXApplication(&argc, argv);
	assert( app != NULL );

//	TreeTestDir* dir = new TreeTestDir(app);
//	dir->Activate();
//
//	TreeTestDir2* dir2 = new TreeTestDir2(app);
//	dir2->Activate();
//
	TreeTestDir3* dir3 = new TreeTestDir3(app);
	dir3->Activate();

	app->Run();				// never actually returns
	return 0;
}
int
main
	(
	int		argc,
	char*	argv[]
	)
{
	// Create the application object - one per program
	JXApplication* app = 
		jnew JXApplication(&argc, argv, kAppSignature, kTutorialStringData);
	assert( app != NULL );

	// Create the window director
	DNDWidgetDir* mainDir = jnew DNDWidgetDir(app);
	assert( mainDir != NULL );

	// Activate the window director
	mainDir->Activate();
	
	// Start the event loop
	app->Run();				
	return 0;
}
int
main
	(
	int		argc,
	char*	argv[]
	)
{
	// Create the application object - one per program
	JXApplication* app = 
		new JXApplication(&argc, argv, kAppSignature, kTutorialStringData);
	assert( app != NULL );

	// Create the window director to maintain the Hello World window
	DialogHelloDir* mainDir = new DialogHelloDir(app);
	assert( mainDir != NULL );

	// Show the window and activate it
	mainDir->Activate();
	
	// Start the event loop
	app->Run();				
	return 0;
}
Exemple #8
0
void
JXApplication::Abort
	(
	const JXDocumentManager::SafetySaveReason	reason,
	const JBoolean								dumpCore
	)
{
	if (!abortCalled)
		{
		abortCalled = kJTrue;

		JXDocumentManager* docMgr = NULL;
		if (JXGetDocumentManager(&docMgr))
			{
			docMgr->SafetySave(reason);
			}

		JXApplication* app;
		if (JXGetApplication(&app))
			{
			app->CleanUpBeforeSuddenDeath(reason);
			}
		}
	else
		{
		fprintf(stderr, "\nError inside XIO fatal error handler!\n\n");
		}

	if (dumpCore)
		{
		JThisProcess::Abort();
		}
	else
		{
		JThisProcess::Exit(1);
		}
}