Click here to Skip to main content
15,886,519 members
Articles / Desktop Programming / MFC

2D LUA Based Robot Simulator

Rate me:
Please Sign up or sign in to vote.
4.89/5 (26 votes)
14 Apr 2014Public Domain9 min read 130.8K   7.9K   119  
An article on designing your own robot simulator
#pragma once
#include "afxcmn.h"
#include "afxwin.h"


// CEditorDlg dialog
class CEditorDlg : public CDialog
{
	DECLARE_DYNAMIC(CEditorDlg)

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

// Dialog Data
	enum { IDD = IDD_EDITOR };

// Overrides
public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);

	virtual void SetText(LPCSTR szText);
	virtual LPSTR GetText();
	virtual void GetText(CString &strText);
	virtual BOOL LoadFile(LPCSTR szFile);
	virtual BOOL SaveFile(LPCSTR szFile);
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);


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

// Implemetation
protected:
	afx_msg BOOL OnInitDialog();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnEditCopy();
	afx_msg void OnEditPaste();
	afx_msg void OnEditCut();
	afx_msg void OnEditUndo();
	afx_msg void OnEditRedo();
	afx_msg void OnSaveFile();
	afx_msg void OnOpenFile();
	//afx_msg void OnUpdateLine(CCmdUI* pCmdUI);

	DECLARE_MESSAGE_MAP()

	CToolBar m_wndToolBar;
	CStatusBar m_bar;

private:
	// Initializes the Scintilla editor
	void InitialiseEditor();
	// Sends a message to the Scintilla editor
	LRESULT SendEditor(UINT Msg, WPARAM wParam = 0, LPARAM lParam = 0);
	// Sets a Scintilla style
	void SetAStyle(int style, COLORREF fore, COLORREF back = RGB(255, 255, 255), int size = -1, const char *face = 0);
	// Positions child windows
	BOOL ScintillaSize();
	// Create status bar
	BOOL SetStatusBar();
	// Line numbering
	int GetLinenumberChars();
	int GetLinenumberWidth();
	void SetDisplayLinenumbers(BOOL bFlag);
	// Handle to Scintilla editor window
	HWND m_hwndEditor;

public:
};

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 A Public Domain dedication


Written By
Student
Indonesia Indonesia
http://kataauralius.com/

Comments and Discussions