/* Project laskuri Copyright © 1994. All Rights Reserved. SUBSYSTEM: laskuri.exe Application FILE: laskrapp.cpp AUTHOR: OVERVIEW ======== Source file for implementation of laskuriApp (TApplication). */ #include #pragma hdrstop #include "laskrapp.h" #include "tlaskuri.h" #include "lskrabtd.h" // Definition of about dialog. //{{laskuriApp Implementation}} // // Build a response table for all messages/commands handled // by the application. // DEFINE_RESPONSE_TABLE1(laskuriApp, TApplication) //{{laskuriAppRSP_TBL_BEGIN}} EV_COMMAND(CM_FILENEW, CmFileNew), EV_COMMAND(CM_FILEOPEN, CmFileOpen), EV_COMMAND(CM_FILECLOSE, CmFileClose), EV_COMMAND(CM_HELPABOUT, CmHelpAbout), //{{laskuriAppRSP_TBL_END}} END_RESPONSE_TABLE; ////////////////////////////////////////////////////////// // laskuriApp // ===== // laskuriApp::laskuriApp () : TApplication("laskuri") { // Common file file flags and filters for Open/Save As dialogs. Filename and directory are // computed in the member functions CmFileOpen, and CmFileSaveAs. FileData.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; FileData.SetFilter("All Files (*.*)|*.*|"); // INSERT>> Your constructor code here. } laskuriApp::~laskuriApp () { // INSERT>> Your destructor code here. } ////////////////////////////////////////////////////////// // laskuriApp // ===== // Application intialization. // void laskuriApp::InitMainWindow () { // SDIDecFrame *frame = new SDIDecFrame(0, "title", new TDialog(0, IDD_TLaskuri)); // TFrameWindow *frame = new TFrameWindow(0, "title", new TDialog(0, IDD_TLaskuri)); // SetMainWindow(new TFrameWindow(0, "title" new TDialog(0, IDD_MYDIALOG))); SDIDecFrame *frame = new SDIDecFrame(0, GetName(), 0, FALSE); nCmdShow = nCmdShow != SW_SHOWMINIMIZED ? SW_SHOWNORMAL : nCmdShow; // // Assign ICON w/ this application. // frame->SetIcon(this, IDI_SDIAPPLICATION); // // Menu associated with window and accelerator table associated with table. // frame->AssignMenu(SDI_MENU); // // Associate with the accelerator table. // frame->Attr.AccelTable = SDI_MENU; SetMainWindow(frame); // SetMainWindow(new TFrameWindow(0, "title", new TDialog(0, IDD_TLaskuri))); } ////////////////////////////////////////////////////////// // laskuriApp // =========== // Menu File New command void laskuriApp::CmFileNew () { TLaskuri(MainWindow).Execute(); } ////////////////////////////////////////////////////////// // laskuriApp // =========== // Menu File Open command void laskuriApp::CmFileOpen () { // // Display standard Open dialog box to select a file name. // *FileData.FileName = 0; TWindow *client = TYPESAFE_DOWNCAST(GetMainWindow()->GetClientWindow(), TWindow); // Client window for the frame. if (client->CanClose()) if (TFileOpenDialog(GetMainWindow(), FileData).Execute() == IDOK) OpenFile(); } void laskuriApp::OpenFile (const char *fileName) { if (fileName) lstrcpy(FileData.FileName, fileName); } ////////////////////////////////////////////////////////// // laskuriApp // ===== // Menu File Close command void laskuriApp::CmFileClose () { CmFileNew(); } //{{SDIDecFrame Implementation}} SDIDecFrame::SDIDecFrame (TWindow *parent, const char far *title, TWindow *clientWnd, BOOL trackMenuSelection, TModule *module) : TDecoratedFrame(parent, title, clientWnd == 0 ? new TWindow(0, "") : clientWnd, trackMenuSelection, module) { // INSERT>> Your constructor code here. } SDIDecFrame::~SDIDecFrame () { // INSERT>> Your destructor code here. } ////////////////////////////////////////////////////////// // laskuriApp // =========== // Menu Help About laskuri.exe command void laskuriApp::CmHelpAbout () { // // Show the modal dialog. // laskuriAboutDlg(MainWindow).Execute(); } int OwlMain (int , char* []) { laskuriApp App; int result; result = App.Run(); return result; }