#ifndef _DANGERBUTTON_H
#define _DANGERBUTTON_H
static char DangerButton_h_id[] = "$Header: /usr/tiburon/unix/gui/tmacs/RCS/DangerButton.h,v 1.1 1996/10/28 09:13:30 oreilly Exp $";

/*
$Log: DangerButton.h,v $
Revision 1.1  1996/10/28 09:13:30  oreilly
Initial revision

*/

#include <Xm/ToggleB.h>
#include <Vk/VkComponent.h>

/*
DangerButton provides an interface that requires several user actions
to activate a function
*/
class DangerButton : public VkComponent
{
  public:
  DangerButton(const char *name, Widget parent);

  ~DangerButton()
  {
  }
  
  virtual const char *className()
  {
    return "DangerButton";
  }

  // Set flash period for armed state
  void setFlashPeriod(int period)
  {
    _flashPeriod = period;
  }
  
  // Set inactive state
  void deactivate();

  // Set active state
  void activate();

  // Set armed state
  void arm();

  protected:
  Widget _actionButton;
  Widget _deactivate, _activate, _arm;
  
  Pixel _inactiveBackground, _activeBackground, _armedBackground;
  Pixel _inactiveForeground, _activeForeground, _armedForeground;
  int _phase;
  
  int _flashPeriod;
  
  XtIntervalId _flashTimer;
  
  // Handle toggle events
  void toggle(Widget w);

  // Handle armed action button being pressed
  void actionButtonPressed();
  

  private:
  
  static void toggleCallback(Widget w, XtPointer clientData, 
			     XtPointer callData);

  static void timerCallback(XtPointer clientData, XtIntervalId *id);

  static void actionButtonCallback(Widget w, XtPointer clientData,
				   XtPointer callData);
  
  static XtResource _resources[];
  
  static String _defaultResources[];
  
};


#endif
