Пример #1
0
BMenuBar*
MenuBuilder::BuildMainMenuBar()
{
	BMenuBar* menuBar = new BMenuBar("MainMenuBar");

	menuBar->AddItem(BuildFileMenu());
	menuBar->AddItem(BuildEditMenu());
	menuBar->AddItem(BuildProjectMenu());
	menuBar->AddItem(BuildTracksMenu());
	menuBar->AddItem(BuildEffectsMenu());
	menuBar->AddItem(BuildGenerateMenu());
	menuBar->AddItem(BuildEngineMenu());
	menuBar->AddItem(BuildHelpMenu());

	return menuBar;
}
Пример #2
0
PoorManWindow::PoorManWindow(BRect frame)
	:
	BWindow(frame, STR_APP_NAME, B_TITLED_WINDOW, 0),
	fStatus(false),
	fHits(0),
	fPrefWindow(NULL),
	fLogFile(NULL),
	fServer(NULL)
{
	//preferences init
	fWebDirectory.SetTo(STR_DEFAULT_WEB_DIRECTORY);
	fIndexFileName.SetTo("index.html");
	fDirListFlag = false;
	
	fLogConsoleFlag = true;
	fLogFileFlag = false;
	fLogPath.SetTo("");
	
	fMaxConnections = (int16)32;
	
	fIsZoomed = true;
	fLastWidth = 318.0f;
	fLastHeight = 320.0f;
	this->fFrame = frame;
	fSetwindowFrame.Set(112.0f, 60.0f, 492.0f, 340.0f);
	
	// PoorMan Window
	SetSizeLimits(318, 1600, 53, 1200); 
	// limit the size of the size of the window
	
	// -----------------------------------------------------------------
	// Three Labels 
	
	// Status String
	fStatusView = new BStringView("Status View", B_TRANSLATE("Status: Stopped"));
	
	// Directory String
	fDirView = new BStringView("Dir View", B_TRANSLATE("Directory: (none)"));
	
	// Hits String
	fHitsView = new BStringView("Hit View", B_TRANSLATE("Hits: 0"));

	// -----------------------------------------------------------------
	// Logging View

	fLoggingView = new BTextView(STR_TXT_VIEW, B_WILL_DRAW );

	fLoggingView->MakeEditable(false);	// user cannot change the text
	fLoggingView->MakeSelectable(true);
	fLoggingView->SetViewColor(WHITE);
	fLoggingView->SetStylable(true);
		
	// create the scroll view
	fScrollView = new BScrollView("Scroll View", fLoggingView,
					B_WILL_DRAW | B_FRAME_EVENTS | B_FOLLOW_ALL_SIDES, 
					// Make sure articles on border do not occur when resizing
					false, true);
	fLoggingView->MakeFocus(true);


	// -----------------------------------------------------------------
	// menu bar
	fFileMenuBar = new BMenuBar("File Menu Bar");
	
	// menus
	fFileMenu = BuildFileMenu();
	if (fFileMenu)
		fFileMenuBar->AddItem(fFileMenu);
			
	fEditMenu = BuildEditMenu();
	if (fEditMenu)
		fFileMenuBar->AddItem(fEditMenu);
		
	fControlsMenu = BuildControlsMenu();
	if (fControlsMenu)
		fFileMenuBar->AddItem(fControlsMenu);
	
	// File Panels
	BWindow* change_title;
	
	fSaveConsoleFilePanel = new BFilePanel(B_SAVE_PANEL, new BMessenger(this),
						NULL, B_FILE_NODE, false,
						new BMessage(MSG_FILE_PANEL_SAVE_CONSOLE));
	change_title = fSaveConsoleFilePanel->Window();
	change_title->SetTitle(STR_FILEPANEL_SAVE_CONSOLE);
	
	fSaveConsoleSelectionFilePanel = new BFilePanel(B_SAVE_PANEL,
						new BMessenger(this), NULL, B_FILE_NODE, false,
						new BMessage(MSG_FILE_PANEL_SAVE_CONSOLE_SELECTION));
	change_title = fSaveConsoleSelectionFilePanel->Window();
	change_title->SetTitle(STR_FILEPANEL_SAVE_CONSOLE_SELECTION);
	
	BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
		.SetInsets(0)
		.Add(fFileMenuBar)
		.AddGroup(B_VERTICAL, B_USE_SMALL_SPACING)
			.SetInsets(B_USE_WINDOW_INSETS)
			.AddGroup(B_HORIZONTAL)
				.Add(fStatusView)
				.AddGlue()
				.Add(fHitsView)
				.End()
			.AddGroup(B_HORIZONTAL)
				.Add(fDirView)
				.AddGlue()
				.End()
			.Add(fScrollView);
	
	pthread_rwlock_init(&fLogFileLock, NULL);
}