[GME-commit] GMESRC/Paradigms/MetaGME/NamespaceConfigure BON2Component.cpp,NONE,1.1 BON2Component.h,NONE,1.1 ComponentConfig.h,NONE,1.1 MetaGMEBonX.cpp,NONE,1.1 MetaGMEBonX.h,NONE,1.1 MetaGMEVisitor.cpp,NONE,1.1 MetaGMEVisitor.h,NONE,1.1 NamespaceConfig.vcproj,NONE,1.1 NmspSpec.cpp,NONE,1.1 NmspSpec.h,NONE,1.1 StdAfx.cpp,NONE,1.1 StdAfx.h,NONE,1.1 compicon.ico,NONE,1.1 component.def,NONE,1.1 component.rc,NONE,1.1 resource.h,NONE,1.1

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon Sep 25 17:14:58 CDT 2006


Update of /project/gme-repository/GMESRC/Paradigms/MetaGME/NamespaceConfigure
In directory escher:/tmp/cvs-serv19301

Added Files:
	BON2Component.cpp BON2Component.h ComponentConfig.h 
	MetaGMEBonX.cpp MetaGMEBonX.h MetaGMEVisitor.cpp 
	MetaGMEVisitor.h NamespaceConfig.vcproj NmspSpec.cpp 
	NmspSpec.h StdAfx.cpp StdAfx.h compicon.ico component.def 
	component.rc resource.h 
Log Message:
Namespace config component checked in.
Able to edit namespaces for rootfolder and libraries.
(Applicable to MetaGME paradigm only)



CVS User: Zoltan Molnar, ISIS (zolmol)

--- NEW FILE: ComponentConfig.h ---
// Component configuration file automatically generated as ComponentConfig.h
// by ConfigureComponent on Sat Sep 16 10:19:44 2006


#define BON2COMPONENT

// COM UUID-s, names and progID

#define TYPELIB_UUID "E2EF519D-E248-43B1-98BC-0F7B04B58685"
#define TYPELIB_NAME "MGA Interpreter TypeLibrary (NamespaceConfig)"
#define COCLASS_UUID "633DC0FE-841F-4194-B29F-CCE836D9DFB4"
#define COCLASS_NAME "MGA Interpreter CoClass (NamespaceConfig)"
#define COCLASS_PROGID "MGA.Interpreter.NamespaceConfig"


// This name will appear in the popup window for interpreter selection.
#define COMPONENT_NAME "NamespaceConfig"


// This text will appear in the toolbar icon tooltip and in the menu.
#define TOOLTIP_TEXT "NamespaceConfig Interpreter"


// This #define determines the interpreter type:
#define GME_INTERPRETER
// The name of the paradigm(s). The GME will use this component
// for this paradigm. Separate the names of paradigms by commas.
#define PARADIGMS "MetaGME"


// This is the location of the GME interfaces file (Mga.idl, Meta.idl, etc)
#define GME_BASE ../../../GME


// not defined: 
#define BON_ICON_SUPPORT

// not defined: #define BON_CUSTOM_TRANSACTIONS

// not defined: #define REGISTER_SYSTEMWIDE

// Just to please the whims of those Microsoft jerks:
#define COCLASS_UUID_EXPLODED1 0x633DC0FE
#define COCLASS_UUID_EXPLODED2  0x841F
#define COCLASS_UUID_EXPLODED3  0x4194
#define COCLASS_UUID_EXPLODED4  0xB2
#define COCLASS_UUID_EXPLODED5  0x9F
#define COCLASS_UUID_EXPLODED6  0xCC
#define COCLASS_UUID_EXPLODED7  0xE8
#define COCLASS_UUID_EXPLODED8  0x36
#define COCLASS_UUID_EXPLODED9  0xD9
#define COCLASS_UUID_EXPLODED10  0xDF
#define COCLASS_UUID_EXPLODED11  0xB4

