mi32/unitmenu.h

Go to the documentation of this file.
00001 /**
00002  * \file unitmenu.h <mi32/unitmenu.h>
00003  * \brief Header file for unit selection menu functions
00004  *
00005  * \if NODOC
00006  * $Id: unitmenu.h_v 1.18 2003/09/15 13:49:56 fileserver!dwilliss Exp $
00007  *
00008  * $Log: unitmenu.h_v $
00009  * Revision 1.18  2003/09/15 13:49:56  fileserver!dwilliss
00010  * Doxygen
00011  *
00012  * Revision 1.17  2003/09/05 17:08:19  mju
00013  * Make most stuff inline as plan to deprecate.
00014  * Update for UOM system.
00015  *
00016  * Revision 1.16  2003/06/03 20:08:14  scowan
00017  * Added associate with.
00018  *
00019  * Revision 1.15  2002/08/14 17:20:07  mju
00020  * Remove FillInUnit...ComboBox as unit one has method equivalent in combobox and type one is a trivial loop.
00021  *
00022  * Revision 1.14  2001/12/13 16:59:14  mju
00023  * MGUI class change.
00024  *
00025  * Revision 1.13  2001/10/22 21:05:25  dwilliss
00026  * Fixed error in name on ifdef
00027  *
00028  * Revision 1.12  2001/10/22 20:53:42  dwilliss
00029  * Added prototypes for MFC version
00030  *
00031  * Revision 1.11  2000/09/01 20:35:43  msmith
00032  * Genitor documentation
00033  *
00034  * Revision 1.10  2000/08/31 21:43:00  mju
00035  * INclude xdefns.h so compiles in isolation.
00036  *
00037  * Revision 1.9  1999/04/08 19:18:02  mju
00038  * Add inclusion guards.
00039  *
00040  * Revision 1.8  1999/01/05  19:12:56  scowan
00041  * Swapped multiple keywords
00042  *
00043  * Revision 1.7  1998/10/13 17:22:48  mju
00044  * Add UNITMENU_UseSymbol and UNITMENU_OneOfMany.
00045  *
00046  * Revision 1.6  1998/03/18  16:34:36  mju
00047  * Update callback functions to take parameters in prototypes.
00048  *
00049  * Revision 1.5  1998/03/05  21:36:07  mju
00050  * Rework for i18n.
00051  * \endif
00052 **/
00053 
00054 #ifndef  INC_MI32_UNITMENU_H
00055 #define  INC_MI32_UNITMENU_H
00056 
00057 #ifndef  INC_MI32_UNITCONV_H
00058 #include <mi32/unitconv.h>
00059 #endif
00060 
00061 #ifdef X_NATIVE
00062 #ifndef  INC_MI32_XDEFNS_H
00063 #include <mi32/xdefns.h>
00064 #endif
00065 #endif
00066 
00067 
00068 #define  UNITMENU_UseSymbol      0x0001
00069 #define  UNITMENU_OneOfMany      0x0002
00070 #define  UNITMENU_NameSingular   0x0004
00071 #define  UNITMENU_AddNone        0x1000
00072 
00073 //!:Associate with "Unit Conversions"
00074 //!\addtogroup UnitConv Unit Conversion
00075 //!@{
00076 
00077 #if defined(__cplusplus)
00078 extern "C" {
00079 #endif
00080 
00081 #ifdef X_NATIVE
00082 //! Create MENUITEM array for all defined units of a specified type.
00083 //!
00084 //! @return MENUITEM array containing unit names
00085 //! Flags
00086 //!   \li\b UNITMENU_UseSymbol               Use symbol instead of name for unit
00087 //!   \li\b UNITMENU_OneOfMany               Set MxMENU_ONE_OF_MANY in each MENUITEM
00088 //!      \li\b UNITMENU_NameSingular            Use singular (eg meter, foot) for unit name instead of plural
00089 //!   \li\b UNITMENU_AddNone                 Add "None" item to menu array
00090 //! Returns an array of MENUITEMs for units of the specified type.  If flags is MxONE_OF_MANY, the
00091 //! array will contain radio buttons.
00092 //! The callback function will get as its 2nd parameter a number.  This number (call it "unit")
00093 //! represents the unit type AND the unit number.  unit/256 is the unit type, unit%256 is
00094 //! the unit number.
00095 MENUITEM * MxCreateUnitMenuItems (
00096    int type,                           //!< Unit type
00097    int dft,                            //!< Default unit number
00098    XtCallbackProc cbfunc,              //!< Callback function
00099    UINT32 flags = 0                    //!< Flags (UNITMENU_...)
00100    );
00101 
00102 //! Create OptionMenu for specifying units (feet, meters, etc...).
00103 //! @return OptionMenu widget, unmanaged if no arglist provided, otherwise managed.
00104 //! Returns an OptionMenu widget for selecting units of a given type.
00105 //! The callback function will get as its 2nd parameter a number.  This number (call it "unit")
00106 //! represents the unit type AND the unit number.  unit/256 is the unit type, unit%256 is the unit number.
00107 //! Flags
00108 //!      \li\b UNITMENU_UseSymbol               Use symbol instead of name for unit
00109 //!   \li\b UNITMENU_OneOfMany               Set MxMENU_ONE_OF_MANY in each MENUITEM
00110 //!      \li\b UNITMENU_NameSingular            Use singular (eg meter, foot) for unit name instead of plural
00111 //!   \li\b UNITMENU_AddNone                 Add "None" item to menu array
00112 Widget MxCreateUnitOptionMenu (
00113    Widget pwidget,                     //!< Parent widget to contain OptionMenu
00114    const char *label,                  //!< Label of OptionMenu
00115    int type,                           //!< Unit type
00116    int dft,                            //!< Default unit number
00117    XtCallbackProc cbfunc,              //!< Callback function
00118    void *udata,                        //!< Value to use for menu item XmNuserData resource
00119    UINT32 flags = 0,                   //!< Flags (UNITMENU_...)
00120    const Arg *arglist = 0,             //!< Arguments for widget attachment
00121    int argcount = 0                    //!< Number of arguments
00122    );
00123 
00124 //! Create OptionMenu for specifying units (feet, meters, etc...).
00125 //! @see MxCreateUnitOptionMenu.
00126 inline Widget MxCreateUnitOptionMenuExt (
00127    Widget pwidget,                     //!< Parent widget to contain OptionMenu
00128    const char *label,                  //!< Label of OptionMenu
00129    int type,                           //!< Unit type
00130    int dft,                            //!< Default unit number
00131    XtCallbackProc cbfunc,              //!< Callback function
00132    void *udata,                        //!< Value to use for menu item XmNuserData resource
00133    UINT32 flags,                       //!< Flags (UNITMENU_...)
00134    const Arg *arglist,                 //!< Arguments for widget attachment
00135    int argcount                        //!< Number of arguments
00136    ) {
00137    return (MxCreateUnitOptionMenu(pwidget,label,type,dft,cbfunc,udata,flags,arglist,argcount));
00138    }
00139 
00140 //! Create OptionMenu for specifying units (feet, meters, etc...).
00141 //! @see MxCreateUnitOptionMenu.
00142 inline Widget MxCreateUnitOptionMenuF (
00143    Widget pwidget,                     //!< Parent widget
00144    const char *label,                  //!< Label of OptionMenu
00145    int type,                           //!< Unit type
00146    int dft,                            //!< Default unit number
00147    XtCallbackProc cbfunc,              //!< Callback function
00148    void *udata,                        //!< Value to use for menu item XmNuserData resource
00149    UINT32 flags                        //!< Flags (UNITMENU_...)
00150    ) {
00151    return (MxCreateUnitOptionMenu(pwidget,label,type,dft,cbfunc,udata,flags,NULL,0));
00152    }
00153 #endif
00154 
00155 #if defined(__cplusplus)
00156 }
00157 #endif
00158 
00159 //!@}
00160 
00161 #endif   //!<  INC_MI32_UNITMENU_H 

Generated on Thu Apr 26 04:45:27 2007 for TNTsdk by  doxygen 1.5.2