home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tybc4
/
xped3
/
xped3app.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-13
|
4KB
|
146 lines
/* Project xped3
Copyright ⌐ 1993. All Rights Reserved.
SUBSYSTEM: xped3.exe Application
FILE: xped3app.cpp
AUTHOR:
OVERVIEW
========
Source file for implementation of XpEd3App (TApplication).
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include "xped3app.h"
#include "xpd3mdic.h"
#include "xped3abd.h" // Definition of about dialog.
//{{XpEd3App Implementation}}
//
// Build a response table for all messages/commands handled
// by the application.
//
DEFINE_RESPONSE_TABLE1(XpEd3App, TApplication)
//{{XpEd3AppRSP_TBL_BEGIN}}
EV_COMMAND(CM_HELPABOUT, CmHelpAbout),
//{{XpEd3AppRSP_TBL_END}}
END_RESPONSE_TABLE;
//////////////////////////////////////////////////////////
// XpEd3App
// =====
//
XpEd3App::XpEd3App () : TApplication("xped3")
{
// INSERT>> Your constructor code here.
}
XpEd3App::~XpEd3App ()
{
// INSERT>> Your destructor code here.
}
void XpEd3App::SetupSpeedBar (TDecoratedMDIFrame *frame)
{
//
// Create default toolbar New and associate toolbar buttons with commands.
//
TControlBar* cb = new TControlBar(frame);
cb->Insert(*new TButtonGadget(CM_MDIFILENEW, CM_MDIFILENEW));
cb->Insert(*new TButtonGadget(CM_MDIFILEOPEN, CM_MDIFILEOPEN));
cb->Insert(*new TButtonGadget(CM_FILESAVE, CM_FILESAVE));
cb->Insert(*new TSeparatorGadget(6));
cb->Insert(*new TButtonGadget(CM_EDITCUT, CM_EDITCUT));
cb->Insert(*new TButtonGadget(CM_EDITCOPY, CM_EDITCOPY));
cb->Insert(*new TButtonGadget(CM_EDITPASTE, CM_EDITPASTE));
cb->Insert(*new TSeparatorGadget(6));
cb->Insert(*new TButtonGadget(CM_EDITUNDO, CM_EDITUNDO));
cb->Insert(*new TSeparatorGadget(6));
cb->Insert(*new TButtonGadget(CM_EDITFIND, CM_EDITFIND));
cb->Insert(*new TButtonGadget(CM_EDITFINDNEXT, CM_EDITFINDNEXT));
// Add fly-over help hints.
cb->SetHintMode(TGadgetWindow::EnterHints);
frame->Insert(*cb, TDecoratedFrame::Top);
}
//////////////////////////////////////////////////////////
// XpEd3App
// =====
// Application intialization.
//
void XpEd3App::InitMainWindow ()
{
TDecoratedMDIFrame* frame = new TDecoratedMDIFrame(Name, MDI_MENU, *(new xped3MDIClient), TRUE);
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;
SetupSpeedBar(frame);
TStatusBar *sb = new TStatusBar(frame, TGadget::Recessed,
TStatusBar::CapsLock |
TStatusBar::NumLock |
TStatusBar::ScrollLock |
TStatusBar::Overtype);
frame->Insert(*sb, TDecoratedFrame::Bottom);
MainWindow = frame;
}
//////////////////////////////////////////////////////////
// XpEd3App
// ===========
// Menu Help About xped3.exe command
void XpEd3App::CmHelpAbout ()
{
//
// Show the modal dialog.
//
XpEd3AboutDlg(MainWindow).Execute();
}
int OwlMain (int , char* [])
{
XpEd3App App;
int result;
result = App.Run();
return result;
}