/*
 * Copyright 1994-1995 TriloBYTE Software Solutions.
 *
 * Author: Amen Zwa, TriloBYTE.
 */



// static char* sccsid = "XmWidget: %W%\t%G%\tAmen Zwa, TriloBYTE.";



// WProgress.h: progress dialog class



#if !defined(WPROGRESS_H)
#define WPROGRESS_H

#include "WDrawingArea.h"
#include "WShl.h"
#include "WEtc.h"



enum {
    ip_msg0_lbl,
    ip_msg1_lbl,
    ip_pbar_da,
    ip_stop_pbtn,
    ip_numwgt
};



// progress bar drawing area
class WProgressBar : public WDrawingArea {
    float prog;				// current progress value
    Pixel pbarcol;			// progress bar color
    friend class WProgress;
public:
    WProgressBar(Widget par) : WDrawingArea(par) {
	drawframeflg = False; prog = 0.0F; }
    void expose();
};



class WProgress : public WDialog {
    XtCallbackProc cp;			// callback procedure
    XtPointer usrdata;			// user data passed to callback
    friend void cp_activate_prog(Widget w, XtPointer usr, XtPointer wgt);
public:
    WProgress(Widget par);
    // access functions
    void set_cp_stop(XtCallbackProc c, XtPointer u=0) { cp = c; usrdata = u; }
    void hide();
    void set_message(int l, const char* s);
    void set_barcolor(Pixel fg, Pixel bg);
    void set_progress(float p);
    float get_progress() const;
    void show_button(Boolean showflg);
};

#endif	// WPROGRESS_H