--- NEW FILE: MetaGMEBonX.cpp ---
#include "stdafx.h"
#include "MetaGMEBonX.h"
#include "MetaGMEVisitor.h"


namespace BON
{

} // namespace BON


--- NEW FILE: NmspSpec.cpp ---
// NmspSpec.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "NmspSpec.h"
#include ".\nmspspec.h"
#include <list>

// NmspSpec dialog

IMPLEMENT_DYNAMIC(NmspSpec, CDialog)
NmspSpec::NmspSpec(CWnd* pParent /*=NULL*/)
	: CDialog(NmspSpec::IDD, pParent)
{
}

NmspSpec::~NmspSpec()
{
}

void NmspSpec::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EDIT1, m_edName);
	DDX_Control(pDX, IDC_TREE1, m_tree);
	DDX_Control(pDX, IDC_CHECK1, m_bEnabled);
}


BEGIN_MESSAGE_MAP(NmspSpec, CDialog)
	ON_EN_KILLFOCUS(IDC_EDIT1, OnEnKillfocusEdit1)
	ON_EN_CHANGE(IDC_EDIT1, OnEnChangeEdit1)
	ON_NOTIFY(NM_CLICK, IDC_TREE1, OnNMClickTree1)
	ON_NOTIFY(NM_SETFOCUS, IDC_TREE1, OnNMSetfocusTree1)
	ON_NOTIFY(TVN_SELCHANGED, IDC_TREE1, OnTvnSelchangedTree1)
END_MESSAGE_MAP()


// NmspSpec message handlers

void NmspSpec::updateItemInfo( int pIdx, CString pTxt)
{
	int idx = 0;
	for( MetaBON::MetaGMEVisitor::VectorOfPairs::iterator it = m_data.begin()
		; it != m_data.end()
		; ++it, ++idx)
	{
		if( idx == pIdx && !it->first->isInLibrary())
		{
			it->second = (LPCTSTR) pTxt;
		}
	}
}

bool NmspSpec::loadItemInfo( int pIdx, CString& pTxt)
{
	bool editable = false;
	int idx = 0;
	for( MetaBON::MetaGMEVisitor::VectorOfPairs::iterator it = m_data.begin()
		; it != m_data.end()
		; ++it, ++idx)
	{
		if( idx == pIdx)
		{
			pTxt = it->second.c_str();
			editable = !it->first->isInLibrary();
		}
	}
	return editable;
}

void NmspSpec::setData( MetaBON::MetaGMEVisitor::VectorOfPairs& pData)
{
	m_data = pData;
}

void NmspSpec::getData( MetaBON::MetaGMEVisitor::VectorOfPairs& pResu)
{
	pResu = m_data;
}

void NmspSpec::initElems()
{
	int p = 0;
	for( MetaBON::MetaGMEVisitor::VectorOfPairs::const_iterator it = m_data.begin()
		; it != m_data.end()
		; ++it, ++p)
	{
		insert( p, it);
	}
}

void NmspSpec::insert( int pIdx, MetaBON::MetaGMEVisitor::VectorOfPairs::const_iterator it)
{
	std::string pr = it->first->getName();
	std::string nm = it->second;

	HTREEITEM ele = m_tree.InsertItem( LVIF_TEXT|TVIF_PARAM, pr.c_str(), 0, 0, 0, 0, pIdx, pIdx?m_rootElem:TVI_ROOT, TVI_LAST);

	if( pIdx == 0) m_rootElem = ele;
}

void NmspSpec::updateEditField( int pSel /* = -1 */)
{
	int hm = pSel; // pSel might send the value of just selected/highlighted item
	if( hm < 0)
	{
		// get the currently selected item
		TVITEM tv;
		tv.mask = TVIF_PARAM | TVIF_HANDLE;
		tv.hItem = m_tree.GetNextItem( TVI_ROOT, TVGN_CARET);
		if( tv.hItem && m_tree.GetItem( &tv))
		{
			hm = tv.lParam;
		}
	}

	if( hm >= 0)
	{
		CString itm;
		bool editable = loadItemInfo( hm, itm);
		m_edName.EnableWindow( editable);
		m_edName.SetWindowText( (LPCTSTR) itm);
	}
	else
		m_edName.SetWindowText( "");
}

