BOOL LLSplitButton::handleMouseUp(S32 x, S32 y, MASK mask) { gFocusMgr.setMouseCapture(NULL); if (mShownItem->parentPointInView(x, y)) { onItemSelected(mShownItem); return TRUE; } for (std::list<LLButton*>::const_iterator it = mHidenItems.begin(); it != mHidenItems.end(); ++it) { LLButton* item = *it; S32 panel_x = 0; S32 panel_y = 0; localPointToOtherView(x, y, &panel_x, &panel_y, mItemsPanel); if (item->parentPointInView(panel_x, panel_y)) { onItemSelected(item); return TRUE; } } return TRUE; }
BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, MASK mask) { if(mAddLandmarkBtn->parentPointInView(x,y)) { updateAddLandmarkTooltip(); } // Let the buttons show their tooltips. if (LLUICtrl::handleToolTip(x, y, mask)) { if (mList->getRect().pointInRect(x, y)) { S32 loc_x, loc_y; //x,y - contain coordinates related to the location input control, but without taking the expanded list into account //So we have to convert it again into local coordinates of mList localPointToOtherView(x,y,&loc_x,&loc_y,mList); LLScrollListItem* item = mList->hitItem(loc_x,loc_y); if (item) { LLSD value = item->getValue(); if (value.has("tooltip")) { LLToolTipMgr::instance().show(value["tooltip"]); } } } return TRUE; } return FALSE; }
BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { if ((mOutboxInventoryPanel.get() == NULL) || //(mWindowShade && mWindowShade->isShown()) || LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || mOutboxId.isNull()) { return FALSE; } LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); BOOL handled = (handled_view != NULL); // Determine if the mouse is inside the inventory panel itself or just within the floater bool pointInInventoryPanel = false; bool pointInInventoryPanelChild = false; LLInventoryPanel* panel = mOutboxInventoryPanel.get(); LLFolderView * root_folder = panel->getRootFolder(); if (panel->getVisible()) { S32 inv_x, inv_y; localPointToOtherView(x, y, &inv_x, &inv_y, panel); pointInInventoryPanel = panel->getRect().pointInRect(inv_x, inv_y); LLView * inventory_panel_child_at_point = panel->childFromPoint(inv_x, inv_y, true); pointInInventoryPanelChild = (inventory_panel_child_at_point != root_folder); } // Pass all drag and drop for this floater to the outbox inventory control if (!handled || !isAccepted(*accept)) { // Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel // (otherwise the inventory panel itself will handle the drag and drop operation, without any override) if (!pointInInventoryPanel) { handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); } else { mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild); } return handled; }
BOOL LLPopupView::handleMouseEvent(boost::function<BOOL(LLView*, S32, S32)> func, boost::function<bool(LLView*)> predicate, S32 x, S32 y, bool close_popups) { BOOL handled = FALSE; // make a copy of list of popups, in case list is modified during mouse event handling popup_list_t popups(mPopups); for (popup_list_t::iterator popup_it = popups.begin(), popup_end = popups.end(); popup_it != popup_end; ++popup_it) { LLView* popup = popup_it->get(); if (!popup || !predicate(popup)) { continue; } S32 popup_x, popup_y; if (localPointToOtherView(x, y, &popup_x, &popup_y, popup) && popup->pointInView(popup_x, popup_y)) { if (func(popup, popup_x, popup_y)) { handled = TRUE; break; } } if (close_popups) { mPopups.remove(*popup_it); popup->onTopLost(); } } return handled; }