Example #1
0
bool ListView1::InitiateDrag(BPoint point,  bool wasSelected) {
printf("InitiateDrag():");
	
	point.PrintToStream();
	BRow	*row=FocusRow();
	if (row==NULL) return false;
/*	
	if ((CDMode==DATACD_INDEX) || (CDMode==BOOTABLECD_INDEX)) {	// yes? then we are not in audio mode
		folderRow=new FolderRow(((FolderRow *)row)->GetFilename(),
						((FolderRow *)row)->IsFolder(),
						((FolderRow *)row)->GetBitmap());
	} else */
	if ((CDMode==AUDIOCD_INDEX) || (CDMode==CDEXTRA_INDEX)){
		audioRow=new AudioRow(((AudioRow *)row)->GetTrackNumber(),((AudioRow *)row)->GetFilename(),
						((AudioRow *)row)->GetPregap(),
						((AudioRow *)row)->GetBytes(),
						((AudioRow *)row)->GetLength());
		audioRow->SetCDTitle(((AudioRow *)row)->GetCDTitle());
		audioRow->SetIndexList(((AudioRow *)row)->GetIndexList());
		audioRow->SetPregap(((AudioRow *)row)->GetPregap());
		audioRow->SetStartFrame(((AudioRow *)row)->GetStartFrame());
		audioRow->SetEndFrame(((AudioRow *)row)->GetEndFrame());
//		audioRow->SetStartTime(((AudioRow *)row)->GetStartTime());
//		audioRow->SetEndTime(((AudioRow *)row)->GetEndTime());
		//audioRow=new AudioRow(*((AudioRow *)row));
	}
	
	BMessage	*message=new BMessage(LISTITEM_DROPPED);
	BRect		rect;
	if (GetRowRect(row, &rect)) {
		void *r=(void *)row;
		message->AddPointer("from", r);
		if (!((FolderRow *)row)->IsFolder())
			message->AddInt32("index", (int32)IndexOf(row));
		DragMessage(message, rect);
//		if ((CDMode==AUDIOCD_INDEX) || (CDMode==CDEXTRA_INDEX))
//			RemoveRow(IndexOf(row));
		//delete row;
	}
	return true;
}
Example #2
0
void
View::FrameMoved(BPoint point)
{
	point.PrintToStream();
}