本文整理汇总了C++中BTextControl::SetModificationMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ BTextControl::SetModificationMessage方法的具体用法?C++ BTextControl::SetModificationMessage怎么用?C++ BTextControl::SetModificationMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTextControl
的用法示例。
在下文中一共展示了BTextControl::SetModificationMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddCat
void SplitWindow::AddCat()
{
ResizeBy(0, 25);
uint16 xpos = 20;
uint16 width = 150;
BTextControl* tc = new BTextControl(BRect(xpos - 5, ypos + 10,
xpos + width, ypos + 10), "CatField", "", "", 0);
xpos += width;
tc->SetDivider(0);
catTexts.push_back(tc);
v->AddChild(tc);
BPopUpMenu* pu = new BPopUpMenu("", true, false);
BMenuField* mf = new BMenuField(BRect(xpos + 2, ypos + 9,
xpos + 2, ypos + 9), "CatMenu", "", pu);
mf->SetDivider(0);
v->AddChild(mf);
xpos += 30;
tc = new BTextControl(BRect(xpos - 5, ypos + 10,
xpos + 75, ypos + 10), "AmountField", "", "", 0);
tc->SetDivider(0);
tc->SetAlignment(B_ALIGN_LEFT, B_ALIGN_RIGHT);
tc->SetModificationMessage(new BMessage(AmountModifiedMSG));
amtTexts.push_back(tc);
v->AddChild(tc);
ypos += 25;
for (cas::iterator ci = catS->begin(); ci != catS->end(); ci++)
{
if ((*ci)->IsRoot())
{
pu->AddItem(MakeCatMenu(*ci));
}
}
catnum++;
}
示例2: 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);
//.........这里部分代码省略.........