ReactOS  0.4.15-dev-1377-ga59cecd
CUiSplitPanel Class Reference

#include <rosui.h>

Inheritance diagram for CUiSplitPanel:
Collaboration diagram for CUiSplitPanel:

Public Member Functions

 CUiSplitPanel ()
 
virtual ~CUiSplitPanel ()
 
virtual CUiBoxAsBox ()
 
CUiCollectionFirst ()
 
CUiCollectionSecond ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 
INT GetPos ()
 
VOID SetPos (INT NewPos)
 
HWND Create (HWND hwndParent)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 

Public Attributes

INT m_Pos
 
BOOL m_Horizontal
 
BOOL m_DynamicFirst
 
INT m_MinFirst
 
INT m_MinSecond
 
CUiMeasure m_Width
 
CUiMeasure m_Height
 
- Public Attributes inherited from CUiBox
CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 

Protected Attributes

HCURSOR m_hCursor
 
CUiPanel m_First
 
CUiPanel m_Second
 
RECT m_LastRect
 
BOOL m_HasOldRect
 
- Protected Attributes inherited from CUiPrimitive
CUiPrimitivem_Parent
 

Private Member Functions

BOOL ProcessWindowMessage (HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
 

Static Private Attributes

static const INT THICKNESS = 4
 

Additional Inherited Members

- Protected Member Functions inherited from CUiBox
 CUiBox ()
 
virtual VOID ComputeRect (RECT parentRect, RECT currentRect, RECT *newRect)
 

Detailed Description

Definition at line 522 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiSplitPanel()

CUiSplitPanel::CUiSplitPanel ( )
inline

Definition at line 550 of file rosui.h.

551  {
554  m_Pos = 100;
555  m_MinFirst = 100;
556  m_MinSecond = 100;
559  }
BOOL m_HasOldRect
Definition: rosui.h:538
INT m_MinFirst
Definition: rosui.h:544
CUiMeasure m_Width
Definition: rosui.h:547
#define FALSE
Definition: types.h:117
static CUiMeasure FitParent()
Definition: rosui.h:213
INT m_MinSecond
Definition: rosui.h:545
BOOL m_DynamicFirst
Definition: rosui.h:543
CUiMeasure m_Height
Definition: rosui.h:548
INT m_Pos
Definition: rosui.h:541

◆ ~CUiSplitPanel()

virtual CUiSplitPanel::~CUiSplitPanel ( )
inlinevirtual

Definition at line 561 of file rosui.h.

562  {
563  }

Member Function Documentation

◆ AsBox()

virtual CUiBox* CUiSplitPanel::AsBox ( )
inlinevirtual

Reimplemented from CUiPrimitive.

Definition at line 565 of file rosui.h.

565 { return this; }

◆ ComputeContentBounds()

virtual VOID CUiSplitPanel::ComputeContentBounds ( RECT rect)
inlinevirtual

Reimplemented from CUiBox.

Definition at line 580 of file rosui.h.

581  {
582  RECT r;
583 
586 
587  ::GetWindowRect(m_hWnd, &r);
588 
589  rect->left = min(rect->left, r.left);
590  rect->top = min(rect->top, r.top);
591  rect->right = max(rect->right, r.right);
592  rect->bottom = max(rect->bottom, r.bottom);
593  };
#define max(a, b)
Definition: svc.c:63
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
& rect
Definition: startmenu.cpp:1413
CUiPanel m_First
Definition: rosui.h:533
CUiPanel m_Second
Definition: rosui.h:534
#define min(a, b)
Definition: monoChain.cc:55
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
virtual VOID ComputeContentBounds(RECT *rect)
Definition: rosui.h:395

◆ ComputeMinimalSize()

virtual VOID CUiSplitPanel::ComputeMinimalSize ( SIZE size)
inlinevirtual

Reimplemented from CUiBox.

Definition at line 570 of file rosui.h.

571  {
572  if (m_Horizontal)
573  size->cx = max(size->cx, THICKNESS);
574  else
575  size->cy = max(size->cy, THICKNESS);
578  };
#define max(a, b)
Definition: svc.c:63
virtual VOID ComputeMinimalSize(SIZE *size)
Definition: rosui.h:383
static const INT THICKNESS
Definition: rosui.h:527
GLsizeiptr size
Definition: glext.h:5919
CUiPanel m_First
Definition: rosui.h:533
BOOL m_Horizontal
Definition: rosui.h:542
CUiPanel m_Second
Definition: rosui.h:534

Referenced by OnParentSize().

◆ CountSizableChildren()

virtual DWORD_PTR CUiSplitPanel::CountSizableChildren ( )
inlinevirtual

Reimplemented from CUiBox.

Definition at line 595 of file rosui.h.

596  {
597  INT count = 1;
600  return count;
601  };
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:58
CUiPanel m_First
Definition: rosui.h:533
CUiPanel m_Second
Definition: rosui.h:534
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:407

Referenced by SetPos().

◆ Create()

HWND CUiSplitPanel::Create ( HWND  hwndParent)
inline

Definition at line 803 of file rosui.h.

804  {
805  if (m_Horizontal)
807  else
809 
811  DWORD exStyle = WS_EX_TRANSPARENT;
812 
813  RECT size = {205, 180, 465, THICKNESS};
814  size.right += size.left;
815  size.bottom += size.top;
816 
817  return CWindowImpl::Create(hwndParent, size, NULL, style, exStyle);
818  }
#define IDC_SIZEWE
Definition: winuser.h:689
HCURSOR m_hCursor
Definition: rosui.h:531
_In_ BOOLEAN Create
Definition: pstypes.h:519
static const INT THICKNESS
Definition: rosui.h:527
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define WS_CHILD
Definition: pedump.c:617
#define IDC_SIZENS
Definition: winuser.h:690
static HWND hwndParent
Definition: cryptui.c:300
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL m_Horizontal
Definition: rosui.h:542
#define LoadCursor
Definition: winuser.h:5787
#define NULL
Definition: types.h:112
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CApplicationView::CreateHSplitter(), and CMainWindow::CreateVSplitter().

◆ First()

CUiCollection& CUiSplitPanel::First ( )
inline

Definition at line 567 of file rosui.h.

567 { return m_First.Children(); }
CUiPanel m_First
Definition: rosui.h:533
CUiCollection & Children()
Definition: rosui.h:359

Referenced by CApplicationView::CreateListView(), and CMainWindow::CreateTreeView().

◆ GetPos()

INT CUiSplitPanel::GetPos ( )
inline

Definition at line 755 of file rosui.h.

756  {
757  return m_Pos;
758  }
INT m_Pos
Definition: rosui.h:541

◆ OnParentSize()

virtual HDWP CUiSplitPanel::OnParentSize ( RECT  parentRect,
HDWP  hDwp 
)
inlinevirtual

Reimplemented from CUiBox.

Definition at line 603 of file rosui.h.

604  {
605  RECT rect = {0};
606 
607  SIZE content = {0};
609 
610  INT preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx);
611  INT preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy);
612 
613  rect.right = preferredWidth;
614  rect.bottom = preferredHeight;
615 
616  ComputeRect(parentRect, rect, &rect);
617 
618  SIZE growth = {0};
619  if (m_HasOldRect)
620  {
621  RECT oldRect = m_LastRect;
622 
623  growth.cx = (parentRect.right - parentRect.left) - (oldRect.right - oldRect.left);
624  growth.cy = (parentRect.bottom - parentRect.top) - (oldRect.bottom - oldRect.top);
625  }
626 
627  RECT splitter = rect;
628  RECT first = rect;
629  RECT second = rect;
630 
631  if (m_Horizontal)
632  {
633  rect.top += m_MinFirst;
634  rect.bottom -= THICKNESS + m_MinSecond;
635  if (m_DynamicFirst)
636  {
637  if (growth.cy > 0)
638  {
639  m_Pos += min(growth.cy, rect.bottom - (m_Pos + THICKNESS));
640  }
641  else if (growth.cy < 0)
642  {
643  m_Pos += max(growth.cy, rect.top - m_Pos);
644  }
645  }
646 
647  if (m_Pos > rect.bottom)
648  m_Pos = rect.bottom;
649 
650  if (m_Pos < rect.top)
651  m_Pos = rect.top;
652 
653  splitter.top = m_Pos;
654  splitter.bottom = m_Pos + THICKNESS;
655  first.bottom = splitter.top;
656  second.top = splitter.bottom;
657  }
658  else
659  {
660  rect.left += m_MinFirst;
661  rect.right -= THICKNESS + m_MinSecond;
662  if (m_DynamicFirst)
663  {
664  if (growth.cx > 0)
665  {
666  m_Pos += min(growth.cx, rect.right - (m_Pos + THICKNESS));
667  }
668  else if (growth.cx < 0)
669  {
670  m_Pos += max(growth.cy, rect.left - m_Pos);
671  }
672  }
673 
674  if (m_Pos > rect.right)
675  m_Pos = rect.right;
676 
677  if (m_Pos < rect.left)
678  m_Pos = rect.left;
679 
680  splitter.left = m_Pos;
681  splitter.right = m_Pos + THICKNESS;
682  first.right = splitter.left;
683  second.left = splitter.right;
684  }
685 
686  m_LastRect = parentRect;
687  m_HasOldRect = TRUE;
688 
689  hDwp = m_First.OnParentSize(first, hDwp);
690  hDwp = m_Second.OnParentSize(second, hDwp);
691 
692  if (hDwp)
693  {
694  return DeferWindowPos(hDwp, NULL,
695  splitter.left, splitter.top,
696  splitter.right - splitter.left,
697  splitter.bottom - splitter.top,
699  }
700  else
701  {
703  splitter.left, splitter.top,
704  splitter.right - splitter.left,
705  splitter.bottom - splitter.top,
707  return NULL;
708  }
709  };
BOOL m_HasOldRect
Definition: rosui.h:538
#define max(a, b)
Definition: svc.c:63
RECT m_LastRect
Definition: rosui.h:536
#define TRUE
Definition: types.h:120
static const INT THICKNESS
Definition: rosui.h:527
const GLint * first
Definition: glext.h:5794
INT m_MinFirst
Definition: rosui.h:544
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1232
CUiMeasure m_Width
Definition: rosui.h:547
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:421
INT ComputeMeasure(INT parent, INT content)
Definition: rosui.h:190
content
Definition: atl_ax.c:993
LONG cx
Definition: windef.h:334
INT m_MinSecond
Definition: rosui.h:545
virtual VOID ComputeMinimalSize(SIZE *size)
Definition: rosui.h:570
virtual VOID ComputeRect(RECT parentRect, RECT currentRect, RECT *newRect)
Definition: rosui.h:252
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
CUiPanel m_First
Definition: rosui.h:533
BOOL m_DynamicFirst
Definition: rosui.h:543
#define SWP_NOACTIVATE
Definition: winuser.h:1227
BOOL m_Horizontal
Definition: rosui.h:542
CUiPanel m_Second
Definition: rosui.h:534
INT m_Pos
Definition: rosui.h:541
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309
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 SetPos().

◆ ProcessWindowMessage()

BOOL CUiSplitPanel::ProcessWindowMessage ( HWND  hwnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult,
DWORD  dwMapId 
)
inlineprivate

Definition at line 712 of file rosui.h.

713  {
714  theResult = 0;
715  switch (Msg)
716  {
717  case WM_SETCURSOR:
719  theResult = TRUE;
720  break;
721 
722  case WM_LBUTTONDOWN:
723  SetCapture();
724  break;
725 
726  case WM_LBUTTONUP:
727  case WM_RBUTTONDOWN:
728  if (GetCapture() == m_hWnd)
729  {
730  ReleaseCapture();
731  }
732  break;
733 
734  case WM_MOUSEMOVE:
735  if (GetCapture() == m_hWnd)
736  {
737  POINT Point;
740  if (m_Horizontal)
741  SetPos(Point.y);
742  else
743  SetPos(Point.x);
744  }
745  break;
746 
747  default:
748  return FALSE;
749  }
750 
751  return TRUE;
752  }
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
HCURSOR m_hCursor
Definition: rosui.h:531
#define TRUE
Definition: types.h:120
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
struct @1620 Msg[]
#define FALSE
Definition: types.h:117
#define WM_SETCURSOR
Definition: winuser.h:1618
HWND WINAPI GetCapture(void)
Definition: message.c:2880
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
BOOL m_Horizontal
Definition: rosui.h:542
struct Point Point
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI SetCapture(_In_ HWND hWnd)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define WM_MOUSEMOVE
Definition: winuser.h:1757
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
VOID SetPos(INT NewPos)
Definition: rosui.h:760

