#ifndef _ALARMTEXT
#define _ALARMTEXT
static char AlarmText_h_id[] = "$Header: /usr/tiburon/unix/gui/tmacs/RCS/AlarmText.h,v 1.6 1997/10/03 09:38:18 oreilly Exp $";

/*
$Log: AlarmText.h,v $
Revision 1.6  1997/10/03 09:38:18  oreilly
*** empty log message ***

 * Revision 1.5  97/08/12  14:16:44  14:16:44  oreilly (Thomas C. O'Reilly)
 * Popup menu to show alarm definition
 * 
 * Revision 1.4  97/05/30  15:46:39  15:46:39  oreilly (Thomas C. O'Reilly)
 * *** empty log message ***
 * 
 * Revision 1.3  97/05/06  16:23:51  16:23:51  oreilly (Thomas C. O'Reilly)
 * Foreground and background are class attributes. Supply default format.
 * 
 * Revision 1.2  97/04/30  19:28:40  19:28:40  oreilly (Thomas C. O'Reilly)
 * Allow for NULL alarm passed to constructor
 * 
 * Revision 1.1  96/10/28  09:13:18  09:13:18  oreilly (Thomas C. O'Reilly)
 * Initial revision
 * 
*/


#include "DmGuiObject.h"
#include "Alarm.h"

/*
AlarmText displays the mnemonic for an alarm item, in appropriate
alarm priority colors.
*/
class AlarmText : public DmGuiObject
{
  public:
  AlarmText(const char *name, Widget parent, Alarm *alarm, 
	    char *format = "%s");

  ~AlarmText()
  {
    free(_format);
  }
  
  const char *className()
  {
    return "AlarmText";
  }

  virtual void updateGui(DM_Item handle = 0);

  static const char *const alarmUpdateCallback;

  Priority priority();
  
  protected:

  Widget _valueText;
  Alarm *_alarm;
  char *_format;
  Pixel _foreground, _background;
  Priority _priority;
  int _nAlarmChanges;
  int _value;
  
  // Post menu showing options in response to button press
  virtual void postOptions(XEvent *event);


};


#endif
