[GME-commit]
GMESRC/GME/Gme resource.h,1.63,1.64 GMEView.h,1.65,1.66
GMEView.cpp,1.160,1.161 GME.rc,1.135,1.136
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Jan 12 12:03:35 CST 2005
Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv29519
Modified Files:
resource.h GMEView.h GMEView.cpp GME.rc
Log Message:
Extended interface for scripting
CVS User: bogyom
Index: resource.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/resource.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** resource.h 5 Jan 2005 20:06:25 -0000 1.63
--- resource.h 12 Jan 2005 18:03:33 -0000 1.64
***************
*** 168,171 ****
--- 168,172 ----
#define IDC_STATIC_VSSDB 1105
#define IDC_STATIC_VSSPROJ 1106
+ #define IDC_GMEACTIVEBROWSERCTRL1 1107
#define IDD_PRINT_DIALOG 1538
#define IDD_PRINTSETUP_DIALOG 1539
***************
*** 336,341 ****
#define ID_VIEW_REFRESH_SOURCECONTROL 32972
#define ID_CNTX_CHECK 32973
! #define ID_EDIT_PASTESPECIAL_ASCLOSURE 32974
! #define ID_CNTX_PASTESPECIAL_ASCLOSURE 32975
#define IDC_BTNSELECT 33000
#define IDC_BTNDESELECT 33001
--- 337,343 ----
#define ID_VIEW_REFRESH_SOURCECONTROL 32972
#define ID_CNTX_CHECK 32973
! #define ID_CNTX_LOCATE 32974
! #define ID_EDIT_PASTESPECIAL_ASCLOSURE 32975
! #define ID_CNTX_PASTESPECIAL_ASCLOSURE 32976
#define IDC_BTNSELECT 33000
#define IDC_BTNDESELECT 33001
***************
*** 357,362 ****
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 211
! #define _APS_NEXT_COMMAND_VALUE 32976
! #define _APS_NEXT_CONTROL_VALUE 1107
#define _APS_NEXT_SYMED_VALUE 115
#endif
--- 359,364 ----
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 211
! #define _APS_NEXT_COMMAND_VALUE 32977
! #define _APS_NEXT_CONTROL_VALUE 1109
#define _APS_NEXT_SYMED_VALUE 115
#endif
Index: GMEView.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** GMEView.h 5 Jan 2005 20:06:25 -0000 1.65
--- GMEView.h 12 Jan 2005 18:03:33 -0000 1.66
***************
*** 221,224 ****
--- 221,225 ----
void ZoomIn(CPoint point);
void ZoomRect(CRect srect);
+ void ZoomToFCOs(CRect rect);
void ShowRegistryBrowser(CComPtr<IMgaFCO> fco);
void ShowAnnotationBrowser(CComPtr<IMgaFCO> fco, CComPtr<IMgaRegNode> focus);
***************
*** 267,270 ****
--- 268,275 ----
// Generated message map functions
+ public:
+ void ShowGrid(bool show);
+ void AttributepanelPage(long page);
+ void ZoomPercent(long percent);
protected:
//{{AFX_MSG(CGMEView)
***************
*** 349,354 ****
--- 354,361 ----
afx_msg void OnCntxInterpret();
afx_msg void OnCntxCheck();
+ afx_msg void OnCntxLocate();
afx_msg void OnUpdateCntxInterpret(CCmdUI* pCmdUI);
afx_msg void OnUpdateCntxCheck(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateCntxLocate(CCmdUI* pCmdUI);
afx_msg void OnCntxRegistry();
afx_msg void OnEditRegistry();
Index: GMEView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.160
retrieving revision 1.161
diff -C2 -d -r1.160 -r1.161
*** GMEView.cpp 5 Jan 2005 20:50:54 -0000 1.160
--- GMEView.cpp 12 Jan 2005 18:03:33 -0000 1.161
***************
*** 331,336 ****
--- 331,338 ----
ON_COMMAND(ID_CNTX_INTERPRET, OnCntxInterpret)
ON_COMMAND(ID_CNTX_CHECK, OnCntxCheck)
+ ON_COMMAND(ID_CNTX_LOCATE, OnCntxLocate)
ON_UPDATE_COMMAND_UI(ID_CNTX_INTERPRET, OnUpdateCntxInterpret)
ON_UPDATE_COMMAND_UI(ID_CNTX_CHECK, OnUpdateCntxCheck)
+ ON_UPDATE_COMMAND_UI(ID_CNTX_LOCATE, OnUpdateCntxLocate)
ON_COMMAND(ID_CNTX_REGISTRY, OnCntxRegistry)
ON_COMMAND(ID_EDIT_REGISTRY, OnEditRegistry)
***************
*** 4230,4233 ****
--- 4232,4241 ----
}
+ void CGMEView::ShowGrid(bool show)
+ {
+ drawGrid = show;
+ Invalidate();
+ }
+
void CGMEView::OnViewGrid()
{
***************
*** 4430,4433 ****
--- 4438,4457 ----
}
+ void CGMEView::AttributepanelPage(long page)
+ {
+ switch (page)
+ {
+ case 0:
+ ShowAttributes();
+ break;
+ case 1:
+ ShowPreferences();
+ break;
+ case 2:
+ ShowProperties();
+ break;
+ }
+ }
+
void CGMEView::OnCntxPreferences()
{
***************
*** 5352,5355 ****
--- 5376,5407 ----
}
+ void CGMEView::OnCntxLocate()
+ {
+ // ??
+ // position the Object Browser to the selected or current object
+ CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxLocate\r\n");
+ CGMEEventLogger::LogGMEEvent(" Selected FCO:");
+ GMEEVENTLOG_GUIFCOS(selected);
+
+ MSGTRY
+ {
+ CComPtr<IMgaFCO> selfco;
+
+ if (selected.IsEmpty())
+ selfco = currentModel;
+ else
+ {
+ POSITION pos = selected.GetHeadPosition();
+ selfco = selected.GetNext(pos)->mgaFco;
+ }
+ BeginTransaction(TRANSACTION_READ_ONLY);
+ BSTR IDObj = NULL;
+ selfco->get_ID(&IDObj);
+ CommitTransaction();
+ CGMEBrowser::theInstance->FocusItem(IDObj);
+ }
+ MSGCATCH("Error while trying to check the selected or current model",;)
+ }
+
void CGMEView::OnUpdateCntxCheck(CCmdUI* pCmdUI)
{
***************
*** 5362,5365 ****
--- 5414,5422 ----
}
+ void CGMEView::OnUpdateCntxLocate(CCmdUI* pCmdUI)
+ {
+ pCmdUI->Enable(!selected.IsEmpty() || currentModel != NULL);
+ }
+
void CGMEView::OnCntxRegistry()
{
***************
*** 6236,6239 ****
--- 6293,6349 ----
}
+ void CGMEView::ZoomToFCOs(CRect srect)
+ {
+ // perform a zoom to that rectangle
+ CRect crect;
+ GetClientRect(&crect);
+ CSize sizeSb;
+ GetScrollBarSizes(sizeSb);
+ if (m_noHscroll) // let's suppose it will be after zoom
+ crect.bottom -= sizeSb.cy;
+ if (m_noVscroll) // let's suppose it will be
+ crect.right -= sizeSb.cx;
+
+ int curzoom = m_zoomVal;
+ CRect ori_proj = srect;
+ srect.OffsetRect(-CPoint(srect.left, srect.top));
+
+ int zoom = (int)min(100.*crect.Height()/srect.Height(), 100.*crect.Width()/srect.Width());
+ m_zoomVal = (zoom<ZOOM_MIN)? ZOOM_MIN: ((zoom>ZOOM_MAX)? ZOOM_MAX: zoom);
+
+ if (m_zoomVal != curzoom)
+ frame->propBar.SetZoomVal(m_zoomVal);
+ CMainFrame::theInstance->WriteStatusZoom(m_zoomVal);
+ m_zoomP.x = m_zoomP.y = 0;
+
+ CPoint scp = GetScrollPosition(); // upper corner of scrolling
+
+ {
+ CWindowDC dc(NULL);
+ dc.SetMapMode(MM_ISOTROPIC);
+ dc.SetWindowExt(100,100);
+ dc.SetViewportExt(curzoom, curzoom);
+ dc.LPtoDP(&ori_proj);
+ dc.LPtoDP(&scp);
+ }
+ CPoint home = CPoint(ori_proj.left, ori_proj.top);
+ CSize orisize_srect(ori_proj.Width(), ori_proj.Height());
+
+ CPoint point = home - scp;
+ point.x += orisize_srect.cx/2;
+ point.y += orisize_srect.cy/2;
+
+ // prevous zoom value : curzoom
+ // new zoom value stored in m_zoomVal
+ // point : win client coordinates - this image point has to be centered
+ setZoomPoint(curzoom, point);
+ Invalidate();
+ }
+
+ void CGMEView::ZoomPercent(long percent)
+ {
+ OnZoom(0, (LPARAM)percent);
+ }
+
LRESULT CGMEView::OnZoom(WPARAM, LPARAM lParam)
{
***************
*** 6280,6283 ****
--- 6390,6395 ----
setZoomPoint(curzoom, point);
+ frame->propBar.SetZoomVal(m_zoomVal);
+ CMainFrame::theInstance->WriteStatusZoom(m_zoomVal);
Invalidate();
}
Index: GME.rc
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GME.rc,v
retrieving revision 1.135
retrieving revision 1.136
diff -C2 -d -r1.135 -r1.136
*** GME.rc 5 Jan 2005 20:06:25 -0000 1.135
--- GME.rc 12 Jan 2005 18:03:33 -0000 1.136
***************
*** 381,384 ****
--- 381,385 ----
MENUITEM "Interpret", ID_CNTX_INTERPRET
MENUITEM "Check", ID_CNTX_CHECK
+ MENUITEM "Locate", ID_CNTX_LOCATE
MENUITEM SEPARATOR
MENUITEM "Help", ID_CNTX_HELP
***************
*** 498,501 ****
--- 499,503 ----
MENUITEM "Interpret", ID_CNTX_INTERPRET
MENUITEM "Check", ID_CNTX_CHECK
+ MENUITEM "Locate", ID_CNTX_LOCATE
MENUITEM SEPARATOR
MENUITEM "Help", ID_CNTX_HELP
***************
*** 615,621 ****
FONT 8, "MS Sans Serif"
BEGIN
! CONTROL "",IDC_GME_ACTIVE_BROWSER_CTRL,
! "{DD4F2DEB-D064-4844-9EE1-04673C872E7B}",WS_TABSTOP,11,
! 121,230,128
END
--- 617,623 ----
FONT 8, "MS Sans Serif"
BEGIN
! CONTROL "",IDC_GMEACTIVEBROWSERCTRL1,
! "{DD4F2DEB-D064-4844-9EE1-04673C872E7B}",WS_TABSTOP,10,
! 10,233,53
END
***************
*** 1178,1183 ****
IDD_BROWSER_DIALOG DLGINIT
BEGIN
! IDC_GME_ACTIVE_BROWSER_CTRL, 0x376, 20, 0
! 0x0000, 0x0000, 0x0000, 0x0001, 0x23a8, 0x0000, 0x157f, 0x0000, 0x0000,
0x0000,
0
--- 1180,1185 ----
IDD_BROWSER_DIALOG DLGINIT
BEGIN
! IDC_GMEACTIVEBROWSERCTRL1, 0x376, 20, 0
! 0x0000, 0x0000, 0x0000, 0x0001, 0x2688, 0x0000, 0x08c4, 0x0000, 0x0000,
0x0000,
0
***************
*** 1442,1445 ****
--- 1444,1448 ----
ID_EDIT_COPYCLOSURE "Copy a closure of the selected objects to the Clipboard"
ID_CNTX_CHECK "Check selected or current model"
+ ID_CNTX_LOCATE "Locate in Object Browser"
END
More information about the GME-commit
mailing list