home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / builderExamples / stopwatch / Face.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.5 KB  |  117 lines

  1. /////////////////////////////////////////////////////////////
  2. //
  3. // Source file for Face
  4. //
  5. //    This file generated by a BuilderXcessory.  DO NOT EDIT THIS FILE.
  6. //    TO ADD EXTENSIONS TO THIS CLASS, USE THE BUILDER XCESSORY
  7. //    TO CREATE A SUBCLASS.
  8. //
  9. //    This class is a user interface "component", as described
  10. //    in "Object-Oriented Programming with C++ and OSF/Motif",
  11. //    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
  12. //
  13. //
  14. /////////////////////////////////////////////////////////////
  15.  
  16.  
  17. #include "Face.h" // Generated header file for this class
  18. #include <Xm/Frame.h> 
  19. #include <Xm/Label.h> 
  20. #include <Xm/RowColumn.h> 
  21. #ifndef XmNrow    
  22. #define XmNrow "row"
  23. #endif    
  24. #ifndef XmNcolumn    
  25. #define XmNcolumn "column"
  26. #endif     
  27.  
  28.  
  29. // These are default resources for widgets in objects of this class
  30. // All resources will be prepended by *<name> at instantiation,
  31. // where <name> is the name of the specific instance, as well as the
  32. // name of the baseWidget. These are only defaults, and may be overriden
  33. // in a resource file by providing a more specific resource name
  34.  
  35. String  Face::_defaultFaceResources[] = {
  36.         NULL
  37. };
  38.  
  39. Face::Face(const char *name, Widget parent) : 
  40.          VkComponent(name) 
  41.     Arg      args[2];
  42.     Cardinal count;
  43.  
  44.     count = 0;
  45.  
  46.     // Load any class-defaulted resources for this object
  47.  
  48.     setDefaultResources(parent, _defaultFaceResources  );
  49.  
  50.  
  51.  
  52.     // Create an unmanaged widget as the top of the widget hierarchy
  53.  
  54.     _baseWidget = _face= XtVaCreateWidget ( _name,
  55.                                         xmRowColumnWidgetClass,
  56.                                         parent, 
  57.                                             XmNorientation, XmHORIZONTAL, 
  58.                                             XmNpacking, XmPACK_COLUMN, 
  59.                                         NULL); 
  60.  
  61.     // install a callback to guard against unexpected widget destruction
  62.  
  63.     installDestroyHandler();
  64.  
  65.  
  66.     // Create widgets used in this component
  67.     // All variables are data members of this class
  68.  
  69.     _label = XtVaCreateManagedWidget  ( "label",
  70.                                             xmLabelWidgetClass,
  71.                                             _w, 
  72.                                             XmNx, 3, 
  73.                                             XmNy, 3, 
  74.                                             XmNwidth, 83, 
  75.                                             XmNheight, 24, 
  76.                                             NULL); 
  77.  
  78.  
  79.     _frame = XtVaCreateManagedWidget  ( "frame",
  80.                                             xmFrameWidgetClass,
  81.                                             _w, 
  82.                                             XmNx, 89, 
  83.                                             XmNy, 3, 
  84.                                             XmNwidth, 83, 
  85.                                             XmNheight, 24, 
  86.                                             NULL); 
  87.  
  88.  
  89.     _text = XtVaCreateManagedWidget  ( "text",
  90.                                             xmLabelWidgetClass,
  91.                                             _frame, 
  92.                                             XmNrecomputeSize, True, 
  93.                                             XmNx, 3, 
  94.                                             XmNy, 3, 
  95.                                             XmNwidth, 77, 
  96.                                             XmNheight, 18, 
  97.                                             NULL); 
  98.  
  99.  
  100. }
  101.  
  102. Face::~Face() 
  103. {
  104.     // Empty Destructor. Base class destroys widgets
  105. }
  106.  
  107. const char * Face::className() // classname
  108. {
  109.     return ("Face");
  110. }
  111.  
  112.  
  113.  
  114.  
  115.  
  116.