#include <dialog_resize_helper.h>
|
| dialog_resize_helper (const param *src, unsigned count, unsigned p_min_x, unsigned p_min_y, unsigned p_max_x, unsigned p_max_y) |
|
| ~dialog_resize_helper () |
|
void | add_sizegrip () |
|
| PFC_CLASS_NOT_COPYABLE_EX (dialog_resize_helper) |
|
bool | process_message (HWND wnd, UINT msg, WPARAM wp, LPARAM lp) |
|
BOOL | ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult) |
|
void | set_max_size (unsigned x, unsigned y) |
|
void | set_min_size (unsigned x, unsigned y) |
|
Definition at line 8 of file dialog_resize_helper.h.
struct dialog_resize_helper::param |
Enumerator |
---|
X_MOVE |
|
X_SIZE |
|
Y_MOVE |
|
Y_SIZE |
|
XY_MOVE |
|
XY_SIZE |
|
X_MOVE_Y_SIZE |
|
X_SIZE_Y_MOVE |
|
Definition at line 32 of file dialog_resize_helper.h.
dialog_resize_helper::dialog_resize_helper |
( |
const param * |
src, |
|
|
unsigned |
count, |
|
|
unsigned |
p_min_x, |
|
|
unsigned |
p_min_y, |
|
|
unsigned |
p_max_x, |
|
|
unsigned |
p_max_y |
|
) |
| |
Definition at line 150 of file dialog_resize_helper.cpp.
pfc::array_t< param > m_table
void set_size(t_size p_size)
pfc::array_t< RECT > rects
dialog_resize_helper::~dialog_resize_helper |
( |
| ) |
|
void dialog_resize_helper::add_sizegrip |
( |
| ) |
|
Definition at line 132 of file dialog_resize_helper.cpp.
136 sizegrip = CreateWindowEx(0, WC_SCROLLBAR, _T(
""), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN,
137 0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
138 parent, (HMENU)0, NULL, NULL);
142 GetClientRect(
parent, &rc);
144 SetWindowPos(
sizegrip, NULL, rc.right - (rc_grip.right - rc_grip.left), rc.bottom - (rc_grip.bottom - rc_grip.top), 0, 0, SWP_NOZORDER | SWP_NOSIZE);
void dialog_resize_helper::on_wm_size |
( |
| ) |
|
|
private |
Definition at line 30 of file dialog_resize_helper.cpp.
34 unsigned count =
m_table.get_size();
36 HDWP hWinPosInfo = BeginDeferWindowPos(count);
37 for(
unsigned n=0;n<
m_table.get_size();n++)
40 const RECT & orig_rect =
rects[n];
42 GetClientRect(
parent,&cur_client);
43 HWND wnd = GetDlgItem(
parent,e.id);
45 unsigned dest_x = orig_rect.left, dest_y = orig_rect.top,
46 dest_cx = orig_rect.right - orig_rect.left, dest_cy = orig_rect.bottom - orig_rect.top;
61 hWinPosInfo = DeferWindowPos(hWinPosInfo, wnd,0,dest_x,dest_y,dest_cx,dest_cy,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE);
67 GetClientRect(
parent, &rc);
69 hWinPosInfo = DeferWindowPos(hWinPosInfo,
sizegrip, NULL, rc.right - (rc_grip.right - rc_grip.left), rc.bottom - (rc_grip.bottom - rc_grip.top), 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
71 EndDeferWindowPos(hWinPosInfo);
pfc::array_t< param > m_table
pfc::array_t< RECT > rects
bool dialog_resize_helper::process_message |
( |
HWND |
wnd, |
|
|
UINT |
msg, |
|
|
WPARAM |
wp, |
|
|
LPARAM |
lp |
|
) |
| |
Definition at line 76 of file dialog_resize_helper.cpp.
79 SetWindowLongPtr(wnd,DWLP_MSGRESULT,result);
BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
BOOL dialog_resize_helper::ProcessWindowMessage |
( |
HWND |
hWnd, |
|
|
UINT |
uMsg, |
|
|
WPARAM |
wParam, |
|
|
LPARAM |
lParam, |
|
|
LRESULT & |
lResult |
|
) |
| |
Definition at line 83 of file dialog_resize_helper.cpp.
88 case WM_GETMINMAXINFO:
91 LPMINMAXINFO
info = (LPMINMAXINFO) lParam;
92 DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE);
93 DWORD dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
96 r.left = 0; r.right =
max_x;
97 r.top = 0; r.bottom =
max_y;
98 MapDialogRect(hWnd,&r);
99 AdjustWindowRectEx(&r, dwStyle, FALSE, dwExStyle);
100 info->ptMaxTrackSize.x = r.right - r.left;
101 info->ptMaxTrackSize.y = r.bottom - r.top;
105 r.left = 0; r.right =
min_x;
106 r.top = 0; r.bottom =
min_y;
107 MapDialogRect(hWnd,&r);
108 AdjustWindowRectEx(&r, dwStyle, FALSE, dwExStyle);
109 info->ptMinTrackSize.x = r.right - r.left;
110 info->ptMinTrackSize.y = r.bottom - r.top;
119 for(n=0;n<
m_table.get_size();n++) {
BOOL GetChildWindowRect(HWND wnd, UINT id, RECT *child)
void info(const char *p_message)
pfc::array_t< param > m_table
pfc::array_t< RECT > rects
void set_parent(HWND wnd)
void dialog_resize_helper::reset |
( |
| ) |
|
|
private |
void dialog_resize_helper::set_max_size |
( |
unsigned |
x, |
|
|
unsigned |
y |
|
) |
| |
|
inline |
void dialog_resize_helper::set_min_size |
( |
unsigned |
x, |
|
|
unsigned |
y |
|
) |
| |
|
inline |
void dialog_resize_helper::set_parent |
( |
HWND |
wnd | ) |
|
|
private |
unsigned dialog_resize_helper::max_x |
|
private |
unsigned dialog_resize_helper::max_y |
|
private |
unsigned dialog_resize_helper::min_x |
|
private |
unsigned dialog_resize_helper::min_y |
|
private |
RECT dialog_resize_helper::orig_client |
|
private |
HWND dialog_resize_helper::parent |
|
private |
HWND dialog_resize_helper::sizegrip |
|
private |
The documentation for this class was generated from the following files: