ReactOS  0.4.15-dev-489-g75a0787
ResizeManager Struct Reference

Management of controls in resizable dialogs. More...

#include <window.h>

Inheritance diagram for ResizeManager:
Collaboration diagram for ResizeManager:

Public Types

typedef std::list< ResizeEntrysuper
 

Public Member Functions

 ResizeManager (HWND hwnd)
 
void Add (UINT id, int flags)
 
void Add (HWND hwnd, int flags)
 
void HandleSize (int cx, int cy)
 
void Resize (int dx, int dy)
 
void SetMinMaxInfo (LPMINMAXINFO lpmmi)
 

Public Attributes

SIZE _min_wnd_size
 

Protected Attributes

HWND _hwnd
 
SIZE _last_size
 

Detailed Description

Management of controls in resizable dialogs.

Definition at line 485 of file window.h.

Member Typedef Documentation

◆ super

Definition at line 487 of file window.h.

Constructor & Destructor Documentation

◆ ResizeManager()

ResizeManager::ResizeManager ( HWND  hwnd)

Definition at line 776 of file window.cpp.

777  : _hwnd(hwnd)
778 {
779  ClientRect clnt(hwnd);
780  _last_size.cx = clnt.right;
781  _last_size.cy = clnt.bottom;
782 
783  WindowRect rect(hwnd);
784  _min_wnd_size.cx = rect.right - rect.left;
785  _min_wnd_size.cy = rect.bottom - rect.top;
786 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND _hwnd
Definition: window.h:509
& rect
Definition: startmenu.cpp:1413
LONG cx
Definition: windef.h:334
SIZE _min_wnd_size
Definition: window.h:506
SIZE _last_size
Definition: window.h:510
LONG cy
Definition: windef.h:335

Member Function Documentation

◆ Add() [1/2]

void ResizeManager::Add ( UINT  id,
int  flags 
)
inline

Definition at line 491 of file window.h.

492  {push_back(ResizeEntry(id, flags));}
structure to assign RESIZE_FLAGS to dialogs control
Definition: window.h:471
GLbitfield flags
Definition: glext.h:7161

Referenced by FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

◆ Add() [2/2]

void ResizeManager::Add ( HWND  hwnd,
int  flags 
)
inline

Definition at line 494 of file window.h.

495  {push_back(ResizeEntry(hwnd, flags));}
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
structure to assign RESIZE_FLAGS to dialogs control
Definition: window.h:471
GLbitfield flags
Definition: glext.h:7161

◆ HandleSize()

void ResizeManager::HandleSize ( int  cx,
int  cy 
)

Definition at line 788 of file window.cpp.

789 {
790  ClientRect clnt_rect(_hwnd);
791  SIZE new_size = {cx, cy};
792 
793  int dx = new_size.cx - _last_size.cx;
794  int dy = new_size.cy - _last_size.cy;
795 
796  if (!dx && !dy)
797  return;
798 
799  _last_size = new_size;
800 
801  HDWP hDWP = BeginDeferWindowPos(size());
802 
803  for(ResizeManager::const_iterator it=begin(); it!=end(); ++it) {
804  const ResizeEntry& e = *it;
805  RECT move = {0};
806 
807  if (e._flags & MOVE_LEFT)
808  move.left += dx;
809 
810  if (e._flags & MOVE_RIGHT)
811  move.right += dx;
812 
813  if (e._flags & MOVE_TOP)
814  move.top += dy;
815 
816  if (e._flags & MOVE_BOTTOM)
817  move.bottom += dy;
818 
819  UINT flags = 0;
820 
821  if (!move.left && !move.top)
822  flags = SWP_NOMOVE;
823 
824  if (move.right==move.left && move.bottom==move.top)
825  flags |= SWP_NOSIZE;
826 
827  if (flags != (SWP_NOMOVE|SWP_NOSIZE)) {
828  HWND hwnd = GetDlgItem(_hwnd, e._id);
829 
830  if (hwnd) {
831  WindowRect rect(hwnd);
833 
834  rect.left += move.left;
835  rect.right += move.right;
836  rect.top += move.top;
837  rect.bottom += move.bottom;
838 
839  hDWP = DeferWindowPos(hDWP, hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, flags|SWP_NOACTIVATE|SWP_NOZORDER);
840  }
841  }
842  }
843 
844  EndDeferWindowPos(hDWP);
845 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HDWP WINAPI BeginDeferWindowPos(_In_ int)
HWND _hwnd
Definition: window.h:509
structure to assign RESIZE_FLAGS to dialogs control
Definition: window.h:471
GLint dy
Definition: linetemp.h:97
LONG top
Definition: windef.h:307
GLuint GLuint end
Definition: gl.h:1545
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:308
& rect
Definition: startmenu.cpp:1413
#define e
Definition: ke_i.h:82
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
LONG cx
Definition: windef.h:334
static clock_t begin
Definition: xmllint.c:466
GLsizeiptr size
Definition: glext.h:5919
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1227
GLbitfield flags
Definition: glext.h:7161
#define SWP_NOSIZE
Definition: winuser.h:1230
unsigned int UINT
Definition: ndis.h:50
GLint dx
Definition: linetemp.h:97
SIZE _last_size
Definition: window.h:510
_Out_opt_ int * cx
Definition: commctrl.h:581
LONG bottom
Definition: windef.h:309
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
LONG cy
Definition: windef.h:335

Referenced by Resize(), and ResizeController< Dialog >::WndProc().

◆ Resize()

void ResizeManager::Resize ( int  dx,
int  dy 
)

Definition at line 847 of file window.cpp.

848 {
851 
852  ClientRect clnt_rect(_hwnd);
853  HandleSize(clnt_rect.right, clnt_rect.bottom);
854 }
HWND _hwnd
Definition: window.h:509
void MoveVisible(HWND hwnd)
Definition: utility.cpp:72
GLint dy
Definition: linetemp.h:97
void HandleSize(int cx, int cy)
Definition: window.cpp:788
LONG cx
Definition: windef.h:334
SIZE _min_wnd_size
Definition: window.h:506
#define SWP_NOACTIVATE
Definition: winuser.h:1227
GLint dx
Definition: linetemp.h:97
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LONG cy
Definition: windef.h:335

Referenced by FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

◆ SetMinMaxInfo()

void ResizeManager::SetMinMaxInfo ( LPMINMAXINFO  lpmmi)
inline

Definition at line 500 of file window.h.

501  {
502  lpmmi->ptMinTrackSize.x = _min_wnd_size.cx;
503  lpmmi->ptMinTrackSize.y = _min_wnd_size.cy;
504  }
POINT ptMinTrackSize
Definition: winuser.h:3605
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG cx
Definition: windef.h:334
SIZE _min_wnd_size
Definition: window.h:506
LONG cy
Definition: windef.h:335

Referenced by ResizeController< Dialog >::WndProc().

Member Data Documentation

◆ _hwnd

HWND ResizeManager::_hwnd
protected

Definition at line 509 of file window.h.

Referenced by HandleSize(), and Resize().

◆ _last_size

SIZE ResizeManager::_last_size
protected

Definition at line 510 of file window.h.

Referenced by HandleSize(), and ResizeManager().

◆ _min_wnd_size

SIZE ResizeManager::_min_wnd_size

Definition at line 506 of file window.h.

Referenced by Resize(), ResizeManager(), and SetMinMaxInfo().


The documentation for this struct was generated from the following files: