本文整理汇总了C++中Locale::DateToString方法的典型用法代码示例。如果您正苦于以下问题:C++ Locale::DateToString方法的具体用法?C++ Locale::DateToString怎么用?C++ Locale::DateToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::DateToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawItem
void TransactionItem::DrawItem(BView *owner, BRect frame, bool complete)
{
BString string;
Locale locale = fAccount->GetLocale();
BRect r(frame);
r.right--;
rgb_color linecolor;
if(IsSelected())
{
linecolor.red=120;
linecolor.green=120;
linecolor.blue=120;
owner->SetHighColor(GetColor(BC_SELECTION_FOCUS));
owner->SetLowColor(GetColor(BC_SELECTION_FOCUS));
owner->FillRect(frame);
owner->SetHighColor(linecolor);
owner->StrokeRect(frame);
owner->SetHighColor(255,255,255);
}
else
{
linecolor.red=200;
linecolor.green=200;
linecolor.blue=200;
if(fStatus==TRANS_RECONCILED)
{
owner->SetHighColor(232,232,232);
owner->SetLowColor(232,232,232);
owner->FillRect(frame);
owner->SetHighColor(linecolor);
owner->StrokeLine(r.LeftBottom(),r.RightBottom());
owner->SetHighColor(255,255,255);
}
else
{
owner->SetHighColor(255, 255, 255);
owner->SetLowColor(255, 255, 255);
owner->FillRect(frame);
// owner->SetHighColor(222, 222, 222);
owner->SetHighColor(linecolor);
owner->StrokeLine(r.LeftBottom(),r.RightBottom());
}
}
owner->SetHighColor(0, 0, 0);
BRect cliprect;
BRegion clip(cliprect);
float xpos = TLeftPadding();
float ypos = r.top + TRowHeight();
// Date
cliprect.left = xpos;
cliprect.right = xpos + TDateWidth();
cliprect.top = ypos - TRowHeight();
cliprect.bottom = ypos;
clip = cliprect;
owner->ConstrainClippingRegion(&clip);
locale.DateToString(fDate,string);
owner->DrawString(string.String(), BPoint(xpos, ypos - 3));
owner->ConstrainClippingRegion(NULL);
xpos += TDateWidth();
owner->SetHighColor(linecolor);
//Line Between Date & Type
owner->StrokeLine(BPoint(xpos, ypos - TRowHeight()), BPoint(xpos, ypos));
owner->StrokeLine(BPoint(0,ypos),BPoint(r.right,ypos));
owner->SetHighColor(0, 0, 0);
// Type
owner->SetHighColor(0,0,0);
owner->DrawString(fType.String(), BPoint(xpos + 5, ypos - 3));
// Line between Type and Payee
xpos += TNumWidth();
owner->SetHighColor(linecolor);
owner->StrokeLine(BPoint(xpos, ypos - TRowHeight()), BPoint(xpos, ypos));
// Calculate the rectangle for the payee, but this field depends on the
// width of the view, so we can't yet easily calculate the right coordinate
// of the rectangle just yet
BRect payee_rect(xpos, ypos, xpos, ypos - TRowHeight());
// Balance
xpos = r.right - TAmountWidth();
cliprect.right = r.right;
cliprect.left = xpos;
clip = cliprect;
owner->SetHighColor(0, 0, 0);
Fixed balance = fAccount->BalanceAtTransaction(fDate,fPayee.String());
if(balance.AsFixed()<0)
owner->SetHighColor(150, 0, 0);
//.........这里部分代码省略.........