ReactOS 0.4.15-dev-8245-gd24675b
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 ()
 
virtual CUiBoxAsBox ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 

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 569 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiSplitPanel()

CUiSplitPanel::CUiSplitPanel ( )
inline

Definition at line 593 of file rosui.h.

594 {
595 m_hCursor = NULL;
598 m_Pos = 100;
600 m_MinFirst = 100;
601 m_MinSecond = 100;
604 memset(&m_LastRect, 0, sizeof(m_LastRect));
605 }
static CUiMeasure FitParent()
Definition: rosui.h:226
CUiMeasure m_Height
Definition: rosui.h:591
INT m_Pos
Definition: rosui.h:584
BOOL m_Horizontal
Definition: rosui.h:585
RECT m_LastRect
Definition: rosui.h:579
BOOL m_DynamicFirst
Definition: rosui.h:586
CUiMeasure m_Width
Definition: rosui.h:590
HCURSOR m_hCursor
Definition: rosui.h:574
BOOL m_HasOldRect
Definition: rosui.h:581
INT m_MinSecond
Definition: rosui.h:588
INT m_MinFirst
Definition: rosui.h:587
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define memset(x, y, z)
Definition: compat.h:39

◆ ~CUiSplitPanel()

virtual CUiSplitPanel::~CUiSplitPanel ( )
inlinevirtual

Definition at line 607 of file rosui.h.

608 {
609 }

Member Function Documentation

◆ AsBox()

virtual CUiBox * CUiSplitPanel::AsBox ( )
inlinevirtual

Reimplemented from CUiPrimitive.

Definition at line 612 of file rosui.h.

613 {
614 return this;
615 }

◆ ComputeContentBounds()

virtual VOID CUiSplitPanel::ComputeContentBounds ( RECT rect)
inlinevirtual

Reimplemented from CUiBox.

Definition at line 640 of file rosui.h.

641 {
642 RECT r;
643
646
647 ::GetWindowRect(m_hWnd, &r);
648
649 rect->left = min(rect->left, r.left);
650 rect->top = min(rect->top, r.top);
651 rect->right = max(rect->right, r.right);
652 rect->bottom = max(rect->bottom, r.bottom);
653 };
virtual VOID ComputeContentBounds(RECT *rect)
Definition: rosui.h:426
CUiPanel m_Second
Definition: rosui.h:577
CUiPanel m_First
Definition: rosui.h:576
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define min(a, b)
Definition: monoChain.cc:55
& rect
Definition: startmenu.cpp:1413
#define max(a, b)
Definition: svc.c:63
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

◆ ComputeMinimalSize()

virtual VOID CUiSplitPanel::ComputeMinimalSize ( SIZE size)
inlinevirtual

Reimplemented from CUiBox.

Definition at line 629 of file rosui.h.

630 {
631 if (m_Horizontal)
632 size->cx = max(size->cx, THICKNESS);
633 else
634 size->cy = max(size->cy, THICKNESS);
637 };
virtual VOID ComputeMinimalSize(SIZE *size)
Definition: rosui.h:413
static const INT THICKNESS
Definition: rosui.h:571
GLsizeiptr size
Definition: glext.h:5919

Referenced by OnParentSize().

◆ CountSizableChildren()

virtual DWORD_PTR CUiSplitPanel::CountSizableChildren ( )
inlinevirtual

Reimplemented from CUiBox.

Definition at line 656 of file rosui.h.

657 {
658 INT count = 1;
661 return count;
662 };
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:439
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:58

Referenced by SetPos().

◆ Create()

HWND CUiSplitPanel::Create ( HWND  hwndParent)
inline

Definition at line 867 of file rosui.h.