◆ Second()

CUiCollection& CUiSplitPanel::Second ( )
inline

Definition at line 568 of file rosui.h.

568 { return m_Second.Children(); }
CUiPanel m_Second
Definition: rosui.h:534
CUiCollection & Children()
Definition: rosui.h:359

Referenced by CApplicationView::CreateAppInfoDisplay(), and CMainWindow::CreateApplicationView().

◆ SetPos()

VOID CUiSplitPanel::SetPos ( INT  NewPos)
inline

Definition at line 760 of file rosui.h.

761  {
762  RECT rcParent;
763 
764  rcParent = m_LastRect;
765 
766  if (m_Horizontal)
767  {
768  rcParent.bottom -= THICKNESS;
769 
770  m_Pos = NewPos;
771 
772  if (m_Pos < rcParent.top)
773  m_Pos = rcParent.top;
774 
775  if (m_Pos > rcParent.bottom)
776  m_Pos = rcParent.bottom;
777  }
778  else
779  {
780  rcParent.right -= THICKNESS;
781 
782  m_Pos = NewPos;
783 
784  if (m_Pos < rcParent.left)
785  m_Pos = rcParent.left;
786 
787  if (m_Pos > rcParent.right)
788  m_Pos = rcParent.right;
789  }
790 
792 
793  HDWP hdwp = NULL;
794  hdwp = BeginDeferWindowPos(count);
795  if (hdwp) hdwp = OnParentSize(m_LastRect, hdwp);
796  if (hdwp) EndDeferWindowPos(hdwp);
797  }
HDWP WINAPI BeginDeferWindowPos(_In_ int)
RECT m_LastRect
Definition: rosui.h:536
static const INT THICKNESS
Definition: rosui.h:527
GLuint GLuint GLsizei count
Definition: gl.h:1545
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:595
BOOL m_Horizontal
Definition: rosui.h:542
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:603
INT m_Pos
Definition: rosui.h:541
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309

