源代码如下:
-------------------------------------------------------------------------
类 ProgressBarField.java
import com.rim.client.RIMConstants;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
public class ProgressBarField extends Field{
// timed progress bar with label
public static final int PROGRESS = 1;
// timed progress bar with percent label
public static final int PERCENT = 2;
// unlimited progerss bar with label, can be used for progress dialog
public static final int UNLIMITED = 3;
public static final int INTERVAL = 100;
public static final int NORMAL_CELL_WIDTH = 4;
public static final int CELL_SPACE = 2;
public static final int OFFSET = 2;
public static final int EDGE_WIDTH = 3;
Font textFont;
int textColor;
int edgeColor;
int barBackgroundColor;
int progerssBarColor;
int interval;
int m_style;
int m_width, m_height;
String m_text;
int totalSeconds, progressInc;
int m_currentProgress, totalProgress;
int cellWidth, cellHeight;
int sliderWidth;
int posX, cellY, drawX;
int cellWidthOffset;
boolean stop = false;
boolean m_pause = false;
public ProgressBarField(int width, int height, String label, int totalSeconds, int interval, int style){
super();
m_width = width;
m_height = height;
m_style = style;
m_text = label;