本文整理汇总了C++中BTextControl::MoveBy方法的典型用法代码示例。如果您正苦于以下问题:C++ BTextControl::MoveBy方法的具体用法?C++ BTextControl::MoveBy怎么用?C++ BTextControl::MoveBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTextControl
的用法示例。
在下文中一共展示了BTextControl::MoveBy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: node
/***********************************************************
* InitGUI
***********************************************************/
void
HAddressView::InitGUI()
{
float divider = StringWidth(_("Subject:")) + 20;
divider = max_c(divider , StringWidth(_("From:"))+20);
divider = max_c(divider , StringWidth(_("To:"))+20);
divider = max_c(divider , StringWidth(_("Bcc:"))+20);
BRect rect = Bounds();
rect.top += 5;
rect.left += 20 + divider;
rect.right = Bounds().right - 5;
rect.bottom = rect.top + 25;
BTextControl *ctrl;
ResourceUtils rutils;
const char* name[] = {"to","subject","from","cc","bcc"};
for(int32 i = 0;i < 5;i++)
{
ctrl = new BTextControl(BRect(rect.left,rect.top
,(i == 1)?rect.right+divider:rect.right
,rect.bottom)
,name[i],"","",NULL
,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,B_WILL_DRAW|B_NAVIGABLE);
if(i == 1)
{
ctrl->SetLabel(_("Subject:"));
ctrl->SetDivider(divider);
ctrl->MoveBy(-divider,0);
}else{
ctrl->SetDivider(0);
}
BMessage *msg = new BMessage(M_MODIFIED);
msg->AddPointer("pointer",ctrl);
ctrl->SetModificationMessage(msg);
ctrl->SetEnabled(!fReadOnly);
AddChild(ctrl);
rect.OffsetBy(0,25);
switch(i)
{
case 0:
fTo = ctrl;
break;
case 1:
fSubject = ctrl;
break;
case 2:
fFrom = ctrl;
fFrom->SetEnabled(false);
fFrom->SetFlags(fFrom->Flags() & ~B_NAVIGABLE);
break;
case 3:
fCc = ctrl;
break;
case 4:
fBcc = ctrl;
break;
}
}
//
BRect menuRect= Bounds();
menuRect.top += 5;
menuRect.left += 22;
menuRect.bottom = menuRect.top + 25;
menuRect.right = menuRect.left + 16;
BMenu *toMenu = new BMenu(_("To:"));
BMenu *ccMenu = new BMenu(_("Cc:"));
BMenu *bccMenu = new BMenu(_("Bcc:"));
BQuery query;
BVolume volume;
BVolumeRoster().GetBootVolume(&volume);
query.SetVolume(&volume);
query.SetPredicate("((META:email=*)&&(BEOS:TYPE=application/x-person))");
if(!fReadOnly && query.Fetch() == B_OK)
{
BString addr[4],name,group,nick;
entry_ref ref;
BList peopleList;
while(query.GetNextRef(&ref) == B_OK)
{
BNode node(&ref);
if(node.InitCheck() != B_OK)
continue;
ReadNodeAttrString(&node,"META:name",&name);
ReadNodeAttrString(&node,"META:email",&addr[0]);
ReadNodeAttrString(&node,"META:email2",&addr[1]);
ReadNodeAttrString(&node,"META:email3",&addr[2]);
ReadNodeAttrString(&node,"META:email4",&addr[3]);
ReadNodeAttrString(&node,"META:group",&group);
//.........这里部分代码省略.........