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

CSplitBar, CHorizontalSplitBar, CVerticalSplitBar

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Immutable Accessors
Mutable Accessors and Modifiers
Tracking Interface
Protected Methods

Subclass:
CHorizontalSplitBar
Description
Public Methods
Constructor and Destructor Methods
Methods Overriden From CSplitBar
Protected Methods

Subclass:
CVerticalSplitBar
Description
Public Methods
Constructor and Destructor Methods
Methods Overriden From CSplitBar
Protected Methods

CSplitBar


Heritage

Superclass: None

Subclasses: CHorizontalSplitBar, CVerticalSplitBar


Description

Splitbars should be used as delegate objects to support the splitting of a user interface. Splitbar enforces no rules for how an interface should be split. This should be done by the delegate owner. The benefit of using a splitbar is that many split styles and rules may be created by simply composing higher-level objects of splitbars.

Splitbar expects global/window-relative coordinates. Splitbars will draw themselves with a beveled look. You may specify the colors used for beveled look as well as the size of the splitbar


Usage

Use splitbars in a delegation style and ensure that mouse events are delivered uniformly when tracking.

[Construction]
itsVSplitBar = new CVerticalSplitBar(this, aVerRange, aVSplit);
itsHSplitBar = new CHorizontalSplitBar(this, aHorRange, aHSplit);

[Delegate Drawing]
void CSplitWin::DoDraw(...) {
CWindow::DoDraw(theRegion);
if (!IsVisible()) return;
itsVSplitBar->Draw();
itsHSplitBar->Draw();
itsVSplitBar->DrawIntersection(itsHSplitBar);
itsHSplitBar->DrawIntersection(itsVSplitBar);
}

[Delegate Tracking]
void CSplitWin::MouseUp(...) {
if (itsVSplitBar->IsTracking())
itsVSplitBar->EndTracking();
if (itsHSplitBar->IsTracking())
itsHSplitBar->EndTracking();
}

void CSplitWin::MouseDown(...) {
if (itsHSplitBar->HitTest(theLoc))
itsHSplitBar->BeginTracking(theLoc);
if (itsVSplitBar->HitTest(theLoc))
itsVSplitBar->BeginTracking(theLoc);
}

void CSplitWin::MouseMove(...) {
if (itsVSplitBar->IsTracking
itsVSplitBar->MoveTracking(theLoc);
if (itsHSplitBar->IsTracking())
itsHSplitBar->MoveTracking(theLoc);
}

[Moving the Splitbar]
if (itsVSplitBar->IsTracking())
{
UNITS aVAxis = itsVSplitBar->EndTracking();
itsVSplitBar->SetAxis(aVAxis);
}
if (itsHSplitBar->IsTracking())
{
UNITS aHAxis = itsHSplitBar->EndTracking();
itsHSplitBar->SetAxis(aHAxis);
}

Protected Data Members

Attributes:

CWindow* itsDrawWin;
UNITS itsSplitBarSize;
CRect itsRange;
CPoint itsTrackingPoint;
CPoint itsTrackingOffset;
UNITS itsAxisCur;
BOOLEAN itIsTracking;
COLOR itsLightCol;
COLOR itsShadowCol;
COLOR itsBarCol;


Public Methods

Immutable Accessors

virtual UNITS GetSplitBarSize() const;
virtual CRect GetSplitBarFrame(UNITS theAxisLoc = PWR_SPLITBAR_DEFAULT) const = 0;
virtual BOOLEAN HitTest(const CPoint& theLoc) const;

Mutable Accessors and Modifiers

virtual UNITS GetAxis() const; 
virtual void SetAxis(UNITS theAxisLoc, BOOLEAN theUpdate = TRUE);
virtual CRect GetRange() const;
virtual void SetRange(const CRect& theRange);
virtual void Draw() = 0;
virtual void UpdateDraw();
virtual BOOLEAN ShouldDrawIntersection(
const CSplitBar* theSplitBar);

Tracking Interface

virtual BOOLEAN IsTracking() const;\
virtual void BeginTracking(const CPoint& theLoc);
virtual void MoveTracking(const CPoint& theLoc);
virtual UNITS EndTracking();

Protected Methods

virtual UNITS GetAxisFromPoint(const CPoint& theLoc) = 0;
virtual CPoint GetAxisEdge(const CPoint& theLoc) = 0;

Subclass:


CHorizontalSplitBar


Description

CHorizontalSplitBar is the adapter interface for horizontal splitbars.


Public Methods

Constructor and Destructor Methods

CHorizontalSplitBar(
CWindow* theDrawWin,
const CRect& theRange,
UNITS theCurVertLoc,
UNITS theSplitBarSize = 7.0F,
COLOR theLightCol = COLOR_WHITE,
COLOR theShadowCol = COLOR_GRAY,
COLOR theBarCol = COLOR_LTGRAY);
virtual ~CHorizontalSplitBar();

Methods Overriden From CSplitBar

virtual CRect GetSplitBarFrame(
UNITS theAxisLoc = PWR_SPLITBAR_DEFAULT) const;
virtual void Draw();
virtual void DrawIntersection(
const CVerticalSplitBar* theSplitBar);

Protected Methods

virtual UNITS GetAxisFromPoint(const CPoint& theLoc) = 0;
virtual CPoint GetAxisEdge(const CPoint& theLoc) = 0;

Subclass:


CVerticalSplitBar


Description

CVerticalSplitBar is the adapter interface for vertical splitbars.


Public Methods

Constructor and Destructor Methods

CVerticalSplitBar(
CWindow* theDrawWin,
const CRect& theRange,
UNITS theCurVertLoc,
UNITS theSplitBarSize = 7.0F,
COLOR theLightCol = COLOR_WHITE,
COLOR theShadowCol = COLOR_GRAY,
COLOR theBarCol = COLOR_LTGRAY);
virtual ~CVerticalSplitBar();

Methods Overriden From CSplitBar

virtual CRect GetSplitBarFrame(
UNITS theAxisLoc = PWR_SPLITBAR_DEFAULT) const;
virtual void Draw();
virtual void DrawIntersection(
const CVerticalSplitBar* theSplitBar);

Protected Methods

virtual UNITS GetAxisFromPoint(const CPoint& theLoc) = 0;
virtual CPoint GetAxisEdge( const CPoint& theLoc ) = 0;


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

support@xvt.com


Visit our online help desk for tech support

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