- Timestamp:
- 10/20/07 15:17:40 (1 year ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/trunk/Linux/Sources/Support/Table/CTableDragAndDrop.cp
r21 r108 268 268 { 269 269 270 // Clear existing cell hilight271 ClearDropCell(mDropCell);270 // Clear existing cell hilight 271 ClearDropCell(mDropCell); 272 272 273 273 // Cache the action for reference … … 292 292 { 293 293 STableCell dropCell; 294 JPoint imagePt; 295 LocalToImagePoint(pt, imagePt); 296 if (GetCellHitBy(imagePt, dropCell) && IsDropCell(mCurrentDropFlavors, dropCell)) 294 if (GetCellHitBy(pt, dropCell) && IsDropCell(mCurrentDropFlavors, dropCell)) 297 295 { 298 296 if (mDropCursor) … … 300 298 // Check if close to edge of cell and drop cursor allowed 301 299 JRect rowRect; 302 Get LocalCellRect(dropCell, rowRect);300 GetImageCellBounds(dropCell, rowRect); 303 301 304 302 if ((pt.y < rowRect.top + 2) || (pt.y > rowRect.bottom - 2)) … … 322 320 // Get the hit cell 323 321 STableCell hitCell; 324 JPoint imagePt; 325 LocalToImagePoint(pt, imagePt); 326 GetCellHitBy(imagePt, hitCell); 322 GetCellHitBy(pt, hitCell); 327 323 328 324 JRect rowRect; 329 Get LocalCellRect(hitCell, rowRect);325 GetImageCellBounds(hitCell, rowRect); 330 326 331 327 JPoint offset = pt; … … 333 329 334 330 // Get the hit cell 335 LocalToImagePoint(offset, imagePt); 336 GetCellHitBy(imagePt, hitCell); 331 GetCellHitBy(offset, hitCell); 337 332 338 333 if (mRows == 0) … … 377 372 void CTableDragAndDrop::HandleDNDHere(const JPoint& pt, const JXWidget* source) 378 373 { 379 JPoint imagePt;380 LocalToImagePoint(pt, imagePt);381 382 374 bool hilite = false; 383 375 STableCell lastDrop = mLastDropCell; … … 388 380 // Get the hit cell 389 381 STableCell hitCell; 390 GetCellHitBy( imagePt, hitCell);382 GetCellHitBy(pt, hitCell); 391 383 mLastHitCell = hitCell; 392 384 … … 398 390 // Check if close to edge of cell and drop cursor allowed 399 391 JRect rowRect; 400 Get LocalCellRect(hitCell, rowRect);392 GetImageCellBounds(hitCell, rowRect); 401 393 402 394 if ((pt.y < rowRect.top + 2) || (pt.y > rowRect.bottom - 2)) … … 416 408 // Get the hit cell 417 409 STableCell hitCell; 418 GetCellHitBy( imagePt, hitCell);410 GetCellHitBy(pt, hitCell); 419 411 420 412 JRect rowRect; 421 Get LocalCellRect(hitCell, rowRect);422 423 JPoint offset = imagePt;413 GetImageCellBounds(hitCell, rowRect); 414 415 JPoint offset = pt; 424 416 offset += JPoint(0, rowRect.height()/2); 425 417 426 418 // Get the hit cell 427 GetCellHitBy( imagePt, hitCell);419 GetCellHitBy(offset, hitCell); 428 420 429 421 if (!hilite) … … 548 540 // Get row rect 549 541 JRect rowRect; 550 GetLocalCellRect(mLastDropCell, rowRect); 551 542 GetImageCellBounds(mLastDropCell, rowRect); 552 543 p->RectInside(rowRect); 553 544 } … … 558 549 // Get row rect 559 550 JRect rowRect; 560 GetLocalCellRect(cell, rowRect); 561 551 GetImageCellBounds(cell, rowRect); 562 552 p->RectInside(rowRect); 563 553 } … … 594 584 if (mLastDropCursor <= GetItemCount()) 595 585 { 596 Get LocalRowRect(mLastDropCursor.row, rowRect);586 GetImageCellBounds(mLastDropCursor.row, rowRect); 597 587 rowRect.bottom = rowRect.top + 2; 598 588 } … … 601 591 STableCell temp = mLastDropCursor; 602 592 temp.row--; 603 Get LocalRowRect(temp.row, rowRect);593 GetImageCellBounds(temp.row, rowRect); 604 594 rowRect.top = rowRect.bottom - 2; 605 595 } … … 616 606 if (cell.row <= GetItemCount()) 617 607 { 618 Get LocalRowRect(cell.row, rowRect);608 GetImageCellBounds(cell.row, rowRect); 619 609 rowRect.bottom = rowRect.top + 2; 620 610 } … … 623 613 STableCell temp = cell; 624 614 temp.row--; 625 Get LocalRowRect(temp.row, rowRect);615 GetImageCellBounds(temp.row, rowRect); 626 616 rowRect.top = rowRect.bottom - 2; 627 617 }