/* Written by Bogdan Ledwig (bogdanle@opole.mtl.pl). Copyright © 1999 Bogdan Ledwig. All Rights Reserved. This code may be used in compiled form in any way you wish. This file may be redistributed unmodified by any means PROVIDING it is not sold for profit without the authors written consent, and providing that this notice and the authors name is included. If the source code is used in any commercial application then an email letting me know that you are using it would be nice. However, this code may not be sold as a part of any commercial library in compiled or source form. In any other cases the code is free to whoever wants it anyway. This software is provided "as is" without express or implied warranty. Use it at you own risk! The author accepts no liability for any damages to your computer or data this product may cause. */ // Modified by Larry Leonard, Definitive Solutions, Inc. #if !defined (MYMDICLIENTH_) #define MYMDICLIENTH_ ///////////////////////////////////////////////////////////////////////////// // MyMdiClient window class MyMdiClient : public CWnd { // Enums. public: enum DisplayModesEnum { dispTile, dispCenter, dispStretch, dispCustom }; // Construction. public: MyMdiClient(); virtual ~MyMdiClient(); // Attributes. public: void SetBkColor(COLORREF clrValue); // Load background bitmap from given file bool SetBitmap(LPCTSTR lpszFileName, UINT uFlags = LR_LOADMAP3DCOLORS); // Load background bitmap from resource. You can map some colors using // COLORMAP struct (see LoadMappedBitmap() for details how to use it) bool SetBitmap(UINT nBitmapID, COLORMAP* pClrMap = NULL, int nCount = 0); // Set desired display mode (tile, center, stretch or custom) void SetDisplayMode(DisplayModesEnum eDisplayMode); // Specify coordinates of image's top-left corner. Used when dispCustom is // selected. void SetOrigin(int x, int y, bool bRedraw = TRUE); void SetOrigin(const CPoint& point, bool bRedraw = TRUE); // Operations. public: // Restore original (system-wide) settings. void Reset(); // Load/Store current settings in registry. void SaveState() const; void RestoreState(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(MyMdiClient) virtual void PreSubclassWindow(); //}}AFX_VIRTUAL // Generated message map functions protected: //{{AFX_MSG(MyMdiClient) afx_msg void OnPaint(); afx_msg void OnDestroy(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() // Data. public: CBitmap m_bitmap; // The background bitmap CBrush m_brush; // Brush used for background painting COLORREF m_crBackground; // The background color CString m_sFileName; // The filename if bitmap was loaded from a file CPoint m_ptOrigin; // Coordinates of top-left corner of image. Used when dispCustom is selected CSize m_sizImage; // Cache the image size; DisplayModesEnum m_eDisplayMode; // Mode. }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // MYMDICLIENTH_