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

CToolBarAttachment

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Constructor, Operator, and Destructor Methods
Utility Methods
Protected Methods

CToolBarAttachment


Heritage

Superclass: CAttachment

Subclass: CToolPaletteAttachment


Description

CToolBarAttachment provides intelligent sizing of CToolBars attached to a CAttachmentFrame. Basically, CToolBarAttachment provides a mechanism (inherited from CAttachment) for requesting "fit sizes" and a "best size" for any given CToolBar.


Usage

A CToolBarAttachment is created directly via its constructor as follows:

CShellWin::CShellWin(...)

{
// Create toolbar
CToolBar *aToolBar = new CToolBar(this);
//... code to add items to toolbar.
// NOTE: it is likely that the toolbar will be
// created by an Architect Factory, making
// the code above unnecessary.
// Create an attachment frame that allows docking
// at all sides of the window
itsAttachmentFrame = new CAttachmentFrame(this,
CAttachmentFrame::ATTACH_ALL);

// Create an attachment object that will manage the
// toolbar. In addition, register attachment frame
// as a sink to allow drag-and-dock
itsToolBarAttachment = new CToolBarAttachment(
aToolBar);
itsToolBarAttachment->RegisterSink(
itsAttachmentFrame);

// Attach toolbar to top of anAttachmentFrame and
// arrange the attachments as necessary
itsToolBarAttachment->Attach(itsAttachmentFrame,
CAttachmentFrame::ATTACH_TOP);
itsAttachmentFrame->ArrangeAttachments();
}

Protected Data Members

BOOLEAN itCalculatesBestSize; Determines if size object can be deleted
CRect* itsBestSize; Preferred size for the toolbar
BOOLEAN itIsInSetEnclosure; Used to flag transition of enclosure states


Public Methods

Constructor, Operator, and Destructor Methods

CToolBarAttachment(CToolBar *theToolBar);
CToolBarAttachment(CToolBar *theToolBar, 
const CRect &theBestSize);
CToolBarAttachment(const CToolBarAttachment &theAttachment);
CToolBarAttachment& operator=(
const CToolBarAttachment &theAttachment);
virtual ~CToolBarAttachment(void);

Utility Methods

virtual void InvalidateSizes(void);
CToolBar* GetToolBar(void) const;
virtual const RWSortedVector* GetAllFitSizes(void);
virtual CRect GetBestSize(void);
virtual CRect GetSize(void);
virtual void Detach(BOOLEAN hasTitleBar = TRUE);
virtual void Popup(CWindow *theWindow, 
BOOLEAN hasTitleBar = FALSE);
virtual void RegisterSink(
CDragSink *theDragSink,
BOOLEAN isInFront = TRUE);
virtual void UnregisterSink(CDragSink *theDragSink);

Protected Methods

virtual void CalculateFitSizes(void);
virtual void CalculateBestSize(void);
virtual void InternalAttach(
CAttachmentFrame *theFrame,
CAttachmentFrame::AttachmentPoint theAttachmentPoint);
CRect GetDesiredSize(void);


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

support@xvt.com


Visit our online help desk for tech support

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