• Progress Bar


    Progress Bar

    [edit]Introduction

    A progress bar is a graphical representation of a job's progress and is used extensively in the standard application. By using a progress bar, users can follow the job's progress. It is best practice to always display a progress bar during a lengthy process.

    [edit]Progress Bar within a batchable class

    The RunBase framework has methods which will initialize the progress bar so that you can focus on coding the process.

    // progress bar Runbase demo
    public void run()
    {
        str     text;
        int     percent;
        int     counter;
        int64   progressTotal = 200; // hard coded for demo purpose (this is normally calculated)  ;   this.progressInit("Processing", progressTotal,  #AviFormLetter);
        progress.setText("Item");   for (counter = 1; counter <= progressTotal; counter ++)
        {
            //
            // processing happens here
            //
            sleep(10);
            //
            // progress bar text for the current 'item'
            //
            percent = decRound((counter / progressTotal) * 100, 0);
            text    = strFmt("Item %1 of %2 (%3%)", counter, progressTotal, percent);
            progress.setText(text);
            progress.incCount();
        }   progress = null;
    }

    [edit]Progress Bar within a Method

    On occasion you may want to show a progress bar from a method, whether that be inside a class or just a job. You can show it as follows:

    #AviFiles
    SysOperationProgress  progress = new SysOperationProgress();
    ;
    progress.setAnimation(#....); // from AviFiles macro
    progress.setCaption("<caption text>");   //99 Steps to perform
    progress.setTotal(99);   progress.incCount();   progress.setCount(2);   progress.setCaption("<caption text>");   progress.kill();
  • 相关阅读:
    2013年3月17日星期日
    2013第11周一
    2013年第11周二
    2013年第11周三今天开发踩过的坑
    2013第11周四开发摸索
    2013第10周六项目中用到的前端技术学习1
    PHP 数组使用之道
    快递查询API接口集成,有需要的可以直接用
    PHP intval() 函数
    巧用 PHP 数组函数
  • 原文地址:https://www.cnblogs.com/perock/p/2352999.html
Copyright © 2020-2023  润新知