BOOL NmspSpec::OnInitDialog()
{
	CDialog::OnInitDialog();

	initElems();
	m_tree.Expand( m_rootElem, TVE_EXPAND);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void NmspSpec::OnEnKillfocusEdit1()
{
	// get the edited value
	CString txt;
	m_edName.GetWindowText( txt);

	// apply it to the selected library
	TVITEM tv;
	tv.mask = TVIF_PARAM | TVIF_HANDLE;
	tv.hItem = m_tree.GetNextItem( TVI_ROOT, TVGN_CARET);
	if( tv.hItem && m_tree.GetItem( &tv))
	{
		updateItemInfo( tv.lParam, txt);
	}
}

void NmspSpec::OnEnChangeEdit1()
{
	// TODO:  If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.

	// TODO:  Add your control notification handler code here
}

void NmspSpec::OnNMClickTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
	updateEditField();
	*pResult = 0;
}

void NmspSpec::OnNMSetfocusTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
	updateEditField();
	*pResult = 0;
}

void NmspSpec::OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	updateEditField( pNMTreeView ? pNMTreeView->itemNew.lParam : 0);
	*pResult = 0;
}

--- NEW FILE: compicon.ico ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: component.rc ---
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE 
BEGIN
    "1 TYPELIB ""ComponentLib.tlb""\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904B0"
        BEGIN
            VALUE "FileDescription", "Interpreter Module"
            VALUE "FileVersion", "1, 0, 0, 1"
            VALUE "InternalName", "Interpreter"
            VALUE "LegalCopyright", "Copyright 2000"
            VALUE "OriginalFilename", "Interpreter.DLL"
            VALUE "ProductName", "Interpreter Module"
            VALUE "ProductVersion", "1, 0, 0, 1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_COMPICON            ICON                    "compicon.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_DIALOG1 DIALOGEX 0, 0, 313, 114
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
    WS_SYSMENU
CAPTION "Namespace editing"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    CONTROL         "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS | 
                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
                    7,7,235,64
    EDITTEXT        IDC_EDIT1,7,89,235,14,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,256,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,256,24,50,14
    CONTROL         "Enabled",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | NOT 
                    WS_VISIBLE | WS_TABSTOP,261,92,41,10
    LTEXT           "Namespace value set:",IDC_STATIC,9,78,82,8
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO 
BEGIN
    IDD_DIALOG1, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 306
        TOPMARGIN, 7
        BOTTOMMARGIN, 107
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE 
BEGIN
    IDS_PROJNAME            "Component"
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
1 TYPELIB "ComponentLib.tlb"

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED


--- NEW FILE: NamespaceConfig.vcproj ---
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="7.10"
	Name="NamespaceConfig"
	ProjectGUID="{A915BA20-6F11-437A-B668-8368F4A88B46}"
	SccProjectName=""
	SccLocalPath=""
	Keyword="AtlProj">
	<Platforms>
		<Platform
			Name="Win32"/>
	</Platforms>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory=".\Debug"
			IntermediateDirectory=".\Debug"
			ConfigurationType="2"
			UseOfMFC="2"
			ATLMinimizesCRunTimeLibraryUsage="FALSE"
			CharacterSet="2">
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/Zm200 /Zm200 "
				Optimization="0"
				AdditionalIncludeDirectories="./,C:/Program Files/GME/sdk/BON/"
				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;BUILDER_OBJECT_NETWORK_V2"
				BasicRuntimeChecks="3"
				RuntimeLibrary="3"
				RuntimeTypeInfo="TRUE"
				UsePrecompiledHeader="3"
				PrecompiledHeaderThrough="stdafx.h"
				PrecompiledHeaderFile=".\Debug/NamespaceConfigBON2Component.pch"
				AssemblerListingLocation=".\Debug/"
				ObjectFile=".\Debug/"
				ProgramDataBaseFileName=".\Debug/"
				BrowseInformation="1"
				WarningLevel="3"
				SuppressStartupBanner="TRUE"
				DebugInformationFormat="4"/>
			<Tool
				Name="VCCustomBuildTool"
				Description="Performing registration"
				CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;
echo regsvr32 exec. time &gt; &quot;$(OutDir)\regsvr32.trg&quot;
"
				Outputs="$(OutDir)\regsvr32.trg"/>
			<Tool
				Name="VCLinkerTool"
				OutputFile=".\Debug/NamespaceConfig.dll"
				LinkIncremental="1"
				SuppressStartupBanner="TRUE"
				ModuleDefinitionFile=".\Component.def"
				GenerateDebugInformation="TRUE"
				ProgramDatabaseFile=".\Debug/NamespaceConfigBON2Component.pdb"
				SubSystem="2"
				ImportLibrary=".\Debug/NamespaceConfigBON2Component.lib"
				TargetMachine="1"/>
			<Tool
				Name="VCMIDLTool"
				TypeLibraryName=".\Debug/NamespaceConfigBON2Component.tlb"
				HeaderFileName=""/>
			<Tool
				Name="VCPostBuildEventTool"/>
			<Tool
				Name="VCPreBuildEventTool"/>
			<Tool
				Name="VCPreLinkEventTool"/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="1033"/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"/>
			<Tool
				Name="VCXMLDataGeneratorTool"/>
			<Tool
				Name="VCWebDeploymentTool"/>
			<Tool
				Name="VCManagedWrapperGeneratorTool"/>
			<Tool
				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory=".\Release"
			IntermediateDirectory=".\Release"
			ConfigurationType="2"
			UseOfMFC="2"
			UseOfATL="1"
			ATLMinimizesCRunTimeLibraryUsage="FALSE"
			CharacterSet="2">
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/Zm200 "
				Optimization="1"
				InlineFunctionExpansion="1"
				AdditionalIncludeDirectories="./,C:/Program Files/GME/sdk/BON/"
				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;BUILDER_OBJECT_NETWORK_V2"
				StringPooling="TRUE"
				RuntimeLibrary="2"
				EnableFunctionLevelLinking="TRUE"
				RuntimeTypeInfo="TRUE"
				UsePrecompiledHeader="3"
				PrecompiledHeaderThrough="stdafx.h"
				PrecompiledHeaderFile=".\Release/NamespaceConfigBON2Component.pch"
				AssemblerListingLocation=".\Release/"
				ObjectFile=".\Release/"
				ProgramDataBaseFileName=".\Release/"
				WarningLevel="3"
				SuppressStartupBanner="TRUE"
				DebugInformationFormat="3"/>
			<Tool
				Name="VCCustomBuildTool"
				Description="Performing registration"
				CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;
echo regsvr32 exec. time &gt; &quot;$(OutDir)\regsvr32.trg&quot;
"
				Outputs="$(OutDir)\regsvr32.trg"/>
			<Tool
				Name="VCLinkerTool"
				OutputFile=".\Release/NamespaceConfig.dll"
				LinkIncremental="1"
				SuppressStartupBanner="TRUE"
				ModuleDefinitionFile=".\Component.def"
				GenerateDebugInformation="TRUE"
				ProgramDatabaseFile=".\Release/NamespaceConfigBON2Component.pdb"
				SubSystem="2"
				ImportLibrary=".\Release/NamespaceConfigBON2Component.lib"
				TargetMachine="1"/>
			<Tool
				Name="VCMIDLTool"
				TypeLibraryName=".\Release/NamespaceConfigBON2Component.tlb"
				HeaderFileName=""/>
			<Tool
				Name="VCPostBuildEventTool"/>
			<Tool
				Name="VCPreBuildEventTool"/>
			<Tool
				Name="VCPreLinkEventTool"/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="1033"/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"/>
			<Tool
				Name="VCXMLDataGeneratorTool"/>
			<Tool
				Name="VCWebDeploymentTool"/>
			<Tool
				Name="VCManagedWrapperGeneratorTool"/>
			<Tool
				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\BON.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="BON2Component.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						PreprocessorDefinitions=""
						UsePrecompiledHeader="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\BONImpl.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComHelp.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="3"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="3"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Common.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="Component.def">
			</File>
			<File
				RelativePath="Component.rc">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCResourceCompilerTool"
						PreprocessorDefinitions=""
						AdditionalIncludeDirectories="$(OUTDIR)"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCResourceCompilerTool"
						PreprocessorDefinitions=""
						AdditionalIncludeDirectories="$(OUTDIR)"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComponentDll.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="3"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="3"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComponentLib.idl">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCMIDLTool"
						AdditionalIncludeDirectories="$(ProjectDir)"
						TypeLibraryName="$(OutDir)/ComponentLib.tlb"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCMIDLTool"
						AdditionalIncludeDirectories="$(ProjectDir)"
						TypeLibraryName="$(OutDir)/ComponentLib.tlb"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComponentObj.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="3"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="3"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Events.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Exceptions.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Extensions.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\MON.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\MONImpl.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\NmspSpec.cpp">
			</File>
			<File
				RelativePath="StdAfx.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="1"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						PreprocessorDefinitions=""
						UsePrecompiledHeader="1"/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Utils.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="0"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="3"
						UsePrecompiledHeader="0"
						BrowseInformation="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						Optimization="1"
						AdditionalIncludeDirectories=""
						PreprocessorDefinitions=""
						BasicRuntimeChecks="0"
						UsePrecompiledHeader="0"
						BrowseInformation="0"/>
				</FileConfiguration>
			</File>
			<Filter
				Name="BonX"
				Filter="">
				<File
					RelativePath=".\MetaGMEBonX.cpp">
				</File>
				<File
					RelativePath=".\MetaGMEVisitor.cpp">
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl">
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\BON.h">
			</File>
			<File
				RelativePath="BON2Component.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\BONImpl.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComHelp.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Common.h">
			</File>
			<File
				RelativePath="ComponentConfig.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComponentDll.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\ComponentObj.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Events.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Exceptions.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Extensions.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\GMECOM.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\MON.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\MONImpl.h">
			</File>
			<File
				RelativePath=".\NmspSpec.h">
			</File>
			<File
				RelativePath="Resource.h">
			</File>
			<File
				RelativePath="StdAfx.h">
			</File>
			<File
				RelativePath="C:\Program Files\GME\sdk\BON\Utils.h">
			</File>
			<Filter
				Name="BonX"
				Filter="">
				<File
					RelativePath=".\MetaGMEBonX.h">
				</File>
				<File
					RelativePath=".\MetaGMEVisitor.h">
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
			<File
				RelativePath="CompIcon.ico">
			</File>
		</Filter>
		<File
			RelativePath="ConfigureComponent.exe">
		</File>
	</Files>
	<Globals>
		<Global
			Name="RESOURCE_FILE"
			Value="Component.rc"/>
	</Globals>
</VisualStudioProject>

--- NEW FILE: MetaGMEVisitor.h ---
#pragma once

#include "BON.h"
#include "BONImpl.h"
#include "Extensions.h"
#include "MetaGMEBonX.h"

namespace MetaBON
{

class MetaGMEVisitor
	: public BON::Visitor
{
	public:
		typedef std::pair< BON::Folder, std::string >     FolderNamespPair;
		typedef std::vector< FolderNamespPair >           VectorOfPairs;


	protected:
		VectorOfPairs                                     m_data;

	public : 
		MetaGMEVisitor();
		virtual ~MetaGMEVisitor();

		void showOptions();

	public :
		virtual void visitFolderImpl( const BON::Folder& folder);
};

} // namespace

