status_t
TBarView::DragStart()
{
	if (!Dragging())
		return B_OK;

	BPoint loc;
	uint32 buttons;
	GetMouse(&loc, &buttons);

	if (fExpando && fExpando->Frame().Contains(loc)) {
		ConvertToScreen(&loc);
		BPoint expandoLocation = fExpando->ConvertFromScreen(loc);
		TTeamMenuItem* item = fExpando->TeamItemAtPoint(expandoLocation);

		if (fLastDragItem)
			init_tracking_hook(fLastDragItem, NULL, NULL);

		if (item != NULL) {
			if (item == fLastDragItem)
				return B_OK;

			fLastDragItem = item;
		}
	}

	return B_OK;
}
Esempio n. 2
0
void
TBarView::DragStop(bool full)
{
	if (!Dragging())
		return;
	
	//
	//	revert the local click to open to
	//	the launch state, cached in constructor
	_menu_info_ptr_->click_to_open = fClickToOpen;

	if (fExpando) {
		if (fLastDragItem) {
			init_tracking_hook(fLastDragItem, NULL, NULL);
			fLastDragItem = NULL;
		}
	}
	
	if (full) {
		delete fDragMessage;
		fDragMessage = NULL;
	
		delete fCachedTypesList;
		fCachedTypesList = NULL;
	}
}
Esempio n. 3
0
void
TBarMenuBar::InitTrackingHook(bool (*hookFunction)(BMenu*, void*),
	void* state, bool both)
{
	BPoint loc;
	uint32 buttons;
	GetMouse(&loc, &buttons);
	// set the hook functions for the two menus
	// will always have the deskbar menu
	// may have the app menu as well (mini mode)
	if (fDeskbarMenuItem->Frame().Contains(loc) || both)
		init_tracking_hook(fDeskbarMenuItem, hookFunction, state);

	if (fAppListMenuItem && (fAppListMenuItem->Frame().Contains(loc) || both))
		init_tracking_hook(fAppListMenuItem, hookFunction, state);
}
void
TBarView::DragStop(bool full)
{
	if (!Dragging())
		return;

	if (fExpando) {
		if (fLastDragItem) {
			init_tracking_hook(fLastDragItem, NULL, NULL);
			fLastDragItem = NULL;
		}
	}

	if (full) {
		delete fDragMessage;
		fDragMessage = NULL;

		delete fCachedTypesList;
		fCachedTypesList = NULL;
	}
}
Esempio n. 5
0
status_t
TBarView::DragStart()
{	
	//	always set the click to open state
	//	to false during a drag
	//	so that a release on a menu/menubar will not
	//	leave the menu open (ExpandoMenuBar, BarMenuBar)
	//	will get reset to actual initial system
	//	state on DragStop
	_menu_info_ptr_->click_to_open = false;

	if (!Dragging())
		return B_OK;
			
	BPoint loc;
	uint32 buttons;
	GetMouse(&loc, &buttons);

	if (fExpando && fExpando->Frame().Contains(loc)) {
		ConvertToScreen(&loc);
		BPoint expandoloc = fExpando->ConvertFromScreen(loc);		
		TTeamMenuItem *item = fExpando->ItemAtPoint(expandoloc);

		if (fLastDragItem)
			init_tracking_hook(fLastDragItem, NULL, NULL);

		if (item) {
			if (item == fLastDragItem)
				return B_OK;

			fLastDragItem = item;		
		}					
	}
	
	return B_OK;
}