Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

RmMFCScrollWnd.h

00001 //=================================================================================================//
00002 // filename: RmMFCColorSlider.h                                                                    //
00003 //                                                                                                 //
00004 //           ATI Research, Inc.                                                                    //
00005 //           3D Application Research Group                                                         //
00006 //                                                                                                 //
00007 // description: Definition of the CRmScrollWnd class.                                              //
00008 //                                                                                                 //
00009 //=================================================================================================//
00010 //   (C) 2004 ATI Research, Inc.  All rights reserved.                                             //
00011 //=================================================================================================//
00012 
00013 #ifndef _RM_MFC_UTILITIES_SCROLL_WND_H_
00014 #define _RM_MFC_UTILITIES_SCROLL_WND_H_
00015 
00016 #include <MFCUtilities/RmMFCTypes.h>
00017 
00018 //=================================================================================================//
00019 // Class:         CRmScrollFrame                                                                   //
00020 //                                                                                                 //
00021 // Description:   Provides frame window for an attached child window                               //
00022 //=================================================================================================//
00023 class CRmScrollFrame : public CWnd
00024 {
00025 public: // Public member functions
00026             
00027         // Generated message map functions
00028         //{{AFX_MSG(CRmScrollFrame)
00029    afx_msg LRESULT OnChildResize( WPARAM wParam, LPARAM lParam );
00030    afx_msg LRESULT OnChildScroll( WPARAM wParam, LPARAM lParam );
00031    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00032    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00033         //}}AFX_MSG
00034    
00035    DECLARE_MESSAGE_MAP()
00036    
00037 }; // end class CRmScrollFrame : public CWnd
00038 
00039 //=================================================================================================//
00040 // Class:         CRmScrollWnd                                                                     //
00041 //                                                                                                 //
00042 // Description:   Provides scrolling frame window for an attached child window                     //
00043 //=================================================================================================//
00044 class RMMFCUTIL_API CRmScrollWnd : public CWnd
00045 {
00046 public: // Public type definitions
00047 
00048    enum CRmScrollWndControlIDs
00049    {
00050       HorizontalScrollBarID = 0x123,
00051       VerticalScrollBarID,
00052       
00053    }; // end enum CRmScrollWndControlIDs
00054 
00055 public: // Public member functions
00056 
00057    // Default construction / destruction
00058    CRmScrollWnd();
00059    virtual ~CRmScrollWnd();
00060    
00061    // ScrollWnd Create function   
00062    void CreateScrollWnd(   HWND hParentWnd,
00063                            RECT& rect,
00064                            DWORD dwStyle = WS_CHILD | WS_VISIBLE,
00065                            bool bCenterChild = false );
00066         
00067    // Attach / Detach Child window
00068    bool  AttachScrollChild( CWnd *pChildWnd );
00069    CWnd* DetachScrollChild();
00070    CWnd* GetScrollChild() { return( m_pScrollChildWnd ); }
00071    
00072    // Scroll adjustment and helper functions
00073    void AdjustScrollWindow();
00074    
00075    static void CalculateScrollBarRequirements(  CRect *pFrameRect,
00076                                                 CRect *pChildRect,
00077                                                 bool &bNeedHorizontalScrollBar,
00078                                                 bool &bNeedVerticalScrollBar ) ;
00079    
00080         // Generated message map functions
00081         //{{AFX_MSG(CRmScrollWnd)
00082    afx_msg void      OnSize(UINT nType, int cx, int cy);
00083    afx_msg void      OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00084    afx_msg void      OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00085    afx_msg LRESULT   OnChildResize( WPARAM wParam, LPARAM lParam );
00086    afx_msg LRESULT   OnChildScroll( WPARAM wParam, LPARAM lParam );
00087    afx_msg void      OnDestroy();
00088    afx_msg BOOL      OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00089         //}}AFX_MSG
00090    
00091    DECLARE_MESSAGE_MAP()
00092    
00093 protected: // protected member variables
00094 
00095    // Horizontal and Vertical Scroll bars
00096    CScrollBar  m_horizontalScrollBar;
00097    CScrollBar  m_verticalScrollBar;
00098    
00099    // Frame / Child windows
00100    CRmScrollFrame m_frameWnd;
00101    CWnd           *m_pScrollChildWnd;
00102    bool           m_bAdjustingScrollWindow;
00103    bool           m_bCenterChild;
00104    
00105 }; // end class CRmScrollWnd : public CWnd
00106 
00107 #endif // !defined( _RM_MFC_UTILITIES_SCROLL_WND_H_ )

Generated on Fri Feb 25 16:08:38 2005 for RenderMonkey SDK by doxygen 1.3.6