home *** CD-ROM | disk | FTP | other *** search
/ Total C++ 2 / TOTALCTWO.iso / borland / mdidlg.pak / APP.CPP next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  94 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1995, 1995 by Borland International, All Rights Reserved
  4. //
  5. // Filename:    app.cpp
  6. //
  7. // Date:        27-Apr-95
  8. //
  9. // Description:
  10. //----------------------------------------------------------------------------
  11. #include <owl/pch.h>
  12. #include "Test.h"
  13.  
  14. //
  15. // Application constructor
  16. //
  17. TTestApp::TTestApp(const char far* name)
  18. :
  19.   TApplication(name),
  20.   THelpFileManager("testhelp.hlp")
  21. {
  22.  
  23. }
  24.  
  25.  
  26. //
  27. // Application destructor
  28. //
  29. TTestApp::~TTestApp()
  30. {
  31. }
  32.  
  33.  
  34. //
  35. // InitMainWindow
  36. //
  37. void
  38. TTestApp::InitMainWindow()
  39. {
  40.   TFrameWindow* frame = new TMDIFrame(GetName(), IDM_MDIMENU, *new TTestClient);
  41.   SetMainWindow(frame);
  42. }
  43.  
  44. DEFINE_RESPONSE_TABLE2(TTestApp, THelpFileManager, TApplication)
  45.   EV_COMMAND(CM_ABOUT, CmAbout),
  46. END_RESPONSE_TABLE;
  47.  
  48. //
  49. //
  50. //
  51. void
  52. TTestApp::CmAbout()
  53. {
  54.   TAboutDialog(GetMainWindow(), IDD_ABOUT).Execute();
  55. }
  56.  
  57. //
  58. // OwlMain
  59. //
  60. int
  61. OwlMain(int /*argc*/, char* /*argv*/ [])
  62. {
  63.   TTestApp app("Test Application");
  64.   return app.Run();
  65. }
  66.  
  67.  
  68. TAboutDialog::TAboutDialog(TWindow* parent, TResId resId)
  69. :
  70.   TDialog(parent, resId)
  71. {
  72.  
  73. }
  74.  
  75. void
  76. TAboutDialog::SetupWindow()
  77. {
  78.   TDialog::SetupWindow();
  79.   SETUP_HELPCONTEXT(TTestApp, TAboutDialog);
  80. }
  81.  
  82. void
  83. TAboutDialog::CleanupWindow()
  84. {
  85.   CLEANUP_HELPCONTEXT(TTestApp, TAboutDialog);
  86.   TDialog::CleanupWindow();
  87. }
  88.  
  89. DEFINE_HELPCONTEXT(TAboutDialog)
  90.   HCENTRY_CONTROL(IDH_ABOUTDLG_IDOK,     IDOK),
  91.   HCENTRY_CONTROL(IDH_ABOUTDLG_IDCANCEL, IDCANCEL),
  92.   HCENTRY_CONTROL(IDH_ABOUTDLG_IDHELP,   IDHELP),
  93. END_HELPCONTEXT;
  94.