本文整理汇总了C++中BListItem::SetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ BListItem::SetHeight方法的具体用法?C++ BListItem::SetHeight怎么用?C++ BListItem::SetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BListItem
的用法示例。
在下文中一共展示了BListItem::SetHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefsReceived
void PecoApp::RefsReceived ( BMessage* msg ) {
entry_ref ref;
BPath aPath;
BEntry aEntry;
off_t size;
time_t timer;
fWindow->Lock();
BTextControl* pfadView = (BTextControl *)fWindow->FindView("pfadView");
fWindow->Unlock();
//Pfad finden
for ( int i=0; msg->FindRef("refs", i, &ref) == B_OK; i++ ) if ( ref.device > 1 ) break;
if ( ref.device > 1 ) {
New();
fWindow->Lock();
((PecoApp *)be_app)->fStatusBar->SetText(STATUS_IMPORT);
fWindow->Unlock();
aEntry = BEntry(&ref);
BPath( &aEntry ).GetParent(&fPfad);
fWindow->Lock();
pfadView->SetText( fPfad.Path() );
fWindow->Unlock();
//zählen
type_code typeFound;
long total = 0;
msg->GetInfo("refs", &typeFound, &total);
fWindow->Lock();
fStatusBar->SetMaxValue( total );
fWindow->Unlock();
BPath newPath;
bool didntshow_msgmultidir = true;
for ( int i=0; msg->FindRef("refs", i, &ref) == B_OK; i++ ) {
fWindow->Lock();
fStatusBar->Update(1);
fWindow->Unlock();
// Laufwerke ausfiltern
if ( ref.device == 1 ) continue;
// Dateien mit falschem Pfad ausfiltern
aEntry = BEntry(&ref);
aPath = BPath(&aEntry);
BPath( &aEntry ).GetParent(&newPath);
if ( (strcmp( fPfad.Path(), newPath.Path() ) != 0 ) ) {
if ( didntshow_msgmultidir ) {
BAlert* myAlert = new BAlert(NULL, MESSAGE_MULTIDIR, STR_OK);
myAlert->Go();
didntshow_msgmultidir = false;
}
continue;
}
// Werte auslesen
if (aEntry.IsFile()) aEntry.GetSize(&size);
else
if (aEntry.IsSymLink()) size = -1;
else
if (aEntry.IsDirectory()) size = -2;
else continue;
aEntry.GetModificationTime(&timer);
fList->AddItem(new FileListItem(aPath.Leaf(), size, timer, &ref));
}
fWindow->Lock();
fListView->AddList(fList);
float Hoehe = be_plain_font->Size() + 2;
if (Hoehe < 18) {
BListItem* myListItem;
for (int i=0; (myListItem = fListView->ItemAt(i)); i++) myListItem->SetHeight(18);
// Zum Updaten:
fListView->AddItem(myListItem = new BStringItem(""));
fListView->RemoveItem(myListItem);
}
fStatusBar->Reset(STATUS_STATUS);
fStatusBar->SetMaxValue(fList->CountItems());
fWindow->Unlock();
MakeList();
}
fWindow->Activate();
UpdateWindowStatus();
}