868 {
869 if (m_Horizontal)
871 else
873
875 DWORD exStyle = WS_EX_TRANSPARENT;
876
877 RECT size = {205, 180, 465, THICKNESS};
878 size.right += size.left;
879 size.bottom += size.top;
880
881 return CWindowImpl::Create(hwndParent, size, NULL, style, exStyle);
882 }
Arabic default style
Definition: afstyles.h:94
static HWND hwndParent
Definition: cryptui.c:300
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define IDC_SIZENS
Definition: winuser.h:695
#define LoadCursor
Definition: winuser.h:5821
#define IDC_SIZEWE
Definition: winuser.h:694

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

◆ First()

CUiCollection & CUiSplitPanel::First ( )
inline

Definition at line 618 of file rosui.h.

619 {
620 return m_First.Children();
621 }
CUiCollection & Children()
Definition: rosui.h:384

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

◆ GetPos()

INT CUiSplitPanel::GetPos ( )
inline

Definition at line 815 of file rosui.h.

816 {
817 return m_Pos;
818 }

◆ OnParentSize()

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

Reimplemented from CUiBox.

Definition at line 665 of file rosui.h.

666 {
667 RECT rect = {0};
668
669 SIZE content = {0};
671
672 INT preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx);
673 INT preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy);
674
675 rect.right = preferredWidth;
676 rect.bottom = preferredHeight;
677
678 ComputeRect(parentRect, rect, &rect);
679
680 SIZE growth = {0};
681 if (m_HasOldRect)
682 {
683 RECT oldRect = m_LastRect;
684
685 growth.cx = (parentRect.right - parentRect.left) - (oldRect.right - oldRect.left);
686 growth.cy = (parentRect.bottom - parentRect.top) - (oldRect.bottom - oldRect.top);
687 }
688
689 RECT splitter = rect;
690 RECT first = rect;
691 RECT second = rect;
692
693 if (m_Horizontal)
694 {
695 rect.top += m_MinFirst;
696 rect.bottom -= THICKNESS + m_MinSecond;
697 if (m_DynamicFirst)
698 {
699 if (growth.cy > 0)
700 {
701 m_Pos += min(growth.cy, rect.bottom - (m_Pos + THICKNESS));
702 }
703 else if (growth.cy < 0)
704 {
705 m_Pos += max(growth.cy, rect.top - m_Pos);
706 }
707 }
708
709 if (m_Pos > rect.bottom)
710 m_Pos = rect.bottom;
711
712 if (m_Pos < rect.top)
713 m_Pos = rect.top;
714
715 splitter.top = m_Pos;
716 splitter.bottom = m_Pos + THICKNESS;
717 first.bottom = splitter.top;
718 second.top = splitter.bottom;
719 }
720 else
721 {
722 rect.left += m_MinFirst;
723 rect.right -= THICKNESS + m_MinSecond;
724 if (m_DynamicFirst)
725 {
726 if (growth.cx > 0)
727 {
728 m_Pos += min(growth.cx, rect.right - (m_Pos + THICKNESS));
729 }
730 else if (growth.cx < 0)
731 {
732 m_Pos += max(growth.cy, rect.left - m_Pos);
733 }
734 }
735
736 if (m_Pos > rect.right)
737 m_Pos = rect.right;
738
739 if (m_Pos < rect.left)
740 m_Pos = rect.left;
741
742 splitter.left = m_Pos;
743 splitter.right = m_Pos + THICKNESS;
744 first.right = splitter.left;
745 second.left = splitter.right;
746 }
747
748 m_LastRect = parentRect;
750
751 hDwp = m_First.OnParentSize(first, hDwp);
752 hDwp = m_Second.OnParentSize(second, hDwp);
753
754 if (hDwp)
755 {
756 return DeferWindowPos(
757 hDwp, NULL, splitter.left, splitter.top, splitter.right - splitter.left, splitter.bottom - splitter.top,
759 }
760 else
761 {
763 NULL, splitter.left, splitter.top, splitter.right - splitter.left, splitter.bottom - splitter.top,
765 return NULL;
766 }
767 };
virtual VOID ComputeRect(RECT parentRect, RECT currentRect, RECT *newRect)
Definition: rosui.h:268
INT ComputeMeasure(INT parent, INT content)
Definition: rosui.h:201
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:454
virtual VOID ComputeMinimalSize(SIZE *size)
Definition: rosui.h:629
#define TRUE
Definition: types.h:120
content
Definition: atl_ax.c:994
const GLint * first
Definition: glext.h:5794
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
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:1242
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
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:1247

