Click here to Skip to main content
13,592,891 members
Click here to Skip to main content

Stats

67.3K views
6.7K downloads
87 bookmarked
Posted 30 Oct 2010
Licenced CPOL

Writing a Platform and GUI Toolkit Independent OpenGL Class

, 1 Nov 2010
Article showing how to write OS and GUI toolkit portable OpenGL view class
basecode
linux
MultiGL
GLView
GLViewGTKApp
.project
AUTHORS
autom4te.cache
output.0
requests
traces.0
ChangeLog
config.guess
config.h.in
config.sub
configure
configure.in
COPYING
depcomp
glviewgtkapp.gladep
INSTALL
install-sh
Makefile.am
Makefile.in
missing
mkinstalldirs
NEWS
po
ChangeLog
Makefile.in.in
POTFILES.in
README
src
Makefile.am
Makefile.in
stamp-h.in
GLViewMotifApp
.project
autom4te.cache
output.0
requests
traces.0
config.h.in
configure
configure.ac
depcomp
install-sh
Makefile.am
Makefile.in
missing
src
Makefile.am
Makefile.in
GLViewQtApp
.project
GLViewQtApp.ico
GLViewQtApp.pro.user
glviewqtapp.qrc
Makefile
Resources
.project
autom4te.cache
output.0
requests
traces.0
config.guess
config.h.in
config.sub
configure
configure.ac
depcomp
install-sh
m4
Makefile.am
Makefile.in
missing
src
Makefile.am
Makefile.in
win32
MultiGL
GLView
GLViewGTKApp
AUTHORS
ChangeLog
configure.in
devcpp
glviewgtkapp.dev
glviewgtkapp.gladep
Makefile.am
msvc
glviewgtkapp.suo
glviewgtkapp.vcproj
NEWS
po
ChangeLog
POTFILES.in
README
src
Makefile.am
stamp-h.in
GLViewMFCDlgApp
GLViewMFCDlgApp.aps
GLViewMFCDlgApp.vcproj
res
GLViewMFCDlgApp.ico
GLViewMFCMDIApp
GLViewMFCMDIApp.vcproj
res
buttons.bmp
filelarge.bmp
filesmall.bmp
GLViewMFCMDIApp.ico
GLViewMFCMDIAppDoc.ico
main.bmp
Toolbar.bmp
Toolbar256.bmp
writelarge.bmp
writesmall.bmp
GLViewQtApp
GLViewQtApp
GLViewQtApp.ico
glviewqtapp.qrc
GLViewQtApp.vcproj
Makefile
moc_glviewqtapp.o
Resources
GLView.cpp.bak
GLView.suo
GLView.vcproj
MultiGL.suo
// This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface 
// (the "Fluent UI") and is provided only as referential material to supplement the 
// Microsoft Foundation Classes Reference and related electronic documentation 
// included with the MFC C++ library software.  
// License terms to copy, use or distribute the Fluent UI are available separately.  
// To learn more about our Fluent UI licensing program, please visit 
// http://msdn.microsoft.com/officeui.
//
// Copyright (C) Microsoft Corporation
// All rights reserved.

// ChildFrm.cpp : implementation of the CChildFrame class
//

#include "stdafx.h"
#include "GLViewMFCMDIApp.h"

#include "ChildFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CChildFrame

IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWndEx)

BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWndEx)
	ON_COMMAND(ID_FILE_PRINT, &CChildFrame::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, &CChildFrame::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CChildFrame::OnFilePrintPreview)
	ON_UPDATE_COMMAND_UI(ID_FILE_PRINT_PREVIEW, &CChildFrame::OnUpdateFilePrintPreview)
END_MESSAGE_MAP()

// CChildFrame construction/destruction

CChildFrame::CChildFrame()
{
	// TODO: add member initialization code here
}

CChildFrame::~CChildFrame()
{
}


BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs
	if( !CMDIChildWndEx::PreCreateWindow(cs) )
		return FALSE;

	return TRUE;
}

// CChildFrame diagnostics

#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
	CMDIChildWndEx::AssertValid();
}

void CChildFrame::Dump(CDumpContext& dc) const
{
	CMDIChildWndEx::Dump(dc);
}
#endif //_DEBUG

// CChildFrame message handlers

void CChildFrame::OnFilePrint()
{
	if (m_dockManager.IsPrintPreviewValid())
	{
		PostMessage(WM_COMMAND, AFX_ID_PREVIEW_PRINT);
	}
}

void CChildFrame::OnFilePrintPreview()
{
	if (m_dockManager.IsPrintPreviewValid())
	{
		PostMessage(WM_COMMAND, AFX_ID_PREVIEW_CLOSE);  // force Print Preview mode closed
	}
}

void CChildFrame::OnUpdateFilePrintPreview(CCmdUI* pCmdUI)
{
	pCmdUI->SetCheck(m_dockManager.IsPrintPreviewValid());
}

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)

Share

About the Author

Sharjith
Product Manager Mahindra & Mahindra
India India
Sharjith is a Mechanical Engineer with strong passion for Automobiles, Aircrafts and Software development.

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02-2016 | 2.8.180618.1 | Last Updated 1 Nov 2010
Article Copyright 2010 by Sharjith
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid