[Igarden-commit] Garden/source/Document CDatabasePanel.h, 1.17.2.13, 1.17.2.14 CDatabasePanel.cpp,
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2008-05-17 19:53:18
|
Update of /cvsroot/igarden/Garden/source/Document In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16785/source/Document Modified Files: Tag: Release_branch_v1 CDatabasePanel.h CDatabasePanel.cpp Log Message: Add the ability to drag from the source materials window & list views to the palette Index: CDatabasePanel.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/Document/CDatabasePanel.h,v retrieving revision 1.17.2.13 retrieving revision 1.17.2.14 diff -C2 -d -r1.17.2.13 -r1.17.2.14 *** CDatabasePanel.h 8 Apr 2008 22:24:23 -0000 1.17.2.13 --- CDatabasePanel.h 17 May 2008 19:53:21 -0000 1.17.2.14 *************** *** 146,149 **** --- 146,150 ---- virtual long DoKeyEvent(long arg, void* parg); virtual long DoColWidthChanged(long arg, void* parg); + virtual long DoIconPlantDrag( long /*arg*/, void* parg ); virtual void PrintPageContents(Rect& printRect, XGDraw& draw, Int32 xOffset, Int32 yOffset); Index: CDatabasePanel.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/Document/CDatabasePanel.cpp,v retrieving revision 1.4.2.26 retrieving revision 1.4.2.27 diff -C2 -d -r1.4.2.26 -r1.4.2.27 *** CDatabasePanel.cpp 12 Apr 2008 19:03:54 -0000 1.4.2.26 --- CDatabasePanel.cpp 17 May 2008 19:53:21 -0000 1.4.2.27 *************** *** 170,173 **** --- 170,174 ---- DISPATCHTABLE(KXGKeyEvent,CDatabasePanel::DoKeyEvent) // For SourceDB window DISPATCHTABLE(KTableColumnWidthChange,CDatabasePanel::DoColWidthChanged) + DISPATCHTABLE(KXGTableIconDrag,CDatabasePanel::DoIconPlantDrag) ENDDISPATCH *************** *** 1351,1357 **** case kDragIcon: if(firstRow && !rowPtr->inGroup) ! cell->SetIcon(kDragIconID, 14, 14); else ! cell->SetEmpty(KTypeIcon); break; --- 1352,1358 ---- case kDragIcon: if(firstRow && !rowPtr->inGroup) ! cell->SetDragIcon(kDragIconID, 14, 14); else ! cell->SetEmpty(KTypeIconDrag); break; *************** *** 3753,3756 **** --- 3754,3760 ---- /// DoColWidthChanged // + /// Called back from RGTableView or subclasses when the user has changed the width of a column + /// heading (by dragging). + // long CDatabasePanel::DoColWidthChanged(long arg, void* parg) { *************** *** 3767,3770 **** --- 3771,3810 ---- } + // --------------------------------------------------------------------------- + /// DoIconPlantDrag + // + //// Called back when a cell of type KTypeIconDrag is dragged. In this case, it + /// represents a plant or other material to be dragged somewhere + // + long CDatabasePanel::DoIconPlantDrag( long /*arg*/, void* parg ) + { + iconCellDragInfo_t dragInfo = *((iconCellDragInfo_t *)parg); + + + Rect dragRect; + Material *mat; + MaterialDragger *dragger; + + // This assumes all of the data is already initialized. + dragRect.top = dragInfo.pt.v; + dragRect.left = dragInfo.pt.h; + dragRect.bottom = dragInfo.pt.v + materialDragHeight; + dragRect.right = dragInfo.pt.h+materialDragWidth; + _table->ViewToScreen(&dragRect); + + dragger = new MaterialDragger; + + mat = RowPtr(dragInfo.row)->ref->GetMaterial(ifMissingNULL); + + if(mat != NULL) + { + dragger->AddMaterial(mat); + dragger->DoDrag(dragRect); + delete dragger; + } + + return 0; + } + #pragma mark Other *************** *** 3772,3775 **** --- 3812,3820 ---- /// SetupContextMenu // + /// Called back from YAAF to determine if this view has a contextual menu, and what + /// the items are on the contextual menu (right-click). + // + // Returns true since this view does have a contextual menu. + // bool CDatabasePanel::SetupContextMenu(RGContextMenu *menu) { |