- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# ResizableGrip.h

    00001 // ResizableGrip.h: interface for the CResizableGrip class.
    00002 //
    00004 //
    00005 // Copyright (C) 2000-2002 by Paolo Messina
    00006 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
    00007 //
    00008 // The contents of this file are subject to the Artistic License (the "License").
    00009 // You may not use this file except in compliance with the License.
    00010 // You may obtain a copy of the License at:
    00011 // http://www.opensource.org/licenses/artistic-license.html
    00012 //
    00013 // If you find this code useful, credits would be nice!
    00014 //
    00016
    00017 #if !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)
    00018 #define AFX_RESIZABLEGRIP_H__INCLUDED_
    00019
    00020 #if _MSC_VER > 1000
    00021 #pragma once
    00022 #endif // _MSC_VER > 1000
    00023
    00024 class CResizableGrip
    00025 {
    00026 private:
    00027         class CSizeGrip : public CScrollBar
    00028         {
    00029         public:
    00030                 CSizeGrip()
    00031                 {
    00032                         m_bTransparent = FALSE;
    00033                         m_bTriangular = FALSE;
    00034                         m_size.cx = 0;
    00035                         m_size.cy = 0;
    00036                 }
    00037
    00038                 void SetTriangularShape(BOOL bEnable);
    00039                 void SetTransparency(BOOL bActivate);
    00040
    00041                 BOOL IsRTL();                   // right-to-left layout support
    00042
    00043                 virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
    00044
    00045                 SIZE m_size;                    // holds grip size
    00046
    00047         protected:
    00048                 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
    00049
    00050                 BOOL m_bTriangular;             // triangular shape active
    00051                 BOOL m_bTransparent;    // transparency active
    00052
    00053                 // memory DCs and bitmaps for transparent grip
    00054                 CDC m_dcGrip, m_dcMask;
    00055                 CBitmap m_bmGrip, m_bmMask;
    00056         };
    00057
    00058         CSizeGrip m_wndGrip;            // grip control
    00059         int m_nShowCount;                       // support for hiding the grip
    00060
    00061 protected:
    00062         // create a size grip, with options
    00063         BOOL CreateSizeGrip(BOOL bVisible = TRUE,
    00064                 BOOL bTriangular = TRUE, BOOL bTransparent = FALSE);
    00065
    00066         BOOL IsSizeGripVisible();       // TRUE if grip is set to be visible
    00067         void SetSizeGripVisibility(BOOL bVisible);      // set default visibility
    00068         void UpdateSizeGrip();          // update the grip's visibility and position
    00069         void ShowSizeGrip(DWORD* pStatus, DWORD dwMask = 1);    // temp show the size grip
    00070         void HideSizeGrip(DWORD* pStatus, DWORD dwMask = 1);    // temp hide the size grip
    00071         BOOL SetSizeGripBkMode(int nBkMode);            // like CDC::SetBkMode
    00072         void SetSizeGripShape(BOOL bTriangular);
    00073
    00074         virtual CWnd* GetResizableWnd() = 0;
    00075
    00076 public:
    00077         CResizableGrip();
    00078         virtual ~CResizableGrip();
    00079 };
    00080
    00081 #endif // !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)