00001 /** 00002 * mi32/xdefns.h - Definitions for MicroImages library functions which use X toolkit 00003 * 00004 * \if NODOC 00005 * $Log: xdefns.h_v $ 00006 * Revision 3.710 2004/10/21 16:57:26 mju 00007 * Use msys fn to get appcontext in mxXtTimeOutAdd. 00008 * 00009 * Revision 3.709 2004/10/15 20:56:39 mju 00010 * In mxToggleButtonSetState force values to true/false when call xm version. 00011 * 00012 * Revision 3.708 2004/10/14 20:14:03 dwilliss 00013 * Added 2 new option menu functions to wrap Motif ones 00014 * 00015 * Revision 3.707 2004/07/15 19:28:50 mju 00016 * Use region2d for region generation functions. 00017 * 00018 * Revision 3.706 2004/07/14 22:56:15 dwilliss 00019 * another dregion bites the dust! 00020 * 00021 * Revision 3.705 2004/07/14 22:14:13 dwilliss 00022 * mx setup floodparms callback now takes a REGION2D, not a dregion. 00023 * 00024 * Revision 3.704 2004/07/13 15:36:13 mju 00025 * *** empty log message *** 00026 * 00027 * Revision 3.703 2004/07/12 19:41:52 scowan 00028 * Removed mx extents form prototypes. 00029 * 00030 * Revision 3.702 2004/07/12 16:50:10 mju 00031 * Remove legacy map calculator. 00032 * 00033 * Revision 3.701 2004/06/30 21:22:49 scowan 00034 * *** empty log message *** 00035 * 00036 * Revision 3.700 2004/06/30 21:18:06 scowan 00037 * Forward declare region 2d. 00038 * 00039 * Revision 3.699 2004/06/30 21:08:09 mju 00040 * Don't include coordop, just forward-declare what we actually need. 00041 * 00042 * Revision 3.698 2004/06/29 21:28:42 scowan 00043 * Fixed prototype change. 00044 * 00045 * Revision 3.697 2004/06/29 21:21:26 vdronov 00046 * *** empty log message *** 00047 * 00048 * Revision 3.696 2004/06/16 17:47:47 dwilliss 00049 * Added MxPopupMenuAddParent 00050 * 00051 * Revision 3.695 2004/06/15 16:33:33 dwilliss 00052 * Proto for new function 00053 * 00054 * Revision 3.694 2004/06/11 17:27:56 scowan 00055 * Deprecated mx extents form functions. 00056 * 00057 * Revision 3.693 2004/06/02 15:18:56 dwilliss 00058 * MxCreateXmStringUC now takes optional style parameter 00059 * 00060 * Revision 3.692 2004/05/25 19:28:04 dwilliss 00061 * Added an optional parameter to the MxStringXxx functions 00062 * 00063 * Revision 3.691 2004/04/14 21:47:49 mju 00064 * Add MxMENU_NOCENTERLABEL. 00065 * 00066 * Revision 3.690 2004/04/08 22:16:18 scowan 00067 * Removed prototypes of mx texts style form functions. 00068 * 00069 * Revision 3.689 2004/03/11 21:12:25 mju 00070 * Change comment for mxToolTip fn replacement. 00071 * 00072 * Revision 3.688 2004/03/08 15:48:47 dwilliss 00073 * New prototype 00074 * 00075 * Revision 3.687 2004/03/05 16:03:44 dwilliss 00076 * Added parameter to MxStringExtents to clear up confusion about what height 00077 * was returned (even though it was CLEARLY DOCUMENTED!) Now you have to tell 00078 * it what you want. You have a choice and it's not optional. 00079 * 00080 * Revision 3.686 2004/03/01 15:15:30 mju 00081 * Deprecate more legacy functions. 00082 * Show replacements for most deprecated items. 00083 * 00084 * Revision 3.685 2004/02/26 16:54:53 mju 00085 * Deprecate old style editor functions. 00086 * 00087 * Revision 3.684 2004/02/16 21:48:34 mju 00088 * No mtTextGetXmString. 00089 * 00090 * Revision 3.683 2004/02/16 18:01:49 mju 00091 * Use 'deprecated' on deprecated items. 00092 * 00093 * Revision 3.682 2004/02/05 22:08:04 mju 00094 * Remove/deprecate legacy tooltip functions. 00095 * 00096 * Revision 3.681 2004/02/02 17:54:17 mju 00097 * Add xmstr.SetFromWidget. 00098 * 00099 * Revision 3.680 2004/01/06 14:29:39 mju 00100 * Remove getXServerFont as not used. 00101 * 00102 * Revision 3.679 2004/01/06 13:08:53 mju 00103 * Remove 'console' functions to own header. 00104 * 00105 * Revision 3.678 2004/01/02 17:38:52 mju 00106 * Add mxClearWidget. 00107 * 00108 * Revision 3.677 2003/12/19 21:25:42 mju 00109 * mtTextGetSmString should be inline. 00110 * 00111 * Revision 3.676 2003/12/19 17:15:03 dwilliss 00112 * added a new prototype for a new tooltip func 00113 * 00114 * Revision 3.675 2003/12/19 14:20:44 mju 00115 * Remove obsolete mtTextSetXeTextString. 00116 * 00117 * Revision 3.674 2003/12/18 13:42:42 mju 00118 * Remove deprecated stuff. 00119 * 00120 * Revision 3.673 2003/12/15 23:55:11 dwilliss 00121 * Added tool tip function to show an MGD image 00122 * 00123 * Revision 3.672 2003/12/15 21:02:07 dwilliss 00124 * Added a proto 00125 * 00126 * Revision 3.671 2003/11/19 21:50:26 mju 00127 * Add MxCreateLabel using MISTRING. 00128 * 00129 * Revision 3.670 2003/11/11 22:54:36 dwilliss 00130 * Overloaded version of MxGetDBFields that takes MISTRING/FILEPATH 00131 * 00132 * Revision 3.669 2003/11/10 16:13:26 dwilliss 00133 * New prototype. 00134 * 00135 * Revision 3.668 2003/11/07 14:37:44 mju 00136 * Remove mxWarp... protototypes. 00137 * 00138 * Revision 3.667 2003/11/05 20:50:30 mju 00139 * Restore XMSTR ctor/op= from UNICODE const*. 00140 * 00141 * Revision 3.666 2003/11/05 15:01:15 mju 00142 * Forgot to inline fn. 00143 * 00144 * Revision 3.665 2003/11/05 14:44:00 mju 00145 * Add mxGetColorPixel, setWidgetColor. 00146 * Remove more obsolete prototypes. 00147 * 00148 * Revision 3.664 2003/11/04 15:27:36 scowan 00149 * Removed get scaalbe font flags and prototype. 00150 * 00151 * Revision 3.663 2003/11/04 15:24:38 scowan 00152 * Removed legacy wrapper call to get scalable font function. 00153 * 00154 * Revision 3.662 2003/11/03 20:40:06 scowan 00155 * Deprecate legacy get scalable font function. 00156 * 00157 * Revision 3.661 2003/11/03 14:41:26 mju 00158 * Add MxMsgLineSetText, make SetString/SetTextID call it. 00159 * 00160 * Revision 3.660 2003/10/31 22:28:43 mju 00161 * Move MxcAlloc after FindClosest so builds. 00162 * 00163 * Revision 3.659 2003/10/31 22:12:09 mju 00164 * Remove almost all Mxc color toolkit fns as colormapped displays no longer supported. 00165 * 00166 * Revision 3.658 2003/10/31 16:33:38 mju 00167 * Remove mxFindClosestStdColor. 00168 * 00169 * Revision 3.657 2003/10/31 16:21:52 mju 00170 * Delete obsolete prototypes. 00171 * 00172 * Revision 3.656 2003/10/31 16:02:42 mju 00173 * Remove old metadata attachment fn. 00174 * 00175 * Revision 3.655 2003/10/30 20:25:33 scowan 00176 * Changed check disk space prototype to take a filepath and a int 64. 00177 * 00178 * Revision 3.654 2003/10/22 16:33:09 mju 00179 * Remove mxGeorefMakeImplied prototype. 00180 * 00181 * Revision 3.653 2003/10/22 15:44:11 mju 00182 * Remove mxDisplayMessageCode prototypes. 00183 * 00184 * Revision 3.652 2003/10/17 14:52:50 mju 00185 * Deprecate MxPopupYNC. 00186 * 00187 * Revision 3.651 2003/10/16 18:03:36 scowan 00188 * nc. 00189 * 00190 * Revision 3.650 2003/10/15 21:51:43 mju 00191 * Deprecate MfxSelectTable. 00192 * 00193 * Revision 3.649 2003/10/15 14:59:54 mju 00194 * MxAdvisor parms changed. 00195 * 00196 * Revision 3.648 2003/10/09 15:27:23 scowan 00197 * Added text id support for xm str class. 00198 * 00199 * Revision 3.647 2003/10/08 22:33:26 scowan 00200 * Removed unused prototypes. 00201 * 00202 * Revision 3.646 2003/10/08 16:42:14 mju 00203 * Add MxMsgLineSetTimer variant using textid. 00204 * 00205 * Revision 3.645 2003/09/22 19:57:03 scowan 00206 * removed old recover rvc function prototype. 00207 * 00208 * Revision 3.644 2003/09/15 15:25:32 dwilliss 00209 * Fixed error in Doxygen cleanup. 00210 * 00211 * Revision 3.643 2003/09/15 13:49:56 fileserver!dwilliss 00212 * Doxygen 00213 * 00214 * \endif 00215 **/ 00216 00217 #if !defined(INC_MI32_XDEFNS_H) && (!defined(WIN32_NATIVE) || defined(GENERATING_DOXYGEN_OUTPUT)) 00218 00219 #define INC_MI32_XDEFNS_H 00220 00221 #define NoXmMessageDialogTypes //!< So don't allow XmDIALOG_ERROR, WARNING, etc 00222 00223 #ifndef INC_MI32_STDDEFNS_H 00224 #include <mi32/stddefns.h> 00225 #endif 00226 00227 #ifndef _XLIB_H_ 00228 #include <X11/Xlib.h> 00229 #endif 00230 00231 #ifndef _XUTIL_H 00232 #include <X11/Xutil.h> 00233 #endif 00234 00235 #ifdef EDITRES 00236 #include <X11/Xmu/Editres.h> 00237 #endif 00238 00239 #ifndef _Xm_h 00240 #include <Xm/Xm.h> 00241 #endif 00242 #ifndef _XmToggle_h 00243 #include <Xm/ToggleB.h> 00244 #endif 00245 00246 #ifndef INC_MI32_MSTATUSW_H 00247 #include <mi32/mstatusw.h> 00248 #endif 00249 #ifndef INC_MI32_MDLG_H 00250 #include <mi32/mdlg.h> 00251 #endif 00252 #ifndef INC_MI32_MCB_H 00253 #include <mi32/mcb.h> 00254 #endif 00255 00256 #ifndef INC_MI32_DISPINFO_H 00257 #include <mi32/dispinfo.h> 00258 #endif 00259 00260 #ifndef INC_MI32_ELEMTYPE_H 00261 #include <mi32/elemtype.h> 00262 #endif 00263 00264 #ifndef INC_MI32_COLOR_H 00265 #include <mi32/color.h> 00266 #endif 00267 00268 #ifndef INC_MI32_TEXTBASE_H 00269 #include <mi32/textbase.h> //! For TEXTBASEORIGIN 00270 #endif 00271 00272 #ifndef INC_MI32_LATLONFM_H 00273 #include <mi32/latlonfm.h> //! For DEGTOSTRFLAGS 00274 #endif 00275 00276 #ifndef INC_MI32_MSYS_H 00277 #include <mi32/msys.h> 00278 #endif 00279 00280 #ifndef INC_MI32_SIMPLEAR_H 00281 #include <mi32/simplear.h> 00282 #endif 00283 00284 #ifndef INC_MI32_RVCDEFNS_H 00285 #include <mi32/rvcdefns.h> 00286 #endif 00287 00288 #ifndef INC_MI32_HELPID_H 00289 #include <mi32/helpid.h> 00290 #endif 00291 00292 #ifndef INC_MI32_MG2ENUMS_H 00293 #include <mi32/mg2enums.h> 00294 #endif 00295 00296 #ifdef index 00297 #undef index 00298 #endif 00299 00300 //! Forward declarations 00301 00302 union ANYRASTVALUE; 00303 struct BITMAPPATTHDR; 00304 class REGION2D; 00305 struct COLMAPINFO; 00306 struct HISTORGB; 00307 struct MAPPROJPARM; 00308 struct MICONSTRUCT; 00309 struct RGNELEMLIST; 00310 struct RVCRASTINFO; 00311 struct RVCTABLEINFO; 00312 struct TABLEFIELD; 00313 struct TEXTSTYLE; 00314 struct TRANSPARM; 00315 struct MTIMER; 00316 class TRANS2D_MAPGEN; 00317 struct UNITCONV; 00318 class FILEPATH; 00319 class XTARGS; 00320 00321 00322 #ifndef USE_NEW_MGD 00323 #define USE_NEW_MGD 00324 #endif 00325 00326 00327 namespace MGD { 00328 class DEVICE; 00329 class DEVICE_BINARY; 00330 } 00331 typedef MGD::DEVICE MGD_DISPLAY; 00332 00333 namespace RVC { 00334 class OBJITEM; 00335 } 00336 typedef RVC::OBJITEM RVCOBJITEM; 00337 00338 namespace SPATREF { 00339 class COORDREFSYS; 00340 } 00341 00342 /*----------------------------------------------------------------------------*/ 00343 /* Helper macros */ 00344 /*----------------------------------------------------------------------------*/ 00345 00346 #define XtSetArgI(arg,c,n,v) ((void)(arg[c].name=(char*)(n),arg[c].value=(XtArgVal)(v),c++)) 00347 00348 // The sizeof operators are used to ensure that the size of the variable where 00349 // userData will be stored is at least as large as a pointer. Normally the 00350 // expression inside the [] evaluates to 1. mju 1994-05-10 00351 #define MxGetUserData(w,p) { Arg _mxgetuserdataarg[sizeof(*p)-sizeof(void*)+1]; XtSetArg(_mxgetuserdataarg[0],XmNuserData,p); XtGetValues(w,_mxgetuserdataarg,1); } 00352 00353 #define MxAddEditResHandler(shell) XtAddEventHandler(shell, (EventMask) 0, True, _XEditResCheckMessages, NULL) 00354 00355 //! Macros for defining class methods to add Xt callbacks / event handlers 00356 #define MXXTCB_ADD(_clsname) inline void MxXtCallbackAdd (Widget w, const char *name, void (*f)(Widget,_clsname*,void*)) { XtAddCallback(w,(name),reinterpret_cast<XtCallbackProc>(f),this); } 00357 #define MXXTCB_REMOVE(_clsname) inline void MxXtCallbackRemove (Widget w, const char *name, void (*f)(Widget,_clsname*,void*)) { XtRemoveCallback(w,(name),reinterpret_cast<XtCallbackProc>(f),this); } 00358 #define MXXTEH_ADD(_clsname) inline void MxXtEventHandlerAdd (Widget w, EventMask emask, void (*f)(Widget,_clsname*,XEvent*,Boolean*), bool nmi=false) { XtAddEventHandler(w,(emask),(Boolean)(nmi),reinterpret_cast<XtEventHandler>(f),this); } 00359 #define MXXTEH_REMOVE(_clsname) inline void MxXtEventHandlerRemove (Widget w, EventMask emask, void (*f)(Widget,_clsname*,XEvent*,Boolean*), bool nmi=false) { XtRemoveEventHandler(w,(emask),(Boolean)(nmi),reinterpret_cast<XtEventHandler>(f),this); } 00360 #define MXXTTO_ADD(_clsname) inline XtIntervalId MxXtTimeOutAdd (Widget w, unsigned long delay, void (*f)(_clsname*,XtIntervalId*)) { return(XtAppAddTimeOut(MsysAppGetXContext(),(delay),reinterpret_cast<XtTimerCallbackProc>(f),this)); } 00361 00362 00363 /*----------------------------------------------------------------------------*/ 00364 00365 extern "C" { 00366 00367 extern int _MxShadowThickness; //!< Shadow thickness for widgets that have shadows 00368 extern int _MxSpaceNarrow; //!< Narrow spacing (eg, inside Frame) between widgets 00369 extern int _MxSpaceNormal; //!< Normal spacing between widgets 00370 extern int _MxSpaceWide; //!< Wide spacing between widgets 00371 00372 } //! extern "C" 00373 00374 /*----------------------------------------------------------------------------*/ 00375 /* Definitions for EditColor */ 00376 /*----------------------------------------------------------------------------*/ 00377 00378 #define EDITCOLOR_AllowTransp 0x0002 //!< Allows transparency toggle 00379 #define EDITCOLOR_AllowTransPct 0x0004 //!< Allows setting of transparency 0-100% 00380 00381 struct EDITCOLORINFO { 00382 COLOR color; 00383 Pixel pixel; //!< Pixel value to use on PseudoColor displays 00384 UINT8 CanChangeColor; //!< Set if colormap entry for pixel value is writable 00385 UINT8 AllowTransparent; //!< Allow this color to be set to "transparent" 00386 UINT8 DefaultSelected; //!< Default to having this item 'selected' 00387 UINT8 spare; 00388 char *name; //!< Name for color, will be translated through resource file 00389 }; 00390 00391 00392 /*----------------------------------------------------------------------------*/ 00393 /* Menu Item definitions */ 00394 /*----------------------------------------------------------------------------*/ 00395 00396 struct MENUITEM { 00397 mutable char *label; //!< Label for the item, if "-" a separator will be generated, NULL to indicate end of array. 00398 unsigned long flags; //!< Must be same size as pointer for proper alignment on the DEC Alpha 00399 XtCallbackProc callback; //!< Callback function; NULL if none 00400 void *callback_data; //!< client_data for callback() 00401 const char *help; //!< Help id 00402 const MENUITEM *subitems; //!< Submenu items; NULL if none 00403 void *userdata; //!< Used to set userData resource if NULL passed to MxCreateMenuBar 00404 UINT32 icid; //!< Interface Component ID for customization 00405 mutable Widget widget; //!< Widget created for this menu item 00406 Widget *pwidget; //!< If non-NULL, pointed-to value will be set to widget when created 00407 }; 00408 00409 struct MENUBARITEM { 00410 mutable char *label; //!< Label for the item, NULL to indicate end of array. 00411 const MENUITEM *items; //!< First pulldown menu items, NULL to indicate end. 00412 Widget *widget_list; //!< Array of widgets to save into 00413 mutable Widget widget; //!< Widget created for this menu bar item 00414 const char *help; //!< Help id 00415 UINT32 icid; //!< Interface Component ID for customization 00416 Widget *pwidget; //!< If non-NULL, pointed-to value will be set to widget when created 00417 }; 00418 00419 #define MxMENU_SELECTED 0x0001 00420 #define MxMENU_ONE_OF_MANY 0x0002 //!< radio button gadget 00421 #define MxMENU_TOGGLE 0x0004 //!< single ToggleButtonGadget 00422 #define MxMENU_DISABLED 0x0008 //!< button is initially not "Sensitive" 00423 #define MxMENU_LABEL 0x0010 //!< Just a label 00424 #define MxMENU_FORCENAME 0x0020 //!< Set labelString resource to label value so doesn't read from resource file 00425 #define MxMENU_LABELUNICODE 0x0040 //!< Label is a pointer to a UNICODE string 00426 #define MxMENU_IGNORE 0x0080 //!< Ignore this item, don't put on menu 00427 #define MxMENU_NOGADGET 0x0100 //!< Don't use "gadget" for this item 00428 #define MxMENU_NOCENTERLABEL 0x0200 //!< Don't center if label 00429 #define MxMENU_PROGRAMMER 0x0400 //!< Item only appears on "Programmer" systems 00430 #define MxMENU_NOCHGCBDATA 0x0800 //!< Don't change callback_data for this item 00431 #define MxMENU_FREELABEL 0x1000 //!< Free label field after item created 00432 #define MxMENU_NOCUSTOMSUBMENU 0x2000 //!< Don't show submenu when customizing 00433 00434 00435 enum MxEDITMENUFLAGS { //! Flags for MxEditMenuCreate 00436 MxEDITMENUFLAG_None = 0x0000, 00437 MxEDITMENUFLAG_NoSearch = 0x0001, 00438 MxEDITMENUFLAG_NoReplace = 0x0002, 00439 MxEDITMENUFLAG_NoInsertFile = 0x0004, 00440 MxEDITMENUFLAG_AllowFormat = 0x0008 //!< For if widgit is WYSIWYG 00441 }; 00442 DEFINE_ENUM_OPERATORS(MxEDITMENUFLAGS); 00443 00444 /*----------------------------------------------------------------------------*/ 00445 /* Definitions used by MxCreateButtonRow */ 00446 /*----------------------------------------------------------------------------*/ 00447 00448 struct BUTTONITEM { 00449 char *label; //!< the label for the item 00450 UINT32 flags; //!< see below 00451 XtCallbackProc callback; //!< Callback function; NULL if none 00452 void *callback_data; //!< client_data for callback() if NULL passed to MxCreateButtonRow 00453 const char *help; //!< Help id 00454 void *userdata; //!< Used to set userData resource if NULL passed to MxCreateButtonRow 00455 mutable Widget pbwidget; //!< Widget created 00456 const char *IconName; //!< name of the bitmap fill pattern to use for the icon (16 chars max) 00457 const char *ClassName; //!< if not NULL, will override "class" passed to MxCreateIconButtonXXXX 00458 UINT32 icid; //!< Interface Component ID for customization 00459 const UNICODE *ToolTip; //!< ToolTip string for override 00460 Pixel BackgroundPixel; //!< Background color of icon if MxBUTTON_BACKGROUND_PIXEL is set 00461 Widget *pwidget; //!< If non-NULL, pointed-to value will be set to widget when created 00462 }; 00463 00464 #define MxBUTTON_DISABLED 0x0001 //!< Button is initially not "Sensitive" 00465 #define MxBUTTON_TOGGLE 0x0002 //!< Create toggle (radio or checkbox) button 00466 #define MxBUTTON_NOINDICATOR 0x0004 //!< Don't show indicator 00467 #define MxBUTTON_SELECTED 0x0008 //!< Toggle button initially selected 00468 #define MxBUTTON_ONE_OF_MANY 0x0010 //!< Use one-of-many indicator, enforce radio behavior 00469 #define MxBUTTON_DEFAULT 0x0020 //!< Button gets default border (Not implemented) 00470 #define MxBUTTON_MULTI_CLICK 0x0040 //!< Button allows multiple clicks in rapid succession 00471 #define MxBUTTON_IGNORE 0x0080 //!< Ignore this entry in the BUTTONITEM array 00472 #define MxBUTTON_PROGRAMMER 0x0100 //!< Don't display button unless in Programmer mode 00473 #define MxBUTTON_NOMANAGE 0x0200 //!< Don't manage button when created (RowColumn button-rows only) 00474 #define MxBUTTON_ICON_MENU 0x0400 //!< Create icon popup menu for button, callback_data points to MENUITEM* 00475 #define MxBUTTON_ICON_MENU_FILE 0x0800 //!< Create icon popup menu for button, callback_data points to menu file name 00476 #define MxBUTTON_BACKGROUND_PIXEL 0x1000 //!< Use BackgroundPixel from ButtonItem 00477 #define MxBUTTON_NOCUSTOMSUBMENU 0x2000 //!< Don't show submenu when customizing 00478 #define MxBUTTON_FORCENAME 0x4000 //!< Set labelString resource to label value so doesn't read from resource file 00479 #define MxBUTTON_LABELUNICODE 0x8000 //!< Label is a pointer to a UNICODE string (implies FORCENAME) 00480 00481 #define MxBUTTONROW_NoIcons 0x0001 //!< Don't create and use icons for this button row (passed in flags for MxCreateIconButtonRow() 00482 #define MxBUTTONROW_RowColumn 0x0002 //!< Use RowColumn for button-row instead of form 00483 00484 /*----------------------------------------------------------------------------*/ 00485 /* TABPAGE definitions */ 00486 /*----------------------------------------------------------------------------*/ 00487 00488 typedef void (*TABPAGEFUNC) (Widget, int, void*); 00489 00490 struct MxTABPAGEITEM { 00491 char *label; 00492 UINT32 flags; 00493 TABPAGEFUNC create; 00494 TABPAGEFUNC activate; 00495 TABPAGEFUNC deactivate; 00496 TABPAGEFUNC destroy; 00497 void *pageUserData; 00498 }; 00499 00500 #define MxTABPAGE_DISABLED 0x0001 //!< TabPage is initially disabled 00501 #define MxTABPAGE_FreeLabel 0x0002 //!< TabPage will free the allocated label 00502 #define MxTABPAGE_LabelUnicode 0x0004 //!< Label is pointer to Unicode string 00503 00504 /*----------------------------------------------------------------------------*/ 00505 /* Flags for MxCreateIcon... */ 00506 /*----------------------------------------------------------------------------*/ 00507 00508 #define MXICON_Stippled MICONFLAG_Stippled 00509 #define MXICON_DefaultBackground MICONFLAG_DefaultBackground 00510 #define MXICON_StippledSelected MICONFLAG_StippledSelected 00511 #define MXICON_Size16 MICONFLAG_Size16 00512 #define MXICON_Size32 MICONFLAG_Size32 00513 #define MXICON_NoDarkenSelected MICONFLAG_NoDarkenSelected 00514 00515 /* Flags for MxSelectIcon() */ 00516 00517 #define SELICON_Resize 0x01 //!< Resize icons smaller than specified minimum size 00518 00519 00520 /*----------------------------------------------------------------------------*/ 00521 /* Flags used by MxPopupGet... and MxCreateDouble() etc... */ 00522 /*----------------------------------------------------------------------------*/ 00523 00524 #define GET_NoMin (0x00000011) //! Don't use or show 00525 #define GET_NoMax (0x00000022) 00526 #define GET_NoRange (0x00000033) 00527 #define GET_NoDft (0x00000004) 00528 #define GET_InvValid (0x00000008) //! For GetString 00529 #define GET_AllowCancel (0x00000001) //! For MxPopupYNC 00530 #define GET_AllowYesAll (0x00000002) //! For MxPopupYNC 00531 #define GET_RastValRGB16UINT2 (0x00000008) //! For MxPromptRastValCreate 00532 #define GET_RangeMask (0xFFFFFFFC) 00533 00534 #define GET_NoShowMin (0x00000010) //! Use, but don't show 00535 #define GET_NoShowMax (0x00000020) 00536 #define GET_NoShowRange (0x00000030) //! Obsolete 00537 #define GET_ShowUnitLabel (0x00000040) //! Show "unit" label 00538 #define GET_ShowRange (0x00000080) //! Set if want range displayed 00539 00540 #define GET_NoCancel (0x00000100) 00541 #define GET_LabelTop (0x00000200) //! label on top of text widget 00542 #define GET_DftRet (0x00000400) //! retval contains default 00543 #define GET_AddOne (0x00000800) //! Add 1 before showing dft/range 00544 00545 #define GET_DegsNS (0x00000000) //! For Lat/Lon prompt (yes, this is zero) 00546 #define GET_DegsEW (0x00001000) //! For Lat/Lon prompt 00547 #define GET_ToUpper (0x00002000) //! Convert characters to upper case as entered 00548 #define GET_DetectNULL (0x00004000) //! Treat 7FFF as empty string (for databases) 00549 #define GET_BlankZero (0x00008000) //! Show 0 values as blank 00550 #define GET_RightJustify (0x00010000) //! Right justify within field 00551 #define GET_OutputOnly (0x00020000) //! Output-only prompt 00552 #define GET_PromptGiven (0x00040000) //! For DBQueryEdit Only 00553 #define GET_DegsNoDir (0x00080000) //! For Lat/Lon "range" prompt, don't show direction 00554 #define GET_NoManage (0x00100000) 00555 #define GET_NoForm (0x00200000) //! For MxCreatePrompt... 00556 #define GET_PopupForceStr (0x00400000) //! In MxPopup... use specified string instead of doing lookup 00557 #define GET_HasScale (0x00800000) //! Put "Scale" widget in prompt 00558 #define GET_Degs360EW (0x01000000) //! For Longitude allow entry/display of W360 to E360 00559 #define GET_Unicode (0x02000000) //! Make string widget Unicode 00560 #define GET_PromptUnicode (0x04000000) //! Prompt string is really (UNICODE*) 00561 #define GET_LeftJustify (0x08000000) //! Left justify numeric value within field 00562 #define GET_UseLogScale (0x20000000) //! Set if want logarithmic scale, must set GET_HasScale also 00563 #define GET_Password (0x40000000) //! Show "*"'s in text widget 00564 00565 #define MxPromptRastValCR_ValueChanged 0x0001 00566 00567 #define MxPromptCR_ValueChanged 0x00000001 //!< User has changed prompt value 00568 #define MxPromptCR_ValueChangeDrag 0x00000002 //!< User dragging prompt scale slider 00569 #define MxPromptCR_Activate 0x00000004 //!< User pressed <Enter> while in prompt 00570 00571 struct MxPromptCallbackStruct { 00572 UINT32 reason; //!< Callback reason 00573 Widget prompt; //!< Prompt widget 00574 void *value; //!< Pointer to prompt value 00575 }; 00576 00577 typedef void (*MxPromptCallbackFunc)(MxPromptCallbackStruct*, void*); 00578 00579 #define MXPRMTCB_ADD(_clsname) inline void MxPromptCallbackAdd (Widget w, void (*f)(MxPromptCallbackStruct*,_clsname*), UINT32 flags = MxPromptCR_ValueChanged) const { MxPromptAddCallback(w,reinterpret_cast<MxPromptCallbackFunc>(f),(void*)this,(flags)); } 00580 #define MXPRMTCB_REMOVE(_clsname) inline void MxPromptCallbackRemove (Widget w, void (*f)(MxPromptCallbackStruct*,_clsname*), UINT32 flags) const { MxPromptRemoveCallback(w,reinterpret_cast<MxPromptCallbackFunc>(f),(void*)this,(flags)); } 00581 00582 /* Prompt field types */ 00583 #define MXPROMPT_ASTRING 0 //!< ASCII string 00584 #define MXPROMPT_USTRING 1 //!< Unicode string 00585 #define MXPROMPT_ACHAR 2 //!< Single ASCII character 00586 #define MXPROMPT_UCHAR 3 //!< Single Unicode character 00587 #define MXPROMPT_DOUBLE 10 //!< 64-bit floating-point 00588 #define MXPROMPT_FLOAT 11 //!< 32-bit floating-point 00589 #define MXPROMPT_UINT32 12 //!< Unsigned 32-bit number 00590 #define MXPROMPT_INT32 13 //!< Signed 32-bit number 00591 #define MXPROMPT_UINT16 14 //!< Unsigned 16-bit number 00592 #define MXPROMPT_INT16 15 //!< Signed 16-bit number 00593 #define MXPROMPT_UINT8 16 //!< Unsigned 8-bit number 00594 #define MXPROMPT_INT8 17 //!< Signed 8-bit number 00595 #define MXPROMPT_LATLON 18 //!< Latitude or Longitude stored as double 00596 00597 /*----------------------------------------------------------------------------*/ 00598 /* Flags for MxGetPattern */ 00599 /*----------------------------------------------------------------------------*/ 00600 00601 enum GETPATTERNFLAGS { 00602 GETPATTERN_None = 0x00, 00603 GETPATTERN_NewOK = 0x01, //!< Allow new pattern to be created 00604 GETPATTERN_IconMode = 0x02, //!< Don't replicate bitmap samples 00605 GETPATTERN_OnlyOne = 0x04, //!< Only allow one icon in the user set 00606 GETPATTERN_TitleEdit = 0x08 //!< Use "edit" title instead of "select" title 00607 }; 00608 DEFINE_ENUM_OPERATORS(GETPATTERNFLAGS); 00609 00610 /*----------------------------------------------------------------------------*/ 00611 /* Flags for MxCreateRastTypeOptionMenu */ 00612 /*----------------------------------------------------------------------------*/ 00613 00614 #define RASTYPE_binary 0x00000001 //!< one bit (binary) 00615 #define RASTYPE_1bit 0x00000001 //!< one bit (binary) 00616 #define RASTYPE_2bit 0x00000002 //!< two bit integer 00617 #define RASTYPE_4bit 0x00000004 //!< four bit integer 00618 #define RASTYPE_signed8 0x00000008 //!< signed 8 bit integer 00619 #define RASTYPE_unsigned8 0x00000010 //!< unsigned 8 bit integer 00620 #define RASTYPE_signed16 0x00000020 //!< signed 16 bit integer 00621 #define RASTYPE_unsigned16 0x00000040 //!< unsigned 16 bit integer 00622 #define RASTYPE_rgb_packed16 0x00000080 //!< 16 bit packed rgb 00623 #define RASTYPE_bgr_packed16 0x00000100 //!< 16 bit packed bgr 00624 #define RASTYPE_rgb_packed24 0x00000200 //!< 24 bit packed rgb 00625 #define RASTYPE_bgr_packed24 0x00000400 //!< 24 bit packed bgr 00626 #define RASTYPE_signed32 0x00000800 //!< 32 bit signed integer 00627 #define RASTYPE_unsigned32 0x00001000 //!< 32 bit unsigned integer 00628 #define RASTYPE_float32 0x00002000 //!< 32 bit floating point 00629 #define RASTYPE_float64 0x00004000 //!< 64 bit floating point 00630 #define RASTYPE_complexmp 0x00008000 //!< complex magnitude/phase 00631 #define RASTYPE_complexri 0x00010000 //!< complex real/imaginary 00632 #define RASTYPE_all 0x0001FFFF //!< ALL datatypes 00633 #define RASTYPE_no_rgb 0x0001F87F //!< no rgb or bgr datatypes 00634 #define RASTYPE_no_complex 0x00007FFF //!< no complex datatypes 00635 #define RASTYPE_no_bin 0x0001FFFE //!< no binary datatype 00636 #define RASTYPE_no_2 0x0001FFFD //!< no two bit integer 00637 #define RASTYPE_no_4 0x0001FFFB //!< no four bit integer 00638 #define RASTYPE_no_lessthan8 0x0001FFF8 //!< no types less than 8 bit 00639 #define RASTYPE_signed 0x00000828 //!< all signed types (any depth) 00640 #define RASTYPE_unsigned 0x00001057 //!< all unsigned type(any depth) 00641 #define RASTYPE_float 0x00006000 //!< both float32 and float64 00642 #define RASTYPE_dimmed 0x00100000 //!< dim non_selected types 00643 #define RASTYPE_omit 0x00200000 //!< omit non_selected types 00644 #define RASTYPE_none_dimmed 0x0001FFFF //!< do not dim any of the items 00645 00646 /*----------------------------------------------------------------------------*/ 00647 /* Values by MxPositionWindowRel */ 00648 /*----------------------------------------------------------------------------*/ 00649 00650 enum MxRELPOSN { 00651 MxRELPOSN_Default = 0, 00652 MxRELPOSN_AutoLeftRight = 1, 00653 MxRELPOSN_RightTop = 2, 00654 MxRELPOSN_LeftTop = 3, 00655 MxRELPOSN_RightCenter = 4, 00656 MxRELPOSN_LeftCenter = 5, 00657 MxRELPOSN_RightBottom = 6, 00658 MxRELPOSN_LeftBottom = 7, 00659 MxRELPOSN_TopLeft = 8, 00660 MxRELPOSN_BottomLeft = 9, 00661 MxRELPOSN_TopCenter = 10, 00662 MxRELPOSN_BottomCenter = 11, 00663 MxRELPOSN_TopRight = 12, 00664 MxRELPOSN_BottomRight = 13, 00665 MxRELPOSN_MatchBottom = 14, 00666 MxRELPOSN_MatchTop = 15, 00667 MxRELPOSN_MatchLeft = 16, 00668 MxRELPOSN_MatchRight = 17 00669 }; 00670 00671 /*----------------------------------------------------------------------------*/ 00672 /* Values used by MxLockWindowSize() */ 00673 /*----------------------------------------------------------------------------*/ 00674 00675 #define MxLOCKSIZE_MinHeight 0x1 00676 #define MxLOCKSIZE_MinWidth 0x2 00677 #define MxLOCKSIZE_MaxHeight 0x4 00678 #define MxLOCKSIZE_MaxWidth 0x8 00679 #define MxLOCKSIZE_Min (MxLOCKSIZE_MinHeight | MxLOCKSIZE_MinWidth) 00680 #define MxLOCKSIZE_Max (MxLOCKSIZE_MaxHeight | MxLOCKSIZE_MaxWidth) 00681 #define MxLOCKSIZE_MinMax (MxLOCKSIZE_Min | MxLOCKSIZE_Max) 00682 00683 /*----------------------------------------------------------------------------*/ 00684 /* Values used by MxCreatePathSelector */ 00685 /*----------------------------------------------------------------------------*/ 00686 00687 #define MxPATHSEL_AllowFiles 0x0002 //!< Allow files to be specified in path 00688 00689 /*----------------------------------------------------------------------------*/ 00690 /* Definitions used by MxEditStyle...() */ 00691 /*----------------------------------------------------------------------------*/ 00692 00693 #define EDITSTYLE_Default 0x00000001 //!< Only editing the "default" style 00694 #define EDITSTYLE_CAD 0x00000002 //!< Editing CAD styles 00695 #define EDITSTYLE_OKCancel 0x00000004 //!< Add OK/Cancel butons 00696 #define EDITSTYLE_SingleType 0x00000008 //!< Only allow editing of specified style type 00697 #define EDITSTYLE_NoRenameStyles 0x00000010 //!< Don't allow styles to be renamed 00698 #define EDITSTYLE_NoNewDelStyles 0x00000020 //!< Don't allow styles to be created or deleted 00699 #define EDITSTYLE_NoElemHeight 0x00000040 //!< Don't include "Use element height" togglebutton 00700 #define EDITSTYLE_AllowTextHTML 0x00000080 //!< Allow HTML text formatting options 00701 #define EDITSTYLE_AllowTextSpecialFormat 0x00000100 //!< Allow "Special Format" options for text styles 00702 #define EDITSTYLE_NoScaleToNone 0x00000200 //!< Scaling to "none" not allowed 00703 #define EDITSTYLE_NoTypeButtons 0x00000400 //!< Don't include buttons for switching style type 00704 #define EDITSTYLE_NoScaleToLayout 0x00000800 //!< Don't allow scaling to "layout" 00705 #define EDITSTYLE_NoScaleOptions 0x00001000 //!< Don't give user options for scale-to 00706 #define EDITSTYLE_NoSymbolNone 0x00002000 //!< Don't allow "no symbol" option 00707 #define EDITSTYLE_AllowTextVertAlignment 0x00004000 //!< Add option for text vertical alignment 00708 #define EDITSTYLE_SymbolForceSquare 0x00008000 //!< Force symbol "width" to match "height" 00709 #define EDITSTYLE_NoSample 0x00010000 //!< No not show "sample" 00710 #define EDITSTYLE_NoWordWrap 0x00020000 //!< Disallow setting word wrap 00711 #define EDITSTYLE_ForceWordWrap 0x00040000 //!< Force word wrap 00712 #define EDITSTYLE_NoBlockWidth 0x00080000 //!< Don't allow setting block width 00713 #define EDITSTYLE_NoAdvanced 0x00100000 //!< Don't allow advanced button 00714 00715 /*----------------------------------------------------------------------------*/ 00716 /* Values used by MxSetupXYDigRefInfo */ 00717 /*----------------------------------------------------------------------------*/ 00718 00719 #define MxXYD_NoChangeProj 0x00000001 00720 00721 /*----------------------------------------------------------------------------*/ 00722 /* Class for double-click handling */ 00723 /*----------------------------------------------------------------------------*/ 00724 00725 class DOUBLECLICKTEST { 00726 public: 00727 00728 //! Constructor 00729 DOUBLECLICKTEST ( 00730 ): 00731 m_State(0), 00732 m_Interval(400), 00733 m_StartTime(0) 00734 { } 00735 00736 //! Destructor 00737 ~DOUBLECLICKTEST ( 00738 ) { } 00739 00740 //! Reset to initial state 00741 void Reset ( 00742 ) { m_State = 0; } 00743 00744 //! Set interval 00745 void SetInterval ( 00746 INT32 Interval //!< Interval in milliseconds 00747 ) { m_Interval = Interval; } 00748 00749 //! Test if event results in double-click 00750 bool TestEvent ( 00751 const XEvent *event //!< Event to check 00752 ); 00753 00754 private: 00755 #ifndef GENERATING_DOXYGEN_OUTPUT 00756 UINT8 m_State; //!< State for double-click testing 00757 INT32 m_Interval; //!< Interval in milliseconds 00758 UINT32 m_StartTime; //!< Starting event time 00759 #endif // GENERATING_DOXYGEN_OUTPUT 00760 }; 00761 00762 00763 /*----------------------------------------------------------------------------*/ 00764 /* Misc constants */ 00765 /*----------------------------------------------------------------------------*/ 00766 00767 #define MxCOLORSEL_EditTranspPct 0x0001 //!< Allow transparency percentage to be set in MxColorSel... 00768 00769 #if !defined(DEPRECATE_GROUPKEY) && !defined(DEPRECATE_OLDHELP) 00770 #define MxYNC_HasCancel GET_AllowCancel 00771 #endif 00772 00773 #define MxBCOL_ALIGN_BEGINNING 1 00774 00775 #define MxTEXTSTYLEFORM_NoColorButton 0x00000001 00776 00777 #define MxSETTITLE_AnyLevel 0x00000000 //!< Used in MxSetTitleStringExt() 00778 #define MxSETTITLE_TopLevelOnly 0x00000001 //!< Used in MxSetTitleStringExt() 00779 00780 /*----------------------------------------------------------------------------*/ 00781 /* Function prototypes (keep in alphabetical order!) */ 00782 /*----------------------------------------------------------------------------*/ 00783 00784 //!:Associate with "MsysApp Functions" 00785 //!\addtogroup MsysApp MsysApp Functions 00786 //!@{ 00787 00788 extern "C" { 00789 00790 //! Get X Application Context. 00791 XtAppContext MsysAppGetXContext (); 00792 00793 //! Get X Display pointer. 00794 Display* MsysAppGetXDisplay (); 00795 00796 //! Set X Display pointer and application context. 00797 void MsysAppSetXDisplayContext ( 00798 Display *xdisplay, //!< X Display pointer 00799 XtAppContext xappcontext //!< Xt application context 00800 ); 00801 00802 //!@} 00803 //!:Associate with "X Functions" 00804 //!\addtogroup X11 X11 Functions 00805 //!@{ 00806 00807 /* Generic callbacks */ 00808 00809 //! The XmNhelpCallback to any widget that you want to give help to. 00810 //! The callback data should be a string containing the refcode of the 00811 //! help entry. If the name of the widget is the same as it's refcode, 00812 //! you can just pass null for the callback data. 00813 void MxcbDisplayHelp ( 00814 Widget, //!< The widget to display help for 00815 void*, 00816 void* 00817 ); 00818 00819 //! Callback to place dialog on center of primary monitor/screen. 00820 //! Use for mapCallback. 00821 void MxcbMapToCenter ( 00822 Widget, 00823 void*, 00824 void* 00825 ); 00826 00827 //! OptionMenu callback for setting UINT8 value. 00828 //! The userdata parameter specified in MxCreateOptionMenuExt() must be a pointer to the UINT8 variable or member to be set. 00829 //! The MENUITEM.callback_data will contain the values to be set in the specified variable. 00830 void MxcbOptionUBYTE ( 00831 Widget w, 00832 void *voption, 00833 void* 00834 ); 00835 00836 //! OptionMenu callback for setting UINT32 value. 00837 //! The userdata parameter specified in MxCreateOptionMenuExt() must be a pointer to the UINT32 variable or member to be set. 00838 //! The MENUITEM.callback_data will contain the values to be set in the specified variable. 00839 void MxcbOptionULONG ( 00840 Widget w, 00841 void *voption, 00842 void* 00843 ); 00844 00845 //! OptionMenu callback for setting UINT16 value. 00846 //! The userdata parameter specified in MxCreateOptionMenuExt() must be a pointer to the UINT16 variable or member to be set. 00847 //! The MENUITEM.callback_data will contain the values to be set in the specified variable. 00848 void MxcbOptionUWORD ( 00849 Widget w, 00850 void *voption, 00851 void* 00852 ); 00853 00854 //! Set the exit process 00855 void MxcbSetExit ( 00856 Widget, 00857 void*, 00858 void* 00859 ); 00860 00861 //! Callback for toggling bool variable/member. 00862 //! The callback data must be a pointer to the 'bool' value to toggle. 00863 void MxcbToggleBool ( 00864 Widget, 00865 void *vvalue, 00866 XmToggleButtonCallbackStruct *cbs 00867 ); 00868 00869 //! Callback for toggling UINT8 variable/member. 00870 //! The callback data must be a pointer to the UINT8 value to toggle. 00871 void MxcbToggleUBYTE ( 00872 Widget, 00873 void *vvalue, 00874 XmToggleButtonCallbackStruct *cbs 00875 ); 00876 00877 //! Set value in UINT8 base on radio ToggleButton setting. 00878 void MxcbToggleSetUBYTE ( 00879 Widget w, 00880 void *voption, 00881 XmToggleButtonCallbackStruct *cbs 00882 ); 00883 00884 #define MxcbOptionUINT8 MxcbOptionUBYTE 00885 #define MxcbOptionUINT16 MxcbOptionUWORD 00886 #define MxcbOptionUINT32 MxcbOptionULONG 00887 #define MxcbToggleUINT8 MxcbToggleUBYTE 00888 #define MxcbToggleSetUINT8 MxcbToggleSetUBYTE 00889 00890 //! Main entry point for Edit / Attribute Database. 00891 int Main_DatabaseEditor ( 00892 Widget parent //!< Parent widget 00893 ); 00894 00895 namespace RVC { 00896 //! Create a georeference option menu. 00897 //! @return the option menu 00898 MDLGPARENT OmGeorefCreate ( 00899 MDLGPARENT dlgparent, 00900 const RVC::OBJITEM& ObjItem, 00901 RVC::OBJECTNAME& GeorefName, 00902 Arg *arglist, 00903 int argcount 00904 ); 00905 00906 ERRVALUE OmGeorefUpdate ( 00907 MDLGPARENT GeorefOM, //!< Previously-created georeference OptionMenu 00908 const RVC::OBJITEM& ObjItem, 00909 RVC::OBJECTNAME& GeorefName 00910 ); 00911 00912 } //! End of RVC namespace 00913 00914 //! Dialog to ask user to select a port. 00915 //! This function will bring up a modal dialog asking the user to 00916 //! select a port. port_type should be able to hold a 20 byte 00917 //! string. port_name can be any length, but if PORTTYPE_File 00918 //! is allowed, 256 is recommended. If valid_types is 0, all 00919 //! available port types are valid. If a device can only talk 00920 //! to LPT or COM, set valid_types to PORTTYPE_LPT|PORTTYPE_COM. 00921 void MpSelectPort ( 00922 Widget parent, //!< Parent widget 00923 char* type, //!< Port type (string) 00924 char* name, //!< Port name 00925 char* extn, //!< Dft extension to use if going to file 00926 int maxlen, //!< Max len for name to return 00927 UINT32 validtypes //!< Bit mask of valid types 00928 ); 00929 00930 //! Handle f.delete from TWM or f.kill from MWM. 00931 //! This function should be called after any dialog is created. It will 00932 //! add support for the "Close" item on the MWM menu (f.kill) and the 00933 //! f.delete (Be Polite) in TWM. It uses the standard WM_DELETE_WINDOW 00934 //! protocol so anything that sends WM_DELETE_WINDOW will be trapped by 00935 //! this callback. It is also assumed that the resource deleteResponse 00936 //! has been set to XmDO_NOTHING. If you do not pass a shell widget, the 00937 //! widget hierarchy of the widget you do pass will be searched for the 00938 //! nearest shell widget. 00939 //! If you pass NULL for the callback function, a static local callback 00940 //! which calls XBeep() will be added for you. 00941 //! See mxadwcb.c for more information about what is going on. 00942 void MxAddDeleteWindowCallback ( 00943 Widget widget, 00944 XtCallbackProc cbproc, 00945 void* cbdata 00946 ); 00947 00948 //! Close TNT Advisor dialog if it is currently open. 00949 //! This will close the TNT Advisor dialog. It must be called when the user-invoked 00950 //! step resulting in the advisor being opened has completed. 00951 void MxAdvisorClose ( 00952 ); 00953 00954 //! Open TNT Advisor dialog and display specified message. 00955 //! This function will open the advisor dialog and display the specified message if the appropriate 00956 //! number of intervals (default is 5) have elapsed since the last time this particular message was 00957 //! requested. Each message may use its own interval by adding a <msgkey>Freq=### to the [advisor] 00958 //! section of the tntmips.ini file. If the advisor window is already open because of a previous 00959 //! message the message will be updated automatically. 00960 //! The [advisor] message class will be used for retrieving the message. 00961 //! If you call this function, you MUST call MxAdvisorClose() whener the entire sequence of steps 00962 //! resulting from the last user action is complete. In other words, do not pop the advisor window 00963 //! in and our for each individual step. 00964 void MxAdvisorOpen ( 00965 Widget parent, //!< Parent widget, will use MxTopLevel() if NULL 00966 const MISTRING& msg, //!< Message to show in window 00967 const char* IniKey //!< Ini key for determining whether to show 00968 ); 00969 00970 //! Make labels a uniform width and right justify them. 00971 //! This routine takes an array of widgets and makes them all as wide as the widest one in the list. 00972 //! This forces XmALIGNMENT_CENTER for buttons and XmALIGNMENT_END for everything else. 00973 void MxAlignLabels ( 00974 Widget* widgets, //!< Array of widgets to align 00975 int num //!< Number of widgets to align 00976 ); 00977 00978 //! Make specified widgets the same width, adjust alignment if requested. 00979 //! This routine takes an array of widgets and makes them all as wide as the widest one in the list. 00980 //! Flags: 00981 //! \li 1 = Force XmALIGNMENT_CENTER for buttons and XmALIGNMENT_END for everything else 00982 //! \li 2 = Force XmALIGNMENT_BEGINNING for everything 00983 void MxAlignWidgets ( 00984 Widget* widgets, //!< Array of widgets to align 00985 int num, //!< Number of widgets to align 00986 UINT32 flags //!< Flags 00987 ); 00988 00989 00990 #define MxANGLECONTROL_Quadrant1 0x00000001 00991 #define MxANGLECONTROL_Quadrant2 0x00000002 00992 #define MxANGLECONTROL_Quadrant3 0x00000004 00993 #define MxANGLECONTROL_Quadrant4 0x00000008 00994 #define MxANGLECONTROL_FullCircle 0x0000000F //!< All of the above 00995 #define MxANGLECONTROL_ZeroAtTop 0x00000010 00996 00997 //! Create a graphical control for entering an angle. 00998 //! 00999 //! Creates a drawing area which will allow the user to 01000 //! graphically enter an angle. Note that no numeric prompt 01001 //! is created. If you want one, create it yourself, then 01002 //! call MxAngleControlSetPrompt(). 01003 //! By default, the control allows for 360 degrees. If you want 01004 //! to limit it to one or more quadrants, use one or more of the 01005 //! following flags ORd together. 01006 //! 01007 //! \li MxANGLECONTROL_Quadrant1 Upper Right 01008 //! \li MxANGLECONTROL_Quadrant2 Upper Left 01009 //! \li MxANGLECONTROL_Quadrant3 Lower Left 01010 //! \li MxANGLECONTROL_Quadrant4 Lower Right 01011 //! 01012 //! There's no guarentee what you'll get if you give three quadrants 01013 //! or two which are diagonaly opposite. 01014 //! 01015 //! If you intend to add a numeric prompt, you can also pass the 01016 //! following flag to the create function. 01017 //! 01018 //! \li MxANGLECONTROL_ZeroAtTop 01019 //! 01020 //! The default is for zero to be along the right X axis and increase 01021 //! counter-clockwise. If you give the ZeroAtTop flag, then zero is 01022 //! at the top (go figure!) and increases clockwise. 01023 //! 01024 Widget MxAngleControlCreate ( 01025 Widget parent, 01026 double* pValue, //!< Pointer to angle to modify (radians) 01027 int radius, //!< Radius of control 01028 UINT32 flags, //!< 01029 Arg *callerargs, 01030 int numargs 01031 ); 01032 01033 01034 //! Set the numeric prompt for an angular prompt (graphic control). 01035 //! 01036 //! MxAngleControlCreate only creates the graphic control for setting 01037 //! an angle. If you also want a numeric prompt to reflect the angle, 01038 //! you can create the prompt yourself, placing it wherever you want 01039 //! then call this function. 01040 ERRVALUE MxAngleControlSetPrompt ( 01041 Widget control, 01042 Widget prompt 01043 ); 01044 01045 //! Add a callback to be called when the angle is changed. 01046 ERRVALUE MxAngleControlAddCallback ( 01047 Widget control, 01048 McbCallbackFunc cbfunc, 01049 void* cbdata 01050 ); 01051 01052 //! Remove a callback to be called when the angle is changed. 01053 ERRVALUE MxAngleControlRemoveCallback ( 01054 Widget control, 01055 McbCallbackFunc cbfunc, 01056 void* cbdata 01057 ); 01058 01059 //! Inform the AngleControl that the angle it's representing has changed. 01060 ERRVALUE MxAngleControlUpdate ( 01061 Widget control, 01062 double value 01063 ); 01064 01065 //! Set the angle. 01066 //! Note: Won't call the callbacks 01067 ERRVALUE MxAngleControlSetValue ( 01068 Widget control, 01069 double value 01070 ); 01071 01072 //! Get the current angle of an Angle Control 01073 double MxAngleControlGetValue ( 01074 Widget control, 01075 double value 01076 ); 01077 01078 //! Create "application shell". 01079 //! 01080 //! @return unrealized topLevelShell widget 01081 Widget MxAppShellCreate ( 01082 const char *posnkey, //!< Name of shell (used for window positioning) NULL ok 01083 Arg* arg, //!< Argument list 01084 int numargs //!< Number of arguments 01085 ); 01086 01087 //! Assign cursor to a window. 01088 //! 01089 //! @return 0 01090 void MxAssignCursor ( 01091 Display* display, 01092 Window window, 01093 int cursor 01094 ); 01095 01096 //! Creates a file manager for .atl files. 01097 //! 01098 //! @return 0 01099 int MxATLFileManager ( 01100 Widget parent, //!< Parent widget 01101 UNICODE *filename //!< atl filename 01102 ); 01103 01104 //! Help users assemble their TNTatlas for CD-ROM mastering. 01105 //! 01106 //! @return 0 01107 int MxAtlasAssemblyWizard ( 01108 Widget parent 01109 ); 01110 01111 01112 //! Deternime number of items in BUTTONITEM array including terminator. 01113 //! 01114 //! @return number of items 01115 int MxButtonGetNumItems ( 01116 const BUTTONITEM *items //!< BUTTONITEM array 01117 ); 01118 01119 //! Retry/Cancel dialog if lock change is not possible. 01120 //! 01121 //! This function will try to change the lock on the file using 01122 //! MfChangeFileLock(). If MfChangeFileLock() returns R_CantGetReadLock, 01123 //! R_CantGetWriteLock or R_FileReadOnly the Retry/Cancel dialog is 01124 //! presented and a message placed on it referring to the problem. The 01125 //! function will automaticalley try to relock the file at specific 01126 //! intervals until it succeeds or the retry interval has elapsed. For 01127 //! batch routines, the dialog appears anyway, but the retry interval 01128 //! is much longer. 01129 //! Flag values: 01130 //! \li\b RVCFILE_ReadLock Lock the file for reading 01131 //! \li\b RVCFILE_WriteLock Lock the file for writing 01132 //! \li\b RVCFILE_WriteLockAttempt Lock the file for write access if possible, otherwise lock for read 01133 //! \li\b RVCFILE_SharedLock Lock the file for shared access, not implemented yet 01134 int MxChangeFileLock ( 01135 Widget parent, 01136 int file, 01137 UINT32 flags 01138 ); 01139 01140 //! Checks to see if disk space is available. 01141 //! 01142 //! @return warning if not enough space, 0 if enough space, or space available 01143 DEPRECATED int MxCheckDiskSpace ( 01144 MDLGPARENT parent, 01145 const FILEPATH& filename, //!< File name 01146 INT64 SpaceNeeded //!< Space needed 01147 ); 01148 01149 // Erase specified widget, optionally generating exposure notification. 01150 void MxClearWidget ( 01151 Widget widget, 01152 bool sendexposure = true 01153 ); 01154 01155 //! Add callbacks to edit menu items after menu has been created. 01156 //! Same as old MxEditMenuAddCallbacks, but don't have to have the handle. 01157 //! If the text widget is in a dialog that already has an edit menu 01158 //! registered by calling MxEditMenuAddCallbacks(handle, NULL), it will 01159 //! setup callbacks for the text widget to make it handle the edit menu. 01160 //! If there is no edit menu in the dialog, it silently ignores you. 01161 void MxClipboardRegisterTextWidget ( 01162 Widget widget //!< An XeText widget 01163 ); 01164 01165 //! Create color selection form to insert into dialog. 01166 //! 01167 //! @return Form widget containing palette, Color... button and sample area 01168 //! Flags: 01169 //! \li\b MxCOLORSEL_EditTranspPct Allow transparency percentage to be set by user 01170 Widget MxColorSelCreate ( 01171 Widget parent, //!< Parent widget 01172 COLOR* color, //!< Color value to change when user makes a selection 01173 int size, //!< Size of palette boxes (0 for default of 8) 01174 UINT32 flags, //!< Flags 01175 Arg* arg, //!< Arguments for attachment, etc 01176 int numargs //!< Argument count 01177 ); 01178 01179 //! Set function to call when selected color is changes in "Color Selection" form. 01180 void MxColorSelSetChangeCallback ( 01181 Widget, //!< Widget returned by MxColorSelCreate 01182 void(*) ( //! Function to call when user selects new color 01183 COLOR*, //! New color value 01184 void* //! Value specified in MxColorSelSetChangeCallback 01185 ), 01186 void* //! Data to pass to changefunc 01187 ); 01188 01189 //! Set new color for "Color Selection" form. 01190 void MxColorSelSetColor ( 01191 Widget parent, //!< Widget returned by MxColorSelCreate 01192 COLOR* color, //!< New color value to set 01193 int CalllChangeFunc //!< Set if should call "changefunc" 01194 ); 01195 01196 //! Convert a value from one unit to another. 01197 //! 01198 //! @return converted value 01199 //! This function allows you to convert distances from various units to another. 01200 //! This differs from the normal unit conversion functions in that is can convert 01201 //! to and from screen pixels. It uses MxTopLevel() to get the display pixel 01202 //! size. Units can be any of the following: 01203 //! \li\b SCREENUNIT_Inches 01204 //! \li\b SCREENUNIT_mm 01205 //! \li\b SCREENUNIT_Points 01206 //! \li\b SCREENUNIT_Pixels 01207 //! \li\b SCREENUNIT_1OverInches 01208 //! \li\b SCREENUNIT_MetersAtCurrentScale 01209 double MxConvertScreenUnits ( 01210 double val, //!< Value to convert 01211 int InUnits,