Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Read and Write application parameters in XML

, 30 Jun 2003
This article provides an easy way to load and save the parameters of an application in XML format.
#if !defined(AFX_EDITCELL_H__2EB671B5_0711_11D3_90AB_00E029355177__INCLUDED_)
#define AFX_EDITCELL_H__2EB671B5_0711_11D3_90AB_00E029355177__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditCell.h : header file
//
#include <string>
#include "XML_Node.h"

static const UINT ID_BUTTON_EDITCELL = 1000;

/////////////////////////////////////////////////////////////////////////////
// gxEditCell window
class gxEditCell : public CEdit
{
public:
	 gxEditCell (gxListCtrl* pCtrl, int iItem, int iSubItem, CString sInitText, bool withButton = false);
    virtual ~gxEditCell();
    void    SetListText(CWnd* pNewWnd = 0);

	 // ARNAUD
	 void setNode(XML_Node::nodes_iterator node, const char *ParameterText)
	 {
		 _node = node;
		 _paramTxt = std::string(ParameterText);
	 }
	 void setTreeWnd(CWnd* treeWnd)
	 {
		 _treeWnd = treeWnd;
	 }

	 virtual BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );

    int getItem()
    {
      return Item;
    }

    //{{AFX_VIRTUAL(gxEditCell)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	//}}AFX_VIRTUAL

protected:
    gxListCtrl* pListCtrl;
    int			Item;
    int			SubItem;
    CString		InitText;
    BOOL		bEscape;

	 // ARNAUD
	 XML_Node::nodes_iterator _node;
	 std::string _paramTxt;
	 CWnd* _treeWnd;

	 bool _withButton;
	 CButton _button;
	 void OnButtonClicked();

	//{{AFX_MSG(gxEditCell)
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnNcDestroy();
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	 afx_msg UINT OnGetDlgCode();
	 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG

    DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_EDITCELL_H__2EB671B5_0711_11D3_90AB_00E029355177__INCLUDED_)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Arnaud Brejeon
Web Developer
China China
I've been living & working in Tokyo since 2000 . I'm currently working in Gentech Corp. (www.gen.co.jp), developing computer vision applications, especially in the field of face detection.
 
I've been interested in C++ for quite a while and recently discovered Ruby.
 
My hobbies are trekking, japanese food, yoga & onsens.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 1 Jul 2003
Article Copyright 2001 by Arnaud Brejeon
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid