Accounting Software
Small Business Software Estimating Software
Project Management SoftwareProject Estimating SoftwareProject Tracking SoftwareInventory Tracking SoftwareCustomer Tracking SoftwareCustomer Management SoftwareBusiness Management Software

Label Icons (Header)

Link to: source code | other interface directory

Copyright Turtle Creek Software 1996-2006. All Rights Reserved.

This class manages label icons for the
Goldenseal small business accounting software,
project management software, construction accounting software
and construction software.

class CLabelIcon : public CTCS_Control
{
public:

// Class ID for UReanimator
enum { class_ID = 'CTLI' };
enum
{
// Public constants
cUseDBIcon = true,
cUseResIcon = false
};
enum
{
// Broadcast messages
msg_LabelIconSelected = 'TLI0',
msg_LabelIconDoubleClicked = 'TLI1'
};
CLabelIcon (const SPaneInfo & paneInfo,
const SLabelIconInfo & iconInfo,
const Boolean inUseDBIcon = cUseDBIcon);
virtual ~CLabelIcon();
static void GetOptimalFrameSize (IconViewType inViewType,
IconLabelPos inLabelPos,
const CTCS_TextInfo & inTextInfo,
const CTextString & inLabel,
SInt32 *outWidth = nil,
SInt32 *outHeight = nil);

// Following is an extension of IsVisible() to find exact visiblity state
virtual Boolean IsHidden() const { return mVisible == triState_Off; }
virtual void GetLabel(CTextString *theLabel) const { *theLabel = mLabel; }
virtual CTextString GetLabel() const { return mLabel; }
virtual void SetLabel (const CTextString & inLabel,
Boolean inRefresh = true);
virtual SInt32 GetIconID() const { return mIconSuite.GetID(); }
virtual void SetIconID (SInt32 inIconID, Boolean redraw = true,
Boolean inUseDBIcon = cUseDBIcon);
virtual IconViewType GetViewType() { return mViewType; }
virtual void SetViewType (IconViewType aViewType);

virtual IconLabelPos GetLabelPosition() { return mLabelPosition; }
virtual void SetLabelPosition (IconLabelPos inPosition,
Boolean redraw = true)
{
mLabelPosition = inPosition;
if (redraw)
Refresh();
}
virtual SInt32 GetSelectedStyle() { return mSelectedStyle; };
virtual void SetSelectedStyle (SInt32 aStyle, Boolean redraw = true)
{
mSelectedStyle = aStyle;
if ((redraw) && (mValue == Button_On))
Draw (nil);
}
virtual SInt32 GetIndent() { return mIndent; }
virtual void SetIndent (SInt32 anIndent, Boolean redraw = true)
{
mIndent = anIndent;
if (redraw)
Refresh();
}
virtual MessageT GetClickMessage() { return mClickMessage; }
virtual void SetClickMessage (MessageT aMsg) { mClickMessage = aMsg; }
virtual MessageT GetDblClkMessage() { return mDblClkMessage; }
virtual void SetDblClkMessage (MessageT aMsg) { mDblClkMessage = aMsg; }
virtual void MakeRegionOutline (CTCS_Region *aRegion);

virtual void SetValue (SInt32 inValue);
virtual Boolean PointIsInFrame (SInt32 inHorizPort, SInt32 inVertPort) const;

protected :
MessageT mClickMessage, // Broadcast messages (4 bytes each)
mDblClkMessage;

UInt32 mIndent, // Horizontal display indent (pixels)
mLabelPosition; // position of text label relative to icon
SInt32 mSelectedStyle; // text style for label when button is on

IconViewType mViewType; // icon view, sicn view, no icon view (byte)
CTextString mLabel; // Label to be displayed with icon

CIconSuiteGraphic mIconSuite; // Object to manage icon suite
virtual void ClickSelf (const SMouseDownEvent &inMouseDown);
virtual void DrawSelf();
void CalcBoxes (TCS_Rect *iconRect, TCS_Rect *labelRect);
};
const SInt16 cDefaultIconID = 128;
enum
{
cRootLevelIndent = 2, // Icon indent for root level of hierarchy
cTextHeight = 12,
cVertIconSpacing = 3,
cVertSicnSpacing = 3,
cVertListSpacing = 3
};