Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XmConveUn(Xm) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 XmConvertUnits(Xm)             6 January 1993             XmConvertUnits(Xm)


 Name

    XmConvertUnits - a function that converts a value in one unit type to
    another unit type

 Syntax


    #include <Xm/Xm.h>

    int XmConvertUnits (widget, orientation, from_unit_type,
                        from_value, to_unit_type)
    Widget widget;
    int orientation;
    int from_unit_type;
    int from_value;
    int to_unit_type;


 Description

    XmConvertUnits converts the value and returns it as the return value from
    the function.

    widget  Specifies the widget for which the data is to be converted

    orientation
            Specifies whether the converter uses the horizontal or vertical
            screen resolution when performing the conversions. orientation
            can have values of XmHORIZONTAL or XmVERTICAL.

    fromunittype
            Specifies the current unit type of the supplied value

    fromvalue
            Specifies the value to be converted

    tounittype
            Converts the value to the unit type specified

    The parameters fromunittype and tounittype can have the following
    values:

    +  XmPIXELS -- all values provided to the widget are treated as normal
       pixel values. This is the default for the resource.

    +  Xm100THMILLIMETERS -- all values provided to the widget are treated
       as 1/100 millimeter.

    +  Xm1000THINCHES -- all values provided to the widget are treated as
       1/1000 inch.

    +  Xm100THPOINTS -- all values provided to the widget are treated as
       1/100 point.  A point is a unit typically used in text processing
       applications and is defined as 1/72 inch.

    +  Xm100THFONTUNITS -- all values provided to the widget are treated as
       1/100 of a font unit.  A font unit has horizontal and vertical com-
       ponents.  These are the values of the XmScreen resources XmNhorizon-
       talFontUnit and XmNverticalFontUnit.

 Return value

    Returns the converted value.  If a NULL widget, incorrect orientation, or
    incorrect unittype is supplied as parameter data, 0 is returned.

 See also

    XmSetFontUnits(Xm) and XmScreen(Xm).


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026