Exemple #1
0
//cast operator BView*
StringView::operator BView*()
{
    if (fView)
        return fView;
    fView = new BGroupView(B_HORIZONTAL);
    BLayout* layout = fView->GroupLayout();
    fLabelItem = layout->AddView(fLabel);
    fTextItem = layout->AddView(fText);
    return fView;
}
Exemple #2
0
KeyRequestWindow::KeyRequestWindow()
	:
	BWindow(BRect(50, 50, 100, 100), B_TRANSLATE("Unlock keyring"),
		B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
			| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS
			| B_CLOSE_ON_ESCAPE),
	fRequestView(NULL),
	fDoneSem(-1),
	fResult(B_ERROR)
{
	fDoneSem = create_sem(0, "keyring unlock dialog");
	if (fDoneSem < 0)
		return;

	BLayout* layout = new(std::nothrow) BGroupLayout(B_HORIZONTAL);
	if (layout == NULL)
		return;

	SetLayout(layout);

	fRequestView = new(std::nothrow) KeyRequestView();
	if (fRequestView == NULL)
		return;

	layout->AddView(fRequestView);
}