home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tybc4
/
xped5
/
xped5app.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-13
|
3KB
|
149 lines
/* Project xped5
Copyright ⌐ 1993. All Rights Reserved.
SUBSYSTEM: xped5.exe Application
FILE: xped5app.cpp
AUTHOR:
OVERVIEW
========
Source file for implementation of XpEd5App (TApplication).
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include "xped5app.h"
#include "xpd5mdic.h"
#include "xpd5mdi1.h"
#include "xped5abd.h" // Definition of about dialog.
//{{XpEd5App Implementation}}
//{{DOC_VIEW}}
DEFINE_DOC_TEMPLATE_CLASS(TFileDocument, TEditView, DocType1);
//{{DOC_VIEW_END}}
//{{DOC_MANAGER}}
DocType1 __dvt1("All Files (*.*)", "*.*", 0, "TXT", dtAutoDelete | dtUpdateDir);
//{{DOC_MANAGER_END}}
//
// Build a response table for all messages/commands handled
// by the application.
//
DEFINE_RESPONSE_TABLE1(XpEd5App, TApplication)
//{{XpEd5AppRSP_TBL_BEGIN}}
EV_OWLVIEW(dnCreate, EvNewView),
EV_OWLVIEW(dnClose, EvCloseView),
EV_COMMAND(CM_HELPABOUT, CmHelpAbout),
//{{XpEd5AppRSP_TBL_END}}
END_RESPONSE_TABLE;
//////////////////////////////////////////////////////////
// XpEd5App
// =====
//
XpEd5App::XpEd5App () : TApplication("xped5")
{
DocManager = new TDocManager(dmMDI | dmMenu);
// INSERT>> Your constructor code here.
}
XpEd5App::~XpEd5App ()
{
// INSERT>> Your destructor code here.
}
//////////////////////////////////////////////////////////
// XpEd5App
// =====
// Application intialization.
//
void XpEd5App::InitMainWindow ()
{
TDecoratedMDIFrame* frame = new TDecoratedMDIFrame(Name, MDI_MENU, *(new xped5MDIClient), FALSE);
nCmdShow = (nCmdShow != SW_SHOWMINNOACTIVE) ? SW_SHOWNORMAL : nCmdShow;
//
// Assign ICON w/ this application.
//
frame->SetIcon(this, IDI_MDIAPPLICATION);
//
// Menu associated with window and accelerator table associated with table.
//
frame->AssignMenu(MDI_MENU);
//
// Associate with the accelerator table.
//
frame->Attr.AccelTable = MDI_MENU;
MainWindow = frame;
}
//////////////////////////////////////////////////////////
// XpEd5App
// =====
// Response Table handlers:
//
void XpEd5App::EvNewView (TView& view)
{
TMDIClient *mdiClient = TYPESAFE_DOWNCAST(MainWindow->GetClientWindow(), TMDIClient);
if (mdiClient) {
xped5MDIChild* child = new xped5MDIChild(*mdiClient, 0, view.GetWindow());
// Associate ICON w/ this child window.
child->SetIcon(this, IDI_DOC);
child->Create();
}
}
void XpEd5App::EvCloseView (TView&)
{
}
//////////////////////////////////////////////////////////
// XpEd5App
// ===========
// Menu Help About xped5.exe command
void XpEd5App::CmHelpAbout ()
{
//
// Show the modal dialog.
//
XpEd5AboutDlg(MainWindow).Execute();
}
int OwlMain (int , char* [])
{
XpEd5App App;
int result;
result = App.Run();
return result;
}