本文整理汇总了C++中BPopUpMenu::SetFontSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BPopUpMenu::SetFontSize方法的具体用法?C++ BPopUpMenu::SetFontSize怎么用?C++ BPopUpMenu::SetFontSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BPopUpMenu
的用法示例。
在下文中一共展示了BPopUpMenu::SetFontSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowPopUp
void SeqPhraseMatrixView::ShowPopUp()
{
BPoint point;
uint32 buttons;
GetMouse(&point, &buttons, false);
BPopUpMenu* menu = new BPopUpMenu( "", TRUE, TRUE, B_ITEMS_IN_COLUMN );
BMenuItem* item1 = new BMenuItem("Properties", new BMessage(PROPERTIES_MSG) );
// BMenuItem* item2 = new BMenuItem("Edit Name", new BMessage(EDIT_START_MSG) );
// BMenuItem* item3 = new BMenuItem("Remove", new BMessage(REMOVE_MSG) );
// if (menu && item1 && item2 && item3) {
if (menu && item1) {
if (item1 && item1->Message() ) item1->Message()->AddPoint(WHERE_STR, point);
menu->SetFontSize(10);
menu->AddItem(item1);
// menu->AddItem(item2);
// menu->AddItem(item3);
menu->SetTargetForItems(this);
BRect r(point, point);
menu->Go( ConvertToScreen(point), true, false, ConvertToScreen(r), true );
}
}
示例2: ShowTimeSignatureMenu
void SeqMeasureControl::ShowTimeSignatureMenu(BPoint pt) const
{
AmSignature sig;
if (SignatureForPt(pt, sig) != B_OK) return;
BPopUpMenu* menu = new BPopUpMenu("menu");
if (!menu) return;
menu->SetFontSize(10);
menu->SetAsyncAutoDestruct(true);
BMessage signatureChoices;
if (seq_get_message_preference(SIGNATURE_CHOICES_PREF, &signatureChoices) == B_OK) {
int32 beats;
for(int32 k = 0; signatureChoices.FindInt32("beats", k, &beats) == B_OK; k++) {
int32 beatvalue;
if (signatureChoices.FindInt32("beat value", k, &beatvalue) == B_OK) {
BString label;
label << beats << " / " << beatvalue;
BMessage* msg = new BMessage(CHANGE_SIGNATURE_MSG);
BMenuItem* item;
if (msg && (item = new BMenuItem(label.String(), msg)) ) {
msg->AddInt32("measure", sig.Measure() );
msg->AddInt32("beats", beats);
msg->AddInt32("beat value", beatvalue);
menu->AddItem(item);
item->SetTarget(this);
}
}
}
}
BMessage* msg = new BMessage(CHANGE_SIGNATURE_MSG);
BMenuItem* item;
if ( msg && (item = new BMenuItem("Other...", msg)) ) {
msg->AddInt32("measure", sig.Measure() );
msg->AddInt32("beats", sig.Beats() );
msg->AddInt32("beat value", sig.BeatValue() );
menu->AddItem(item);
item->SetTarget( Window() );
}
/* If I'm a track measure control, add in my motion list.
*/
BMenu* motionMenu = NULL;
if (mTrackWinProps && (motionMenu = new BMenu("Motion")) ) {
BMessage* msg = new BMessage(CHANGE_MOTION_MSG);
BMenuItem* item;
if (msg && (item = new BMenuItem(NONE_STR, msg)) ) {
msg->AddInt32("code", MOTION_NONE);
msg->AddInt32("measure", sig.Measure() );
motionMenu->AddItem(item);
item->SetTarget(this);
}
msg = new BMessage(CHANGE_MOTION_MSG);
if (msg && (item = new BMenuItem(CLEAR_STR, msg)) ) {
msg->AddInt32("code", MOTION_CLEAR);
msg->AddInt32("measure", sig.Measure() );
motionMenu->AddItem(item);
item->SetTarget(this);
}
BString label, key;
for (uint32 k = 0; AmGlobals().GetMotionInfo(k, label, key) == B_OK; k++) {
msg = new BMessage(CHANGE_MOTION_MSG);
if (msg && (item = new BMenuItem(label.String(), msg)) ) {
if (k == 0) motionMenu->AddSeparatorItem();
msg->AddString(MOTION_KEY_STR, key);
msg->AddInt32("measure", sig.Measure() );
motionMenu->AddItem(item);
item->SetTarget(this);
}
}
if (motionMenu) {
menu->AddSeparatorItem();
BMenuItem* i = new BMenuItem(motionMenu);
if (i) menu->AddItem(i);
}
}
BRect frame(pt, pt);
menu->Go( ConvertToScreen(pt), true, false, ConvertToScreen(frame), true);
}