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

  1. //    Microworks ObjectMate  2.6
  2. //
  3. //  "SFX Class Library"
  4. //
  5. //    An ObjectWindows 2.0 extension for Borland C++ 4.0
  6. //
  7. //    Copyright 1992-94 Microworks Sydney, Australia.
  8. //
  9. //  SFRAME.CPP
  10.  
  11. #include <owl\owlpch.h>
  12. #include <sfx\sfx200.h>
  13. #include <sfx\sframe.h>
  14.  
  15. DEFINE_RESPONSE_TABLE1(TSFXFrameWindow, TFrameWindow)
  16. END_RESPONSE_TABLE;
  17.  
  18. //    constructor for a TSFXFrameWindow object
  19.  
  20. TSFXFrameWindow::TSFXFrameWindow(TWindow*        parent,
  21.                                  const char far* title,
  22.                                  TWindow*        clientWnd,
  23.                                  BOOL            sfxFrame,
  24.                                  BOOL            sfxCaption,
  25.                                  BOOL            shrinkToClient,
  26.                                  TModule*        module)
  27.     :TFrameWindow(parent, title, clientWnd, shrinkToClient, module)
  28. {
  29.     TWindow::Init(0, title, module);
  30.     if (sfxFrame)
  31.         Attr.Style |= MWS_SFXFRAME;
  32.     else
  33.         Attr.Style |= MWS_3DFRAME;
  34.     if (sfxCaption)
  35.         Attr.Style |= MWS_SFXCAPTION;
  36. }
  37.  
  38. void
  39. TSFXFrameWindow::SetupWindow()
  40. {
  41.     TFrameWindow::SetupWindow();
  42.     if (Attr.Style & MWS_SFXFRAME)
  43.     {
  44.         ::SetClassWord((HWND) ClientWnd->HWindow, GCW_HBRBACKGROUND,
  45.                        (UINT) GetStockObject(LTGRAY_BRUSH));
  46.     }
  47. }
  48.  
  49. LRESULT
  50. TSFXFrameWindow::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
  51. {
  52.     return SFXDefWindowProc(HWindow, message, wParam, lParam);
  53. }
  54.  
  55. IMPLEMENT_STREAMABLE2(TSFXFrameWindow, TFrameWindow, TWindow);
  56.  
  57. void*
  58. TSFXFrameWindow::Streamer::Read(ipstream& is, uint32 /*version*/) const
  59. {
  60.     ReadVirtualBase((TFrameWindow*)GetObject(), is);
  61.     return GetObject();
  62. }
  63.  
  64. void
  65. TSFXFrameWindow::Streamer::Write(opstream& os) const
  66. {
  67.     WriteVirtualBase((TFrameWindow*)GetObject(), os);
  68. }
  69.  
  70.  
  71.