[GME-commit] GMESRC/GME/Gme GME.rc,1.147,1.148 GME.vcproj,1.2,1.3
GMEApp.cpp,1.135,1.136 GMEApp.h,1.30,1.31 GMEDoc.cpp,1.30,1.31
GMEDoc.h,1.13,1.14 GMEOLEApp.cpp,1.11,1.12 GMEOLEApp.h,1.6,1.7
GMEStd.h,1.26,1.27 GMEView.cpp,1.177,1.178 MainFrm.cpp,1.32,1.33
MainFrm.h,1.24,1.25 resource.h,1.68,1.69 sizecbar.cpp,1.1,1.2
sizecbar.h,1.2,1.3
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Mon Jan 30 20:48:02 CST 2006
Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv30103
Modified Files:
GME.rc GME.vcproj GMEApp.cpp GMEApp.h GMEDoc.cpp GMEDoc.h
GMEOLEApp.cpp GMEOLEApp.h GMEStd.h GMEView.cpp MainFrm.cpp
MainFrm.h resource.h sizecbar.cpp sizecbar.h
Log Message:
-Non-sticky connect/disconnect mode added
-Toolbars floatable/redockable
ReBar is not used anymore,
Main toolbar splitted in two,
New bitmaps added for these
-Control bar paint changed if floating
-Component launch can be restricted (Icon grayed out) based on the active view (focused model)
-Paradigm registered into user registry if an .xmp or .mta file is dropped onto the main window
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: sizecbar.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/sizecbar.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sizecbar.h 12 Jan 2005 17:53:15 -0000 1.2
--- sizecbar.h 30 Jan 2006 20:47:54 -0000 1.3
***************
*** 38,41 ****
--- 38,46 ----
//
/////////////////////////////////////////////////////////////////////////
+ // Modified by: Zoltan Molnar, @ Vanderbilt Univ. in 2006 in order to
+ // work better with the CMiniDockFrameWnd MFC class, version VS.NET 2003
+ // Details: when floating the MFC class already displays a caption and
+ // close button (x), so we avoid painting the gripper and (x)
+ /////////////////////////////////////////////////////////////////////////
#if !defined(__SIZECBAR_H__)
Index: GMEOLEApp.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEOLEApp.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** GMEOLEApp.h 15 Apr 2005 18:24:10 -0000 1.6
--- GMEOLEApp.h 30 Jan 2006 20:47:54 -0000 1.7
***************
*** 92,95 ****
--- 92,99 ----
afx_msg void GridShow(BOOL show);
afx_msg void AttributepanelPage(long page);
+ afx_msg void DisableComp(LPCTSTR pCompName, BOOL pDisable);
+ afx_msg void DisableCompForKinds( LPCTSTR pCompName, LPCTSTR pKindNameSequence);
+ afx_msg void SetCompFiltering( BOOL pOn);
+ afx_msg BOOL GetCompFiltering();
DECLARE_DISPATCH_MAP()
***************
*** 140,143 ****
--- 144,152 ----
STDMETHOD(GridShow)(THIS_ VARIANT_BOOL show);
STDMETHOD(AttributepanelPage)(THIS_ attribpanel_page page);
+
+ STDMETHOD(DisableComp)(THIS_ BSTR pCompName, VARIANT_BOOL pDisable);
+ STDMETHOD(DisableCompForKinds)(THIS_ BSTR pCompName, BSTR pKindSequence);
+ STDMETHOD(SetCompFiltering)( THIS_ VARIANT_BOOL pOn);
+ STDMETHOD(GetCompFiltering)( THIS_ VARIANT_BOOL* pOn);
END_DUAL_INTERFACE_PART(Dual)
Index: GMEApp.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEApp.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** GMEApp.h 15 Nov 2005 20:06:54 -0000 1.30
--- GMEApp.h 30 Jan 2006 20:47:54 -0000 1.31
***************
*** 14,17 ****
--- 14,19 ----
#include "resource.h" // main symbols
+ #include <set>
+ #include <map>
#define ID_FILE_PLUGINMENU 40000
***************
*** 80,85 ****
--- 82,127 ----
CString realFmtStr;
+ //
+ // component filter related fields
+ //
+
+ // the state of component filtering (not preserved through GME sessions)
+ bool m_compFilterOn;
+
+ // will store those command ids, which are disabled by the user
+ // through the ActivateComponent
+ typedef std::set<unsigned int> ONE_ID_LIST;
+ ONE_ID_LIST m_vecDisabledPlugIns;
+ ONE_ID_LIST m_vecDisabledComps;
+
+ typedef std::set<CString> ONE_COMP_LIST;
+ typedef std::map<CString, ONE_COMP_LIST > ONE_COMP_MAP;
+ // map of kind as key, and components registered for it
+ 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
+ //
+ void ClearDisabledComps();
+
+ //
+ // component filter related public methods
+ //
+ public:
+ // called from CGMEOLEApp:
+ void SetCompFiltering( bool pOn) { m_compFilterOn = pOn; }
+ bool GetCompFiltering() { return m_compFilterOn; }
+ void DisableComp(const CString& pCompToFind, bool pbHide);
+ void DisableCompForKinds( const CString& pComp, const CString& pKindSeq);
+ // called from CGMEView:
+ void UpdateCompList4CurrentKind( const CString& kind);
+
+
public:
void ImportDroppedFile(const CString& fname);
+ void RegisterDroppedFile( const CString& fname, bool userReg = true);
bool SafeCloseProject();
void CloseProject(bool updateStatusBar = true);
***************
*** 153,156 ****
--- 195,200 ----
afx_msg void OnRunPlugin(UINT nID);
afx_msg void OnRunInterpreter(UINT nID);
+ afx_msg void OnUpdateFilePluginX(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateFileInterpretX(CCmdUI* pCmdUI);
afx_msg void OnFileDisplayConstraints();
afx_msg void OnUpdateFileDisplayConstraints(CCmdUI* pCmdUI);
Index: MainFrm.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MainFrm.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** MainFrm.cpp 21 Jul 2005 12:22:25 -0000 1.32
--- MainFrm.cpp 30 Jan 2006 20:47:54 -0000 1.33
***************
*** 10,13 ****
--- 10,14 ----
#include "Splash.h"
#include "GMEEventLogger.h"
+ #include ".\mainfrm.h"
#ifdef _DEBUG
***************
*** 82,85 ****
--- 83,98 ----
ON_WM_DROPFILES()
//}}AFX_MSG_MAP
+ // By making the Menu IDs that same as the ToolBar IDs
+ // we can leverage off of code that is already provided
+ // in MFCs implementation of CFrameWnd to check, uncheck
+ // show and hide toolbars.
+ ON_COMMAND_EX(IDW_TOOLBAR_MAIN, OnBarCheck)
+ ON_COMMAND_EX(IDW_TOOLBAR_WINS, OnBarCheck)
+ ON_COMMAND_EX(IDW_TOOLBAR_DUMMY, OnBarCheck)
+ ON_COMMAND_EX(IDW_TOOLBAR_MODE, OnBarCheck)
+ ON_UPDATE_COMMAND_UI(IDW_TOOLBAR_MAIN, OnUpdateControlBarMenu)
+ ON_UPDATE_COMMAND_UI(IDW_TOOLBAR_WINS, OnUpdateControlBarMenu)
+ ON_UPDATE_COMMAND_UI(IDW_TOOLBAR_DUMMY, OnUpdateControlBarMenu)
+ ON_UPDATE_COMMAND_UI(IDW_TOOLBAR_MODE, OnUpdateControlBarMenu)
END_MESSAGE_MAP()
***************
*** 169,202 ****
return -1;
! // TOOLBAR and STATUSBAR
!
! if (!m_wndToolBar.CreateEx(this) ||
! !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
! TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
- m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
! if(!m_wndComponentBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, CRect(0, 0, 0, 0), AFX_IDW_CONTROLBAR_LAST - 1) ||
! !m_wndComponentBar.LoadToolBar(IDR_TOOLBAR_DUMMY))
{
! TRACE0("Failed to create component toolbar\n");
! return -1; // fail to create
}
- m_wndComponentBar.SetBarStyle(m_wndComponentBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
!
! if (!m_wndReBar.Create(this) ||
!
! !m_wndReBar.AddBar(&m_wndToolBar) ||
! !m_wndReBar.AddBar(&m_wndComponentBar))
{
! TRACE0("Failed to create rebar\n");
return -1; // fail to create
}
! m_wndReBar.GetReBarCtrl().MaximizeBand(1);
!
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
--- 182,257 ----
return -1;
! // 3 separate TOOLBARs are created
! //#define AFX_IDW_CONTROLBAR_FIRST 0xE800 = 59392
! //#define AFX_IDW_CONTROLBAR_LAST 0xE8FF
! //
! //#define AFX_IDW_TOOLBAR 0xE800 // main Toolbar for window
! //#define AFX_IDW_STATUS_BAR 0xE801 // Status bar window
! //#define AFX_IDW_PREVIEW_BAR 0xE802 // PrintPreview Dialog Bar
! //#define AFX_IDW_RESIZE_BAR 0xE803 // OLE in-place resize bar
! //#define AFX_IDW_REBAR 0xE804 // COMCTL32 "rebar" Bar
! //#define AFX_IDW_DIALOGBAR 0xE805 // CDialogBar
! //#define AFX_IDW_DOCKBAR_TOP 0xE81B
! //#define AFX_IDW_DOCKBAR_LEFT 0xE81C
! //#define AFX_IDW_DOCKBAR_RIGHT 0xE81D
! //#define AFX_IDW_DOCKBAR_BOTTOM 0xE81E
! //#define AFX_IDW_DOCKBAR_FLOAT 0xE81F = 59423
!
! // thus the IDW_TOOLBAR_* ids conform to these limits
! // being assigned numbers from 0xE820
!
! // -- MAIN ToolBar
! if( !m_wndToolBarMain.CreateEx(this
! , TBSTYLE_FLAT
! , WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP
! , CRect(0,0,0,0)
! , IDW_TOOLBAR_MAIN) // provide unqiue ID for each toolbar [important !!!]
! ||
! !m_wndToolBarMain.LoadToolBar(IDR_TOOLBAR_MAIN)
! )
{
! TRACE0("Failed to create main toolbar\n");
return -1; // fail to create
}
! m_wndToolBarMain.SetBarStyle(m_wndToolBarMain.GetBarStyle()
! | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
!
!
! // -- Window Arrangement ToolBar
! if( !m_wndToolBarWins.CreateEx( this
! , TBSTYLE_FLAT
! , WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP
! , CRect(0,0,0,0)
! , IDW_TOOLBAR_WINS) // provide unqiue ID for each toolbar
! ||
! !m_wndToolBarWins.LoadToolBar(IDR_TOOLBAR_WINS)
! )
{
! TRACE0("Failed to create windows toolbar\n");
! return -1;
}
! m_wndToolBarWins.SetBarStyle( m_wndToolBarWins.GetBarStyle()
! | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
!
! // -- User-defined Component ToolBar
! if( !m_wndComponentBar.CreateEx(this
! , TBSTYLE_FLAT
! , WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP
! , CRect(0, 0, 0, 0)
! , IDW_TOOLBAR_DUMMY) // provide unqiue ID for each toolbar
! ||
! !m_wndComponentBar.LoadToolBar(IDR_TOOLBAR_DUMMY)
! )
{
! TRACE0("Failed to create component toolbar\n");
return -1; // fail to create
}
! m_wndComponentBar.SetBarStyle(m_wndComponentBar.GetBarStyle()
! | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_wndComponentBar.SetBorders( 5, 0, 5, 0);
+ // STATUS BAR
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
***************
*** 211,223 ****
// PART BROWSER
if (!m_partBrowser.Create(_T("Part Browser"), this, CSize(80, 80),
! TRUE, ID_PARTBROWSER))
! {
! TRACE0("Failed to create part browser\n");
! return -1; // fail to create
}
! m_partBrowser.SetBarStyle(m_partBrowser.GetBarStyle() |
! CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_partBrowser.EnableDocking(CBRS_ALIGN_ANY);
--- 266,278 ----
// PART BROWSER
if (!m_partBrowser.Create(_T("Part Browser"), this, CSize(80, 80),
! TRUE, ID_PARTBROWSER))
! {
! TRACE0("Failed to create part browser\n");
! return -1; // fail to create
}
! m_partBrowser.SetBarStyle(m_partBrowser.GetBarStyle() |
! CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_partBrowser.EnableDocking(CBRS_ALIGN_ANY);
***************
*** 225,250 ****
// PANNING WINDOW
if (!m_pannWin.Create(_T("Panning Window"), this, CSize(80, 80),
! TRUE, ID_PANNWIN))
! {
! TRACE0("Failed to create panning Window\n");
! return -1; // fail to create
}
! m_pannWin.SetBarStyle(m_pannWin.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_pannWin.EnableDocking(CBRS_ALIGN_ANY);
// GME ACTIVE BROWSER
! if (!m_browser.Create(_T("GME Browser"), this, CSize(80, 80),
! TRUE, ID_GMEBROWSER))
! {
! TRACE0("Failed to create browser\n");
! return -1; // fail to create
}
m_browser.SetBarStyle(m_browser.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_browser.EnableDocking(CBRS_ALIGN_ANY);
--- 280,305 ----
// PANNING WINDOW
if (!m_pannWin.Create(_T("Panning Window"), this, CSize(80, 80),
! TRUE, ID_PANNWIN))
! {
! TRACE0("Failed to create panning Window\n");
! return -1; // fail to create
}
! m_pannWin.SetBarStyle(m_pannWin.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_pannWin.EnableDocking(CBRS_ALIGN_ANY);
// GME ACTIVE BROWSER
! if (!m_browser.Create(_T("GME Browser"), this, CSize(80, 80),
! TRUE, ID_GMEBROWSER))
! {
! TRACE0("Failed to create browser\n");
! return -1; // fail to create
}
m_browser.SetBarStyle(m_browser.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
! m_browser.EnableDocking(CBRS_ALIGN_ANY);
***************
*** 283,306 ****
}
!
EnableDocking(CBRS_ALIGN_ANY);
! m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
DockControlBar(&m_browser, AFX_IDW_DOCKBAR_RIGHT);
// terge
! DockControlBar(&m_partBrowser, AFX_IDW_DOCKBAR_BOTTOM);
! RecalcLayout(TRUE);
CRect rc;
! m_partBrowser.GetWindowRect(rc);
rc.OffsetRect(rc.Width(), 0);
! DockControlBar(&m_pannWin, AFX_IDW_DOCKBAR_BOTTOM, rc);
! RecalcLayout(TRUE);
! m_pannWin.GetWindowRect(rc);
rc.OffsetRect(rc.Width(), 0);
DockControlBar(&m_objectInspector,AFX_IDW_DOCKBAR_BOTTOM,rc);
RecalcLayout(TRUE);
! m_objectInspector.GetWindowRect(rc);
rc.OffsetRect(0, rc.Height());
DockControlBar(&m_console,AFX_IDW_DOCKBAR_BOTTOM,rc);
--- 338,389 ----
}
!
EnableDocking(CBRS_ALIGN_ANY);
! //m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
! // by commenting out the line above we rely on the standard MFC class
! // CMiniDockFrameWnd which allows us to undock/float/redock toolbars
! // again and again without having to deal with this process
!
! // Toolbars are dockable to any side of the frame
! m_wndToolBarMain.SetWindowText(_T("Standard"));
! m_wndToolBarMain.EnableDocking(CBRS_ALIGN_ANY);
! m_wndToolBarWins.SetWindowText(_T("Windows"));
! m_wndToolBarWins.EnableDocking(CBRS_ALIGN_ANY);
! m_wndComponentBar.SetWindowText(_T("Components"));
! m_wndComponentBar.EnableDocking(CBRS_ALIGN_ANY);
!
! DockControlBar(&m_wndToolBarMain,AFX_IDW_DOCKBAR_TOP);
!
! CRect rd;
! RecalcLayout(TRUE);
! m_wndToolBarMain.GetWindowRect(rd);
! rd.OffsetRect(rd.Width(), 0);
!
! // place next to the main toolbar
! DockControlBar(&m_wndToolBarWins, AFX_IDW_DOCKBAR_TOP, rd);
!
! RecalcLayout(TRUE);
! m_wndToolBarWins.GetWindowRect(rd);
! rd.OffsetRect(rd.Width(), 0);
!
! // place next to the wins toolbar
! DockControlBar(&m_wndComponentBar, AFX_IDW_DOCKBAR_TOP, rd);
DockControlBar(&m_browser, AFX_IDW_DOCKBAR_RIGHT);
// terge
! DockControlBar(&m_partBrowser, AFX_IDW_DOCKBAR_BOTTOM);
! RecalcLayout(TRUE);
CRect rc;
! m_partBrowser.GetWindowRect(rc);
rc.OffsetRect(rc.Width(), 0);
! DockControlBar(&m_pannWin, AFX_IDW_DOCKBAR_BOTTOM, rc);
! RecalcLayout(TRUE);
! m_pannWin.GetWindowRect(rc);
rc.OffsetRect(rc.Width(), 0);
DockControlBar(&m_objectInspector,AFX_IDW_DOCKBAR_BOTTOM,rc);
RecalcLayout(TRUE);
! m_objectInspector.GetWindowRect(rc);
rc.OffsetRect(0, rc.Height());
DockControlBar(&m_console,AFX_IDW_DOCKBAR_BOTTOM,rc);
***************
*** 314,318 ****
LoadBarState(sProfile);
}
!
// CG: The following block was inserted by 'Status Bar' component.
--- 397,401 ----
LoadBarState(sProfile);
}
!
// CG: The following block was inserted by 'Status Bar' component.
***************
*** 333,336 ****
--- 416,423 ----
}
+ // hide initially, openProject will show it if components available
+ // thus we ignore the registry settings
+ m_wndComponentBar.ShowWindow(SW_HIDE);
+
// CG: The following line was added by the Splash Screen component.
CSplashWnd::ShowSplashScreen(this);
***************
*** 872,880 ****
one_just_opened = true;
}
else
! m_console.Message( ".MGA and .XME files may be dropped only. Can't open file: " + conn + "!", 3);
}
else
m_console.Message( "Can't inquire file information!", 3);
}
}
--- 959,1011 ----
one_just_opened = true;
}
+ else if( conn.Right(4).CompareNoCase(".xmp")==0 || conn.Right(4).CompareNoCase(".mta")==0)
+ {
+ if( theApp.guiMetaProject == NULL && theApp.mgaProject == 0) // no project opened
+ {
+ m_console.Message( "Registering " + conn + " as a paradigm.", 1);
+
+ theApp.RegisterDroppedFile( conn.Right(4).CompareNoCase(".xmp")==0?"XML=" + conn:"MGA=" + conn);
+ one_just_opened = false; // we did not open a file, just registered
+ }
+ else
+ m_console.Message( "Can't register paradigm file while project is open!", 3);
+ }
else
! m_console.Message( ".MGA, .XME, .MTA, .XMP files may be dropped only. Can't open file: " + conn + "!", 3);
}
else
m_console.Message( "Can't inquire file information!", 3);
}
+ }
+
+ BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
+ {
+ // this method will show the toolbar enabler popup menu
+ // if the user right clicks on any tool bar
+ if (pMsg->message == WM_RBUTTONDOWN)
+ {
+ CWnd* pWnd = CWnd::FromHandlePermanent(pMsg->hwnd);
+ CToolBar* pBar = DYNAMIC_DOWNCAST(CToolBar, pWnd);
+
+ if (pBar != NULL)
+ {
+ CMenu Menu;
+ CPoint pt;
+
+ pt.x = LOWORD(pMsg->lParam);
+ pt.y = HIWORD(pMsg->lParam);
+ pBar->ClientToScreen(&pt);
+
+ if (Menu.LoadMenu(IDR_MYTOOLBARS_MENU))
+ {
+ CMenu* pSubMenu = Menu.GetSubMenu(0);
+
+ if (pSubMenu!=NULL)
+ {
+ pSubMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,this);
+ }
+ }
+ }
+ }
+ return CMDIFrameWnd::PreTranslateMessage(pMsg);
}
Index: MainFrm.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MainFrm.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** MainFrm.h 11 Jul 2005 17:42:19 -0000 1.24
--- MainFrm.h 30 Jan 2006 20:47:54 -0000 1.25
***************
*** 71,74 ****
--- 71,75 ----
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL DestroyWindow();
+ virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL
***************
*** 94,100 ****
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
! CToolBar m_wndToolBar;
CComponentBar m_wndComponentBar;
- CReBar m_wndReBar;
CDialogBar m_wndDlgBar;
CPartBrowser m_partBrowser;
--- 95,101 ----
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
! CToolBar m_wndToolBarMain;
! CToolBar m_wndToolBarWins;
CComponentBar m_wndComponentBar;
CDialogBar m_wndDlgBar;
CPartBrowser m_partBrowser;
Index: GME.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GME.rc,v
retrieving revision 1.147
retrieving revision 1.148
diff -C2 -d -r1.147 -r1.148
*** GME.rc 16 Sep 2005 15:40:35 -0000 1.147
--- GME.rc 30 Jan 2006 20:47:54 -0000 1.148
***************
*** 80,85 ****
//
! IDR_MAINFRAME BITMAP "res\\Toolbar.bmp"
IDR_TOOLBAR_MODE BITMAP "res\\toolbar1.bmp"
IDB_METAOPEN BITMAP "res\\mgaopen.bmp"
IDB_MGAOPEN BITMAP "res\\metaopen.bmp"
--- 80,86 ----
//
! IDR_TOOLBAR_MAIN BITMAP "res\\ToolbarMain.bmp"
IDR_TOOLBAR_MODE BITMAP "res\\toolbar1.bmp"
+ IDR_TOOLBAR_WINS BITMAP "res\\toolbarWins.bmp"
IDB_METAOPEN BITMAP "res\\mgaopen.bmp"
IDB_MGAOPEN BITMAP "res\\metaopen.bmp"
***************
*** 94,98 ****
//
! IDR_MAINFRAME TOOLBAR 16, 15
BEGIN
BUTTON ID_FILE_CHECK
--- 95,99 ----
//
! IDR_TOOLBAR_MAIN TOOLBAR 16, 15
BEGIN
BUTTON ID_FILE_CHECK
***************
*** 118,130 ****
BUTTON ID_EDIT_SEARCH
SEPARATOR
! BUTTON ID_VIEW_ATTRIBUTES
! BUTTON ID_VIEW_PARTBROWSER
! BUTTON ID_VIEW_BROWSER
! BUTTON ID_VIEW_PANNWIN
! BUTTON ID_VIEW_CONSOLE
! BUTTON ID_WINDOW_TILE_HORZ
! BUTTON ID_WINDOW_TILE_VERT
! SEPARATOR
! BUTTON ID_APP_ABOUT
END
--- 119,124 ----
BUTTON ID_EDIT_SEARCH
SEPARATOR
! BUTTON ID_MODE_SHORTCONNECT
! BUTTON ID_MODE_SHORTDISCONNECT
END
***************
*** 144,147 ****
--- 138,155 ----
END
+ IDR_TOOLBAR_WINS TOOLBAR 16, 15
+ BEGIN
+ BUTTON ID_VIEW_ATTRIBUTES
+ BUTTON ID_VIEW_PARTBROWSER
+ BUTTON ID_VIEW_BROWSER
+ BUTTON ID_VIEW_PANNWIN
+ BUTTON ID_VIEW_CONSOLE
+ SEPARATOR
+ BUTTON ID_WINDOW_TILE_HORZ
+ BUTTON ID_WINDOW_TILE_VERT
+ SEPARATOR
+ BUTTON ID_APP_ABOUT
+ END
+
/////////////////////////////////////////////////////////////////////////////
***************
*** 189,193 ****
POPUP "&View"
BEGIN
! MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
MENUITEM "&Part Browser", ID_VIEW_PARTBROWSER
--- 197,206 ----
POPUP "&View"
BEGIN
! POPUP "&Toolbars"
! BEGIN
! MENUITEM "&Standard", IDW_TOOLBAR_MAIN
! MENUITEM "&Windows", IDW_TOOLBAR_WINS
! MENUITEM "&Component", IDW_TOOLBAR_DUMMY
! END
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
MENUITEM "&Part Browser", ID_VIEW_PARTBROWSER
***************
*** 292,296 ****
POPUP "&View"
BEGIN
! MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
MENUITEM "&Part Browser", ID_VIEW_PARTBROWSER
--- 305,315 ----
POPUP "&View"
BEGIN
! POPUP "&Toolbars"
! BEGIN
! MENUITEM "&Standard", IDW_TOOLBAR_MAIN
! MENUITEM "&Windows", IDW_TOOLBAR_WINS
! MENUITEM "&Component", IDW_TOOLBAR_DUMMY
! MENUITEM "&Mode", IDW_TOOLBAR_MODE
! END
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
MENUITEM "&Part Browser", ID_VIEW_PARTBROWSER
***************
*** 535,538 ****
--- 554,567 ----
END
+ IDR_MYTOOLBARS_MENU MENU
+ BEGIN
+ POPUP "Toolbars"
+ BEGIN
+ MENUITEM "&Standard", IDW_TOOLBAR_MAIN
+ MENUITEM "&Windows", IDW_TOOLBAR_WINS
+ MENUITEM "&Components", IDW_TOOLBAR_DUMMY
+ END
+ END
+
/////////////////////////////////////////////////////////////////////////////
***************
*** 549,552 ****
--- 578,583 ----
"5", ID_MODE_ZOOM, VIRTKEY, CONTROL, NOINVERT
"6", ID_MODE_VISUALIZE, VIRTKEY, CONTROL, NOINVERT
+ "7", ID_MODE_SHORTCONNECT, VIRTKEY, CONTROL, NOINVERT
+ "8", ID_MODE_SHORTDISCONNECT,VIRTKEY, CONTROL, NOINVERT
"F", ID_EDIT_SEARCH, VIRTKEY, CONTROL, NOINVERT
"L", ID_FILE_CLEARLOCKS, VIRTKEY, CONTROL, ALT, NOINVERT
***************
*** 753,757 ****
END
! IDD_OBJECT_INSPECTOR_DIALOG DIALOG 0, 0, 157, 212
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
--- 784,788 ----
END
! IDD_OBJECT_INSPECTOR_DIALOG DIALOG 0, 0, 157, 212
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
***************
*** 1364,1368 ****
STRINGTABLE
BEGIN
! ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
--- 1395,1406 ----
STRINGTABLE
BEGIN
! IDW_TOOLBAR_MAIN "Show or hide the standard toolbar\nToggle Standard ToolBar"
! IDW_TOOLBAR_WINS "Show or hide the window toolbar\nToggle Windows ToolBar"
! IDW_TOOLBAR_DUMMY "Show or hide the component toolbar\nToggle Components ToolBar"
! IDW_TOOLBAR_MODE "Show or hide the mode toolbar\nToggle Mode ToolBar"
! END
!
! STRINGTABLE
! BEGIN
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
***************
*** 1494,1498 ****
IDC_PRINT_METAFILE "Print the active document to a Metafile\nPrint to Metafile"
ID_VIEW_PANNWIN "Toggle Panning Window\nPanning Window"
! ID_BUTTON32959 "Toggle Panning Window\nPanning Window"
END
--- 1532,1541 ----
IDC_PRINT_METAFILE "Print the active document to a Metafile\nPrint to Metafile"
ID_VIEW_PANNWIN "Toggle Panning Window\nPanning Window"
! END
!
! STRINGTABLE
! BEGIN
! ID_MODE_SHORTCONNECT "Non-Sticky Connect Mode\nNon-Sticky Connect Mode"
! ID_MODE_SHORTDISCONNECT "Non-Sticky Disconnect Mode\nNon-Sticky Disconnect Mode"
END
Index: GME.vcproj
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GME.vcproj,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GME.vcproj 15 Apr 2005 18:24:10 -0000 1.2
--- GME.vcproj 30 Jan 2006 20:47:54 -0000 1.3
***************
*** 1832,1835 ****
--- 1832,1841 ----
</File>
<File
+ RelativePath=".\res\ToolbarMain.bmp">
+ </File>
+ <File
+ RelativePath=".\res\ToolbarWins.bmp">
+ </File>
+ <File
RelativePath="res\typemark.ico">
</File>
Index: sizecbar.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/sizecbar.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** sizecbar.cpp 5 Jul 2000 19:20:00 -0000 1.1
--- sizecbar.cpp 30 Jan 2006 20:47:54 -0000 1.2
***************
*** 56,59 ****
--- 56,65 ----
/////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ // Modified by: Zoltan Molnar, @ Vanderbilt Univ. in 2006 in order to
+ // work better with the CMiniDockFrameWnd MFC class, version VS.NET 2003
+ // Details: when floating the MFC class already displays a caption and
+ // close button (x), so we avoid painting the gripper and (x)
+ /////////////////////////////////////////////////////////////////////////
// sizecbar.cpp : implementation file
***************
*** 164,168 ****
m_dwDockStyle = dwDockStyle;
if (m_pDockContext == NULL)
! m_pDockContext = new CSCBDockContext(this);
// permanently wire the bar's owner to its current parent
--- 170,174 ----
m_dwDockStyle = dwDockStyle;
if (m_pDockContext == NULL)
! m_pDockContext = new CDockContext(this); //modification by Z.M. [WAS: CSCBDockContext(this);]
// permanently wire the bar's owner to its current parent
***************
*** 409,413 ****
CRect rcClient = lpncsp->rgrc[0];
! rcClient.DeflateRect(3, 5, 3, 3);
if (!IsFloating())
rcClient.DeflateRect(2, 0, 2, 2);
--- 415,419 ----
CRect rcClient = lpncsp->rgrc[0];
! rcClient.DeflateRect(3, 5, 3, 3);
if (!IsFloating())
rcClient.DeflateRect(2, 0, 2, 2);
***************
*** 434,438 ****
break;
default:
! rcClient.DeflateRect(0, m_cyGripper, 0, 0);
break;
}
--- 440,444 ----
break;
default:
! rcClient.DeflateRect(0, IsFloating()?0:m_cyGripper, 0, 0); // modification by Z.M.
break;
}
***************
*** 519,523 ****
}
! if (m_cyGripper)
NcPaintGripper(&mdc, rcClient);
--- 525,529 ----
}
! if (m_cyGripper && !IsFloating()) // modification by Z.M.
NcPaintGripper(&mdc, rcClient);
***************
*** 574,577 ****
--- 580,587 ----
CRect rcBar, rcEdge;
GetWindowRect(rcBar);
+
+ // these two lines were inserted by Z.M.
+ if( IsFloating())
+ return baseCSizingControlBar::OnNcHitTest( point);
if (!IsFloating())
Index: GMEStd.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEStd.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** GMEStd.h 12 Sep 2005 18:35:25 -0000 1.26
--- GMEStd.h 30 Jan 2006 20:47:54 -0000 1.27
***************
*** 18,22 ****
Modify/extend this file carefully !
*/
! typedef enum { GME_EDIT_MODE, GME_AUTOCONNECT_MODE, GME_DISCONNECT_MODE, GME_SET_MODE, GME_ZOOM_MODE, GME_VISUAL_MODE } GMEModeCode;
typedef enum { GME_CMD_CONTEXT } GMECommandCode;
typedef enum { GME_LEFT_SIDE, GME_TOP_SIDE, GME_RIGHT_SIDE, GME_BOTTOM_SIDE, GME_SIDE_NUM } GMESizeCode;
--- 18,22 ----
Modify/extend this file carefully !
*/
! typedef enum { GME_EDIT_MODE, GME_AUTOCONNECT_MODE, GME_DISCONNECT_MODE, GME_SET_MODE, GME_ZOOM_MODE, GME_VISUAL_MODE, GME_SHORTAUTOCONNECT_MODE, GME_SHORTDISCONNECT_MODE } GMEModeCode;
typedef enum { GME_CMD_CONTEXT } GMECommandCode;
typedef enum { GME_LEFT_SIDE, GME_TOP_SIDE, GME_RIGHT_SIDE, GME_BOTTOM_SIDE, GME_SIDE_NUM } GMESizeCode;
Index: GMEView.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.177
retrieving revision 1.178
diff -C2 -d -r1.177 -r1.178
*** GMEView.cpp 25 Nov 2005 19:07:55 -0000 1.177
--- GMEView.cpp 30 Jan 2006 20:47:54 -0000 1.178
***************
*** 700,704 ****
}
! if (GetFocus() == this && ((pDoc->GetEditMode() == GME_AUTOCONNECT_MODE) || (tmpConnectMode))) {
if (connSrc) {
CRect rect = connSrc->GetLocation();
--- 700,704 ----
}
! if (GetFocus() == this && ((pDoc->GetEditMode() == GME_AUTOCONNECT_MODE || pDoc->GetEditMode() == GME_SHORTAUTOCONNECT_MODE) || (tmpConnectMode))) {
if (connSrc) {
CRect rect = connSrc->GetLocation();
***************
*** 3615,3621 ****
--- 3615,3623 ----
switch(pDoc->GetEditMode()) {
case GME_AUTOCONNECT_MODE:
+ case GME_SHORTAUTOCONNECT_MODE:
SetCursor(connSrc ? autoconnect2Cursor : autoconnectCursor);
break;
case GME_DISCONNECT_MODE:
+ case GME_SHORTDISCONNECT_MODE:
SetCursor(connSrc ? disconnect2Cursor : disconnectCursor);
break;
***************
*** 3920,3923 ****
--- 3922,3926 ----
break;
case GME_AUTOCONNECT_MODE:
+ case GME_SHORTAUTOCONNECT_MODE:
{
CGMEEventLogger::LogGMEEvent(" mode=GME_AUTOCONNECT_MODE\r\n");
***************
*** 3931,3934 ****
--- 3934,3939 ----
Connect(connSrc, connSrcPort, connSrcHotSide, connTmp, connTmpPort, connTmpHotSide, 0 != (nFlags & MK_SHIFT));
ClearConnSpecs();
+ if( doc->GetEditMode() == GME_SHORTAUTOCONNECT_MODE)
+ GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
}
***************
*** 3938,3941 ****
--- 3943,3947 ----
break;
case GME_DISCONNECT_MODE:
+ case GME_SHORTDISCONNECT_MODE:
{
CGMEEventLogger::LogGMEEvent(" mode=GME_DISCONNECT_MODE\r\n");
***************
*** 3959,3962 ****
--- 3965,3970 ----
}
ClearConnSpecs();
+ if( doc->GetEditMode() == GME_SHORTDISCONNECT_MODE)
+ GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
}
}
***************
*** 3971,3974 ****
--- 3979,3984 ----
AfxMessageBox("Selected objects are not connected!");
ClearConnSpecs();
+ if( doc->GetEditMode() == GME_SHORTDISCONNECT_MODE)
+ GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
}
}
***************
*** 3979,3982 ****
--- 3989,3994 ----
AfxMessageBox("Connection cannot be deleted!");
ClearConnSpecs();
+ if( doc->GetEditMode() == GME_SHORTDISCONNECT_MODE)
+ GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
}
}
***************
*** 4335,4340 ****
--- 4347,4354 ----
case GME_AUTOCONNECT_MODE:
+ case GME_SHORTAUTOCONNECT_MODE:
CGMEEventLogger::LogGMEEvent(" mode=GME_AUTOCONNECT_MODE\r\n");
case GME_DISCONNECT_MODE:
+ case GME_SHORTDISCONNECT_MODE:
{
CGMEEventLogger::LogGMEEvent(" mode=GME_DISCONNECT_MODE\r\n");
***************
*** 5284,5287 ****
--- 5298,5302 ----
ClearConnSpecs();
if(guiMeta) {
+ theApp.UpdateCompList4CurrentKind( guiMeta->name);
CMainFrame::theInstance->SetPartBrowser(guiMeta);
CMainFrame::theInstance->SetPartBrowserBg(bgColor);
***************
*** 5326,5335 ****
else {
CGMEDoc *doc = GetDocument();
! if(doc->GetEditMode() == GME_AUTOCONNECT_MODE) {
ClearConnSpecs();
SetCursor(autoconnectCursor);
Invalidate();
}
! else if(doc->GetEditMode() == GME_DISCONNECT_MODE) {
ClearConnSpecs();
SetCursor(disconnectCursor);
--- 5341,5352 ----
else {
CGMEDoc *doc = GetDocument();
! if(doc->GetEditMode() == GME_AUTOCONNECT_MODE
! || doc->GetEditMode() == GME_SHORTAUTOCONNECT_MODE) {
ClearConnSpecs();
SetCursor(autoconnectCursor);
Invalidate();
}
! else if(doc->GetEditMode() == GME_DISCONNECT_MODE
! || doc->GetEditMode() == GME_SHORTDISCONNECT_MODE) {
ClearConnSpecs();
SetCursor(disconnectCursor);
***************
*** 5342,5347 ****
{
CGMEDoc *doc = GetDocument();
! pCmdUI->Enable(((doc->GetEditMode() == GME_AUTOCONNECT_MODE) && connSrc) ||
! ((doc->GetEditMode() == GME_DISCONNECT_MODE) && connSrc));
}
--- 5359,5364 ----
{
CGMEDoc *doc = GetDocument();
! pCmdUI->Enable(((doc->GetEditMode() == GME_AUTOCONNECT_MODE || doc->GetEditMode() == GME_SHORTAUTOCONNECT_MODE) && connSrc) ||
! ((doc->GetEditMode() == GME_DISCONNECT_MODE || doc->GetEditMode() == GME_SHORTDISCONNECT_MODE) && connSrc));
}
***************
*** 6372,6376 ****
}
! if ((GetDocument()->GetEditMode() == GME_AUTOCONNECT_MODE) || (tmpConnectMode)) {
CGMEView *self = const_cast<CGMEView *>(this);
CPoint point(screenpoint);
--- 6389,6393 ----
}
! if ((GetDocument()->GetEditMode() == GME_AUTOCONNECT_MODE || GetDocument()->GetEditMode() == GME_SHORTAUTOCONNECT_MODE) || (tmpConnectMode)) {
CGMEView *self = const_cast<CGMEView *>(this);
CPoint point(screenpoint);
Index: GMEApp.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEApp.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -C2 -d -r1.135 -r1.136
*** GMEApp.cpp 15 Nov 2005 20:06:54 -0000 1.135
--- GMEApp.cpp 30 Jan 2006 20:47:54 -0000 1.136
***************
*** 95,98 ****
--- 95,100 ----
ON_COMMAND_RANGE(ID_FILE_RUNPLUGIN1, ID_FILE_RUNPLUGIN8, OnRunPlugin)
ON_COMMAND_RANGE(ID_FILE_INTERPRET1, ID_FILE_INTERPRET18, OnRunInterpreter)
+ ON_UPDATE_COMMAND_UI_RANGE( ID_FILE_RUNPLUGIN1, ID_FILE_RUNPLUGIN8, OnUpdateFilePluginX)
+ ON_UPDATE_COMMAND_UI_RANGE( ID_FILE_INTERPRET1, ID_FILE_INTERPRET18, OnUpdateFileInterpretX)
END_MESSAGE_MAP()
***************
*** 111,115 ****
CGMEApp::CGMEApp() :
! m_RecentProjectList(0, "Recent Project List", "Project%d", 4)
{
multipleView = false;
--- 113,118 ----
CGMEApp::CGMEApp() :
! m_RecentProjectList(0, "Recent Project List", "Project%d", 4)
! , m_compFilterOn( false)
{
multipleView = false;
***************
*** 640,643 ****
--- 643,647 ----
void CGMEApp::UpdateComponentLists(bool restart_addons) {
+ ClearDisabledComps();
plugins .RemoveAll();
pluginTooltips.RemoveAll();
***************
*** 793,797 ****
tbc.AddButtons(1,&but);
}
! cb.ShowWindow(SW_SHOW);
imlist.Detach();
--- 797,803 ----
tbc.AddButtons(1,&but);
}
!
! if( tbc.GetButtonCount() > 0)
! cb.ShowWindow(SW_SHOW);
imlist.Detach();
***************
*** 2471,2473 ****
--- 2477,2635 ----
if (mgaConstMgr) COMTHROW(mgaConstMgr->Enable(true));
+ }
+
+ void CGMEApp::RegisterDroppedFile( const CString& fname, bool userReg/* = true*/)
+ {
+ try
+ {
+ CWaitCursor wait;
+ CComPtr<IMgaRegistrar> registrar;
+ COMTHROW(registrar.CoCreateInstance(CComBSTR("Mga.MgaRegistrar")));
+
+ regaccessmode_enum reg_access = REGACCESS_USER; //REGACCESS_SYSTEM;
+ //REGACCESS_USER;
+ //REGACCESS_BOTH;
+ CComBSTR newname;
+ COMTHROW(registrar->RegisterParadigmFromData(PutInBstr( fname), &newname, reg_access));
+
+ CMainFrame::theInstance->m_console.Message( "Done.", 1);
+ }
+ catch( hresult_exception &)
+ {
+ CMainFrame::theInstance->m_console.Message( "Error while registering paradigm!", 3);
+ }
+ }
+
+ void CGMEApp::OnUpdateFilePluginX(CCmdUI* pCmdUI)
+ {
+ bool enabled = m_vecDisabledPlugIns.find( pCmdUI->m_nID) == m_vecDisabledPlugIns.end();
+ if( pCmdUI->m_nID >= ID_FILE_RUNPLUGIN1 && pCmdUI->m_nID <= ID_FILE_RUNPLUGIN8)
+ pCmdUI->Enable( enabled );
+ }
+
+ void CGMEApp::OnUpdateFileInterpretX(CCmdUI* pCmdUI)
+ {
+ bool enabled = m_vecDisabledComps.find( pCmdUI->m_nID) == m_vecDisabledComps.end();
+ if( pCmdUI->m_nID >= ID_FILE_INTERPRET1 && pCmdUI->m_nID <= ID_FILE_INTERPRET18)
+ pCmdUI->Enable( enabled );
+ }
+
+ // this method is used internally
+ void CGMEApp::ClearDisabledComps()
+ {
+ m_vecDisabledPlugIns.clear();
+ m_vecDisabledComps.clear();
+ }
+
+ // this method is called from CGMEOLEApp::DisableComp
+ // and CGMEApp::UpdateCompList4CurrentKind
+ void CGMEApp::DisableComp( const CString& pCompToFind, bool pbHide)
+ {
+ UINT id_of_comp = 0;
+ bool is_plugin = false;
+ for(int i = 0; !id_of_comp && i < plugins.GetSize(); ++i)
+ {
+ if( plugins[i] == pCompToFind)
+ {
+ id_of_comp = ID_FILE_RUNPLUGIN1 + i;
+ is_plugin = true;
+ }
+ }
+
+ for(int i = 0; !id_of_comp && i < interpreters.GetSize(); ++i)
+ {
+ if( interpreters[i] == pCompToFind)
+ {
+ id_of_comp = ID_FILE_INTERPRET1 + i;
+ is_plugin = false;
+ }
+ }
+
+ if( id_of_comp) // a valid command ID
+ {
+ //ActivateComp( id_of_comp, is_plugin, pbShow);
+ if( is_plugin)
+ {
+ ONE_ID_LIST::const_iterator pos = m_vecDisabledPlugIns.find( id_of_comp);
+ if( pbHide) // disable, so id_of_comp must be inserted into the vector
+ {
+ if( m_vecDisabledPlugIns.end() == pos) // not found
+ m_vecDisabledPlugIns.insert( m_vecDisabledPlugIns.end(), id_of_comp);
+ }
+ else // enable, so remove id_of_comp from the vector
+ {
+ if( m_vecDisabledPlugIns.end() != pos) // if really found
+ m_vecDisabledPlugIns.erase( pos);
+ }
+ }
+ else
+ {
+ ONE_ID_LIST::const_iterator pos = m_vecDisabledComps.find( id_of_comp);
+ if( pbHide) // disable, so id_of_comp must be inserted into the vector
+ {
+ if( m_vecDisabledComps.end() == pos) // not found
+ m_vecDisabledComps.insert( m_vecDisabledComps.end(), id_of_comp);
+ }
+ else // enable, so remove id_of_comp from the vector
+ {
+ if( m_vecDisabledComps.end() != pos) // if really found
+ m_vecDisabledComps.erase( pos);
+ }
+ }
+ }
+ }
+
+ // this method is called from CGMEOLEApp::DisableCompForKinds
+ void CGMEApp::DisableCompForKinds( const CString& pComp, const CString& pKindSeq)
+ {
+ int nm_of_tokens = 0; // will count the parsed kind names
+ int pos = 0;
+ CString t_kind;
+ t_kind = pKindSeq.Tokenize( ";", pos); // tokenize by ';'
+ while( t_kind != "")
+ {
+ ONE_COMP_LIST &my_comps = m_compsOfKind[ t_kind ];
+ ONE_COMP_LIST::const_iterator it = my_comps.find( pComp);
+ if( it == my_comps.end()) // not found, so insert it
+ m_compsOfKind[ t_kind ].insert( pComp);
+
+ ++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)
+ {
+ ClearDisabledComps(); // reset all to original state (enabled)
+
+ // if filter is OFF return
+ if( !m_compFilterOn)
+ {
+ return;
+ }
+
+ // kind name should not be empty
+ if( pKind.IsEmpty()) { ASSERT(0); return; }
+
+ if( m_compsOfKind.find( pKind) != m_compsOfKind.end()) // if it has an entry
+ {
+ ONE_COMP_LIST &my_comps = m_compsOfKind[ pKind]; // this key already existed
+ for( ONE_COMP_LIST::const_iterator it = my_comps.begin(); it != my_comps.end(); ++it)
+ {
+ 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]
}
Index: GMEOLEApp.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEOLEApp.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** GMEOLEApp.cpp 5 May 2005 20:17:08 -0000 1.11
--- GMEOLEApp.cpp 30 Jan 2006 20:47:54 -0000 1.12
***************
*** 107,110 ****
--- 107,114 ----
DISP_FUNCTION(CGMEOLEApp, "GridShow", GridShow, VT_EMPTY, VTS_BOOL)
DISP_FUNCTION(CGMEOLEApp, "AttributepanelPage", AttributepanelPage, VT_EMPTY, VTS_I4)
+ DISP_FUNCTION(CGMEOLEApp, "DisableComp", DisableComp, VT_EMPTY, VTS_BSTR VTS_BOOL)
+ DISP_FUNCTION(CGMEOLEApp, "DisableCompForKinds", DisableCompForKinds, VT_EMPTY, VTS_BSTR VTS_BSTR)
+ DISP_FUNCTION(CGMEOLEApp, "SetCompFiltering", SetCompFiltering, VT_EMPTY, VTS_BOOL)
+ DISP_FUNCTION(CGMEOLEApp, "GetCompFiltering", GetCompFiltering, VT_BOOL, VTS_NONE)
//}}AFX_DISPATCH_MAP
***************
*** 605,609 ****
panel = new CGMEOLEPanel();
! panel->SetParams( &CMainFrame::theInstance->m_wndReBar, _T("Toolbar"));
coll->Add(panel->GetIDispatch(FALSE));
panel->GetIDispatch(FALSE)->Release(); // We do not hold reference, hopefully the collection will hold one
--- 609,623 ----
panel = new CGMEOLEPanel();
! panel->SetParams( &CMainFrame::theInstance->m_wndToolBarMain, _T("Main Toolbar"));
! coll->Add(panel->GetIDispatch(FALSE));
! panel->GetIDispatch(FALSE)->Release(); // We do not hold reference, hopefully the collection will hold one
!
! panel = new CGMEOLEPanel();
! panel->SetParams( &CMainFrame::theInstance->m_wndToolBarWins, _T("Window Toolbar"));
! coll->Add(panel->GetIDispatch(FALSE));
! panel->GetIDispatch(FALSE)->Release(); // We do not hold reference, hopefully the collection will hold one
!
! panel = new CGMEOLEPanel();
! panel->SetParams( &CMainFrame::theInstance->m_wndComponentBar, _T("Component Toolbar"));
coll->Add(panel->GetIDispatch(FALSE));
panel->GetIDispatch(FALSE)->Release(); // We do not hold reference, hopefully the collection will hold one
***************
*** 657,660 ****
--- 671,705 ----
}
+ void CGMEOLEApp::DisableComp(LPCTSTR pCompName, BOOL pDisable)
+ {
+ // this method allows user added components to be disabled
+ // thus preventing their launch at inappropriate time
+ // it is not equivalent with "Toggle", since that removes
+ // a component from the possible list of interpreters/plugins
+ // and that state is saved and used across several GME sessions
+ // in contrast this disable mechanism is not saves between
+ // separate GME sessions
+ CGMEEventLogger::LogGMEEvent("CGMEOLEApp::DisableComp()\r\n");
+ theApp.DisableComp( pCompName, pDisable == TRUE);
+ }
+
+ void CGMEOLEApp::DisableCompForKinds( LPCTSTR pCompName, LPCTSTR pKindNameSeq)
+ {
+ CGMEEventLogger::LogGMEEvent("CGMEOLEApp::DisableCompForKinds()\r\n");
+ theApp.DisableCompForKinds( pCompName, pKindNameSeq);
+ }
+
+ void CGMEOLEApp::SetCompFiltering( BOOL pOn)
+ {
+ CGMEEventLogger::LogGMEEvent("CGMEOLEApp::SetCompFiltering()\r\n");
+ return theApp.SetCompFiltering( pOn == TRUE);
+ }
+
+ BOOL CGMEOLEApp::GetCompFiltering()
+ {
+ CGMEEventLogger::LogGMEEvent("CGMEOLEApp::GetCompFiltering()\r\n");
+ return theApp.GetCompFiltering();
+ }
+
DELEGATE_DUAL_INTERFACE(CGMEOLEApp, Dual)
***************
*** 1183,1184 ****
--- 1228,1277 ----
CATCH_ALL_DUAL
}
+
+ STDMETHODIMP CGMEOLEApp::XDual::DisableComp(BSTR pCompName, VARIANT_BOOL pHide)
+ {
+ METHOD_PROLOGUE(CGMEOLEApp, Dual)
+
+ TRY_DUAL(IID_IGMEOLEApp)
+ {
+ pThis->DisableComp( CString( pCompName), pHide);
+ return NOERROR;
+ }
+ CATCH_ALL_DUAL
+ }
+
+ STDMETHODIMP CGMEOLEApp::XDual::DisableCompForKinds(BSTR pCompName, BSTR pKindSequence)
+ {
+ METHOD_PROLOGUE(CGMEOLEApp, Dual)
+
+ TRY_DUAL(IID_IGMEOLEApp)
+ {
+ pThis->DisableCompForKinds( CString( pCompName), CString( pKindSequence));
+ return NOERROR;
+ }
+ CATCH_ALL_DUAL
+ }
+
+ STDMETHODIMP CGMEOLEApp::XDual::SetCompFiltering( VARIANT_BOOL pOn)
+ {
+ METHOD_PROLOGUE(CGMEOLEApp, Dual)
+
+ TRY_DUAL(IID_IGMEOLEApp)
+ {
+ pThis->SetCompFiltering( pOn);
+ return NOERROR;
+ }
+ CATCH_ALL_DUAL
+ }
+
+ STDMETHODIMP CGMEOLEApp::XDual::GetCompFiltering( VARIANT_BOOL* pOn)
+ {
+ METHOD_PROLOGUE(CGMEOLEApp, Dual)
+
+ TRY_DUAL(IID_IGMEOLEApp)
+ {
+ *pOn = (pThis->GetCompFiltering())?VARIANT_TRUE:VARIANT_FALSE;
+ return NOERROR;
+ }
+ CATCH_ALL_DUAL
+ }
\ No newline at end of file
Index: GMEDoc.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEDoc.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** GMEDoc.h 31 Aug 2005 19:38:41 -0000 1.13
--- GMEDoc.h 30 Jan 2006 20:47:54 -0000 1.14
***************
*** 91,94 ****
--- 91,98 ----
afx_msg void OnModeZoom();
afx_msg void OnUpdateModeZoom(CCmdUI* pCmdUI);
+ afx_msg void OnModeShortConnect();
+ afx_msg void OnUpdateModeShortConnect(CCmdUI* pCmdUI);
+ afx_msg void OnModeShortDisconnect();
+ afx_msg void OnUpdateModeShortDisconnect(CCmdUI* pCmdUI);
afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
afx_msg void OnViewRefresh();
Index: resource.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/resource.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** resource.h 12 Sep 2005 17:42:01 -0000 1.68
--- resource.h 30 Jan 2006 20:47:54 -0000 1.69
***************
*** 73,76 ****
--- 73,79 ----
#define IDD_NEW_MULTIUSER_PROJ_DLG 208
#define IDD_CONSOLE_DIALOG 209
+ #define IDR_TOOLBAR_MAIN 210
+ #define IDR_TOOLBAR_WINS 211
+ #define IDR_MYTOOLBARS_MENU 212
#define IDC_NAME 1000
#define IDC_TYPENAME 1001
***************
*** 349,352 ****
--- 352,357 ----
#define ID_EDIT_PASTESPECIAL_SMART_MERGE 32987
#define ID_EDIT_PASTESPECIAL_SMART_ADDITIVE 32988
+ #define ID_MODE_SHORTCONNECT 32990
+ #define ID_MODE_SHORTDISCONNECT 32991
#define IDC_BTNSELECT 33000
#define IDC_BTNDESELECT 33001
***************
*** 361,364 ****
--- 366,373 ----
#define IDC_AUTOROTATE 33010
#define IDC_REVERSE 33011
+ #define IDW_TOOLBAR_MAIN 0xE820
+ #define IDW_TOOLBAR_WINS 0xE821
+ #define IDW_TOOLBAR_DUMMY 0xE822
+ #define IDW_TOOLBAR_MODE 0xE823
// Next default values for new objects
***************
*** 367,372 ****
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
! #define _APS_NEXT_RESOURCE_VALUE 212
! #define _APS_NEXT_COMMAND_VALUE 32989
#define _APS_NEXT_CONTROL_VALUE 1111
#define _APS_NEXT_SYMED_VALUE 115
--- 376,381 ----
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
! #define _APS_NEXT_RESOURCE_VALUE 213
! #define _APS_NEXT_COMMAND_VALUE 33012
#define _APS_NEXT_CONTROL_VALUE 1111
#define _APS_NEXT_SYMED_VALUE 115
Index: GMEDoc.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEDoc.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** GMEDoc.cpp 31 Aug 2005 19:38:41 -0000 1.30
--- GMEDoc.cpp 30 Jan 2006 20:47:54 -0000 1.31
***************
*** 43,46 ****
--- 43,50 ----
ON_COMMAND(ID_MODE_ZOOM, OnModeZoom)
ON_UPDATE_COMMAND_UI(ID_MODE_ZOOM, OnUpdateModeZoom)
+ ON_COMMAND(ID_MODE_SHORTCONNECT, OnModeShortConnect)
+ ON_UPDATE_COMMAND_UI(ID_MODE_SHORTCONNECT, OnUpdateModeShortConnect)
+ ON_COMMAND(ID_MODE_SHORTDISCONNECT, OnModeShortDisconnect)
+ ON_UPDATE_COMMAND_UI(ID_MODE_SHORTDISCONNECT, OnUpdateModeShortDisconnect)
ON_UPDATE_COMMAND_UI(ID_FILE_CLOSE, OnUpdateFileClose)
ON_COMMAND(ID_VIEW_REFRESH, OnViewRefresh)
***************
*** 61,70 ****
WS_CHILD|WS_VISIBLE|CBRS_ALIGN_LEFT,
CRect(0,0,0,0),
! IDR_TOOLBAR_MODE); // use a different ID from the default value: AFX_IDW_TOOLBAR (0xe800)
! // since that is used by the main toolbar
modeBar.LoadToolBar(IDR_TOOLBAR_MODE);
! modeBar.SetBarStyle(modeBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
modeBar.EnableDocking(CBRS_ALIGN_ANY);
! CMainFrame::theInstance->ShowControlBar(&modeBar, true, FALSE);
CMainFrame::theInstance->DockControlBar(&modeBar,AFX_IDW_DOCKBAR_LEFT);
--- 65,77 ----
WS_CHILD|WS_VISIBLE|CBRS_ALIGN_LEFT,
CRect(0,0,0,0),
! IDW_TOOLBAR_MODE); // provide unqiue ID for each toolbar [important !!!]
! // see MainFrm.cpp OnCreate for other details
modeBar.LoadToolBar(IDR_TOOLBAR_MODE);
! modeBar.SetBarStyle(modeBar.GetBarStyle()
! | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
modeBar.EnableDocking(CBRS_ALIGN_ANY);
! modeBar.SetWindowText(_T("Mode")); // will show this title when floating
!
! CMainFrame::theInstance->ShowControlBar(&modeBar, TRUE, FALSE);
CMainFrame::theInstance->DockControlBar(&modeBar,AFX_IDW_DOCKBAR_LEFT);
***************
*** 696,699 ****
--- 703,712 ----
OnModeVisualize();
break;
+ case 6: // short-connect
+ OnModeShortConnect();
+ break;
+ case 7: // short-disconnect
+ OnModeShortDisconnect();
+ break;
}
}
***************
*** 775,778 ****
--- 788,817 ----
{
pCmdUI->SetCheck(editMode == GME_VISUAL_MODE);
+ }
+
+ void CGMEDoc::OnModeShortConnect()
+ {
+ CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeShortConnect\r\n");
+ editMode = GME_SHORTAUTOCONNECT_MODE;
+ CMainFrame::theInstance->WriteStatusMode("AUTOCONNECT");
+ ViewModeChange();
+ }
+
+ void CGMEDoc::OnUpdateModeShortConnect(CCmdUI* pCmdUI)
+ {
+ pCmdUI->SetCheck(editMode == GME_SHORTAUTOCONNECT_MODE);
+ }
+
+ void CGMEDoc::OnModeShortDisconnect()
+ {
+ CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeShortDisconnect\r\n");
+ editMode = GME_SHORTDISCONNECT_MODE;
+ CMainFrame::theInstance->WriteStatusMode("DISCONNECT");
+ ViewModeChange();
+ }
+
+ void CGMEDoc::OnUpdateModeShortDisconnect(CCmdUI* pCmdUI)
+ {
+ pCmdUI->SetCheck(editMode == GME_SHORTDISCONNECT_MODE);
}
More information about the GME-commit
mailing list