本文整理汇总了C++中BGridLayout::ItemAt方法的典型用法代码示例。如果您正苦于以下问题:C++ BGridLayout::ItemAt方法的具体用法?C++ BGridLayout::ItemAt怎么用?C++ BGridLayout::ItemAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BGridLayout
的用法示例。
在下文中一共展示了BGridLayout::ItemAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BFile
PersonView::PersonView(const char* name, const char* categoryAttribute,
const entry_ref *ref)
:
BGridView(),
fLastModificationTime(0),
fGroups(NULL),
fControls(20, false),
fCategoryAttribute(categoryAttribute),
fPictureView(NULL),
fSaving(false)
{
SetName(name);
SetFlags(Flags() | B_WILL_DRAW);
fRef = ref;
BFile* file = NULL;
if (fRef != NULL)
file = new BFile(fRef, B_READ_ONLY);
// Add picture "field", using ID photo 35mm x 45mm ratio
fPictureView = new PictureView(70, 90, ref);
BGridLayout* layout = GridLayout();
float spacing = be_control_look->DefaultItemSpacing();
layout->SetInsets(spacing, spacing, spacing, spacing);
layout->AddView(fPictureView, 0, 0, 1, 5);
layout->ItemAt(0, 0)->SetExplicitAlignment(
BAlignment(B_ALIGN_CENTER, B_ALIGN_TOP));
if (file != NULL)
file->GetModificationTime(&fLastModificationTime);
delete file;
}
示例2:
void
PartitionsPage::PageCompleted()
{
BGridLayout* layout = (BGridLayout*)fPartitions->GetLayout();
int32 index = 0;
for (int32 row = 0; row < layout->CountRows(); row += 3, index++) {
BCheckBox* showBox
= dynamic_cast<BCheckBox*>(layout->ItemAt(0, row)->View());
BTextControl* nameControl
= dynamic_cast<BTextControl*>(layout->ItemAt(1, row)->View());
if (nameControl == NULL || showBox == NULL)
debugger("partitions page is broken");
BMessage partition;
if (fSettings->FindMessage("partition", index, &partition) != B_OK)
continue;
partition.ReplaceBool("show", showBox->Value() != 0);
partition.ReplaceString("name", nameControl->Text());
fSettings->ReplaceMessage("partition", index, &partition);
}
}