Click here to Skip to main content
15,892,199 members
Articles / Web Development / HTML

A Comprehensive CE Class Library to Replace ATL and MFC

Rate me:
Please Sign up or sign in to vote.
4.48/5 (14 votes)
4 Oct 2000CPOL 281K   998   70  
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
#ifndef __BeamExPages_h__
#define __BeamExPages_h__


#include <CeDialog.h>
#include <CeTab.h>
#include <CeString.h>
#include "resource.h"
#include <CeMgr.h>
#include <CeGroup.h>

//#include "CeStatic.h"


enum ECrossSection
{
	BSC_Rod = 0,
	BCS_Beam = 1,
	BSC_Triangle = 2,
	BCS_IBeam = 3,
	BSC_LBeam = 4,
	BSC_User = 5,
};

enum EScenario
{
	BST_CantileveredPointLoad = 0,
	BST_CantileveredUniformLoad = 1,
	BST_CantileveredMoment = 2,
	BST_SupportedPointLoad = 3,
	BST_SupportedUniform = 4,
};


class CeLayoutPage: public CeTabPage
{
	// Construction
public:
	CeLayoutPage(): CeTabPage(IDD_LAYOUT_PAGE, _T("Cross Section"))
	{
		m_nSection = (short) BCS_Beam;
	}

	// Attributes
	short m_nSection;
	CeString m_strParm_1;
	CeString m_strParm_2;
	CeString m_strParm_3;
	CeString m_strParm_4;
	
	CeChildMgr m_mgr;
	void SetCrossSection(int nSection);
	virtual void Sync(bool bSave);
	double CalcI();

public:
	// Implementation
	void OnSection();

	virtual BOOL OnSetActive();
	virtual BOOL OnCommand( WPARAM wParam, LPARAM lParam, bool& bHandled );
	virtual BOOL OnInitDialog();
	virtual void OnSize( UINT nType, int cx, int cy, bool& bHandled );
};

class CeActualsPage: public CeTabPage
{
public:
// data members
	CeChildMgr m_mgr;
	short m_nScenario;

	CeString m_strParm_1;
	CeString m_strParm_2;
	CeString m_strParm_3;

	virtual void Sync(bool bSave);
	bool CalcY(double dblI, double dblE, double& dblY, double& dblYmax);

// construction
	CeActualsPage();

// window messages
	virtual BOOL OnInitDialog();
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual void OnSize( UINT nType, int cx, int cy, bool& bHandled );

// implementation
	void OnScenario();
	void SetScenario(int nScenario);
};

class CeMaterialsPage: public CeTabPage
{
public:
// data members
	CeChildMgr m_mgr;
	double m_dblModulus;
	int m_nMaterial;
	CeString m_strMaterial;
	CeString m_strModulus;

	virtual void Sync(bool bSave);

// construction
	CeMaterialsPage(): CeTabPage(IDD_MATERIALS_PAGE, _T("Material"))
	{
		m_dblModulus = 0;
		m_nMaterial = 0;
	}

// window messages
	virtual BOOL OnInitDialog();
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual void OnSize( UINT nType, int cx, int cy, bool& bHandled );

// Implementation
public:
	double CalcE();
	void OnMaterial();
};

// _T("Deflection Results")
class CeResultsPanel: public CeDialog
{
private:
public:
	double m_dblMax;
	double m_dblY;
	CeChildMgr m_mgr;
	CeStaticGroup m_static;

	CeResultsPanel()
	{
		m_dblMax = 0;
		m_dblY = 0;
	}

	virtual BOOL OnInitDialog();
	virtual void OnSize(UINT nType, int cx, int cy, bool& bHandled);
};


class CeScenarioDlg: public CeDialog
{
private:
public:
	short m_nScenario;

	CeScenarioDlg() { m_nScenario = 2; }
	virtual ~CeScenarioDlg() {}
	virtual void OnOK();
	virtual BOOL OnInitDialog();
};

class CeScenario2Dlg: public CeDialog
{
private:
	HIMAGELIST  m_hImageList;
public:
	int m_nScenario;

	CeScenario2Dlg() { m_hImageList = NULL; m_nScenario = 2; }
	virtual ~CeScenario2Dlg() {}
	virtual void OnOK();
	virtual BOOL OnInitDialog();
};


class CeMaterialDlg: public CeDialog
{
private:
	void SetEditValues(int nItem);
	void OnMaterialValues();

public:
	CeMaterialDlg() { m_dblModulus = 0; m_nSelected = 0; }
	virtual ~CeMaterialDlg() {}
	virtual BOOL OnInitDialog();
	virtual LRESULT OnNotify(int nCtrlId, LPNMHDR pNMH, bool& bHandled);
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool& bHandled);
//	virtual BOOL 

	virtual void OnOK();
	virtual void OnCancel();

	CeString m_strMaterial;
	double m_dblModulus;
	int m_nSelected;
};

class CeSectionDlg: public CeDialog
{
private:
public:
	short m_nSection;

	CeSectionDlg() { m_nSection = 1; }
	virtual ~CeSectionDlg() {}
	virtual void OnOK();
	virtual BOOL OnInitDialog();
};


#endif //__BeamExPages_h__

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions