ReactOS 0.4.16-dev-2284-g3529151
CSplitter Struct Reference

#include <CSplitter.hpp>

Collaboration diagram for CSplitter:

Public Member Functions

void Init (CWindow parent, CWindow left, CWindow right)
 
void ResizeWnd (int width, int height)
 
void DragSplitter (INT x)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetCursor (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Private Attributes

CWindow m_Parent
 
CWindow m_Left
 
CWindow m_Right
 
int m_splitterPos = 280
 
const int m_splitterSize = 4
 

Detailed Description

Definition at line 8 of file CSplitter.hpp.

Member Function Documentation

◆ DragSplitter()

void CSplitter::DragSplitter ( INT  x)
inline

Definition at line 47 of file CSplitter.hpp.

48 {
49 m_splitterPos = max(x, 120);
50 RECT rc;
51 m_Parent.GetClientRect(&rc);
52 ResizeWnd(rc.right - rc.left, rc.bottom - rc.top);
53 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int m_splitterPos
Definition: CSplitter.hpp:15
void ResizeWnd(int width, int height)
Definition: CSplitter.hpp:28
CWindow m_Parent
Definition: CSplitter.hpp:11
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define max(a, b)
Definition: svc.c:63

Referenced by OnLButtonUp(), and OnMouseMove().

◆ Init()

void CSplitter::Init ( CWindow  parent,
CWindow  left,
CWindow  right 
)
inline

Definition at line 20 of file CSplitter.hpp.

21 {
23 m_Left = left;
24 m_Right = right;
25 }
r parent
Definition: btrfs.c:3010
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
CWindow m_Left
Definition: CSplitter.hpp:12
CWindow m_Right
Definition: CSplitter.hpp:13

Referenced by CCertMgrProperties::OnInitDialog().

◆ OnLButtonDown()

LRESULT CSplitter::OnLButtonDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 82 of file CSplitter.hpp.

83 {
85
87 {
88 m_Parent.SetCapture();
89
90 bHandled = TRUE;
91 return TRUE;
92 }
93
94 return TRUE;
95 }
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
const int m_splitterSize
Definition: CSplitter.hpp:16
int32_t INT
Definition: typedefs.h:58
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299

◆ OnLButtonUp()

LRESULT CSplitter::OnLButtonUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 108 of file CSplitter.hpp.

109 {
110 if (GetCapture() == m_Parent.m_hWnd)
111 {
114 }
115 return TRUE;
116 }
void DragSplitter(INT x)
Definition: CSplitter.hpp:47
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
HWND WINAPI GetCapture(void)
Definition: message.c:2881

◆ OnMouseMove()

LRESULT CSplitter::OnMouseMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 98 of file CSplitter.hpp.

99 {
100 if (GetCapture() == m_Parent.m_hWnd)
101 {
103 }
104 return TRUE;
105 }

◆ OnSetCursor()

LRESULT CSplitter::OnSetCursor ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 63 of file CSplitter.hpp.

64 {
65 if (LOWORD(lParam) == HTCLIENT)
66 {
67 POINT pt;
69 m_Parent.ScreenToClient(&pt);
70 if (pt.x >= m_splitterPos - m_splitterSize / 2 && pt.x <= m_splitterPos + m_splitterSize / 2)
71 {
73 bHandled = TRUE;
74 return TRUE;
75 }
76 }
77 bHandled = FALSE;
78 return FALSE;
79 }
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define pt(x, y)
Definition: drawing.c:79
#define LOWORD(l)
Definition: pedump.c:82
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3064
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define HTCLIENT
Definition: winuser.h:2511
#define LoadCursor
Definition: winuser.h:5923
#define IDC_SIZEWE
Definition: winuser.h:702

◆ OnSize()

LRESULT CSplitter::OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 56 of file CSplitter.hpp.

57 {
59 return TRUE;
60 }
#define HIWORD(l)
Definition: typedefs.h:247

◆ ResizeWnd()

void CSplitter::ResizeWnd ( int  width,
int  height 
)
inline

Definition at line 28 of file CSplitter.hpp.

29 {
30 RECT rc;
31 m_Parent.GetClientRect(&rc);
32
33 HDWP hdwp = BeginDeferWindowPos(2);
34
35 if (hdwp)
36 hdwp = m_Left.DeferWindowPos(
38 if (hdwp)
39 hdwp = m_Right.DeferWindowPos(
42 if (hdwp)
44 }
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define SWP_NOACTIVATE
Definition: winuser.h:1253
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define SWP_NOZORDER
Definition: winuser.h:1258
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by DragSplitter(), and OnSize().

Member Data Documentation

◆ m_Left

CWindow CSplitter::m_Left
private

Definition at line 12 of file CSplitter.hpp.

Referenced by Init(), and ResizeWnd().

◆ m_Parent

CWindow CSplitter::m_Parent
private

◆ m_Right

CWindow CSplitter::m_Right
private

Definition at line 13 of file CSplitter.hpp.

Referenced by Init(), and ResizeWnd().

◆ m_splitterPos

int CSplitter::m_splitterPos = 280
private

Definition at line 15 of file CSplitter.hpp.

Referenced by DragSplitter(), OnLButtonDown(), OnSetCursor(), and ResizeWnd().

◆ m_splitterSize

const int CSplitter::m_splitterSize = 4
private

Definition at line 16 of file CSplitter.hpp.

Referenced by OnLButtonDown(), OnSetCursor(), and ResizeWnd().


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