OSDN Git Service

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