StatGraph: rename some variable and clean up code
[TortoiseGit.git] / ext / ResizableLib / ResizableMsgSupport.h
blob02a055b3a16a02270a32fadbe531eb2338125486
1 // ResizableMsgSupport.h: some declarations to support custom resizable wnds
2 //
3 /////////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (C) 2000-2002 by Paolo Messina
6 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
7 //
8 // The contents of this file are subject to the Artistic License (the "License").
9 // You may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at:
11 // http://www.opensource.org/licenses/artistic-license.html
13 // If you find this code useful, credits would be nice!
15 /////////////////////////////////////////////////////////////////////////////
17 #if !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)
18 #define AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif // _MSC_VER > 1000
24 typedef struct tagRESIZEPROPERTIES
26 // wether to ask for resizing properties every time
27 BOOL bAskClipping;
28 BOOL bAskRefresh;
29 // otherwise, use the cached properties
30 BOOL bCachedLikesClipping;
31 BOOL bCachedNeedsRefresh;
33 // initialize with valid data
34 tagRESIZEPROPERTIES() : bAskClipping(TRUE), bAskRefresh(TRUE) {}
36 } RESIZEPROPERTIES, *PRESIZEPROPERTIES, *LPRESIZEPROPERTIES;
39 typedef struct tagCLIPPINGPROPERTY
41 BOOL bLikesClipping;
43 // initialize with valid data
44 tagCLIPPINGPROPERTY() : bLikesClipping(FALSE) {}
46 } CLIPPINGPROPERTY, *PCLIPPINGPROPERTY, *LPCLIPPINGPROPERTY;
49 typedef struct tagREFRESHPROPERTY
51 BOOL bNeedsRefresh;
52 RECT rcOld;
53 RECT rcNew;
55 // initialize with valid data
56 tagREFRESHPROPERTY() : bNeedsRefresh(TRUE) {}
58 } REFRESHPROPERTY, *PREFRESHPROPERTY, *LPREFRESHPROPERTY;
61 // registered message to communicate with the library
62 extern const UINT WMU_RESIZESUPPORT;
64 // if the message is implemented the returned value must be non-zero
65 // the default window procedure returns zero for unhandled messages
67 // wParam is one of the following RSZSUP_* values, lParam as specified
68 enum ResizeSupport
70 RSZSUP_QUERYPROPERTIES = 101, // lParam = LPRESIZEPROPERTIES
71 RSZSUP_LIKESCLIPPING = 102, // lParam = LPCLIPPINGPROPERTY
72 RSZSUP_NEEDSREFRESH = 103, // lParam = LPREFRESHPROPERTY
73 RSZSUP_SHEETPAGEEXHACK = 104, // lParam = HWND (source prop.page)
76 /////////////////////////////////////////////////////////////////////////////
77 // utility functions
79 inline BOOL Send_QueryProperties(HWND hWnd, LPRESIZEPROPERTIES pResizeProperties)
81 return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
82 RSZSUP_QUERYPROPERTIES, (LPARAM)pResizeProperties));
85 inline BOOL Send_LikesClipping(HWND hWnd, LPCLIPPINGPROPERTY pClippingProperty)
87 return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
88 RSZSUP_LIKESCLIPPING, (LPARAM)pClippingProperty));
91 inline BOOL Send_NeedsRefresh(HWND hWnd, LPREFRESHPROPERTY pRefreshProperty)
93 return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
94 RSZSUP_NEEDSREFRESH, (LPARAM)pRefreshProperty));
97 inline void Post_SheetPageExHack(HWND hWndSheet, HWND hWndPage)
99 PostMessage(hWndSheet, WMU_RESIZESUPPORT,
100 RSZSUP_SHEETPAGEEXHACK, (LPARAM)hWndPage);
103 #endif // !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)