本文整理汇总了C++中BMenuItem::Frame方法的典型用法代码示例。如果您正苦于以下问题:C++ BMenuItem::Frame方法的具体用法?C++ BMenuItem::Frame怎么用?C++ BMenuItem::Frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMenuItem
的用法示例。
在下文中一共展示了BMenuItem::Frame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: zoomRect
status_t
TWindowMenuItem::Invoke(BMessage* /*message*/)
{
if (!fDragging) {
if (fID >= 0) {
int32 action = (modifiers() & B_CONTROL_KEY) != 0
? B_MINIMIZE_WINDOW : B_BRING_TO_FRONT;
bool doZoom = false;
BRect zoomRect(0.0f, 0.0f, 0.0f, 0.0f);
BMenuItem* item;
if (!fExpanded)
item = Menu()->Superitem();
else
item = this;
if (item->Menu()->Window() != NULL) {
zoomRect = item->Menu()->ConvertToScreen(item->Frame());
doZoom = (fMini && action == B_BRING_TO_FRONT)
|| (!fMini && action == B_MINIMIZE_WINDOW);
}
do_window_action(fID, action, zoomRect, doZoom);
}
}
return B_OK;
}
示例2: str
status_t
PMenuItem::GetProperty(const char *name, PValue *value, const int32 &index) const
{
if (!name || !value)
return B_ERROR;
BString str(name);
PProperty *prop = FindProperty(name,index);
if (!prop)
return B_NAME_NOT_FOUND;
BMenuItem *backend = (BMenuItem*)fBackend;
if (str.ICompare("Message") == 0)
((IntProperty*)prop)->SetValue(backend->Command());
else if (str.ICompare("Trigger") == 0)
((CharProperty*)prop)->SetValue(backend->Trigger());
else if (str.ICompare("Label") == 0)
((StringProperty*)prop)->SetValue(backend->Label());
else if (str.ICompare("Frame") == 0)
((RectProperty*)prop)->SetValue(backend->Frame());
else if (str.ICompare("Marked") == 0)
((BoolProperty*)prop)->SetValue(backend->IsMarked());
else if (str.ICompare("Enabled") == 0)
((BoolProperty*)prop)->SetValue(backend->IsEnabled());
else
{
return PObject::GetProperty(name, value, index);
}
return prop->GetValue(value);
}
示例3: zoomRect
status_t
TShowHideMenuItem::Invoke(BMessage *)
{
bool doZoom = false;
BRect zoomRect(0, 0, 0, 0);
BMenuItem *item = Menu()->Superitem();
if (item->Menu()->Window() != NULL) {
zoomRect = item->Menu()->ConvertToScreen(item->Frame());
doZoom = true;
}
return TeamShowHideCommon(static_cast<int32>(fAction), fTeams, zoomRect, doZoom);
}
示例4: UpdateYearsMenu
/*! \brief Update menu of years
* \details After the user selects another year, the whole
* years' menu should be changed. The selected year
* becomes the middle of the menu, with years before
* and after it surrounding it from top and bottom
* (respectively).
* \param[in] prevYear The year that was previously selected.
* \param[in] curYear The year that is selected now.
*/
void CalendarControl::UpdateYearsMenu(int prevYear, int curYear) {
BMenuItem* item; BMenu* menu;
BString sb;
BRect fr;
sb << prevYear;
if (!fDateSelector) return;
if ( (item = fDateSelector->FindItem(sb.String())) == NULL) {
return;
}
fr = item->Frame();
fDateSelector->RemoveItem( item );
delete item;
menu = CreateYearsMenu( curYear );
if ( menu ) {
fDateSelector->AddItem( menu, fr );
}
} // <-- end of function "CalendarControl::UpdateYearsMenu"