Link to: source code | other
interface directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
This class manages progress bars for the
Goldenseal small business estimating software,
project management software, construction
estimating software
and construction software.
class CProgressBar
{
public:
CProgressBar(const CTextString &message = cEmptyString,
const ResIDT dlogID = DLOG_Progress,
const Boolean showStopButton = true,
const Boolean alwaysShow = false);
virtual ~CProgressBar();
static CProgressBar *GetCurrentDialog();
static CProgressBar *CreateBar(const CTextString &message = cEmptyString,
const ResIDT dlogID = DLOG_Progress,
const Boolean showStopButton = true,
const Boolean alwaysShow = false);
static Boolean ShowingProgressBar(); // TCS 4/2/03
SInt8 GetEventStatus();
void SetEventStatus(const SInt8 inValue) { mStatus = inValue; }
SInt8 Increment(const UInt32 inStep = 1);
SInt8 SetValue(const UInt32 inValue, const Boolean redraw = true);
void SetTextStep(UInt32 inStep) { mTextStep = inStep; }
void SetMaxValue(const UInt32 inMax, const Boolean redraw = true);
void SetMessage(const CTextString & inString);
void SetActionType(const CTextString & inString);
void SetWindowTitle(const CTextString & inString);
CTextString GetWindowTitle() const { return mWindowTitle; } // TCS 7/29/03
UInt32 GetTextStep() const { return mTextStep; }
UInt32 GetMaxValue() const { return mMaxValue; }
UInt32 GetValue() const { return mCurrentValue; }
void SetVisible(const Boolean visible = true);
void SetStopButtonVisible(const Boolean visible = true);
Boolean StopButtonIsVisible() const { return mShowStopButton; }
void SetIsClientBar(const Boolean inValue = true) { mIsClientBar = inValue; }
Boolean IsClientBar() const { return mIsClientBar; }
virtual Boolean HasDialogHandler() { return true; }
// mfs_sa 10aug2k2
// Added default param bErase (see LPane.h)
virtual void Refresh(Boolean bErase = false);
#if TCS_MULTIUSER // TCS 7/14/03
virtual void UserStopped() { mStatus = progress_cancel; }
void UpdateClientProgressBar();
virtual void SetResponder(CTCS_Responder* responder) { mConnectedResponder = responder; }
#endif
protected:
static CProgressBar *sActiveDialog;
CTCS_Caption *mMessageCapt,
*mTextIndicator,
*mCurValueCapt,
*mMaxValueCapt,
*mTextProgressCapt;
CTCS_StdControl *mStopButton;
LPane *mGraphicIndicator;
CTextString mMessageString, // TCS 7/29/03
mActionTypeString,
mWindowTitle;
UInt32 mCurrentValue,
mMaxValue,
mTextStep,
mLastUpdateTime;
SInt8 mStatus;
UInt8 mIsClientBar:1, // TCS 7/31/03
mShowStopButton:1,
mProgressFiller:6;
StDialogHandler *mDialogHandler;
#if TCS_FOR_WINDOWS
LWinDialog *mProgressWindow;
#else
LWindow *mProgressWindow;
#endif
#if TCS_MULTIUSER
CTCS_Responder* mConnectedResponder;
#endif
};
/*class CNonModalProgressBar : public CProgressBar, public LPeriodical
{
CNonModalProgressBar(const CTextString &message = cEmptyString,
const ResIDT dlogID = DLOG_Progress,
const Boolean showStopButton = true,
const Boolean alwaysShow = false)
: CProgressBar(message, dlogID, showStopButton, alwaysShow) {}
virtual ~CNonModalProgressBar();
virtual Boolean HasDialogHandler() { return false; }
};*/#if CAN_USE_MARK
#pragma mark --> CProgressBarBar
#endif
#if TCS_CANUSE_QUICKTIME
#define PPGWorld_H <UGWorld.h>
#define GWORLD_CLASS LGWorld
#else
#endif
#include CTCS_Pane_H
#include PP_Periodical_H
#if TCS_CANUSE_QUICKTIME
#include PPGWorld_H
#endif
class LStream;
class CProgressBarBar : public CTCS_Pane, public LPeriodical
{
public :
enum { class_ID = 'PBAR' };
CProgressBarBar(LStream *inStream);
~CProgressBarBar();
virtual void SetValue(SInt32 inValue);
void SetMaxValue(UInt32 inMax);
void RotateBarberPole();
virtual void SpendTime(const TCS_EventRecord & inMacEvent);
protected :
enum
{
image_Width = 16,
frame_Height = 14,
animation_StepCount = 4
};
virtual void DrawSelf();
void DrawStandardBar();
void DrawBarArea(const TCS_Rect & inArea);
void DrawEmptyArea(const TCS_Rect & inArea);
void DrawInfiniteBar();
void LoadBarberPolePat();
#if TCS_CANUSE_QUICKTIME
GWORLD_CLASS *mGrayBarberPoleImage,
*m1BitBarberPoleImage;
#endif
SInt32 mBarberPoleDrawTick,
mValue;
UInt32 mMaxValue;
SInt16 mBarberPoleOffset;
}; |