home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / include / Vk / VkRepeatButton.h.z / VkRepeatButton.h
Encoding:
C/C++ Source or Header  |  1996-09-20  |  2.6 KB  |  67 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #ifndef _VK_REPEAT_BUTTON
  18. #define _VK_REPEAT_BUTTON
  19.  
  20. #include <Vk/VkComponent.h>
  21.  
  22. enum VkRepeatButtonType { RB_pushButton, RB_pushButtonGadget,
  23.               RB_arrowButton, RB_arrowButtonGadget };
  24.  
  25. class VkRepeatButton : public VkComponent {
  26.   
  27.   public:
  28.     
  29.     static const char *const buttonCallback;
  30.     
  31.     VkRepeatButton(char *name, Widget, VkRepeatButtonType type);
  32.     ~VkRepeatButton();
  33.     
  34.     virtual const char* className();
  35.     
  36.     VkRepeatButtonType type() { return _type; }
  37.     void setParameters(long initial, long repeat){ initialDelay = initial; repeatDelay = repeat; }
  38.  
  39.   protected:
  40.  
  41.     void armButton(XmAnyCallbackStruct *cb);
  42.     void disarmButton(XmAnyCallbackStruct *cb);
  43.     void activateButton(XmAnyCallbackStruct *cb);
  44.     void doRepeat();
  45.     void clearTimeOuts();
  46.     void activateCallback();
  47.     
  48.     
  49.     VkRepeatButtonType _type;
  50.     int lastReason;
  51.     XEvent lastEvent;
  52.     Boolean validEvent;
  53.     long initialDelay, repeatDelay;
  54.     XtIntervalId initialTimeOut, repeatTimeOut;
  55.  
  56.   private:
  57.     
  58.     static void arm_button(Widget w, XtPointer client_data, XtPointer call_data);
  59.     static void disarm_button(Widget w, XtPointer client_data,
  60.                   XtPointer call_data);
  61.     static void activate_button(Widget w, XtPointer client_data,
  62.                 XtPointer call_data);
  63.     static void repeat_timeout(XtPointer client_data, XtIntervalId *id);
  64. };
  65.  
  66. #endif
  67.