--- NEW FILE: MetaGMEVisitor.cpp ---
#include "stdafx.h"
#include "MetaGMEVisitor.h"
#include "NmspSpec.h"

namespace MetaBON
{

MetaGMEVisitor::MetaGMEVisitor()  { }

MetaGMEVisitor::~MetaGMEVisitor() { }

// virtual
void MetaGMEVisitor::visitFolderImpl( const BON::Folder& folder) // rootfolder's accept will call this
{
	if( folder->getFolderMeta().name() == "RootFolder")
	{
		std::string nmsp = "";
		BON::RegistryNode rn = folder->getRegistry()->getChild( "Namespace");
		if( rn) nmsp = rn->getValue();
		else    nmsp = "";

		m_data.push_back( std::make_pair( folder, nmsp));

		//folder->getProject()->consoleMsg( folder->getName(), MSG_INFO);
	}
}

void MetaGMEVisitor::showOptions()
{
	std::string msg;
	for( VectorOfPairs::const_iterator it = m_data.begin()
		; it != m_data.end()
		; ++it)
	{
		msg += it->first->getName() + " : " + it->second + "<br>";
	}

	if( !msg.empty())
	{
		//m_data.begin()->first->getProject()->consoleMsg( msg, MSG_INFO);
	}

	NmspSpec dlg;
	dlg.setData( m_data);
	if( dlg.DoModal() == IDOK)
	{
		dlg.getData( m_data);

		// write back the data
		for( VectorOfPairs::const_iterator it = m_data.begin()
			; it != m_data.end()
			; ++it)
		{
			if( !it->first->isInLibrary()) // libraries nested in libraries can't be written
				it->first->getRegistry()->getChild( "Namespace")->setValue( it->second);
		}
	}
}

} // namespace


--- NEW FILE: BON2Component.h ---
//###############################################################################################################################################
//
//	Meta and Builder Object Network V2.0 for GME
//	BON2Component.h
//
//###############################################################################################################################################

/*
	Copyright (c) Vanderbilt University, 2000-2004
	ALL RIGHTS RESERVED

	Vanderbilt University disclaims all warranties with regard to this
	software, including all implied warranties of merchantability
	and fitness.  In no event shall Vanderbilt University be liable for
	any special, indirect or consequential damages or any damages
	whatsoever resulting from loss of use, data or profits, whether
	in an action of contract, negligence or other tortious action,
	arising out of or in connection with the use or performance of
	this software.
*/

#ifndef BON2Component_h
#define BON2Component_h

#include "BON.h"
#include "BONImpl.h"
#include <ComponentConfig.h>

namespace BON
{

//###############################################################################################################################################
//
// 	C L A S S : BON::Component
//
//###############################################################################################################################################

class Component
{
	//==============================================================
	// IMPLEMENTOR SPECIFIC PART
	// Insert application specific members and method deifinitions here

	//==============================================================
	// BON2 SPECIFIC PART
	// Do not modify anything below

	// Member variables
	public :
		Project 	m_project;
		bool		m_bIsInteractive;

	public:
		Component();
		~Component();

	public:
		void initialize( Project& project );
		void finalize( Project& project );
		void invoke( Project& project, const std::set<FCO>& setModels, long lParam );
		void invokeEx( Project& project, FCO& currentFCO, const std::set<FCO>& setSelectedFCOs, long lParam );
		void objectInvokeEx( Project& project, Object& currentObject, const std::set<Object>& setSelectedObjects, long lParam );
		Util::Variant getParameter( const std::string& strName );
		void setParameter( const std::string& strName, const Util::Variant& varValue );

	#ifdef GME_ADDON
		void globalEventPerformed( globalevent_enum event );
		void objectEventPerformed( Object& object, unsigned long event, VARIANT v );
	#endif
};

}; // namespace BON

