Example #1
0
bool
TExpandoMenuBar::InDeskbarMenu(BPoint loc) const
{
	TBarWindow* window = dynamic_cast<TBarWindow*>(Window());
	if (window != NULL) {
		if (TDeskbarMenu* bemenu = window->DeskbarMenu()) {
			bool inDeskbarMenu = false;
			if (bemenu->LockLooper()) {
				inDeskbarMenu = bemenu->Frame().Contains(loc);
				bemenu->UnlockLooper();
			}
			return inDeskbarMenu;
		}
	}

	return false;
}
Example #2
0
bool
TExpandoMenuBar::InDeskbarMenu(BPoint loc) const
{
	if (!fVertical) {
		if (fDeskbarMenuItem && fDeskbarMenuItem->Frame().Contains(loc))
			return true;
	} else {
		TBarWindow* window = dynamic_cast<TBarWindow*>(Window());
		if (window) {
			if (TDeskbarMenu* bemenu = window->DeskbarMenu()) {
				bool inDeskbarMenu = false;
				if (bemenu->LockLooper()) {
					inDeskbarMenu = bemenu->Frame().Contains(loc);
					bemenu->UnlockLooper();
				}
				return inDeskbarMenu;
			}
		}
	}

	return false;
}