本文整理汇总了C++中BContainerWindow::AddMimeTypesToMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ BContainerWindow::AddMimeTypesToMenu方法的具体用法?C++ BContainerWindow::AddMimeTypesToMenu怎么用?C++ BContainerWindow::AddMimeTypesToMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BContainerWindow
的用法示例。
在下文中一共展示了BContainerWindow::AddMimeTypesToMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindColumnTitle
void
BTitleView::MouseDown(BPoint where)
{
if (!Window()->IsActive()) {
// wasn't active, just activate and bail
Window()->Activate();
return;
}
// finish any pending edits
fPoseView->CommitActivePose();
BColumnTitle *title = FindColumnTitle(where);
BColumnTitle *resizedTitle = InColumnResizeArea(where);
uint32 buttons;
GetMouse(&where, &buttons);
// Check if the user clicked the secondary mouse button.
// if so, display the attribute menu:
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
BContainerWindow *window = dynamic_cast<BContainerWindow *>
(Window());
BPopUpMenu *menu = new BPopUpMenu("Attributes", false, false);
menu->SetFont(be_plain_font);
window->NewAttributeMenu(menu);
window->AddMimeTypesToMenu(menu);
window->MarkAttributeMenu(menu);
menu->SetTargetForItems(window->PoseView());
menu->Go(ConvertToScreen(where), true, false);
return;
}
bigtime_t doubleClickSpeed;
get_click_speed(&doubleClickSpeed);
if (resizedTitle) {
bool force = static_cast<bool>(buttons & B_TERTIARY_MOUSE_BUTTON);
if (force || buttons & B_PRIMARY_MOUSE_BUTTON) {
if (force || fPreviouslyClickedColumnTitle != 0) {
if (force || system_time() - fPreviousLeftClickTime < doubleClickSpeed) {
if (fPoseView->ResizeColumnToWidest(resizedTitle->Column())) {
Invalidate();
return;
}
}
}
fPreviousLeftClickTime = system_time();
fPreviouslyClickedColumnTitle = resizedTitle;
}
} else if (!title)
return;
SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY | B_LOCK_WINDOW_FOCUS);
// track the mouse
if (resizedTitle) {
fTrackingState = new ColumnResizeState(this, resizedTitle, where,
system_time() + doubleClickSpeed);
} else {
fTrackingState = new ColumnDragState(this, title, where,
system_time() + doubleClickSpeed);
}
}