#endif // Bon2Component_H
--- NEW FILE: MetaGMEBonX.h ---
#ifndef METAGMEBONX_H
#define METAGMEBONX_H

#include "BON.h"
#include "BONImpl.h"
#include "Extensions.h"

///BUP
// add your include files/class definitions here
///EUP

namespace MetaBON { class MetaGMEVisitor; }

#include "MetaGMEVisitor.h"

///BUP
// add your additional class definitions here
///EUP

#endif // METAGMEBONX_H

--- NEW FILE: StdAfx.h ---
// stdafx.h : include file for standard system include files,
//      or project specific include files that are used frequently,
//      but are changed infrequently

#if !defined(AFX_STDAFX_H__C4EFDDFC_C095_4509_B571_632F0986D162__INCLUDED_)
#define AFX_STDAFX_H__C4EFDDFC_C095_4509_B571_632F0986D162__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define STRICT
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#define _ATL_APARTMENT_THREADED

#include <afxwin.h>
#include <afxdisp.h>

#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__C4EFDDFC_C095_4509_B571_632F0986D162__INCLUDED)

--- NEW FILE: StdAfx.cpp ---
// stdafx.cpp : source file that includes just the standard includes
//  stdafx.pch will be the pre-compiled header
//  stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

#ifdef _ATL_STATIC_REGISTRY

#include <statreg.h>

#if _ATL_VER < 0x0700
#include <statreg.cpp>
#endif // _ATL_VER < 0x0700

#endif // _ATL_STATIC_REGISTRY

#if _ATL_VER < 0x0700

#include <atlimpl.cpp>

#endif // _ATL_VER < 0x0700
--- NEW FILE: component.def ---
; Interpreter.def : Declares the module parameters.

LIBRARY      "NamespaceConfig.DLL"

EXPORTS
	DllCanUnloadNow     PRIVATE
	DllGetClassObject   PRIVATE
	DllRegisterServer   PRIVATE
	DllUnregisterServer	PRIVATE


--- NEW FILE: resource.h ---
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Component.rc
//
#define IDS_PROJNAME                    100
#define IDD_DIALOG1                     201
#define IDC_LIST1                       201
#define IDC_EDIT1                       202
#define IDC_CHECK1                      203
#define IDC_TREE1                       204

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        202
#define _APS_NEXT_COMMAND_VALUE         32768
#define _APS_NEXT_CONTROL_VALUE         205
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif

--- NEW FILE: BON2Component.cpp ---
//###############################################################################################################################################
//
//	Meta and Builder Object Network V2.0 for GME
//	BON2Component.cpp
//
//###############################################################################################################################################

/*
	Copyright (c) Vanderbilt University, 2000-2004
	ALL RIGHTS RESERVED

	Vanderbilt University disclaims all warranties with regard to this
	software, including all implied warranties of merchantability
	and fitness.  In no event shall Vanderbilt University be liable for
	any special, indirect or consequential damages or any damages
	whatsoever resulting from loss of use, data or profits, whether
	in an action of contract, negligence or other tortious action,
	arising out of or in connection with the use or performance of
	this software.
*/

#include "stdafx.h"
#include "BON2Component.h"
#include "MetaGMEBonX.h"