Referenced by SetPos().

◆ ProcessWindowMessage()

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

Definition at line 771 of file rosui.h.

772 {
773 theResult = 0;
774 switch (Msg)
775 {
776 case WM_SETCURSOR:
778 theResult = TRUE;
779 break;
780
781 case WM_LBUTTONDOWN:
782 SetCapture();
783 break;
784
785 case WM_LBUTTONUP:
786 case WM_RBUTTONDOWN:
787 if (GetCapture() == m_hWnd)
788 {
790 }
791 break;
792
793 case WM_MOUSEMOVE:
794 if (GetCapture() == m_hWnd)
795 {
796 POINT Point;
799 if (m_Horizontal)
800 SetPos(Point.y);
801 else
802 SetPos(Point.x);
803 }
804 break;
805
806 default:
807 return FALSE;
808 }
809
810 return TRUE;
811 }
VOID SetPos(INT NewPos)
Definition: rosui.h:821
struct @1644 Msg[]
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2701
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1775
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define WM_RBUTTONDOWN
Definition: winuser.h:1779
#define WM_LBUTTONUP
Definition: winuser.h:1777
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETCURSOR
Definition: winuser.h:1636
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ Second()

CUiCollection & CUiSplitPanel::Second ( )
inline

Definition at line 623 of file rosui.h.

624 {
625 return m_Second.Children();
626 }

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

◆ SetPos()

VOID CUiSplitPanel::SetPos ( INT  NewPos)
inline

Definition at line 821 of file rosui.h.

822 {
823 RECT rcParent;
824
825 rcParent = m_LastRect;
826
827 if (m_Horizontal)
828 {
829 rcParent.bottom -= THICKNESS;
830
831 m_Pos = NewPos;
832
833 if (m_Pos < rcParent.top)
834 m_Pos = rcParent.top;
835
836 if (m_Pos > rcParent.bottom)
837 m_Pos = rcParent.bottom;
838 }
839 else
840 {
841 rcParent.right -= THICKNESS;
842
843 m_Pos = NewPos;
844
845 if (m_Pos < rcParent.left)
846 m_Pos = rcParent.left;
847
848 if (m_Pos > rcParent.right)
849 m_Pos = rcParent.right;
850 }
851
853
854 HDWP hdwp = NULL;
856 if (hdwp)
857 hdwp = OnParentSize(m_LastRect, hdwp);
858 if (hdwp)
859 EndDeferWindowPos(hdwp);
860 }
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:656
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:665
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HDWP WINAPI BeginDeferWindowPos(_In_ int)

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 581 of file rosui.h.

Referenced by CUiSplitPanel(), and OnParentSize().

◆ m_hCursor

HCURSOR CUiSplitPanel::m_hCursor
protected

Definition at line 574 of file rosui.h.

Referenced by Create(), CUiSplitPanel(), and ProcessWindowMessage().

◆ m_Height

CUiMeasure CUiSplitPanel::m_Height

Definition at line 591 of file rosui.h.

Referenced by CUiSplitPanel().

◆ m_Horizontal

◆ m_LastRect

RECT CUiSplitPanel::m_LastRect
protected

Definition at line 579 of file rosui.h.

Referenced by CUiSplitPanel(), 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 590 of file rosui.h.

Referenced by CUiSplitPanel(), and OnParentSize().

◆ THICKNESS

const INT CUiSplitPanel::THICKNESS = 4
staticprivate

Definition at line 571 of file rosui.h.

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


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