Beispiel #1
0
void
TWindowMenu::DetachedFromWindow()
{
	// in expando mode the teammenu will not call DragStop,
	// thus, it needs to be called from here
	TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView();
	if (barview && barview->Expando() && barview->Dragging()
		&& barview->LockLooper()) {
		// We changed the show level in AttachedToWindow().  Undo it.
		Window()->Show();
		barview->DragStop();
		barview->UnlockLooper();
	}

	BMenu::DetachedFromWindow();
}
Beispiel #2
0
void
TTeamMenu::DetachedFromWindow()
{
	TBarView* barView = (dynamic_cast<TBarApp*>(be_app))->BarView();
	if (barView != NULL) {
		BLooper* looper = barView->Looper();
		if (looper != NULL && looper->Lock()) {
			barView->DragStop();
			looper->Unlock();
		}
	}

	BMenu::DetachedFromWindow();

	BMessenger self(this);
	TBarApp::Unsubscribe(self);
}
Beispiel #3
0
status_t
TTeamMenuItem::Invoke(BMessage* message)
{
	if ((static_cast<TBarApp*>(be_app))->BarView()->InvokeItem(Signature()))
		// handles drop on application
		return B_OK;

	// if the app could not handle the drag message
	// and we were dragging, then kill the drag
	// should never get here, disabled item will not invoke
	TBarView* barView = (static_cast<TBarApp*>(be_app))->BarView();
	if (barView && barView->Dragging())
		barView->DragStop();

	// bring to front or minimize shortcuts
	uint32 mods = modifiers();
	if (mods & B_CONTROL_KEY) {
		TShowHideMenuItem::TeamShowHideCommon((mods & B_SHIFT_KEY)
			? B_MINIMIZE_WINDOW : B_BRING_TO_FRONT, Teams());
	}

	return BMenuItem::Invoke(message);
}