本文整理汇总了C++中BNode::GetModificationTime方法的典型用法代码示例。如果您正苦于以下问题:C++ BNode::GetModificationTime方法的具体用法?C++ BNode::GetModificationTime怎么用?C++ BNode::GetModificationTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BNode
的用法示例。
在下文中一共展示了BNode::GetModificationTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HDialog
CInfoDialog::CInfoDialog(BRect frame, const char *name, window_type type, int flags,
BWindow *owner, BPositionIO* data)
: HDialog(frame, name, type, flags, owner, data)
{
fDoc = dynamic_cast<PDoc*>(owner);
FailNil(fDoc);
SetText("name", owner->Title());
char s[32];
sprintf(s, "%d", fDoc->TextView()->Size());
SetText("docsize", s);
sprintf(s, "%d", fDoc->TextView()->LineCount());
SetText("lines", s);
BMenuField *mf = dynamic_cast<BMenuField*>(FindView("mime"));
FailNil(mf);
fTypes = mf->Menu();
const char *p;
int i = 0;
while ((p = gPrefs->GetIxPrefString(prf_X_Mimetype, i++)) != NULL)
fTypes->AddItem(new BMenuItem(p, new BMessage(msg_FieldChanged)));
if (i == 1)
fTypes->AddItem(new BMenuItem("text/plain", new BMessage(msg_FieldChanged)));
const char *mime = fDoc->MimeType();
if (mime && mime[0])
{
for (i = 0; i < fTypes->CountItems(); i++)
{
BMenuItem *item = fTypes->ItemAt(i);
if (strcmp(item->Label(), mime) == 0)
{
item->SetMarked(true);
break;
}
}
if (i == fTypes->CountItems())
{
fTypes->AddSeparatorItem();
fTypes->AddItem(new BMenuItem(mime, new BMessage(msg_FieldChanged)));
fTypes->ItemAt(fTypes->CountItems() - 1)->SetMarked(true);
}
}
else
{
BMenuItem *item;
fTypes->AddSeparatorItem();
fTypes->AddItem(item = new BMenuItem("<undefined>", new BMessage(msg_FieldChanged)));
item->SetMarked(true);
}
if (fDoc->EntryRef())
{
BNode node;
FailOSErr(node.SetTo(fDoc->EntryRef()));
time_t t;
node.GetModificationTime(&t);
char time[256];
strcpy(time, ctime(&t));
time[strlen(time) - 1] = 0;
SetText("time", time);
}
else
{
//SetEnabled("mime", false);
SetText("time", "Not Saved");
}
mf = dynamic_cast<BMenuField*>(FindView("font"));
FailNil(mf);
fMenu = mf->Menu();
FailNil(fMenu);
font_family ff;
font_style fs;
for (int i = 0; i < count_font_families(); i++)
{
get_font_family(i, &ff);
BMenu *fontItem = new BMenu(ff);
FailNil(fontItem);
fMenu->AddItem(new BMenuItem(fontItem, new BMessage(msg_FieldChanged)));
fontItem->SetFont(be_plain_font);
for (int j = 0; j < count_font_styles(ff); j++)
{
get_font_style(ff, j, &fs);
BMessage *msg = new BMessage(msg_FieldChanged);
msg->AddString("family", ff);
//.........这里部分代码省略.........