Windows C++ Library
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
CSplitWnd Class Reference

This is a window which hosts 2 other windows either side by side or one above the other. More...

#include <SplitWnd.hpp>

Inheritance diagram for CSplitWnd:
CCtrlWnd CPopupWnd CMsgWnd CWnd

List of all members.

Public Types

enum  Split { VERTICAL, HORIZONTAL }
 The style of split. More...
enum  Sizing { FIXED, RESIZEABLE }
 The style of pane resizing. More...
enum  { LEFT_PANE = 0, RIGHT_PANE = 1, TOP_PANE = 0, BOTTOM_PANE = 1 }
 The Index of the panes. More...

Public Member Functions

 CSplitWnd (Sizing eSizing)
 Constructor.
 CSplitWnd (Split eSplit, Sizing eSizing)
 Constructor.
virtual ~CSplitWnd ()
 Destructor.
Split SplitStyle () const
 Get the split style.
void SetSplitStyle (Split eSplit)
 Set the split style.
CWndPane (size_t nPane) const
 Get the window inside a pane.
void SetPane (size_t nPane, CWnd *pWnd)
 Set the window inside a pane.
uint SizingBarPos () const
 Get the position of the sizing bar.
void SetSizingBarPos (uint nPos)
 Set the position of the sizing bar.
CRect PaneRect (size_t nPane) const
 Get the rectangle for a pane.
CRect SizingBarRect () const
 Get the rectangle for the sizing bar.

Protected Member Functions

virtual void GetClassParams (WNDCLASS &rParams)
 Get the window class settings.
virtual void GetCreateParams (WNDCREATE &rParams)
 Get the window instance settings.
virtual void OnResize (int iFlag, const CSize &rNewSize)
 Resize the child panes.
virtual void OnPaint (CDC &rDC)
 Paint the window.
virtual void OnSetCursor (HWND hWnd, uint nHitCode, uint nMouseMsg)
 Set the cursor for this window or one of it's children.
virtual void OnLeftButtonDown (const CPoint &ptCursor, uint nKeyFlags)
 Handle a mouse click over the sizing bar.
virtual void OnLeftButtonUp (const CPoint &ptCursor, uint nKeyFlags)
 Handle a mouse click over the sizing bar.
virtual void OnMouseMove (const CPoint &ptCursor, uint nKeyFlags)
 Handle resizng of the panes.
void Initialise ()
 Common construction.
CRect PaneRect (size_t nPane, const CRect &rcClient) const
 Get the rectangle for a pane.

Static Protected Member Functions

static int ClipBarPos (int iBarPos, int iMin, int iMax)
 Clip the bar position.

Protected Attributes

CWndm_pPanes [2]
 The window panes.
Split m_eSplit
 The position of the split.
Sizing m_eSizing
 The ability to resize the panes.
uint m_nBarPos
 The x or y position of the bar.
CCursor m_curArrow
 The arrow cursor.
CCursor m_curSizer
 The sizing cursor.

Private Member Functions

 CSplitWnd (const CSplitWnd &)
CSplitWndoperator= (const CSplitWnd &)

Detailed Description

This is a window which hosts 2 other windows either side by side or one above the other.

A bar separates the two windows and can be used to resize them.


Member Enumeration Documentation

The style of split.

Enumerator:
VERTICAL 

Split into a left & right pane.

HORIZONTAL 

Split into a top & bottom pane.

The style of pane resizing.

Enumerator:
FIXED 

The pane split is programmatic.

RESIZEABLE 

The pane split is user controlled.

anonymous enum

The Index of the panes.

Enumerator:
LEFT_PANE 

The left pane in a VERTICAL split.

RIGHT_PANE 

The right pane in a VERTICAL split.

TOP_PANE 

The top pane in a HORIZONTAL split.

BOTTOM_PANE 

The bottom pane in a HORIZONTAL split.


Constructor & Destructor Documentation

Constructor.

CSplitWnd::CSplitWnd ( Split  eSplit,
Sizing  eSizing 
)

Constructor.

CSplitWnd::~CSplitWnd ( ) [virtual]

Destructor.

CSplitWnd::CSplitWnd ( const CSplitWnd ) [private]

Member Function Documentation

Get the split style.

void CSplitWnd::SetSplitStyle ( Split  eSplit)

Set the split style.

CWnd * CSplitWnd::Pane ( size_t  nPane) const

Get the window inside a pane.

void CSplitWnd::SetPane ( size_t  nPane,
CWnd pWnd 
)

Set the window inside a pane.

uint CSplitWnd::SizingBarPos ( ) const [inline]

Get the position of the sizing bar.

void CSplitWnd::SetSizingBarPos ( uint  nPos) [inline]

Set the position of the sizing bar.

CRect CSplitWnd::PaneRect ( size_t  nPane) const

Get the rectangle for a pane.

Get the rectangle for the sizing bar.

void CSplitWnd::GetClassParams ( WNDCLASS &  rParams) [protected, virtual]

Get the window class settings.

Reimplemented from CPopupWnd.

void CSplitWnd::GetCreateParams ( WNDCREATE rParams) [protected, virtual]

Get the window instance settings.

Reimplemented from CCtrlWnd.

void CSplitWnd::OnResize ( int  iFlag,
const CSize rNewSize 
) [protected, virtual]

Resize the child panes.

Reimplemented from CMsgWnd.

void CSplitWnd::OnPaint ( CDC rDC) [protected, virtual]

Paint the window.

Reimplemented from CMsgWnd.

void CSplitWnd::OnSetCursor ( HWND  hWnd,
uint  nHitCode,
uint  nMouseMsg 
) [protected, virtual]

Set the cursor for this window or one of it's children.

Reimplemented from CMsgWnd.

void CSplitWnd::OnLeftButtonDown ( const CPoint ptCursor,
uint  nKeyFlags 
) [protected, virtual]

Handle a mouse click over the sizing bar.

Reimplemented from CPopupWnd.

void CSplitWnd::OnLeftButtonUp ( const CPoint ptCursor,
uint  nKeyFlags 
) [protected, virtual]

Handle a mouse click over the sizing bar.

Reimplemented from CPopupWnd.

void CSplitWnd::OnMouseMove ( const CPoint ptCursor,
uint  nKeyFlags 
) [protected, virtual]

Handle resizng of the panes.

Reimplemented from CPopupWnd.

void CSplitWnd::Initialise ( ) [protected]

Common construction.

CRect CSplitWnd::PaneRect ( size_t  nPane,
const CRect rcClient 
) const [protected]

Get the rectangle for a pane.

int CSplitWnd::ClipBarPos ( int  iBarPos,
int  iMin,
int  iMax 
) [static, protected]

Clip the bar position.

CSplitWnd& CSplitWnd::operator= ( const CSplitWnd ) [private]

Member Data Documentation

CWnd* CSplitWnd::m_pPanes[2] [protected]

The window panes.

The position of the split.

The ability to resize the panes.

uint CSplitWnd::m_nBarPos [protected]

The x or y position of the bar.

The arrow cursor.

The sizing cursor.


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