[GME-commit]
GMESRC/GME/Gme GMEView.cpp,1.186,1.187 GMEView.h,1.72,1.73
GUIObject.cpp,1.54,1.55 GUIObject.h,1.24,1.25
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Oct 18 00:04:24 CDT 2006
Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv12040
Modified Files:
GMEView.cpp GMEView.h GUIObject.cpp GUIObject.h
Log Message:
Fixes for JIRA entry GME-140.
An object sometimes can not be moved (leftclick + dropped) inside a model.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: GMEView.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.186
retrieving revision 1.187
diff -C2 -d -r1.186 -r1.187
*** GMEView.cpp 9 Oct 2006 15:30:50 -0000 1.186
--- GMEView.cpp 17 Oct 2006 23:04:22 -0000 1.187
***************
*** 1405,1412 ****
}
! void CGMEView::SendNow()
{
if( m_lstSelect.empty() && m_lstUnselect.empty())
! return;
bool ok = true;
--- 1405,1412 ----
}
! bool CGMEView::SendNow()
{
if( m_lstSelect.empty() && m_lstUnselect.empty())
! return false;
bool ok = true;
***************
*** 1448,1452 ****
--- 1448,1454 ----
ok = false;
}
+ return ok;
}
+
void CGMEView::ResetParent()
{
***************
*** 2685,2688 ****
--- 2687,2691 ----
ResetParent();
if( brw_refresh_needed) CGMEBrowser::theInstance->RefreshAll();
+ this->SetFocus();
}
***************
*** 3932,3936 ****
}
}
! Invalidate();
}
break;
--- 3935,3940 ----
}
}
! bool succ = this->SendNow();
! Invalidate( succ);
}
break;
***************
*** 4103,4107 ****
dragSource = 0;
CScrollZoomView::OnLButtonDown(nFlags, point);
- this->SendNow();
}
--- 4107,4110 ----
Index: GUIObject.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GUIObject.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** GUIObject.h 6 Jul 2005 23:09:11 -0000 1.24
--- GUIObject.h 17 Oct 2006 23:04:22 -0000 1.25
***************
*** 162,165 ****
--- 162,166 ----
int GetParentAspect() { return parentAspect; }
CGuiMetaModel *GetGuiMetaParent();
+ CGMEView *GetView() { return view; }
static bool IsPrimary(CGuiMetaModel *guiMetaModel,CGuiMetaAspect *guiAspect,CComPtr<IMgaMetaRole> &metaRole);
Index: GUIObject.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GUIObject.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** GUIObject.cpp 15 Mar 2006 20:05:19 -0000 1.54
--- GUIObject.cpp 17 Oct 2006 23:04:22 -0000 1.55
***************
*** 1518,1521 ****
--- 1518,1535 ----
CGMEEventLogger::LogGMEEvent("CGuiObject::ShiftModels ");
GMEEVENTLOG_GUIOBJS(objList);
+
+ CGuiObject *first_obj = objList.GetHead();
+ if( first_obj && first_obj->GetView() && first_obj->GetView() != modelGrid.GetSource())
+ {
+ // if the view where the object was moved and the view of the grid
+ // do not correspond, we must clear & update the grid.
+ // possible because if a port is moved inside a model, then the model
+ // is redrawn as well, and modelGrid is a global variable.
+ // clearing only the grid would be too dangerous, would allow any movement
+ // because other objects will disappear from the radar
+ // but a Clear with a FillModelGrid will do the correct update
+ modelGrid.Clear();
+ first_obj->GetView()->FillModelGrid();
+ }
POSITION pos = objList.GetHeadPosition();
while(pos) {
***************
*** 1542,1545 ****
--- 1556,1574 ----
GMEEVENTLOG_GUIOBJS(modelList);
ASSERT(right == 0 || down == 0); // cannot nudge diagonally for now
+
+ CGuiObject *first_obj = modelList.GetHead();
+ if( first_obj && first_obj->GetView() && first_obj->GetView() != modelGrid.GetSource())
+ {
+ // if the view where the object was nudged and the view of the grid
+ // do not correspond, we must clear & update the grid
+ // possible because if a port is moved inside a model, then the model
+ // is redrawn as well, and modelGrid is a global variable.
+ // clearing only the grid would be too dangerous, would allow nudging always
+ // because other objects will not seem to sit in their places
+ // but a Clear with a FillModelGrid will do the correct update
+ modelGrid.Clear();
+ first_obj->GetView()->FillModelGrid();
+ }
+
POSITION pos = modelList.GetHeadPosition();
while(pos) {
Index: GMEView.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** GMEView.h 9 Oct 2006 15:30:50 -0000 1.72
--- GMEView.h 17 Oct 2006 23:04:22 -0000 1.73
***************
*** 160,164 ****
bool SendUnselEvent4List( CGuiObjectList* pSelectedList);
bool SendMouseOver4Object( CGuiObject * object);
! void SendNow();
std::list<CGuiObject*> m_lstSelect;
std::list<CGuiObject*> m_lstUnselect;
--- 160,164 ----
bool SendUnselEvent4List( CGuiObjectList* pSelectedList);
bool SendMouseOver4Object( CGuiObject * object);
! bool SendNow();
std::list<CGuiObject*> m_lstSelect;
std::list<CGuiObject*> m_lstUnselect;
More information about the GME-commit
mailing list