DataTimeLabel Object Class


Overview

The DataTimeLabel class provides automatic time annotation for an axis object. The number of labels and label strings are generated based on the range of the axis and the axis increment.

Example

     XintRange range;
     Object data_group;
     Widget edit;
     ...
     range.start = time((long *) 0L);
     range.increment = 1;

     /* Create a Date label object */
     XtVaCreateWidget ("Real Time",
                       (WidgetClass)xintDataTimeLabelObjectClass,
                       edit,
                       XmNtimeBase, time((long *) 0L),
                       XmNtimeMeasure, XintTIME_SECOND,
                       XmNtimeLabelFormat, "%H:%M:%S",
                       XmNsampledRange, &range,
                       XmNlabelOrientation, XintLABEL_X,
                       XmNdataGroup, data_group, NULL);


Inherited Behavior and Resources

The DataTimeLabel object class inherits behavior and resources from DataLabel.
The following resources are defined for the DataTimeLabel object class:
NameTypeDefaultAccess
XmNtimeBaseint0CSG
XmNtimeMeasureintXintTIME_SECONDCSG
XmNtimeLabelFormatchar *dynamicCSG


XmNtimeBase

Specifies the relative time in seconds since Jan 1st, 1970. See Unix function mktime to convert a specified date into a number of seconds that can be used as the time base. The time base is added to the limits of the axis when generating the time labels.

XmNtimeMeasure

Specifies the units used to measure time.

Resource ValueDescription
XintTIME_SECONDTime is measured in seconds.
XintTIME_MINUTETime is measured in minutes.
XintTIME_HOURTime is measured in hours.
XintTIME_DAYTime is measured in days.
XintTIME_MONTHTime is measured in months.
XintTIME_YEARTime is measured in years.


XmNtimeLabelFormat

Specifies the format used to display the time label using the syntax of function strftime. A partial list of the format specifiers is given below. See man page strftime for a complete description of the syntax.

     %a	     locale's abbreviated weekday name
     %A	     locale's full weekday name
     %b	     locale's abbreviated month name
     %B	     locale's full month name
     %d	     day of the month [1,31]; single digits are preceded by 0 
     %D      date as %m/%d/%y
     %e	     day of the month [1,31]; single digits are preceded by a 
             space
     %h	     locale's abbreviated month name
     %H      hour (24-hour clock) [0,23]; single digits are preceded by 0
     %m      month number [1,12]; single digits are preceded by 0
     %M      minute [00,59]; leading zero is permitted but not required
     %n      insert a newline
     %p      locale's equivalent of either a.m. or p.m.
     %y      year within century [00,99]
     %Y      year, including the century (for example 1993)