[GME-commit]
GMESRC/GME/Gme GME.rc,1.150,1.151 GMEApp.cpp,1.138,1.139
GMEApp.h,1.32,1.33 GMEDoc.cpp,1.32,1.33 GMEDoc.h,1.14,1.15
GMEOLEApp.cpp,1.13,1.14 GMEOLEApp.h,1.7,1.8 GMEView.cpp,1.178,1.179
MgaOpenDlg.cpp,1.14,1.15 MgaOpenDlg.h,1.6,1.7
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Mon May 1 18:20:14 CDT 2006
Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv30558/Gme
Modified Files:
GME.rc GMEApp.cpp GMEApp.h GMEDoc.cpp GMEDoc.h GMEOLEApp.cpp
GMEOLEApp.h GMEView.cpp MgaOpenDlg.cpp MgaOpenDlg.h
Log Message:
Commiting
MGA:
-------
-mga notification sent upon status change from RW2RO or RO2RW (RO-read only, RW-read write)
GMEOLE:
-------
-setworkingdirectory method introd into IGMEOLEApp (will affect the SaveAs dialog's current directory)
-setcompforkind: enable/disable comps also when no model is opened
GME:
-------
-SaveAs dialog offers possibility to save an Mga file with custom extensions also (in the Save as Type dropdown control), however the format is still mga. (feature requested for CAPE project)
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: GMEOLEApp.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEOLEApp.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** GMEOLEApp.h 30 Jan 2006 20:47:54 -0000 1.7
--- GMEOLEApp.h 1 May 2006 17:20:11 -0000 1.8
***************
*** 96,99 ****
--- 96,100 ----
afx_msg void SetCompFiltering( BOOL pOn);
afx_msg BOOL GetCompFiltering();
+ afx_msg void SetWorkingDirectory( LPCTSTR pPath);
DECLARE_DISPATCH_MAP()
***************
*** 149,152 ****
--- 150,154 ----
STDMETHOD(SetCompFiltering)( THIS_ VARIANT_BOOL pOn);
STDMETHOD(GetCompFiltering)( THIS_ VARIANT_BOOL* pOn);
+ STDMETHOD(SetWorkingDirectory)(THIS_ BSTR pPath);
END_DUAL_INTERFACE_PART(Dual)
Index: GMEView.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -C2 -d -r1.178 -r1.179
*** GMEView.cpp 30 Jan 2006 20:47:54 -0000 1.178
--- GMEView.cpp 1 May 2006 17:20:11 -0000 1.179
***************
*** 482,485 ****
--- 482,488 ----
{
if(--instanceCount <= 0) {
+ // update & disable some components
+ theApp.UpdateCompList4CurrentKind( CGMEApp::m_no_model_open_string);
+
delete offScreen;
delete ofsbmp;
Index: GMEDoc.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEDoc.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** GMEDoc.cpp 14 Feb 2006 18:51:23 -0000 1.32
--- GMEDoc.cpp 1 May 2006 17:20:11 -0000 1.33
***************
*** 635,638 ****
--- 635,651 ----
}
+ int CGMEDoc::HowManyViewsAreOpen()
+ {
+ int i = 0;
+ POSITION pos = GetFirstViewPosition();
+ if(pos) {
+ while (pos != NULL) {
+ CGMEView* pView = (CGMEView *)GetNextView(pos);
+ ++i;
+ }
+ }
+ return i;
+ }
+
void CGMEDoc::ResetAllViews()
{
Index: GMEOLEApp.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEOLEApp.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** GMEOLEApp.cpp 1 Feb 2006 19:39:03 -0000 1.13
--- GMEOLEApp.cpp 1 May 2006 17:20:11 -0000 1.14
***************
*** 120,123 ****
--- 120,124 ----
DISP_FUNCTION(CGMEOLEApp, "SetCompFiltering", SetCompFiltering, VT_EMPTY, VTS_BOOL)
DISP_FUNCTION(CGMEOLEApp, "GetCompFiltering", GetCompFiltering, VT_BOOL, VTS_NONE)
+ DISP_FUNCTION(CGMEOLEApp, "SetWorkingDirectory", SetWorkingDirectory, VT_EMPTY, VTS_BSTR)
//}}AFX_DISPATCH_MAP
***************
*** 715,718 ****
--- 716,726 ----
}
+ void CGMEOLEApp::SetWorkingDirectory( LPCTSTR pPath)
+ {
+ CGMEEventLogger::LogGMEEvent("CGMEOLEApp::SetWorkingDirectory()\r\n");
+ bool rv = theApp.SetWorkingDirectory( pPath);
+ if( !rv) throw CString("Error happened");
+ }
+
DELEGATE_DUAL_INTERFACE(CGMEOLEApp, Dual)
***************
*** 1288,1290 ****
}
CATCH_ALL_DUAL
! }
\ No newline at end of file
--- 1296,1310 ----
}
CATCH_ALL_DUAL
! }
!
! STDMETHODIMP CGMEOLEApp::XDual::SetWorkingDirectory(BSTR pPath)
! {
! METHOD_PROLOGUE(CGMEOLEApp, Dual)
!
! TRY_DUAL(IID_IGMEOLEApp)
! {
! pThis->SetWorkingDirectory( CString( pPath));
! return NOERROR;
! }
! CATCH_ALL_DUAL
! }
Index: GMEDoc.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEDoc.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** GMEDoc.h 30 Jan 2006 20:47:54 -0000 1.14
--- GMEDoc.h 1 May 2006 17:20:11 -0000 1.15
***************
*** 35,38 ****
--- 35,39 ----
public:
GMEModeCode GetEditMode() { return editMode; }
+ int HowManyViewsAreOpen();
void InvalidateAllViews(bool thorough = false, bool fullAutoRoute = false);
void ResetAllViews();
Index: GME.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GME.rc,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** GME.rc 17 Mar 2006 15:55:22 -0000 1.150
--- GME.rc 1 May 2006 17:20:11 -0000 1.151
***************
*** 632,636 ****
7,135,165,8
DEFPUSHBUTTON "OK",IDOK,65,151,43,12,WS_GROUP
! CTEXT "GENERIC MODELING ENVIRONMENT 5",IDC_STATIC,7,55,165,8
CONTROL 184,IDC_BMPABOUT,"Static",SS_BITMAP | SS_NOTIFY,7,7,165,
45
--- 632,636 ----
7,135,165,8
DEFPUSHBUTTON "OK",IDOK,65,151,43,12,WS_GROUP
! CTEXT "GENERIC MODELING ENVIRONMENT 6",IDC_STATIC,7,55,165,8
CONTROL 184,IDC_BMPABOUT,"Static",SS_BITMAP | SS_NOTIFY,7,7,165,
45
Index: GMEApp.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEApp.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** GMEApp.h 1 Feb 2006 19:48:19 -0000 1.32
--- GMEApp.h 1 May 2006 17:20:11 -0000 1.33
***************
*** 100,106 ****
ONE_COMP_MAP m_compsOfKind;
- // set of the non-modal comps (those which are not effected by the gui activity, kind selected)
- ONE_COMP_LIST m_nonModalComps;
-
//
// component filter related private methods
--- 100,103 ----
***************
*** 120,123 ****
--- 117,126 ----
void UpdateCompList4CurrentKind( const CString& kind);
+ static const char * m_no_model_open_string;
+
+ // directory preferred by the user
+ CString m_preferredPath;
+ // called from CGMEOLEAPP:
+ bool SetWorkingDirectory( LPCTSTR pPath);
public:
Index: GMEApp.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEApp.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -d -r1.138 -r1.139
*** GMEApp.cpp 28 Feb 2006 19:57:05 -0000 1.138
--- GMEApp.cpp 1 May 2006 17:20:11 -0000 1.139
***************
*** 39,42 ****
--- 39,43 ----
#include "meta_i.c"
#include "Splash.h"
+
CComModule _Module;
/////////////////////////////////////////////////////////////////////////////
***************
*** 108,111 ****
--- 109,113 ----
+ /*static*/ const char * CGMEApp::m_no_model_open_string = "_NO_MODEL_IS_OPEN_";
/////////////////////////////////////////////////////////////////////////////
***************
*** 315,318 ****
--- 317,325 ----
// Application was run with /Embedding or /Automation. Don't show the
// main window in this case.
+
+ //
+ // load settings in this case as well
+ GetSettings();
+
return TRUE;
}
***************
*** 1501,1505 ****
void CGMEApp::OnFileSaveAs() {
CMgaOpenDlg dlg(CMgaOpenDlg::SaveAsDialog);
! CString conn = dlg.AskMGAConnectionString();
CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileSaveAs "+conn+"\r\n");
--- 1508,1523 ----
void CGMEApp::OnFileSaveAs() {
CMgaOpenDlg dlg(CMgaOpenDlg::SaveAsDialog);
! CString spec_ext;
! if( currentConnection.Left(4) == "MGA=") // if MGA format
! {
! int rps = currentConnection.ReverseFind('.');
! if( rps != -1 && rps < currentConnection.GetLength())
! {
! spec_ext = currentConnection.Mid( rps + 1);
! if( spec_ext.CompareNoCase( "mga") == 0) // oh, just the plain 'mga' extension
! spec_ext = ""; // we need not have specific behaviour
! }
! }
! CString conn = dlg.AskMGAConnectionString( spec_ext);
CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileSaveAs "+conn+"\r\n");
***************
*** 1572,1576 ****
COMTHROW( dumper->DumpProject(theApp.mgaProject,PutInBstr(dlg.GetPathName())) );
! AfxMessageBox("The XML file was successfully exported.");
}
MSGCATCH("Error while generating XML file",;)
--- 1590,1595 ----
COMTHROW( dumper->DumpProject(theApp.mgaProject,PutInBstr(dlg.GetPathName())) );
! //AfxMessageBox("The XML file was successfully exported.");
! CMainFrame::theInstance->m_console.Message( "The XML file was successfully exported.", 1);
}
MSGCATCH("Error while generating XML file",;)
***************
*** 1740,1744 ****
OnFileSave();
}
! AfxMessageBox("The XML file was successfully imported.");
keep_on = false;
}
--- 1759,1764 ----
OnFileSave();
}
! //AfxMessageBox("The XML file was successfully imported.");
! CMainFrame::theInstance->m_console.Message( "The XML file was successfully imported.", 1);
keep_on = false;
}
***************
*** 1762,1766 ****
{
CopyTo( result, new_file_name);
! AfxMessageBox("Continuing to Import XML...");
keep_on = true;
}
--- 1782,1787 ----
{
CopyTo( result, new_file_name);
! //AfxMessageBox("Continuing to Import XML...");
! CMainFrame::theInstance->m_console.Message( "Continuing to Import XML...", 1);
keep_on = true;
}
***************
*** 2595,2610 ****
++nm_of_tokens;
! t_kind = pKindSeq.Tokenize( ";", pos); // move to the next token
! }
!
! if( nm_of_tokens == 0) // no real information provided, or parse failed
! {
! // this component is non-modal will be enabled for every kind
! if( m_nonModalComps.find( pComp) == m_nonModalComps.end()) // not found
! m_nonModalComps.insert( m_nonModalComps.end(), pComp); // so insert it
}
}
! // this method is called from CGMEView::OnActivateView
void CGMEApp::UpdateCompList4CurrentKind( const CString& pKind)
{
--- 2616,2626 ----
++nm_of_tokens;
! t_kind = pKindSeq.Tokenize( ";", pos); // move to next token
}
}
! // this method is called from CGMEView::OnActivateView (with the kindname shown)
! // CGMEView::~CGMEView (with the special string: _NO_MODEL_IS_OPEN_ == m_no_model_open_string)
! // CGMEApp::SetCompFiltering (with one from the items above)
void CGMEApp::UpdateCompList4CurrentKind( const CString& pKind)
{
***************
*** 2627,2635 ****
DisableComp( *it, true); // disable comps which are registered for this kind
}
-
- for( ONE_COMP_LIST::const_iterator it = m_nonModalComps.begin(); it != m_nonModalComps.end(); ++it)
- {
- DisableComp( *it, false); // enable
- }
} // if this kind has no assigned [excluded] component set: NOP [every component is enabled]
}
--- 2643,2646 ----
***************
*** 2642,2645 ****
--- 2653,2674 ----
ClearDisabledComps(); // reset all to original state (enabled)
}
+ else // turned ON
+ {
+ // find the current view
+ bool found = false;
+ CMDIChildWnd *pChild = CMainFrame::theInstance->MDIGetActive();
+ if( pChild)
+ {
+ CGMEView *view = (CGMEView*)pChild->GetActiveView();
+ if( view && view->guiMeta)
+ {
+ found = true;
+ this->UpdateCompList4CurrentKind( view->guiMeta->name);
+ }
+ }
+
+ if( !found)
+ this->UpdateCompList4CurrentKind( CGMEApp::m_no_model_open_string);
+ }
}
***************
*** 2647,2649 ****
--- 2676,2686 ----
{
return m_compFilterOn;
+ }
+
+ bool CGMEApp::SetWorkingDirectory( LPCTSTR pPath)
+ {
+ m_preferredPath = pPath;
+ return SetCurrentDirectory( pPath) == TRUE;
+ //int sc = _chdir( pPath);
+ //return sc == 0;
}
Index: MgaOpenDlg.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MgaOpenDlg.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** MgaOpenDlg.h 24 Jun 2005 17:58:01 -0000 1.6
--- MgaOpenDlg.h 1 May 2006 17:20:11 -0000 1.7
***************
*** 32,36 ****
CString AskConnectionString(bool meta);
! CString AskMGAConnectionString();
static CString PruneConnectionString(const CString &conn);
--- 32,36 ----
CString AskConnectionString(bool meta);
! CString AskMGAConnectionString( const CString& spec_ext = "");
static CString PruneConnectionString(const CString &conn);
Index: MgaOpenDlg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MgaOpenDlg.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MgaOpenDlg.cpp 14 Sep 2005 15:20:23 -0000 1.14
--- MgaOpenDlg.cpp 1 May 2006 17:20:11 -0000 1.15
***************
*** 86,90 ****
static char mgafilter[] = "MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
! "Microsoft Access Files (*.mdb)|*.mdb||";
/*static char mgafilter[] = "MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
--- 86,93 ----
static char mgafilter[] = "MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
! "Microsoft Access Files (*.mdb)|*.mdb|All files (*.*)|*.*||";
!
! /*static char mgafilter[] = "MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
! "Microsoft Access Files (*.mdb)|*.mdb||";*/
/*static char mgafilter[] = "MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
***************
*** 94,108 ****
static char metafilter[] = "MGA Meta Files (*.mta)|*.mta|XML Paradigm Files (*.xmp)|*.xmp|"
! "Microsoft Access Files (*.mdb)|*.mdb||";
! CString CMgaOpenDlg::AskMGAConnectionString() {
CString conn;
CFileDialog dlg(flag_isopen ? TRUE : FALSE, NULL, NULL,
OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
! 0, mgaonlyfilter);
if( dlg.DoModal() == IDOK ) {
! conn = CString("MGA=") + dlg.GetPathName();
! if(dlg.GetFileExt() == "") { conn += ".mga"; }
}
return conn;
--- 97,139 ----
static char metafilter[] = "MGA Meta Files (*.mta)|*.mta|XML Paradigm Files (*.xmp)|*.xmp|"
! "Microsoft Access Files (*.mdb)|*.mdb|All files (*.*)|*.*||";
! CString CMgaOpenDlg::AskMGAConnectionString( const CString& spec_ext) {
! CString filters = mgaonlyfilter;
! if( !spec_ext.IsEmpty())
! {
! CString SPEC_EXT = spec_ext; SPEC_EXT.MakeUpper();
! CString spec_filter;
! // as "MGA Files (*.mga)|*.mga|"
! spec_filter.Format( "%s Files (*.%s)|*.%s|", SPEC_EXT, spec_ext, spec_ext);
! // insert this filter at the beginning (thus preferred)
! filters.Insert( 0, spec_filter);
! }
!
CString conn;
CFileDialog dlg(flag_isopen ? TRUE : FALSE, NULL, NULL,
OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
! 0, filters);
!
! // if preferred path was set by the user then change to that directory
! if( !theApp.m_preferredPath.IsEmpty())
! {
! OPENFILENAME &ofn = dlg.GetOFN();
! // better be successful in order to use in ofn structure
! if( theApp.SetWorkingDirectory( theApp.m_preferredPath))
! ofn.lpstrInitialDir = theApp.m_preferredPath;
! }
!
if( dlg.DoModal() == IDOK ) {
! conn = CString("MGA=") + dlg.GetPathName();
! if(dlg.GetFileExt() == "") // no extension specified by the user
! {
! conn += ".";
! // if spec_ext is NOT empty then
! // filterindex = 1 stands for special extension
! // = 2 is the MGA
! conn += dlg.m_ofn.nFilterIndex == 1 && !spec_ext.IsEmpty() ? spec_ext:"mga";
! }
}
return conn;
***************
*** 157,160 ****
--- 188,192 ----
switch( dlg.m_ofn.nFilterIndex )
{
+ case 4:
case 1:
conn = CString("MGA=") + dlg.GetPathName() + (meta ? ".mta" : ".mga");
***************
*** 174,177 ****
--- 206,210 ----
switch( dlg.m_ofn.nFilterIndex )
{
+ case 4:
case 1:
conn = CString("MGA=") + dlg.GetPathName();
More information about the GME-commit
mailing list