Referenced by ProcessWindowMessage().

Member Data Documentation

◆ m_DynamicFirst

BOOL CUiSplitPanel::m_DynamicFirst

◆ m_First

CUiPanel CUiSplitPanel::m_First
protected

◆ m_HasOldRect

BOOL CUiSplitPanel::m_HasOldRect
protected

Definition at line 538 of file rosui.h.

Referenced by CUiSplitPanel(), and OnParentSize().

◆ m_hCursor

HCURSOR CUiSplitPanel::m_hCursor
protected

Definition at line 531 of file rosui.h.

Referenced by Create(), and ProcessWindowMessage().

◆ m_Height

CUiMeasure CUiSplitPanel::m_Height

Definition at line 548 of file rosui.h.

Referenced by CUiSplitPanel().

◆ m_Horizontal

◆ m_LastRect

RECT CUiSplitPanel::m_LastRect
protected

Definition at line 536 of file rosui.h.

Referenced by OnParentSize(), and SetPos().

◆ m_MinFirst

INT CUiSplitPanel::m_MinFirst

◆ m_MinSecond

INT CUiSplitPanel::m_MinSecond

◆ m_Pos

INT CUiSplitPanel::m_Pos

◆ m_Second

CUiPanel CUiSplitPanel::m_Second
protected

◆ m_Width

CUiMeasure CUiSplitPanel::m_Width

Definition at line 547 of file rosui.h.

Referenced by CUiSplitPanel(), and OnParentSize().

◆ THICKNESS

const INT CUiSplitPanel::THICKNESS = 4
staticprivate

Definition at line 527 of file rosui.h.

Referenced by ComputeMinimalSize(), Create(), OnParentSize(), and SetPos().


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