void
DataTranslationsWindow::_SetupViews()
{
	fInfoText = NULL;
	fConfigView = NULL;
	// This is NULL until a translator is
	// selected from the listview

	// Add the translators list view
	fTranslatorListView = new TranslatorListView("TransList");
	fTranslatorListView->SetSelectionMessage(
		new BMessage(kMsgSelectedTranslator));

	BScrollView* scrollView = new BScrollView("scroll_trans",
		fTranslatorListView, B_WILL_DRAW | B_FRAME_EVENTS, false,
		true, B_FANCY_BORDER);

	// Box around the config and info panels
	fRightBox = new BBox("Right_Side");
	fRightBox->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
		B_ALIGN_USE_FULL_HEIGHT));

	// Add the translator icon view
	fIconView = new IconView();

	// Add the translator info button
	fButton = new BButton("info", B_TRANSLATE("Info"),
		new BMessage(kMsgTranslatorInfo),
		B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
	fButton->SetEnabled(false);

	// Populate the translators list view
	_PopulateListView();

	// Build the layout
	BLayoutBuilder::Group<>(this, B_HORIZONTAL)
		.SetInsets(B_USE_WINDOW_SPACING)
		.Add(scrollView, 3)
		.AddGroup(B_VERTICAL)
			.Add(fRightBox)
			.AddGroup(B_HORIZONTAL)
				.Add(fIconView)
				.AddGlue()
				.Add(fButton)
				.End()
			.End()
		.End();

	fTranslatorListView->MakeFocus();
	_ShowInfoView();
}
void
DataTranslationsWindow::_SetupViews()
{
	fConfigView = NULL;
	// This is NULL until a translator is
	// selected from the listview

	// Add the translators list view
	fTranslatorListView = new TranslatorListView("TransList");
	fTranslatorListView->SetSelectionMessage(
		new BMessage(kMsgSelectedTranslator));

	BScrollView* scrollView = new BScrollView("scroll_trans",
		fTranslatorListView, B_WILL_DRAW | B_FRAME_EVENTS, false,
		true, B_FANCY_BORDER);

	// Box around the config and info panels
	fRightBox = new BBox("Right_Side");
	fRightBox->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
			B_ALIGN_USE_FULL_HEIGHT));

	// Add the translator icon view
	fIconView = new IconView();

	// Add the translator info button
	fButton = new BButton("info", B_TRANSLATE("Info"),
		new BMessage(kMsgTranslatorInfo), B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
	fButton->SetEnabled(false);

	// Populate the translators list view
	_PopulateListView();

	// Build the layout
	float padding = be_control_look->DefaultItemSpacing();
	BLayoutBuilder::Group<>(this, B_HORIZONTAL, padding)
		.SetInsets(padding, padding, padding, padding)
		.Add(scrollView, 3)
		.AddGrid(padding, padding, 6)
			.SetInsets(0, 0, 0, 0)
			.Add(fRightBox, 0, 0, 3, 1)
			.Add(fIconView, 0, 1)
			.Add(fButton, 2, 1);

	fTranslatorListView->MakeFocus();
	_ShowInfoView();
}
示例#3
0
void
DataTranslationsWindow::_SetupViews()
{
	fConfigView = NULL;
	// This is NULL until a translator is
	// selected from the listview

	// Window box
	BView* mainView = new BView(Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS);
	mainView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	AddChild(mainView);

	// Add the translators list view
	fTranslatorListView = new TranslatorListView(BRect(0, 0, 1, 1), "TransList",
		B_SINGLE_SELECTION_LIST);
	fTranslatorListView->SetSelectionMessage(new BMessage(kMsgSelectedTranslator));

	BScrollView *scrollView = new BScrollView("scroll_trans", fTranslatorListView,
    		B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW | B_FRAME_EVENTS,
    		false, true, B_FANCY_BORDER);

	// Box around the config and info panels
	fRightBox = new BBox("Right_Side");

	// Add the translator icon view
	fIconView = new IconView(BRect(0, 0, 31, 31), "Icon",
		B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_FRAME_EVENTS);

	// Add the translator info button
	BButton *button = new BButton("STD", "Info" B_UTF8_ELLIPSIS,
		new BMessage(kMsgTranslatorInfo), B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);

	// Add the translator name view
	fTranslatorNameView = new BStringView("TranName", "None");

	// Populate the translators list view
	_PopulateListView();

	// Build the layout
	BALMLayout *layout = new BALMLayout();
	mainView->SetLayout(layout);

	XTab *x1 = layout->AddXTab();
	XTab *x2 = layout->AddXTab();
	XTab *x3 = layout->AddXTab();
	YTab *y1 = layout->AddYTab();

	Area *leftArea = layout->AddArea(layout->Left(), layout->Top(),
		x1, layout->Bottom(), scrollView);
	leftArea->SetLeftInset(10);
	leftArea->SetTopInset(10);
	leftArea->SetBottomInset(10);

	Area *rightArea = layout->AddArea(x1, layout->Top(), layout->Right(), y1, fRightBox);
	rightArea->SetLeftInset(10);
	rightArea->SetTopInset(10);
	rightArea->SetRightInset(10);
	rightArea->SetBottomInset(10);

	Area *iconArea = layout->AddArea(x1, y1, x2, layout->Bottom(), fIconView);
	iconArea->SetLeftInset(10);
	iconArea->SetBottomInset(10);

	Area *infoButtonArea = layout->AddArea(x3, y1, layout->Right(), layout->Bottom(), button);
	infoButtonArea->SetRightInset(10);
	infoButtonArea->SetBottomInset(10);

	layout->AddConstraint(3.0, x1, -1.0, layout->Right(), OperatorType(EQ), 0.0);

	fTranslatorListView->MakeFocus();
	fTranslatorListView->Select(0);
}