Click here to Skip to main content
15,880,796 members
Articles / Desktop Programming / ATL

CM_ConfigBuilder 1.2g: Visual Studio 6/Visual Studio 2005/Visual Studio 2008 Code Generator for Application Settings Graphic Management

Rate me:
Please Sign up or sign in to vote.
4.94/5 (126 votes)
12 Feb 2008CPOL17 min read 696K   9.8K   262  
CM_ConfigBuilder generates and compiles the required files to manage your application's settings/preferences and to store/retrieve them in XML format.
// CXmlFormItem_CheckBox.cpp
//

#include "stdafx.h"
#include "XmlFormItem_CheckBox.h"

CXmlFormItem_CheckBox::CXmlFormItem_CheckBox()
{}

CXmlFormItem_CheckBox::~CXmlFormItem_CheckBox()
{}

bool CXmlFormItem_CheckBox::BuildFromXml(CXMLDOMNode& node)
{
	USES_CONVERSION;

	CXMLDOMNode childNode;
	CXMLDOMNodeList children;
	std::string nodeName;

	children = node.GetChildNodes();
	
	for (long i = 0; i < children.GetLength(); i++) {
		childNode = children.GetItem(i);
	
		nodeName = childNode.GetNodeName();

		if (nodeName == "formItem") {
			CXmlBaseFormItem::BuildFromXml(childNode);
		}  else if (nodeName == "caption") {
			caption_ = W2A(childNode.GetNodeTypedValue().bstrVal);
		}
	}

	return true;
}

bool CXmlFormItem_CheckBox::AppendToDOMDocument(CXMLDOMDocument2& xmlDoc, CXMLDOMElement& parentElement, bool parentIsValid)
{
	CXMLDOMElement newElement;
    CXMLDOMElement rectElement;
	CXMLDOMElement member;
   
    newElement = xmlDoc.CreateElement("formItemCheckBox");

	CXmlBaseFormItem::AppendToDOMDocument(xmlDoc, newElement, parentIsValid);
	
	AppendMemberNode("caption", caption_, newElement, xmlDoc);

	parentElement.AppendChild(newElement);

	return true;
}

enFormItemType CXmlFormItem_CheckBox::GetItemType()
{
	return enFormItemType_CheckBox;
}
	
void CXmlFormItem_CheckBox::SetCaption(const string& caption)
{
	caption_ = caption;
}

string CXmlFormItem_CheckBox::GetCaption()
{
	return caption_;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Italy Italy
For all Stefano's latest code, binaries and tutorials visit www.codemachines.com

Comments and Discussions