[Classes] [Prev] [Next] [Methods]

CMappedSplitter

Methods Index

Heritage
Description
Usage
Classes
Enums
Private Data Members
Public Methods
Constructor, Destructor, and Initializer Methods
Service Methods
Device-Independent Tracking Interface
Implementation Methods
Wide Interface Override
Protected Methods
Initializer Method
Overridden Method For Mapped Splitter Behavior
CMappedPane Helper Methods
CMappedPane Virtual Constructors:

Helper Class:
CMappedSplitter::CMappedPane
Heritage
Description
Public Data Members
Public Methods
Protected Methods
Constructor and Destructor Methods

CMappedSplitter::CMappedSplitterMouseAgent
Heritage
Description
Protected Data Members
Public Methods
Constructor and Destructor Methods
Mouse Handling Overridden Methods

CMappedSplitter


Heritage

Superclass: CSplitter

Subclasses: None

Helper Classes: CMappedSplitter::CMappedPane, CMappedSplitter::CMappedSplitterMouseAgent


Description

You would use a mapped splitter when a single view requires a large geometry to display itself. Mapped splitters allow the user to view various areas-panes-of a geometry within a confined space. A mapped splitter supports synchronized scrolling and dynamic creation and deletion of panes

Mapped splitters also manage decorations, including shared scrollbars and splitboxes used for dynamic splitting.

Mapped splitters use delayed creation to inform clients of the class when to create a paned view.


Usage

[Create splitter]

itsMappedSplitter = new CMappedSplitter(
this,
GetFrame().GetInflatedRect(-2.0F),
//CMappedSplitter::MB_HORIZONTAL_NONE,
//CMappedSplitter::MB_HORIZONTAL_ONE,
CMappedSplitter::MB_HORIZONTAL_MANY,
//CMappedSplitter::MB_VERTICAL_NONE,
//CMappedSplitter::MB_VERTICAL_ONE,
CMappedSplitter::MB_VERTICAL_MANY,
SPLITTER_GRAB_H,
SPLITTER_DRAG_H,
SPLITTER_GRAB_V,
SPLITTER_DRAG_V,
SPLITTER_GRAB_HV,
SPLITTER_DRAG_HV,
TRUE, // hor scollbar
TRUE); // ver scrollbar
itsMappedSplitter->SetGlue(ALLSTICKY);
itsMappedSplitter->IMappedSplitter();
Invalidate();

[Create splitter pane]

--> CMappedSplitter::CMappedPane* thePane <--

CSurrogateScroller* aPane = new CSurrogateScroller(
itsMappedSplitter, thePane->GetFrame());
aPane->IScroller(thePane->GetHorScrollBar(),
thePane->GetVerScrollBar());
aPane->SetGlue(ALLSTICKY);
aPane->Invalidate();

COval* anOval = new COval(aPane, itsSubject);
itsObservers.append(anOval) ;
itsMappedSplitter->IMappedPane(thePane, 1L, aPane);

[Delete splitter pane]

--> CMappedSplitter::CMappedPane* thePane <--

itsObservers.remove(thePane->GetView()
->GetSubviews()->at(0));

[Manage splitter callback and MVC]

switch (theMsg)
{
case WFSizeCmd: {
if (!theCmd) break;
CView* anOriginator = (CView*) theCmd;
itsSubject = anOriginator->GetFrame();
NotifyObservers(anOriginator);
} break;
case MSCreatePaneCmd:
if (!theCmd) break;
CreatePane((CMappedSplitter::CMappedPane*)
theCmd);
break;
case MSDestroyPaneCmd:
if (!theCmd) break;
DestroyPane((CMappedSplitter::CMappedPane*)
theCmd);
break;
};

[Manage MVC change and update]

CDrawingContext aDC(this);
aDC.SetLocalRegionedQueue(TRUE);
RWOrderedIterator doTo(itsObservers);
while (doTo())
{
CView* anObserver = (CView*) doTo.key();
if (anObserver==theObserver) continue;
CRect anOldFrame = anObserver->GetGlobalFrame();
anObserver->DoSize(itsSubject);
aDC.QueueInvalidate(anOldFrame);
aDC.QueueInvalidate(
anObserver->GetGlobalFrame());
}
aDC.FlushInvalidate();

Classes

class CMappedSplitter::CMappedPane
class CMappedSplitter::CMappedSplitterMouseAgent


Enums

Split Horizontal Behavior:

MB_HORIZONTAL_NONE,
MB_HORIZONTAL_ONE,
MB_HORIZONTAL_MANY

Split Vertical Behavior:

MB_VERTICAL_NONE,
MB_VERTICAL_ONE,
MB_VERTICAL_MANY


Private Data Members

CMappedPane attributes:

SplitHorBehavior itsSplitHorBehavior;
SplitVerBehavior itsSplitVerBehavior;
CSplitBar* itsTrackedSplitBox;
SplitBoxTracking itsBoxTracking;
CRect itsHorSplitBox;
CRect itsVerSplitBox;
BOOLEAN isHorSplitBoxVisible;
BOOLEAN isVerSplitBoxVisible;
UNITS itsSplitBarSize;
COLOR itsBoxDarkColor;
COLOR itsBoxLightColor;
COLOR itsBoxBodyColor;
COLOR itsBoxHighlightColor;
BOOLEAN itHasHorScrollBars;
BOOLEAN itHasVerScrollBars;
size_t itsNumColumns;
size_t itsNumRows;
RWOrdered itsHorScrollBarCache;
RWOrdered itsVerScrollBarCache;


