ReactOS 0.4.15-dev-6067-g0b695a6
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

typedef std::list<ResizeEntry> ResizeManager::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}
& rect
Definition: startmenu.cpp:1413
SIZE _last_size
Definition: window.h:510
HWND _hwnd
Definition: window.h:509
SIZE _min_wnd_size
Definition: window.h:506
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Member Function Documentation

◆ Add() [1/2]

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

Definition at line 494 of file window.h.

495 {push_back(ResizeEntry(hwnd, flags));}
GLbitfield flags
Definition: glext.h:7161
structure to assign RESIZE_FLAGS to dialogs control
Definition: window.h:472

◆ Add() [2/2]

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

Definition at line 491 of file window.h.

492 {push_back(ResizeEntry(id, flags));}

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

◆ 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)
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}
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define e
Definition: ke_i.h:82
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
@ MOVE_RIGHT
Definition: window.h:457
@ MOVE_TOP
Definition: window.h:458
@ MOVE_BOTTOM
Definition: window.h:459
@ MOVE_LEFT
Definition: window.h:456
unsigned int UINT
Definition: ndis.h:50
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define SWP_NOMOVE
Definition: winuser.h:1234
#define SWP_NOSIZE
Definition: winuser.h:1235
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1237
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
static clock_t begin
Definition: xmllint.c:458

Referenced by Resize(), and ResizeController< BASE >::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}
void MoveVisible(HWND hwnd)
Definition: utility.cpp:72
void HandleSize(int cx, int cy)
Definition: window.cpp:788
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

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

◆ SetMinMaxInfo()

void ResizeManager::SetMinMaxInfo ( LPMINMAXINFO  lpmmi)
inline

Definition at line 500 of file window.h.

501 {
504 }
POINT ptMinTrackSize
Definition: winuser.h:3620
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

Referenced by ResizeController< BASE >::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: