home *** CD-ROM | disk | FTP | other *** search
- // Microworks ObjectMate 2.6
- //
- // "SFX Class Library"
- //
- // An ObjectWindows 2.0 extension for Borland C++ 4.0
- //
- // Copyright 1992-94 Microworks Sydney, Australia.
- //
- // SMCHILD.CPP
-
- #include <owl\owlpch.h>
- #include <sfx\sfx200.h>
- #include <sfx\smchild.h>
-
- DEFINE_RESPONSE_TABLE1(TSFXMDIChild, TMDIChild)
- EV_WM_CTLCOLOR,
- END_RESPONSE_TABLE;
-
- // constructor for a TSFXMDIChild object
-
- TSFXMDIChild::TSFXMDIChild(TMDIClient& parent,
- const char far* title,
- TWindow* clientWnd,
- BOOL sfxFrame,
- BOOL sfxCaption,
- BOOL shrinkToClient,
- TModule* module)
- :TMDIChild(parent, title, clientWnd, shrinkToClient, module)
- {
- if (sfxFrame)
- Attr.Style |= MWS_SFXFRAME;
- else
- Attr.Style |= MWS_3DFRAME;
- if (sfxCaption)
- Attr.Style |= MWS_SFXCAPTION;
- }
-
- void
- TSFXMDIChild::SetupWindow()
- {
- TMDIChild::SetupWindow();
- if (Attr.Style & MWS_SFXFRAME)
- {
- ::SetClassWord((HWND) ClientWnd->HWindow, GCW_HBRBACKGROUND,
- (UINT) GetStockObject(LTGRAY_BRUSH));
- }
- }
-
- HBRUSH
- TSFXMDIChild::EvCtlColor(HDC hdc, HWND hWndChild, UINT ctlType)
- {
- if (Attr.Style & MWS_SFXFRAME && ctlType == CTLCOLOR_EDIT)
- {
- SetBkColor(hdc, RGB(192, 192, 192));
- SetBkMode(hdc, OPAQUE);
- return (HBRUSH)::GetStockObject(LTGRAY_BRUSH);
- }
- return TMDIChild::EvCtlColor(hdc, hWndChild, ctlType);
- }
-
- LRESULT
- TSFXMDIChild::DefWindowProc(UINT msg, WPARAM wParam, LPARAM lParam)
- {
- return SFXDefMDIChildProc(HWindow, msg, wParam, lParam);
- }
-
- IMPLEMENT_STREAMABLE3(TSFXMDIChild, TMDIChild, TFrameWindow, TWindow);
-
- void*
- TSFXMDIChild::Streamer::Read(ipstream& is, uint32 /*version*/) const
- {
- ReadVirtualBase((TMDIChild*)GetObject(), is);
- return GetObject();
- }
-
- void
- TSFXMDIChild::Streamer::Write(opstream& os) const
- {
- WriteVirtualBase((TMDIChild*)GetObject(), os);
- }
-
-