Public Methods

Constructor, Destructor, and Initializer Methods

CMappedSplitter(CSubview* theEnclosure, 
const CRect& theRect,
SplitHorBehavior theHorBehavior = MB_HORIZONTAL_MANY,
SplitVerBehavior theVerBehavior = MB_VERTICAL_MANY,
CURSOR theHorGrabCursor = CURSOR_ARROW,
CURSOR theHorDragCursor = CURSOR_ARROW,
CURSOR theVerGrabCursor = CURSOR_ARROW,
CURSOR theVerDragCursor = CURSOR_ARROW,
CURSOR theHVGrabCursor = CURSOR_ARROW,
CURSOR theHVDragCursor = CURSOR_ARROW,
BOOLEAN theHorScrollBars = TRUE,
BOOLEAN theVerScrollBars = TRUE,
UNITS theBoxSize = 7.0F,
COLOR theBoxDarkColor = COLOR_BLACK,
COLOR theBoxLightColor = COLOR_WHITE,
COLOR theBoxBodyColor = COLOR_LTGRAY,
COLOR theBoxHighlightColor = COLOR_GRAY);
virtual ~CMappedSplitter();
virtual void IMappedSplitter();

Service Methods

virtual void IMappedPane(CMappedPane* thePane,
long theId, CView* theView);
virtual void SplitHorizontal();
virtual void SplitVertical();

Device-Independent Tracking Interface

virtual BOOLEAN IsBoxTracking() const;
virtual BOOLEAN TrackBoxBegin(const CPoint& theLoc);
virtual BOOLEAN TrackBoxMove(const CPoint& theLoc);
virtual BOOLEAN TrackBoxEnd(const CPoint& theLoc);
virtual BOOLEAN TrackAutoSplit(const CPoint& theLoc);

Implementation Methods

virtual void DrawHorSplitBox();
virtual void DrawVerSplitBox();

Wide Interface Override

virtual void DoDraw(const CRect &theRegion = MAXRect);

Protected Methods

Initializer Method

virtual void ISplitBoxes();

Overridden Method For Mapped Splitter Behavior

virtual void OnAdjustPanes(
CHorizontalSplitBar* theHorSplit,
UNITS theHorAxis,
CVerticalSplitBar* theVerSplit,
UNITS theVerAxis);

CMappedPane Helper Methods

virtual void DoSplitMappedPane(
UNITS theOrigin,
SplitBoxTracking theOrientation);
virtual BOOLEAN HorSplitBoxHitTest(const CPoint& theGlobalHit);
virtual BOOLEAN VerSplitBoxHitTest(const CPoint& theGlobalHit);
virtual BOOLEAN IsMinHorLocation(UNITS theOrigin) const;
virtual BOOLEAN IsMaxHorLocation(UNITS theOrigin) const;
virtual BOOLEAN IsMinVerLocation(UNITS theOrigin) const;
virtual BOOLEAN IsMaxVerLocation(UNITS theOrigin) const;
virtual CRect AdjustClientFrame(
const CRect& theFrame,
BOOLEAN hasHorScrollBar,
BOOLEAN hasVerScrollBar);
virtual CMappedPane* CreateMappedPane(
const CRect& theClientFrame,
NScrollBar* theHorScrollBar,
NScrollBar* theVerScrollBar);
virtual void DestroyMappedPane(CMappedPane* thePane);
virtual NScrollBar* CreateHorScrollBar(
const CRect& theClientFrame,
BOOLEAN hasAdjacantVerScrollBar = FALSE);
virtual NScrollBar* CreateVerScrollBar(
const CRect& theClientFrame,
BOOLEAN hasAdjacantHorScrollBar = FALSE);

CMappedPane Virtual Constructors:

virtual CSplitterMouseAgent* ConstructMouseAgent();
virtual CMappedPane* ConstructMappedPane();
virtual NScrollBar* ConstructScrollBar(
const CRect& theRegion,
DIRECTION theDirection);

Helper Class:


CMappedSplitter::CMappedPane


Heritage

Superclass: CSplitter::CPane

Subclasses: None


Description

CMappedPane is derived from CSplitter::CPane for use with CMappedSplitter.


Public Data Members

friend CMappedSplitter


Public Methods

NScrollBar* GetHorScrollBar();
NScrollBar* GetVerScrollBar();

Protected Methods

Constructor and Destructor Methods

CMappedPane();
virtual ~CMappedPane();

Helper Class:


CMappedSplitter::CMappedSplitterMouseAgent


Heritage

Superclass: CSplitter::CSplitterMouseAgent

Subclasses: None


Description

CMappedSplitterMouseAgent is derived to handle mouse events for CMappedSplitter.

None


Protected Data Members

Mouse action target:

CMappedSplitter* itsMappedSplitter;


Public Methods

Constructor and Destructor Methods

CMappedSplitterMouseAgent(
CMappedSplitter* theSplitter,
short theTrackButton = 0 /* left button */);
virtual ~CMappedSplitterMouseAgent();

Mouse Handling Overridden Methods

The following CMouseHandler methods are overridden to manipulate the splitter through the tracking interface.

virtual BOOLEAN DoDown(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);
virtual BOOLEAN DoUp(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);
virtual BOOLEAN DoMove(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);
virtual BOOLEAN DoDouble(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.