📄 skinprogress.cpp
字号:
/* Name : CSkinProgress */
/* Role : Default constructor for status bar usage */
/* Type : public */
/* Interface : RETURN (direct value) */
/* None */
/* OUTPUT (pointer to value) */
/* None */
/* INPUT (pointer to value, direct/default value) */
/* None */
/* Pre-condition : None */
/* Constraints : Sets the default values to */
/* i_poStrMessage = "Work in progress..." */
/* i_nUpper = 100 - from 0 to 100 */
/* i_nProgress = cSPT_PERCENT - DISPLAY PERCENT */
/* i_nPane = 0 - Share the text pane */
/* i_nSize = 200 - 200 pixels FORCED WIDTH */
/* i_poBitmap = NULL - USE EMBEDDED BITMAP */
/* <> i_bReverse = false - normal display */
/* Behavior : A - Create the progress bar using default parameters */
/*----------------------------------------------------------------------------*/
/* PROC CSkinProgress */
/* */
/* A..... Create a status progress bar with "Work in progress..." as text */
/*----------------------------------------------------------------------------*/
/*--- END FUNCTION HEADER ----------------------------------------------------*/
CSkinProgress::CSkinProgress
( // Default constructor
)
{
// Init
// Process
// A..... Create a default progress bar in Status Bar with "Work in progress..." as text
ProgressInStatusBar("Work in progress");
}
/*--- START FUNCTION HEADER --------------------------------------------------*/
/* Name : CSkinProgress */
/* Role : Default constructor with parameters for status bar usage */
/* Type : public */
/* Interface : RETURN (pointer to value, direct value) */
/* None */
/* OUTPUT (pointer to value) */
/* None */
/* INPUT (pointer to value, direct/default value) */
/* i_poStrMessage : The text message to display in pane 0 */
/* i_nUpper : Upper limit to reach 100% (0 at 0%) */
/* i_nProgress : Progress completion message type */
/* i_nPane : Pane number for the progress bar */
/* i_nSize : Progress bar width in pixel IF pane 0 */
/* i_poBitmap : Replacement progress bar bitmap */
/* <> i_bReverse : Reverse display of the progress bar */
/* Pre-condition : None */
/* Constraints : At least, <i_poStrMessage> must be provided */
/* Behavior : A - Create the progress bar using user's parameters */
/*----------------------------------------------------------------------------*/
/* PROC CSkinProgress */
/* */
/* A..... Create the progress bar using user's parameters */
/*----------------------------------------------------------------------------*/
/*--- END FUNCTION HEADER ----------------------------------------------------*/
CSkinProgress::CSkinProgress
( // Default constructor with parameters for status bar usage
LPCTSTR i_poStrMessage, // Text to display
int i_nUpper, // = 100 : Default range from 0 to i_nUpper
int i_nProgress, // = cSPT_PERCENT : Message type to add to the text
int i_nPane, // = 0 : Pane number in which display the progress bar
int i_nSize, // = 200 : Size of the progress bar if in pane 0
CBitmap* i_poBitmap // = NULL : Pointer to a user bitmap
#ifdef dCSP_SLIDERBAR_METHOD
,BOOL i_bReverse // = false : Reverse display of the progress bar
#endif // dCSP_SLIDERBAR_METHOD
)
{
// Init
// Process
// A..... Create the progress bar using user's parameters
ProgressInStatusBar
(
i_poStrMessage,
i_nUpper,
i_nProgress,
i_nPane,
i_nSize,
i_poBitmap
#ifdef dCSP_SLIDERBAR_METHOD
,i_bReverse
#endif // dCSP_SLIDERBAR_METHOD
);
}
/*--- START FUNCTION HEADER --------------------------------------------------*/
/* Name : CSkinProgress */
/* Role : Default constructor with parameters for dialog usage */
/* Type : public */
/* Interface : RETURN (direct value) */
/* None */
/* OUTPUT (pointer to value) */
/* None */
/* INPUT (pointer to value, direct/default value) */
/* i_poWndProgress : The CWnd where to display the progress */
/* i_nUpper : Upper limit to reach 100% (0 at 0%) */
/* i_poBitmap : Replacement progress bar bitmap */
/* <> i_bReverse : Reverse display of the progress bar */
/* i_poWndMessage : The CWnd where to display the text */
/* i_poStrMessage : The text message to display */
/* i_nProgress : Progress completion message type */
/* Pre-condition : None */
/* Constraints : At least, <i_poStrMessage> must be provided */
/* Behavior : A - Create the dialog progress bar using user's parameters */
/*----------------------------------------------------------------------------*/
/* PROC CSkinProgress */
/* */
/* A..... Create the dialog progress bar using user's parameters */
/*----------------------------------------------------------------------------*/
/* The most simple dialog CSkinProgress constructor : */
/* CSkinProgress oCspBar(&oCStatic); // Use 100 as upper limit */
/*--- END FUNCTION HEADER ----------------------------------------------------*/
#ifdef dCSP_DIALOG_PROGRESS
CSkinProgress::CSkinProgress
( // Default constructor with parameters for dialog usage
CWnd* i_poWndProgress, // Pointer to the anchor CWnd to use for the progress bar
int i_nUpper, // = 100, : Default range from 0 to i_nUpper
CBitmap* i_poBitmap, // = NULL : Pointer to a user bitmap
#ifdef dCSP_SLIDERBAR_METHOD
BOOL i_bReverse, // = false, : Reverse display of the progress bar
#endif // dCSP_SLIDERBAR_METHOD
CWnd* i_poWndMessage, // = NULL, : Pointer to the anchor CWnd to use for the text pane
LPCTSTR i_poStrMessage, // = NULL : Text to display,
int i_nProgress // = cSPT_NONE : Message type to add to the text
)
{
// Init
// Process
// A..... Create the progress bar using user's parameters
ProgressInDialog
(
i_poWndProgress,
i_nUpper,
i_poBitmap,
#ifdef dCSP_SLIDERBAR_METHOD
i_bReverse,
#endif // dCSP_SLIDERBAR_METHOD
i_poWndMessage,
i_poStrMessage,
i_nProgress
);
}
#endif // dCSP_DIALOG_PROGRESS
// *** INITIALIZATORS ***
/*--- START FUNCTION HEADER --------------------------------------------------*/
/* Name : CreateCommon */
/* Role : Initialize the progress with its basic parameters */
/* Type : PROTECTED */
/* Interface : RETURN (direct value) */
/* BOOL = false : Error during progress bar creation */
/* true : Progress bar created */
/* OUTPUT (pointer to value) */
/* None */
/* INPUT (pointer to value, direct/default value) */
/* i_poStrMessage : The text message to display in pane 0 */
/* i_nUpper : Upper limit to reach 100% (0 at 0%) */
/* i_nProgress : Progress completion message type */
/* i_poBitmap : Replacement progress bar bitmap */
/* <> i_bReverse : Reverse display of the progress bar */
/* Pre-condition : None */
/* Constraints : Base of progress bar is fixed to 0, must use */
/* [SetRange(...)] to change it... */
/* Behavior : A - Set base values */
/* B - Set the bitmap */
/* C - Set the progress bar values */
/* D - Get the creation date and time of the progress bar */
/* E - Set the refresh timer */
/* F - Resize the text and display the whole things */
/*----------------------------------------------------------------------------*/
/* PROC CreateCommon */
/* */
/* A..... Set base values */
/* B..... Set the bitmap */
/* C..... Set the progress bar values */
/* D..... Get the creation date and time of the progress bar */
/* E..... Set the refresh timer to 500 milliseconds */
/* F..... Resize the text and display the whole things */
/*----------------------------------------------------------------------------*/
/*--- END FUNCTION HEADER ----------------------------------------------------*/
BOOL CSkinProgress::CreateCommon
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -