Changeset 108 for Mulberry

Show
Ignore:
Timestamp:
10/20/07 15:17:40 (1 year ago)
Author:
daboo
Message:

Fix for drag and drop cell offset issues when lists are scrolled.

Location:
Mulberry/trunk/Linux/Sources
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/trunk/Linux/Sources/Application/Address_Book_Manager/CAdbkManagerTitleTable.cp

    r21 r108  
    9494{ 
    9595        STableCell      hitCell; 
    96         JPoint          imagePt; 
    97         LocalToImagePoint(point, imagePt); 
    98         if (!GetCellHitBy(imagePt, hitCell)) 
     96        if (!GetCellHitBy(point, hitCell)) 
    9997        { 
    10098                CTitleTableView::OnRButtonDown(point, buttonStates, modifiers); 
  • Mulberry/trunk/Linux/Sources/Application/Calendar/Calendar_View/Calendar_Store_View/CCalendarStoreTitleTable.cp

    r21 r108  
    6464 
    6565        // Find column clicked 
    66         JPoint imagePt; 
    67         LocalToImagePoint(point, imagePt); 
    6866        STableCell cell; 
    69         if (GetCellHitBy(imagePt, cell)) 
     67        if (GetCellHitBy(point, cell)) 
    7068                sClickColumn = cell.col; 
    7169         
  • Mulberry/trunk/Linux/Sources/Application/Calendar/Calendar_View/Day_Week_View/CDayWeekTable.cp

    r21 r108  
    127127                                { 
    128128                                        STableCell      hitCell; 
    129                                         JPoint          imagePt; 
    130                                         LocalToImagePoint(mContextPoint, imagePt); 
    131  
    132                                         if (GetCellHitBy(imagePt, hitCell)) 
     129                                        if (GetCellHitBy(mContextPoint, hitCell)) 
    133130                                        { 
    134131                                                // Broadcast double-click if in day area 
     
    173170iCal::CICalendarDateTime CDayWeekTable::GetClickDateTime(const JPoint& localPt) const 
    174171{ 
    175         JPoint imagePt; 
    176         LocalToImagePoint(localPt, imagePt); 
    177172        STableCell hitCell; 
    178         if (GetCellHitBy(imagePt, hitCell)) 
     173        if (GetCellHitBy(localPt, hitCell)) 
    179174        { 
    180175                if (hitCell.row == cAllDayRow) 
     
    196191                        uint32_t bot_secs = mEndHour * 60 * 60; 
    197192 
    198                         uint32_t click_secs = top_secs + (bot_secs - top_secs) * (imagePt.y - cellTop) / (cellBottom - cellTop); 
     193                        uint32_t click_secs = top_secs + (bot_secs - top_secs) * (localPt.y - cellTop) / (cellBottom - cellTop); 
    199194 
    200195                        // Round to nearest 15 minute (900 second) interval 
  • Mulberry/trunk/Linux/Sources/Application/Server/CServerTitleTable.cp

    r21 r108  
    6464 
    6565        // Find column clicked 
    66         JPoint imagePt; 
    67         LocalToImagePoint(point, imagePt); 
    6866        STableCell cell; 
    69         if (GetCellHitBy(imagePt, cell)) 
     67        if (GetCellHitBy(point, cell)) 
    7068                sClickColumn = cell.col; 
    7169         
  • Mulberry/trunk/Linux/Sources/Support/Table/CTableDragAndDrop.cp

    r21 r108  
    268268{ 
    269269 
    270   // Clear existing cell hilight 
    271   ClearDropCell(mDropCell); 
     270        // Clear existing cell hilight 
     271        ClearDropCell(mDropCell); 
    272272 
    273273        // Cache the action for reference 
     
    292292                                { 
    293293                                        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)) 
    297295                                        { 
    298296                                                if (mDropCursor) 
     
    300298                                                        // Check if close to edge of cell and drop cursor allowed 
    301299                                                        JRect rowRect; 
    302                                                         GetLocalCellRect(dropCell, rowRect); 
     300                                                        GetImageCellBounds(dropCell, rowRect); 
    303301                                                         
    304302                                                        if ((pt.y < rowRect.top + 2) || (pt.y > rowRect.bottom - 2)) 
     
    322320                                        // Get the hit cell 
    323321                                        STableCell      hitCell; 
    324                                         JPoint imagePt; 
    325                                         LocalToImagePoint(pt, imagePt); 
    326                                         GetCellHitBy(imagePt, hitCell); 
     322                                        GetCellHitBy(pt, hitCell); 
    327323 
    328324                                        JRect rowRect; 
    329                                         GetLocalCellRect(hitCell, rowRect); 
     325                                        GetImageCellBounds(hitCell, rowRect); 
    330326 
    331327                                        JPoint offset = pt; 
     
    333329 
    334330                                        // Get the hit cell 
    335                                         LocalToImagePoint(offset, imagePt); 
    336                                         GetCellHitBy(imagePt, hitCell); 
     331                                        GetCellHitBy(offset, hitCell); 
    337332                                         
    338333                                        if (mRows == 0) 
     
    377372void CTableDragAndDrop::HandleDNDHere(const JPoint& pt, const JXWidget* source) 
    378373{ 
    379         JPoint  imagePt; 
    380         LocalToImagePoint(pt, imagePt); 
    381  
    382374        bool hilite = false; 
    383375        STableCell lastDrop = mLastDropCell; 
     
    388380                // Get the hit cell 
    389381                STableCell      hitCell; 
    390                 GetCellHitBy(imagePt, hitCell); 
     382                GetCellHitBy(pt, hitCell); 
    391383                mLastHitCell = hitCell; 
    392384 
     
    398390                        // Check if close to edge of cell and drop cursor allowed 
    399391                        JRect rowRect; 
    400                         GetLocalCellRect(hitCell, rowRect); 
     392                        GetImageCellBounds(hitCell, rowRect); 
    401393                         
    402394                        if ((pt.y < rowRect.top + 2) || (pt.y > rowRect.bottom - 2)) 
     
    416408                // Get the hit cell 
    417409                STableCell      hitCell; 
    418                 GetCellHitBy(imagePt, hitCell); 
     410                GetCellHitBy(pt, hitCell); 
    419411 
    420412                JRect rowRect; 
    421                 GetLocalCellRect(hitCell, rowRect); 
    422  
    423                 JPoint offset = imagePt; 
     413                GetImageCellBounds(hitCell, rowRect); 
     414 
     415                JPoint offset = pt; 
    424416                offset += JPoint(0, rowRect.height()/2); 
    425417 
    426418                // Get the hit cell 
    427                 GetCellHitBy(imagePt, hitCell); 
     419                GetCellHitBy(offset, hitCell); 
    428420                 
    429421                if (!hilite) 
     
    548540                // Get row rect 
    549541                JRect rowRect; 
    550                 GetLocalCellRect(mLastDropCell, rowRect); 
    551  
     542                GetImageCellBounds(mLastDropCell, rowRect); 
    552543                p->RectInside(rowRect);  
    553544        } 
     
    558549                // Get row rect 
    559550                JRect rowRect; 
    560                 GetLocalCellRect(cell, rowRect); 
    561  
     551                GetImageCellBounds(cell, rowRect); 
    562552                p->RectInside(rowRect);  
    563553        } 
     
    594584                if (mLastDropCursor <= GetItemCount()) 
    595585                { 
    596                         GetLocalRowRect(mLastDropCursor.row, rowRect); 
     586                        GetImageCellBounds(mLastDropCursor.row, rowRect); 
    597587                        rowRect.bottom = rowRect.top + 2; 
    598588                } 
     
    601591                        STableCell temp = mLastDropCursor; 
    602592                        temp.row--; 
    603                         GetLocalRowRect(temp.row, rowRect); 
     593                        GetImageCellBounds(temp.row, rowRect); 
    604594                        rowRect.top = rowRect.bottom - 2; 
    605595                } 
     
    616606                if (cell.row <= GetItemCount()) 
    617607                { 
    618                         GetLocalRowRect(cell.row, rowRect); 
     608                        GetImageCellBounds(cell.row, rowRect); 
    619609                        rowRect.bottom = rowRect.top + 2; 
    620610                } 
     
    623613                        STableCell temp = cell; 
    624614                        temp.row--; 
    625                         GetLocalRowRect(temp.row, rowRect); 
     615                        GetImageCellBounds(temp.row, rowRect); 
    626616                        rowRect.top = rowRect.bottom - 2; 
    627617                }