home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / mobjm260 / sfxmdi.cp_ / sfxmdi.cp
Encoding:
Text File  |  1994-09-06  |  1.9 KB  |  72 lines

  1. //    Microworks ObjectMate  2.6
  2. //
  3. //    SFXMDI - Basic SFX MDI Frame Window
  4. //
  5. //    Copyright 1992-94 Microworks Sydney, Australia.
  6. //
  7. //  SFXMDI.CPP
  8.  
  9. /* SFXMDI sets up a basic SFX MDI frame window. There are only two
  10.  * window styles that can be used with SFX MDI frame windows: MWS_3DFRAME or 
  11.  * MWS_SFXFRAME. SFXMDI uses the MWS_SFXFRAME style.
  12.  */
  13.  
  14. #include <owl\owlpch.h>
  15. #include <sfx\sfx200.h>
  16. #include <sfx\smdi.h>
  17. #include <sfx\smchild.h>
  18. #include <sfx\swindow.h>
  19.  
  20. class TClient : public TSFXMDIClient {
  21.   public:
  22.     TClient() : TSFXMDIClient(TRUE) {}
  23.     //TClient() : TSFXMDIClient() {}
  24.     TSFXMDIChild* InitChild();
  25.   DECLARE_RESPONSE_TABLE (TClient);
  26. };
  27.  
  28. DEFINE_RESPONSE_TABLE3(TClient, TSFXMDIClient, TMDIClient, TWindow)
  29. END_RESPONSE_TABLE;
  30.  
  31. TSFXMDIChild*
  32. TClient::InitChild()
  33. {
  34.     char childName[] = "MDI Child Window";
  35.  
  36.     /* The first TRUE sets the MWS_SFXFRAME flag and the second TRUE sets the 
  37.      * MWS_SFXCAPTION flag.
  38.      */
  39.     return new TSFXMDIChild(*this, childName, new TWindow(0, 0, 0), TRUE, TRUE);
  40.  
  41.     /* FALSE sets the MWS_3DFRAME flag and TRUE sets the MWS_SFXCAPTION flag.
  42.      */
  43.     //return new TSFXMDIChild(*this, childName, new TWindow(0, 0, 0), FALSE, TRUE);
  44. }
  45.  
  46. //----------------------------------------------------------------------------
  47.  
  48. class TSFXMDIApp : public TApplication {
  49.   public:
  50.     TSFXMDIApp() : TApplication("SFX MDI Window") {}
  51.     void InitMainWindow();
  52. };
  53.  
  54. void
  55. TSFXMDIApp::InitMainWindow()
  56. {
  57.     /* The first TRUE sets the MWS_SFXFRAME flag and the second TRUE sets the 
  58.      * MWS_SFXCAPTION flag.
  59.      */
  60.     MainWindow = new TSFXMDIFrame(GetName(), "MDIMENU", *new TClient(), TRUE, TRUE);
  61.  
  62.     /* FALSE sets the MWS_3DFRAME flag and TRUE sets the MWS_SFXCAPTION flag.
  63.      */
  64.     //MainWindow = new TSFXMDIFrame(GetName(), "MDIMENU", *new TClient(), FALSE, TRUE);
  65. }
  66.  
  67. int
  68. OwlMain(int /*argc*/, char* /*argv*/ [])
  69. {
  70.     return TSFXMDIApp().Run();
  71. }
  72.