本文整理汇总了C++中BFilePanel::GetNextSelectedRef方法的典型用法代码示例。如果您正苦于以下问题:C++ BFilePanel::GetNextSelectedRef方法的具体用法?C++ BFilePanel::GetNextSelectedRef怎么用?C++ BFilePanel::GetNextSelectedRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFilePanel
的用法示例。
在下文中一共展示了BFilePanel::GetNextSelectedRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fileNameNoExt
//.........这里部分代码省略.........
*/
}
}
// comment start
header.ReplaceAll("%COMMS%", commentBlockStart.String());
// comment cont'd
header.ReplaceAll("%COMMC%", commentBlockCont.String());
// comment cont'd lazy (blank if possible)
header.ReplaceAll("%COMML%", commentBlockLazy.String());
// comment end
header.ReplaceAll("%COMME%", commentBlockEnd.String());
// comment line end
commentBlockLineEnd << "\n";
header.ReplaceAll("\n", commentBlockLineEnd.String());
err = B_OK;
break;
}
case 'optf':
{
const char *args[] = {path.Path(), NULL};
err = be_roster->Launch(sTrackerSig, 1, (char **)args);
//printf("err %s\n", strerror(err));
err = B_CANCELED;
break;
}
case 'seta':
{
MimeRefFilter filter("application/x-person");
BPath path;
entry_ref people;
if (find_directory(B_USER_DIRECTORY, &path) == B_OK)
{
path.Append("people");
get_ref_for_path(path.Path(), &people);
}
BFilePanel *panel;
panel = new BFilePanel(B_OPEN_PANEL, NULL, &people,
B_FILE_NODE, false, NULL, &filter);
// trick to synchronously use BFilePanel
PanelHandler *handler = new PanelHandler;
if (panel->Window()->Lock())
{
panel->Window()->AddHandler(handler);
panel->Window()->Unlock();
}
panel->SetTarget(BMessenger(handler));
panel->Show();
if (handler->Wait() < B_OK)
break;
if (!handler->Message())
break;
if (handler->Message()->what == B_CANCEL)
break;
entry_ref ref;
//panel->Message()->PrintToStream();
if (panel->GetNextSelectedRef(&ref) == B_OK)
{
//printf("ref:%s\n", ref.name);
path.SetTo(&ref);
dir.WriteAttr("pe:author_people", B_STRING_TYPE, 0LL,
path.Path(), strlen(path.Path()));
}
delete panel;
delete handler;
err = B_CANCELED;
break;
}
case B_ABOUT_REQUESTED:
{
BString tmpPath("/tmp/Pe-HeaderHeader-About-");
tmpPath << system_time() << "-" << getpid() << ".txt";
entry_ref ref;
get_ref_for_path(tmpPath.String(), &ref);
{
BFile f(&ref, B_CREATE_FILE | B_WRITE_ONLY);
err = f.InitCheck();
if (err < 0)
break;
f.Write(sAboutText, strlen(sAboutText));
f.SetPermissions(0444);
}
BMessage msg(B_REFS_RECEIVED);
msg.AddRef("refs", &ref);
err = be_app_messenger.SendMessage(&msg);
err = B_CANCELED;
break;
}
case 0:
err = B_CANCELED;
break;
default:
break;
}
delete menu;
return err;
}