[Igarden-commit] Garden/source/PlanTool WritablePlanView.cpp, 1.23.2.3, 1.23.2.4 SelectedElements.c
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2008-05-10 22:53:15
|
Update of /cvsroot/igarden/Garden/source/PlanTool In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24363/source/PlanTool Modified Files: Tag: Release_branch_v1 WritablePlanView.cpp SelectedElements.cpp WritablePlanView.h PlanView.h PlanView.cpp SelectedElements.h Log Message: Fix problem where elements would look selected when they weren't Index: SelectedElements.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/SelectedElements.h,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** SelectedElements.h 28 Jun 2005 12:51:19 -0000 1.10 --- SelectedElements.h 10 May 2008 22:52:53 -0000 1.10.2.1 *************** *** 75,78 **** --- 75,79 ---- bool HasInfoWindows(); void MakeInfoWindows(ClientDocument *doc, PlanView *view, Point &showAt); + bool IsElementSelected(Element *elem); protected: Index: PlanView.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/PlanView.h,v retrieving revision 1.26.2.5 retrieving revision 1.26.2.6 diff -C2 -d -r1.26.2.5 -r1.26.2.6 *** PlanView.h 19 Mar 2008 01:37:42 -0000 1.26.2.5 --- PlanView.h 10 May 2008 22:52:53 -0000 1.26.2.6 *************** *** 45,48 **** --- 45,49 ---- class CGWorld; class PersistentTags; + class Element; using yaaf::XGView; *************** *** 146,149 **** --- 147,151 ---- englishRounding_t GetMeasurementRounding() { return _rounding; } void AllowDraw(bool val, const char *msg=NULL); + virtual bool IsElementSelected(Element *elem); PersistentTags *GetPrefs() { return _prefs; } Index: SelectedElements.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/SelectedElements.cpp,v retrieving revision 1.23.2.3 retrieving revision 1.23.2.4 diff -C2 -d -r1.23.2.3 -r1.23.2.4 *** SelectedElements.cpp 26 Mar 2008 22:27:16 -0000 1.23.2.3 --- SelectedElements.cpp 10 May 2008 22:52:53 -0000 1.23.2.4 *************** *** 34,45 **** // --------------------------------------------------------------------------- ! // void SelectedElements::AddSelectedElements( Element* selectedItem ) ! // --------------------------------------------------------------------------- // ! /* Add one element to the list of selected items. */ ! ! ! void ! SelectedElements::AddSelectedElements( Element* selectedItem ) { short n, count; --- 34,42 ---- // --------------------------------------------------------------------------- ! /// AddSelectedElements // ! /// Add one element to the list of selected items. ! // ! void SelectedElements::AddSelectedElements( Element* selectedItem ) { short n, count; *************** *** 55,94 **** { _selected.push_back(selectedItem); ! selectedItem->Select(true, _view); } } - // --------------------------------------------------------------------------- - // Int16 SelectedElements::NumSelectedElements() - // --------------------------------------------------------------------------- - // - /* Count the numner of selected items. */ ! Int16 ! SelectedElements::NumSelectedElements() { return _selected.Length(); } - // --------------------------------------------------------------------------- - // Element* SelectedElements::GetIndexedSelectedElement( UInt32 index ) - // --------------------------------------------------------------------------- - // - /* Index (1-based) into the list of selected items. Used with count to iterate. */ ! Element* ! SelectedElements::GetIndexedSelectedElement( UInt32 index ) { return _selected[index]; } - // --------------------------------------------------------------------------- - // void SelectedElements::ToggleElement( Element* unselectedItem ) - // --------------------------------------------------------------------------- - // - /* If the given element is not present, add it. If it is present, remove it. */ ! void ! SelectedElements::ToggleElement( Element* unselectedItem ) { Int32 n, numSelected; --- 52,88 ---- { _selected.push_back(selectedItem); ! selectedItem->RefreshElement(_view); } } ! // --------------------------------------------------------------------------- ! /// NumSelectedElements ! // ! /// Count the numner of selected items. ! // ! Int16 SelectedElements::NumSelectedElements() { return _selected.Length(); } ! // --------------------------------------------------------------------------- ! /// GetIndexedSelectedElement ! // ! /// Index (1-based) into the list of selected items. Used with count to iterate. ! // ! Element* SelectedElements::GetIndexedSelectedElement( UInt32 index ) { return _selected[index]; } ! // --------------------------------------------------------------------------- ! /// ToggleElement ! // ! /// If the given element is not present, add it. If it is present, remove it. ! // ! void SelectedElements::ToggleElement( Element* unselectedItem ) { Int32 n, numSelected; *************** *** 102,107 **** if(unselectedItem == elem) { - elem->Select(false, _view); _selected.Delete(n); found = true; } --- 96,101 ---- if(unselectedItem == elem) { _selected.Delete(n); + unselectedItem->RefreshElement(_view); found = true; } *************** *** 113,145 **** } } - // --------------------------------------------------------------------------- - // void SelectedElements::RemoveAllSelected() - // --------------------------------------------------------------------------- - // - /* Remove all elements, as when the user click outside of the view. */ ! void ! SelectedElements::RemoveAllSelected() { ! UInt32 n, numSelected; ! Element *elem; ! numSelected = _selected.Length(); ! for(n = 0; n < numSelected; n++) { elem = _selected[n]; ! elem->Select(false, _view); } - _selected.DeleteAll(); } - // --------------------------------------------------------------------------- - // SelectedElements::SelectedElements( WritablePlanView* view ) - // --------------------------------------------------------------------------- - // - /* Constructor */ - SelectedElements::SelectedElements( WritablePlanView* view ) : _view(view) --- 107,135 ---- } } ! // --------------------------------------------------------------------------- ! /// RemoveAllSelected ! // ! /// Remove all elements, as when the user click outside of the view. ! // ! void SelectedElements::RemoveAllSelected() { ! long n, count; ! Element *elem; ! count = _selected.Length(); ! for(n = count-1; n >= 0; n--) { elem = _selected[n]; ! _selected.Delete(n); ! elem->RefreshElement(_view); } } + // --------------------------------------------------------------------------- + /// SelectedElements + // SelectedElements::SelectedElements( WritablePlanView* view ) : _view(view) *************** *** 147,170 **** } - // --------------------------------------------------------------------------- - // SelectedElements::~SelectedElements() - // --------------------------------------------------------------------------- - // - /* Destructor */ - SelectedElements::~SelectedElements() { } - // --------------------------------------------------------------------------- - // Element * SelectedElements::GetSelectedElementOnPoint( planPoint_t point, PlanView* view ) - // --------------------------------------------------------------------------- - // ! Element * ! SelectedElements::GetSelectedElementOnPoint( planPoint_t point, PlanView* view ) { UInt32 n, numElem; --- 137,155 ---- } + // --------------------------------------------------------------------------- + /// ~SelectedElements + // SelectedElements::~SelectedElements() { } ! // --------------------------------------------------------------------------- ! /// GetSelectedElementOnPoint ! // ! Element *SelectedElements::GetSelectedElementOnPoint( planPoint_t point, PlanView* view ) { UInt32 n, numElem; *************** *** 183,194 **** return result; } - // --------------------------------------------------------------------------- - // void SelectedElements::MoveElements( Int32 dx, Int32 dy, bool doRefresh ) - // --------------------------------------------------------------------------- - // ! void ! SelectedElements::MoveElements( planLength_t dx, planLength_t dy, bool doRefresh ) { UInt32 n, numElem; --- 168,177 ---- return result; } ! // --------------------------------------------------------------------------- ! /// MoveElements ! // ! void SelectedElements::MoveElements( planLength_t dx, planLength_t dy, bool doRefresh ) { UInt32 n, numElem; *************** *** 207,219 **** } } - // --------------------------------------------------------------------------- - // planRectangle_t SelectedElements::GetBoundingRectangle() - // --------------------------------------------------------------------------- - // - /* Get the minimal rectangle which completely encloses the path. */ ! planRectangle_t ! SelectedElements::GetBoundingRectangle() { planRectangle_t rect; --- 190,201 ---- } } ! // --------------------------------------------------------------------------- ! /// RemoveAllSelected ! // ! /// Get the minimal rectangle which completely encloses the path. ! // ! planRectangle_t SelectedElements::GetBoundingRectangle() { planRectangle_t rect; *************** *** 261,272 **** return rect; } - // --------------------------------------------------------------------------- - // void SelectedElements::ShowElements() - // --------------------------------------------------------------------------- - // ! void ! SelectedElements::ShowElements() { Element *elem; --- 243,252 ---- return rect; } ! // --------------------------------------------------------------------------- ! /// ShowElements ! // ! void SelectedElements::ShowElements() { Element *elem; *************** *** 280,291 **** } } - // --------------------------------------------------------------------------- - // void SelectedElements::HideElements() - // --------------------------------------------------------------------------- - // ! void ! SelectedElements::HideElements() { Element *elem; --- 260,269 ---- } } ! // --------------------------------------------------------------------------- ! /// HideElements ! // ! void SelectedElements::HideElements() { Element *elem; *************** *** 299,310 **** } } - // --------------------------------------------------------------------------- - // void SelectedElements::DrawElements( PlanView* view, XGDraw& draw ) - // --------------------------------------------------------------------------- - // ! void ! SelectedElements::DrawElements( PlanView* view) { Element *elem; --- 277,286 ---- } } ! // --------------------------------------------------------------------------- ! /// DrawElements ! // ! void SelectedElements::DrawElements( PlanView* view) { Element *elem; *************** *** 322,331 **** } } - // --------------------------------------------------------------------------- - // void SelectedElements::CutToClipboard() - // --------------------------------------------------------------------------- - // void SelectedElements::CutToClipboard(XGFileHandle &stream) { --- 298,306 ---- } } + // --------------------------------------------------------------------------- + /// CutToClipboard + // void SelectedElements::CutToClipboard(XGFileHandle &stream) { *************** *** 350,361 **** _selected.DeleteAll(); } - // --------------------------------------------------------------------------- - // void SelectedElements::CopyToClipboard() - // --------------------------------------------------------------------------- - // ! void ! SelectedElements::CopyToClipboard() { RGClipboard* clipboard = RGClipboard::GetClipboard(); --- 325,334 ---- _selected.DeleteAll(); } ! // --------------------------------------------------------------------------- ! /// CopyToClipboard ! // ! void SelectedElements::CopyToClipboard() { RGClipboard* clipboard = RGClipboard::GetClipboard(); *************** *** 376,379 **** --- 349,356 ---- } + + // --------------------------------------------------------------------------- + /// Delete + // void SelectedElements::Delete(PlanDeleteAction *action) { *************** *** 389,401 **** } // --------------------------------------------------------------------------- ! // void SelectedElements::RemoveElement( Element* selectedItem ) ! // --------------------------------------------------------------------------- // ! /* Remove one element from the list of selected items. */ ! ! ! void ! SelectedElements::RemoveElement( Element* selectedItem ) { UInt32 n, numElem; --- 366,376 ---- } + // --------------------------------------------------------------------------- ! /// RemoveAllSelected // ! /// Remove one element from the list of selected items. ! // ! void SelectedElements::RemoveElement( Element* selectedItem ) { UInt32 n, numElem; *************** *** 410,421 **** } } - // --------------------------------------------------------------------------- - // void SelectedElements::AddElementsToAction( PlanMoveAction* action ) - // --------------------------------------------------------------------------- - // ! void ! SelectedElements::AddElementsToAction( PlanMoveAction* action ) { UInt32 n, numElem; --- 385,394 ---- } } ! // --------------------------------------------------------------------------- ! /// AddElementsToAction ! // ! void SelectedElements::AddElementsToAction( PlanMoveAction* action ) { UInt32 n, numElem; *************** *** 429,441 **** } } - // --------------------------------------------------------------------------- - // bool SelectedElements::KeyEvent( long value ) - // --------------------------------------------------------------------------- - // - /* Return true if you used the keystroke (goes only to the first responding) */ ! bool ! SelectedElements::KeyEvent( long value ) { UInt32 n, numElem; --- 402,413 ---- } } ! // --------------------------------------------------------------------------- ! /// KeyEvent ! // ! /// Return true if you used the keystroke (goes only to the first responding). ! // ! bool SelectedElements::KeyEvent( long value ) { UInt32 n, numElem; *************** *** 460,471 **** return accepted; } - // --------------------------------------------------------------------------- - // bool SelectedElements::ContentMouseDown( planPoint_t point ) - // --------------------------------------------------------------------------- - // ! bool ! SelectedElements::ContentMouseDown( planPoint_t point ) { UInt32 n, numElem; --- 432,441 ---- return accepted; } ! // --------------------------------------------------------------------------- ! /// ContentMouseDown ! // ! bool SelectedElements::ContentMouseDown( planPoint_t point ) { UInt32 n, numElem; *************** *** 489,500 **** return inContent; } - // --------------------------------------------------------------------------- - // bool SelectedElements::ContentMouseMoved( planPoint_t point ) - // --------------------------------------------------------------------------- - // ! bool ! SelectedElements::ContentMouseMoved( planPoint_t point ) { UInt32 n, numElem; --- 459,468 ---- return inContent; } ! // --------------------------------------------------------------------------- ! /// ContentMouseMoved ! // ! bool SelectedElements::ContentMouseMoved( planPoint_t point ) { UInt32 n, numElem; *************** *** 518,529 **** return inContent; } - // --------------------------------------------------------------------------- - // bool SelectedElements::ContentMouseUp( planPoint_t point, short modifiers, bool doubleClick ) - // --------------------------------------------------------------------------- - // ! bool ! SelectedElements::ContentMouseUp( planPoint_t point, short modifiers, bool doubleClick ) { UInt32 n, numElem; --- 486,495 ---- return inContent; } ! // --------------------------------------------------------------------------- ! /// ContentMouseUp ! // ! bool SelectedElements::ContentMouseUp( planPoint_t point, short modifiers, bool doubleClick ) { UInt32 n, numElem; *************** *** 547,559 **** return inContent; } - // --------------------------------------------------------------------------- - // Element* SelectedElements::FirstElementMatchingTool( PlanTool* tool ) - // --------------------------------------------------------------------------- - // - /* Returns NULL if none matching */ ! Element* ! SelectedElements::FirstElementMatchingTool( PlanTool* tool ) { UInt32 n, numElem; --- 513,524 ---- return inContent; } ! // --------------------------------------------------------------------------- ! /// FirstElementMatchingTool ! // ! /// Returns NULL if none matching. ! // ! Element* SelectedElements::FirstElementMatchingTool( PlanTool* tool ) { UInt32 n, numElem; *************** *** 577,588 **** return result; } - // --------------------------------------------------------------------------- - // long SelectedElements::DoGetMenuStatus( long arg, void* parg ) - // --------------------------------------------------------------------------- - // ! long ! SelectedElements::DoGetMenuStatus( long arg, void* parg ) { UInt32 n, numElem; --- 542,551 ---- return result; } ! // --------------------------------------------------------------------------- ! /// DoGetMenuStatus ! // ! long SelectedElements::DoGetMenuStatus( long arg, void* parg ) { UInt32 n, numElem; *************** *** 601,612 **** return result; } - // --------------------------------------------------------------------------- - // long SelectedElements::DoMenuCommand( long arg, void* parg ) - // --------------------------------------------------------------------------- - // ! long ! SelectedElements::DoMenuCommand( long arg, void* parg ) { UInt32 n, numElem; --- 564,573 ---- return result; } ! // --------------------------------------------------------------------------- ! /// DoMenuCommand ! // ! long SelectedElements::DoMenuCommand( long arg, void* parg ) { UInt32 n, numElem; *************** *** 628,637 **** return result; } - // --------------------------------------------------------------------------- - // long SelectedElements::DoIdle( long arg, void* parg ) - // --------------------------------------------------------------------------- - // long SelectedElements::DoIdle( long arg, void* parg ) { --- 589,597 ---- return result; } + // --------------------------------------------------------------------------- + /// DoIdle + // long SelectedElements::DoIdle( long arg, void* parg ) { *************** *** 653,656 **** --- 613,620 ---- } + + // --------------------------------------------------------------------------- + /// HasInfoWindows + // bool SelectedElements::HasInfoWindows() { *************** *** 667,670 **** --- 631,638 ---- } + + // --------------------------------------------------------------------------- + /// MakeInfoWindows + // void SelectedElements::MakeInfoWindows(ClientDocument *doc, PlanView *view, Point &showAt) { *************** *** 677,678 **** --- 645,665 ---- } } + + + // --------------------------------------------------------------------------- + /// IsElementSelected + // + bool SelectedElements::IsElementSelected(Element *elem) + { + UInt32 n, numElem; + bool found; + + numElem = _selected.Length(); + for(n=0, found=false; (n < numElem) && !found; n++) + { + found = (elem == _selected[n]); + } + + return found; + } + Index: WritablePlanView.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/WritablePlanView.cpp,v retrieving revision 1.23.2.3 retrieving revision 1.23.2.4 diff -C2 -d -r1.23.2.3 -r1.23.2.4 *** WritablePlanView.cpp 22 Aug 2007 13:02:45 -0000 1.23.2.3 --- WritablePlanView.cpp 10 May 2008 22:52:53 -0000 1.23.2.4 *************** *** 57,67 **** const long kPlanToolDragMaterialUndoRedoIndex = 17; - // --------------------------------------------------------------------------- - // WritablePlanView::WritablePlanView( XGView* parent, XGArgStream& stream ) - // --------------------------------------------------------------------------- - // - WritablePlanView::WritablePlanView( XGView* parent, XGArgStream& stream ) : PlanView(parent, stream), XGDropper(), _activePath(NULL) --- 57,65 ---- const long kPlanToolDragMaterialUndoRedoIndex = 17; + // --------------------------------------------------------------------------- + /// WritablePlanView + // WritablePlanView::WritablePlanView( XGView* parent, XGArgStream& stream ) : PlanView(parent, stream), XGDropper(), _activePath(NULL) *************** *** 71,81 **** InitDropper(this, NULL); } - // --------------------------------------------------------------------------- - // WritablePlanView::~WritablePlanView() - // --------------------------------------------------------------------------- - // - WritablePlanView::~WritablePlanView() { --- 69,77 ---- InitDropper(this, NULL); } + // --------------------------------------------------------------------------- + /// ~WritablePlanView + // WritablePlanView::~WritablePlanView() { *************** *** 83,95 **** delete _selected; } - // --------------------------------------------------------------------------- - // void WritablePlanView::SetActivePath( Path* activePath ) - // --------------------------------------------------------------------------- - // - /* Sets the given path as the active path, which will be assigned to the next element created. Throws a fault if there is already a current active path. */ ! void ! WritablePlanView::SetActivePath( Path* activePath ) { PRECONDITION(activePath != NULL); --- 79,91 ---- delete _selected; } ! // --------------------------------------------------------------------------- ! /// SetActivePath ! // ! /// Sets the given path as the active path, which will be assigned to the next element created. ! /// Throws a fault if there is already a current active path. ! // ! void WritablePlanView::SetActivePath( Path* activePath ) { PRECONDITION(activePath != NULL); *************** *** 99,123 **** _activePath = activePath; } - // --------------------------------------------------------------------------- - // Path* WritablePlanView::GetActivePath() - // --------------------------------------------------------------------------- - // - /* Get the current active path. */ ! Path* ! WritablePlanView::GetActivePath() { return _activePath; } - // --------------------------------------------------------------------------- - // void WritablePlanView::ClearActivePath() - // --------------------------------------------------------------------------- - // - /* Clear the current active path and dispose the path object. Use after assigning the path to an element. */ ! void ! WritablePlanView::ClearActivePath() { if(_activePath != NULL) --- 95,117 ---- _activePath = activePath; } ! // --------------------------------------------------------------------------- ! /// GetActivePath ! // ! /// Get the current active path. ! // ! Path* WritablePlanView::GetActivePath() { return _activePath; } ! // --------------------------------------------------------------------------- ! /// ClearActivePath ! // ! /// Clear the current active path and dispose the path object. Use after assigning the path to an element. ! // ! void WritablePlanView::ClearActivePath() { if(_activePath != NULL) *************** *** 128,163 **** // --------------------------------------------------------------------------- ! // bool WritablePlanView::IsWritable() ! // --------------------------------------------------------------------------- // ! /* Returns true for this class, false for its superclass. */ ! ! ! bool ! WritablePlanView::IsWritable() { return true; } - // --------------------------------------------------------------------------- - // SelectedElements* WritablePlanView::GetSelectList() - // --------------------------------------------------------------------------- - // - /* Get the selected elements object. */ ! SelectedElements* ! WritablePlanView::GetSelectList() { POSTCONDITION(_selected); return _selected; } - // --------------------------------------------------------------------------- - // bool WritablePlanView::PlanPointsAreClose( planPoint_t point1, planPoint_t point2 ) - // --------------------------------------------------------------------------- - // ! bool ! WritablePlanView::PlanPointsAreClose( planPoint_t point1, planPoint_t point2 ) { Point pix1, pix2; --- 122,151 ---- // --------------------------------------------------------------------------- ! /// IsWritable // ! /// Returns true for this class, false for its superclass. ! // ! bool WritablePlanView::IsWritable() { return true; } ! // --------------------------------------------------------------------------- ! /// GetSelectList ! // ! /// Get the selected elements object ! // ! SelectedElements* WritablePlanView::GetSelectList() { POSTCONDITION(_selected); return _selected; } ! // --------------------------------------------------------------------------- ! /// PlanPointsAreClose ! // ! bool WritablePlanView::PlanPointsAreClose( planPoint_t point1, planPoint_t point2 ) { Point pix1, pix2; *************** *** 168,190 **** (abs(pix1.v - pix2.v) <= multiClick_Distance) ); } - // --------------------------------------------------------------------------- - // void WritablePlanView::UsingPath( Path* path ) - // --------------------------------------------------------------------------- - // - /* If the acti e path is == path, then clear it without deleting it, as it's being used by an element. */ ! void ! WritablePlanView::UsingPath( Path* path ) { if(path == _activePath) _activePath = NULL; // Don't delete } - // --------------------------------------------------------------------------- - // void WritablePlanView::PasteFromClipboard() - // --------------------------------------------------------------------------- - // void WritablePlanView::PasteFromClipboard() { --- 156,176 ---- (abs(pix1.v - pix2.v) <= multiClick_Distance) ); } ! // --------------------------------------------------------------------------- ! /// UsingPath ! // ! /// If the acti e path is == path, then clear it without deleting it, as it's being used by an element. ! // ! void WritablePlanView::UsingPath( Path* path ) { if(path == _activePath) _activePath = NULL; // Don't delete } + // --------------------------------------------------------------------------- + /// PasteFromClipboard + // void WritablePlanView::PasteFromClipboard() { *************** *** 196,199 **** --- 182,189 ---- } + + // --------------------------------------------------------------------------- + /// PasteFromStream + // void WritablePlanView::PasteFromStream(XGFileHandle &stream) { *************** *** 216,238 **** } // --------------------------------------------------------------------------- ! // long WritablePlanView::DoKeyPress( long arg, void* parg ) ! // --------------------------------------------------------------------------- // ! ! ! long ! WritablePlanView::DoKeyPress( long /*arg*/, void* /*parg*/ ) { return -1; } - // --------------------------------------------------------------------------- - // void WritablePlanView::Draw( XGDraw& draw ) - // --------------------------------------------------------------------------- - // ! void ! WritablePlanView::Draw() { PRECONDITION(_selected != NULL); --- 206,223 ---- } + // --------------------------------------------------------------------------- ! /// DoKeyPress // ! long WritablePlanView::DoKeyPress( long /*arg*/, void* /*parg*/ ) { return -1; } ! // --------------------------------------------------------------------------- ! /// Draw ! // ! void WritablePlanView::Draw() { PRECONDITION(_selected != NULL); *************** *** 241,252 **** _selected->DrawElements(this); } - // --------------------------------------------------------------------------- - // bool WritablePlanView::Accept( long modifiers, long itemRef, long flavor ) - // --------------------------------------------------------------------------- - // ! bool ! WritablePlanView::Accept( long /*modifiers*/, long /*itemRef*/, long flavor ) { // remove selection so that drag can't possibly be interpreted as "move elements". --- 226,235 ---- _selected->DrawElements(this); } ! // --------------------------------------------------------------------------- ! /// Accept ! // ! bool WritablePlanView::Accept( long /*modifiers*/, long /*itemRef*/, long flavor ) { // remove selection so that drag can't possibly be interpreted as "move elements". *************** *** 254,265 **** return(static_cast<UInt32>(flavor) == kMaterialDragFlavor); } - // --------------------------------------------------------------------------- - // void WritablePlanView::Track( Point where, long modifiers ) - // --------------------------------------------------------------------------- - // ! void ! WritablePlanView::Track( Point /*where*/, long /*modifiers*/ ) { } --- 237,246 ---- return(static_cast<UInt32>(flavor) == kMaterialDragFlavor); } ! // --------------------------------------------------------------------------- ! /// Track ! // ! void WritablePlanView::Track( Point /*where*/, long /*modifiers*/ ) { } *************** *** 267,288 **** // --------------------------------------------------------------------------- ! // bool WritablePlanView::DropStart( Point where, long modifiers ) ! // --------------------------------------------------------------------------- // ! ! ! bool ! WritablePlanView::DropStart( Point /*where*/, long /*modifiers*/ ) { return true; } - // --------------------------------------------------------------------------- - // bool WritablePlanView::Drop( Point where, long modifiers, long itemRef, long flavor, void* dataPtr, long dataLen ) - // --------------------------------------------------------------------------- - // ! bool ! WritablePlanView::Drop( Point where, long /*modifiers*/, long /*itemRef*/, long flavor, void* dataPtr, long dataLen ) { materialID_t *dragMaterial; --- 248,263 ---- // --------------------------------------------------------------------------- ! /// DropStart // ! bool WritablePlanView::DropStart( Point /*where*/, long /*modifiers*/ ) { return true; } ! // --------------------------------------------------------------------------- ! /// Drop ! // ! bool WritablePlanView::Drop( Point where, long /*modifiers*/, long /*itemRef*/, long flavor, void* dataPtr, long dataLen ) { materialID_t *dragMaterial; *************** *** 496,507 **** return true; } // --------------------------------------------------------------------------- ! // void WritablePlanView::DropEnd( Point where, long modifiers ) ! // --------------------------------------------------------------------------- // ! void ! WritablePlanView::DropEnd( Point /*where*/, long /*modifiers*/ ) { } --- 471,490 ---- return true; } + + // --------------------------------------------------------------------------- ! /// DropEnd // + void WritablePlanView::DropEnd( Point /*where*/, long /*modifiers*/ ) + { + } ! // --------------------------------------------------------------------------- ! /// IsElementSelected ! // ! bool WritablePlanView::IsElementSelected(Element *elem) { + return _selected->IsElementSelected(elem); } + Index: WritablePlanView.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/WritablePlanView.h,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** WritablePlanView.h 16 May 2005 22:17:39 -0000 1.6 --- WritablePlanView.h 10 May 2008 22:52:53 -0000 1.6.2.1 *************** *** 61,64 **** --- 61,65 ---- virtual bool Drop(Point where, long modifiers, long itemRef, long flavor, void* dataPtr, long dataLen); virtual void DropEnd(Point where, long modifiers); + virtual bool IsElementSelected(Element *elem); protected: Index: PlanView.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/PlanView.cpp,v retrieving revision 1.47.2.13 retrieving revision 1.47.2.14 diff -C2 -d -r1.47.2.13 -r1.47.2.14 *** PlanView.cpp 19 Mar 2008 01:37:42 -0000 1.47.2.13 --- PlanView.cpp 10 May 2008 22:52:53 -0000 1.47.2.14 *************** *** 1369,1372 **** --- 1369,1375 ---- + // --------------------------------------------------------------------------- + /// ResizeLayout + // void PlanView::ResizeLayout() { *************** *** 1397,1400 **** --- 1400,1406 ---- } + // --------------------------------------------------------------------------- + /// FillRectangle + // void PlanView::FillRectangle(planRectangle_t rect, double zDepth) { *************** *** 1416,1419 **** --- 1422,1428 ---- } + // --------------------------------------------------------------------------- + /// AllowDraw + // void PlanView::AllowDraw(bool val, const char *msg) { *************** *** 1423,1424 **** --- 1432,1441 ---- } + // --------------------------------------------------------------------------- + /// IsElementSelected + // + bool PlanView::IsElementSelected(Element *elem) + { + return false; + } + |