namespace BON
{

//###############################################################################################################################################
//
// 	C L A S S : BON::Component
//
//###############################################################################################################################################

Component::Component()
	: m_bIsInteractive( false )
{
}

Component::~Component()
{
	if ( m_project ) {
		m_project->finalizeObjects();
		finalize( m_project );
		m_project = NULL;
	}
}

// ====================================================
// This method is called after all the generic initialization is done
// This should be empty unless application-specific initialization is needed

void Component::initialize( Project& project )
{
	// ======================
	// Insert application specific code here
}

// ====================================================
// This method is called before the whole BON2 project released and disposed
// This should be empty unless application-specific finalization is needed

void Component::finalize( Project& project )
{
	// ======================
	// Insert application specific code here
}

// ====================================================
// This is the obsolete component interface
// This present implementation either tries to call InvokeEx, or does nothing except of a notification

void Component::invoke( Project& project, const std::set<FCO>& setModels, long lParam )
{
	#ifdef SUPPORT_OLD_INVOKE
		Object focus;
		invokeEx( project, focus, setModels, lParam );
	#else
		if ( m_bIsInteractive )
			AfxMessageBox("This BON2 Component does not support the obsolete invoke mechanism!");
	#endif
}

// ====================================================
// This is the main component method for Interpereters and Plugins.
// May also be used in case of invokeable Add-Ons

void Component::invokeEx( Project& project, FCO& currentFCO, const std::set<FCO>& setSelectedFCOs, long lParam )
{
#ifdef GME_ADDON
	project->setAutoCommit( false);
#endif
	// ======================
	// Insert application specific code here
	MetaBON::MetaGMEVisitor v;
	BON::Folder rf = project->getRootFolder();
	rf->accept( &v);
	
	std::set<BON::Folder> library_rf = project->getLibraries(); // get all libraries
	for( std::set<BON::Folder>::iterator lib_rf_it = library_rf.begin()
		; lib_rf_it != library_rf.end()
		; ++lib_rf_it)
		(*lib_rf_it)->accept( &v);


	v.showOptions();
}

// ====================================================
// GME currently does not use this function
// You only need to implement it if other invokation mechanisms are used

void Component::objectInvokeEx( Project& project, Object& currentObject, const std::set<Object>& setSelectedObjects, long lParam )
	{
		if ( m_bIsInteractive )
			AfxMessageBox("This BON2 Component does not support objectInvokeEx method!");
	}

// ====================================================
// Implement application specific parameter-mechanism in these functions

Util::Variant Component::getParameter( const std::string& strName )
{
	// ======================
	// Insert application specific code here

	return Util::Variant();
}

void Component::setParameter( const std::string& strName, const Util::Variant& varValue )
{
	// ======================
	// Insert application specific code here
}

#ifdef GME_ADDON

// ====================================================
// If the component is an Add-On, then this method is called for every Global Event

void Component::globalEventPerformed( globalevent_enum event )
{
	// ======================
	// Insert application specific code here
}

// ====================================================
// If the component is an Add-On, then this method is called for every Object Event

void Component::objectEventPerformed( Object& object, unsigned long event, VARIANT v )
{
	// ======================
	// Insert application specific code here
}

#endif // GME_ADDON

}; // namespace BON


--- NEW FILE: NmspSpec.h ---
#pragma once
#include "afxwin.h"
#include "resource.h"

#include "MetaGMEVisitor.h"
#include "afxcmn.h"

// NmspSpec dialog

class NmspSpec : public CDialog
{
	DECLARE_DYNAMIC(NmspSpec)

public:
	NmspSpec(CWnd* pParent = NULL);   // standard constructor
	virtual ~NmspSpec();

// Dialog Data
	enum { IDD = IDD_DIALOG1 };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

protected:
	void initElems();
	void insert( int pIdx, MetaBON::MetaGMEVisitor::VectorOfPairs::const_iterator it);

	void updateEditField( int pSel = -1);
	void updateItemInfo( int pIdx, CString pTxt);
	bool loadItemInfo( int pIdx, CString& pTxt);

	MetaBON::MetaGMEVisitor::VectorOfPairs      m_data;

public:
	void setData( MetaBON::MetaGMEVisitor::VectorOfPairs& pData);
	void getData( MetaBON::MetaGMEVisitor::VectorOfPairs& rData);

public:
	CEdit m_edName;
	CButton m_bEnabled;
	CTreeCtrl m_tree;
	HTREEITEM m_rootElem;

	virtual BOOL OnInitDialog();

	afx_msg void OnEnKillfocusEdit1();
	afx_msg void OnEnChangeEdit1();

	afx_msg void OnNMClickTree1(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMSetfocusTree1(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult);
};



More information about the GME-commit mailing list