home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos13.zip / pmstddlg.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-24  |  22KB  |  386 lines

  1. {| Unit: pmstddlg
  2.  | Version: 1.00
  3.  | translated from file pmstddlg.H
  4.  | Original translation: Peter Singer (PSi)
  5.  | Contributing:
  6.  |   (fill in)
  7.  |
  8.  | change history:
  9.  | Date:    Ver: Author:
  10.  | 11/21/93 1.00 PSi     original translation by PSi
  11. }
  12. Unit pmstddlg;
  13. Interface
  14. Uses
  15.   PmGpi, PmWIN, Os2Def;
  16. {**************************************************************************}
  17. {                                                                          }
  18. {                             IBM/Microsoft                                }
  19. {                                                                          }
  20. {                 Copyright (c) IBM Corporation  1987-1991                 }
  21. {                 Copyright (c) Microsoft Corp.  1987-1991                 }
  22. {                           All Rights Reserved                            }
  23. {                                                                          }
  24. {**************************************************************************}
  25. {********************************************************************}
  26. {                                                                    }
  27. { Module Name: PMSTDDLG.H                                            }
  28. {                                                                    }
  29. { OS/2 Presentation Manager Standard Dialog Declarations             }
  30. {                                                                    }
  31. { ===================================================================}
  32. { The following symbols are used in this file for conditional        }
  33. { sections:                                                          }
  34. {                                                                    }
  35. { INCL_WINSTDSPIN               - spin button control class          }
  36. { INCL_WINSTDDRAG               - standard drag dll                  }
  37. {                                                                    }
  38. {********************************************************************}
  39.  
  40. {********************************************************************}
  41. {                                                                    }
  42. {                          S P I N    B U T T O N                    }
  43. {                                                                    }
  44. {********************************************************************}
  45.  
  46. {********************************************************************}
  47. { SPINBUTTON Creation Flags                                          }
  48. {********************************************************************}
  49.  
  50. {********************************************************************}
  51. { Character Acceptance                                               }
  52. {********************************************************************}
  53.  
  54. CONST
  55.   SPBS_ALLCHARACTERS      =  $00000000 ;           { Default: All chars accepted }
  56.   SPBS_NUMERICONLY        =  $00000040 ;           { Only 0 - 9 accepted & VKeys }
  57.   SPBS_READONLY           =  $00000020 ;           { No chars allowed in entryfld}
  58.  
  59. {********************************************************************}
  60. { Type of Component                                                  }
  61. {********************************************************************}
  62.   SPBS_MASTER             =  $00000010 ;
  63.   SPBS_SERVANT            =  $00000000 ;           { Default: Servant }
  64.  
  65. {********************************************************************}
  66. { Type of Justification                                              }
  67. {********************************************************************}
  68.   SPBS_JUSTDEFAULT        =  $00000000 ;           { Default: Same as Left }
  69.   SPBS_JUSTLEFT           =  $00000000 ;
  70.   SPBS_JUSTRIGHT          =  $00000002 ;
  71.   SPBS_JUSTCENTER         =  $00000001 ;
  72.  
  73. {********************************************************************}
  74. { Border or not                                                      }
  75. {********************************************************************}
  76.   SPBS_NOBORDER           =  $00000200 ;           { Borderless SpinField         }
  77.                                       { Default is to have a border. }
  78.  
  79. {********************************************************************}
  80. { Fast spin or not                                                   }
  81. {********************************************************************}
  82.   SPBS_FASTSPIN           =  $00000100;  { Allow fast spinning.  Fast   }
  83.                                          { spinning is performed by     }
  84.                                          { skipping over numbers        }
  85.  
  86. {********************************************************************}
  87. { Pad numbers on front with 0's                                      }
  88. {********************************************************************}
  89.   SPBS_PADWITHZEROS        =  $00000080 ; { Pad the number with zeroes   }
  90.  
  91. {********************************************************************}
  92. { SPINBUTTON Messages                                                }
  93. {********************************************************************}
  94.  
  95. {********************************************************************}
  96. { Notification from Spinbutton to the application is sent in a       }
  97. { WM_CONTROL message.                                                }
  98. {********************************************************************}
  99.   SPBN_UPARROW               =  $20A;  { up arrow button was pressed  }
  100.   SPBN_DOWNARROW             =  $20B;  { down arrow button was pressed}
  101.   SPBN_ENDSPIN               =  $20C;  { mouse button was released    }
  102.   SPBN_CHANGE                =  $20D;  { spinfield text has changed   }
  103.   SPBN_SETFOCUS              =  $20E;  { spinfield received focus     }
  104.   SPBN_KILLFOCUS             =  $20F;  { spinfield lost focus         }
  105.  
  106. {********************************************************************}
  107. { Messages from application to Spinbutton                            }
  108. {********************************************************************}
  109.   SPBM_OVERRIDESETLIMITS     =  $200;  { Set spinbutton limits without}
  110.                                        {  resetting the current value }
  111.   SPBM_QUERYLIMITS           =  $201;  { Query limits set by          }
  112.                                        {  SPBM_SETLIMITS              }
  113.   SPBM_SETTEXTLIMIT          =  $202;  { Max entryfield characters    }
  114.   SPBM_SPINUP                =  $203;  { Tell entry field to spin up  }
  115.   SPBM_SPINDOWN              =  $204;  { Tell entry field to spin down}
  116.   SPBM_QUERYVALUE            =  $205;  { Tell entry field to send     }
  117.                                        {  current value               }
  118.  
  119. {********************************************************************}
  120. { Query Flags                                                        }
  121. {********************************************************************}
  122.   SPBQ_UPDATEIFVALID               = 0;                     { Default                      }
  123.   SPBQ_ALWAYSUPDATE                = 1;
  124.   SPBQ_DONOTUPDATE                 = 3;
  125.  
  126. {********************************************************************}
  127. { Return value for Empty Field.                                      }
  128. {    If ptr too long, variable sent in query msg                     }
  129. {********************************************************************}
  130.   SPBM_SETARRAY                    =  $206;                 { Change the data to spin      }
  131.   SPBM_SETLIMITS                   =  $207;                 { Change the numeric Limits    }
  132.   SPBM_SETCURRENTVALUE             =  $208;                 { Change the current value     }
  133.   SPBM_SETMASTER                   =  $209;                 { Tell entryfield who master is}
  134.  
  135. {********************************************************************}
  136. { SPINBUTTON Window Class Definition                                 }
  137. {********************************************************************}
  138.  
  139.  
  140. {********************************************************************}
  141. {                                                                    }
  142. {                D I R E C T   M A N I P U L A T I O N               }
  143. {                                                                    }
  144. {********************************************************************}
  145.  
  146.   PMERR_NOT_DRAGGING               =  $1f00;     { move to pmerr.h           }
  147.   PMERR_ALREADY_DRAGGING           =  $1f01;
  148.  
  149.   MSGF_DRAG                        =  $0010;     { message filter identifier }
  150.  
  151.   WM_DRAGFIRST                     =  $0310;
  152.   WM_DRAGLAST                      = (WM_DRAGFIRST + $001f);
  153.  
  154.   DM_DROP                          = (WM_DRAGLAST - $0);
  155.   DM_DRAGOVER                      = (WM_DRAGLAST - $1);
  156.   DM_DRAGLEAVE                     = (WM_DRAGLAST - $2);
  157.   DM_DROPHELP                      = (WM_DRAGLAST - $3);
  158.   DM_ENDCONVERSATION               = (WM_DRAGLAST - $4);
  159.   DM_PRINT                         = (WM_DRAGLAST - $5);
  160.   DM_RENDER                        = (WM_DRAGLAST - $6);
  161.   DM_RENDERCOMPLETE                = (WM_DRAGLAST - $7);
  162.   DM_RENDERPREPARE                 = (WM_DRAGLAST - $8);
  163.   DM_DRAGFILECOMPLETE              = (WM_DRAGLAST - $9);
  164.   DM_EMPHASIZETARGET               = (WM_DRAGLAST - $A);
  165.   DM_DRAGERROR                     = (WM_DRAGLAST - $B);
  166.   DM_FILERENDERED                  = (WM_DRAGLAST - $C);
  167.   DM_RENDERFILE                    = (WM_DRAGLAST - $D);
  168.  
  169.  
  170.   DRT_ASM                         = 'Assembler Code';   { drag type constants  }
  171.   DRT_BASIC                       = 'BASIC Code';
  172.   DRT_BINDATA                     = 'Binary Data';
  173.   DRT_BITMAP                      = 'Bitmap';
  174.   DRT_C                           = 'C Code';
  175.   DRT_COBOL                       = 'COBOL Code';
  176.   DRT_DLL                         = 'Dynamic Link Library';
  177.   DRT_DOSCMD                      = 'DOS Command File';
  178.   DRT_EXE                         = 'Executable';
  179.   DRT_FORTRAN                     = 'FORTRAN Code';
  180.   DRT_ICON                        = 'Icon';
  181.   DRT_LIB                         = 'Library';
  182.   DRT_METAFILE                    = 'Metafile';
  183.   DRT_OS2CMD                      = 'OS/2 Command File';
  184.   DRT_PASCAL                      = 'Pascal Code';
  185.   DRT_RESOURCE                    = 'Resource File';
  186.   DRT_TEXT                        = 'Plain Text';
  187.   DRT_UNKNOWN                     = 'Unknown';
  188.  
  189.   DOR_NODROP                       =  $0000;     { DM_DRAGOVER response codes }
  190.   DOR_DROP                         =  $0001;
  191.   DOR_NODROPOP                     =  $0002;
  192.   DOR_NEVERDROP                    =  $0003;
  193.  
  194.   DO_COPYABLE                      =  $0001;     { supported operation flags  }
  195.   DO_MOVEABLE                      =  $0002;
  196.  
  197.   DC_OPEN                          =  $0001;     { source control flags       }
  198.   DC_REF                           =  $0002;
  199.   DC_GROUP                         =  $0004;
  200.   DC_CONTAINER                     =  $0008;
  201.   DC_PREPARE                       =  $0010;
  202.   DC_REMOVEABLEMEDIA               =  $0020;
  203.  
  204.   DO_DEFAULT                       =  $BFFE;     { Default operation          }
  205.   DO_UNKNOWN                       =  $BFFF;     { Unknown operation          }
  206.   DO_COPY                          =  KC_CTRL;
  207.   DO_MOVE                          =  KC_ALT;
  208.  
  209.   DMFL_TARGETSUCCESSFUL            =  $0001;                { transfer reply flags       }
  210.   DMFL_TARGETFAIL                  =  $0002;
  211.   DMFL_NATIVERENDER                =  $0004;
  212.   DMFL_RENDERRETRY                 =  $0008;
  213.   DMFL_RENDEROK                    =  $0010;
  214.   DMFL_RENDERFAIL                  =  $0020;
  215.  
  216.   DRG_ICON                         =  $00000001 ;           { drag image manipulation    }
  217.   DRG_BITMAP                       =  $00000002 ;           {   flags                    }
  218.   DRG_POLYGON                      =  $00000004 ;
  219.   DRG_STRETCH                      =  $00000008 ;
  220.   DRG_TRANSPARENT                  =  $00000010 ;
  221.   DRG_CLOSED                       =  $00000020 ;
  222.  
  223.   DME_IGNOREABORT                  = 1;                     { DM_DRAGERROR return values }
  224.   DME_IGNORECONTINUE               = 2;
  225.   DME_REPLACE                      = 3;
  226.   DME_RETRY                        = 4;
  227.  
  228.   DF_MOVE                          =  $0001;                { DM_DRAGFILECOMPLETE flags  }
  229.   DF_SOURCE                        =  $0002;
  230.   DF_SUCCESSFUL                    =  $0004;
  231.  
  232.   DFF_MOVE                         = 1;                     { DM_DRAGERROR operation IDs }
  233.   DFF_COPY                         = 2;
  234.   DFF_DELETE                       = 3;
  235.  
  236.  
  237. TYPE
  238.   HSTR = LHANDLE;  { hstr }
  239.  
  240.  
  241.   DRAGITEM = Record                     { ditem }
  242.     hwndItem: HWND;                     { conversation partner }
  243.     ulItemID: ULONG;                    { identifies item being dragged }
  244.     hstrType,                           { type of item }
  245.     hstrRMF,                            { rendering mechanism and format }
  246.     hstrContainerName,                  { name of source container }
  247.     hstrSourceName,                     { name of item at source }
  248.     hstrTargetName: HSTR;               { suggested name of item at dest }
  249.     cxOffset,                           { x offset of the origin of the }
  250.                                         {   image from the mouse hotspot }
  251.     cyOffset: SHORT;                    { y offset of the origin of the }
  252.                                         {   image from the mouse hotspot }
  253.     fsControl,                          { source item control flags }
  254.     fsSupportedOps: USHORT              { ops supported by source }
  255.   End;
  256.   PDRAGITEM = ^DRAGITEM;
  257.  
  258.   DRAGINFO = Record                     { dinfo }
  259.     cbDraginfo: ULONG;                  { Size of DRAGINFO and DRAGITEMs }
  260.     cbDragitem,                         { size of DRAGITEM }
  261.     usOperation: USHORT;                { current drag operation }
  262.     hwndSource: HWND;                   { window handle of source }
  263.     xDrop,                              { x coordinate of drop position }
  264.     yDrop: SHORT;                       { y coordinate of drop position }
  265.     cditem,                             { count of DRAGITEMs }
  266.     usReserved: USHORT                  { reserved for future use }
  267.   End;
  268.   PDRAGINFO = ^DRAGINFO;
  269.  
  270.   DRAGIMAGE = Record                    { dimg }
  271.     cb,                                 { size control block }
  272.     cptl: USHORT;                       { count of pts, if DRG_POLYGON }
  273.     hImage: LHANDLE;                    { image handle passed to DrgDrag }
  274.     sizlStretch: SIZEL;                 { size to strecth ico or bmp to }
  275.     fl: ULONG;                          { flags passed to DrgDrag }
  276.     cxOffset,                           { x offset of the origin of the }
  277.                                         {   image from the mouse hotspot }
  278.     cyOffset: SHORT                     { y offset of the origin of the }
  279.                                         {   image from the mouse hotspot }
  280.   End;
  281.   PDRAGIMAGE = ^DRAGIMAGE;
  282.  
  283.   DRAGTRANSFER = Record                 { dxfer }
  284.     cb: ULONG;                          { size of control block }
  285.     hwndClient: HWND;                   { handle of target }
  286.     pditem: PDRAGITEM;                  { DRAGITEM being transferred }
  287.     hstrSelectedRMF,                    { rendering mech & fmt of choice }
  288.     hstrRenderToName: HSTR;             { name source will use }
  289.     ulTargetInfo: ULONG;                { reserved for target's use }
  290.     usOperation,                        { operation being performed }
  291.     fsReply: USHORT                     { reply flags }
  292.   End;
  293.   PDRAGTRANSFER = ^DRAGTRANSFER;
  294.  
  295.   RENDERFILE = Record                   { rndf }
  296.     hwndDragFiles: HWND;                { conversation window }
  297.     hstrSource,                         { handle to source file name }
  298.     hstrTarget: HSTR;                   { handle to target file name }
  299.     fMove: BOOL;                        { TRUE - move, FALSE - copy }
  300.     usRsvd: USHORT                      { reserved }
  301.   End;
  302.   PRENDERFILE = ^RENDERFILE;
  303.   PPSZ  = ^PSZ;
  304.  
  305.   Function DrgAcceptDroppedFiles (hwnd: HWND; pszPath, pszTypes: PSZ; usDefaultOp, usRsvd: USHORT): BOOL;
  306.  
  307.   Function DrgAccessDraginfo (pdinfo: PDRAGINFO): BOOL;
  308.   Function DrgAddStrHandle (psz: PSZ): HSTR;
  309.  
  310.   Function DrgAllocDraginfo (cditem: USHORT): PDRAGINFO;
  311.   Function DrgAllocDragtransfer (cdxfer: USHORT): PDRAGTRANSFER;
  312.   Function DrgDeleteDraginfoStrHandles (pdinfo: PDRAGINFO): BOOL;
  313.   Function DrgDeleteStrHandle (hstr: HSTR): BOOL;
  314.   Function DrgDrag (hwndSource: HWND; pdinfo: PDRAGINFO; pdimg: PDRAGIMAGE;
  315.                     cdimg: USHORT; vkTerminate: SHORT; pRsvd: PVOID): HWND;
  316.   Function DrgDragFiles (hwnd: HWND; apszFiles: PPSZ; apszTypes: PPSZ;
  317.                          apszTargets: PPSZ; cFiles: USHORT;
  318.                          hptrDrag: HPOINTER; vkTerm: USHORT;
  319.                          fSourceRender: BOOL; ulRsvd: ULONG): BOOL;
  320.   Function DrgFreeDraginfo (pdinfo: PDRAGINFO): BOOL;
  321.   Function DrgFreeDragtransfer (pdxfer: PDRAGTRANSFER): BOOL;
  322.   Function DrgGetPS (hwnd: HWND): HPS;
  323.   Function DrgPostTransferMsg (hwnd: HWND; msg: USHORT; pdxfer: PDRAGTRANSFER;
  324.                                fs, usRsvd: USHORT; fRetry: BOOL): BOOL;
  325.   Function DrgPushDraginfo (pdinfo: PDRAGINFO; hwndDest: HWND): BOOL;
  326.   Function DrgQueryDragitem (pdinfo: PDRAGINFO; cbBuffer: USHORT;
  327.                              pditem: PDRAGITEM; iItem: USHORT): BOOL;
  328.   Function DrgQueryDragitemCount (pdinfo: PDRAGINFO): USHORT;
  329.   Function DrgQueryDragitemPtr (pdinfo: PDRAGINFO; i: USHORT): PDRAGITEM;
  330.   Function DrgQueryNativeRMF (pditem: PDRAGITEM; cbBuffer: USHORT;
  331.                               pBuffer: PCHAR): BOOL;
  332.   Function DrgQueryNativeRMFLen (pditem: PDRAGITEM): USHORT;
  333.   Function DrgQueryStrName (hstr: HSTR; cbBuffer: USHORT; pBuffer: PSZ): USHORT;
  334.   Function DrgQueryStrNameLen (hstr: HSTR): USHORT;
  335.   Function DrgQueryTrueType (pditem:PDRAGITEM; cbBuffer: USHORT; pBuffer: PSZ): BOOL;
  336.   Function DrgQueryTrueTypeLen (pditem: PDRAGITEM): USHORT;
  337.   Function DrgReleasePS (hps: HPS): BOOL;
  338.   Function DrgSendTransferMsg (hwnd: HWND; msg: USHORT; mp1, mp2: MPARAM): MRESULT;
  339.   Function DrgSetDragitem (pdinfo: PDRAGINFO; pditem:  PDRAGITEM;
  340.                           cbBuffer, iItem: USHORT): BOOL;
  341.   Function DrgSetDragPointer (pdinfo: PDRAGINFO; hptr: HPOINTER): BOOL;
  342.   Function DrgSetDragImage (pdinfo: PDRAGINFO; pdimg: PDRAGIMAGE;
  343.                             cdimg: USHORT; pRsvd: PVOID): BOOL;
  344.   Function DrgVerifyNativeRMF (pditem: PDRAGITEM; pszRMF: PSZ): BOOL;
  345.   Function DrgVerifyRMF (pditem: PDRAGITEM; pszMech, pszFmt: PSZ): BOOL;
  346.   Function DrgVerifyTrueType (pditem: PDRAGITEM; pszType: PSZ): BOOL;
  347.   Function DrgVerifyType (pditem: PDRAGITEM; pszType: PSZ): BOOL;
  348.   Function DrgVerifyTypeSet (pditem: PDRAGITEM; pszType: PSZ; cbMatch: USHORT;
  349.                              pszMatch: PSZ): BOOL;
  350.  
  351. Implementation
  352.   Function DrgAcceptDroppedFiles;         External 'PMDRAG'   Index   64;
  353.   Function DrgAccessDraginfo;             External 'PMDRAG'   Index    1;
  354.   Function DrgAddStrHandle;               External 'PMDRAG'   Index    2;
  355.   Function DrgAllocDraginfo;              External 'PMDRAG'   Index    3;
  356.   Function DrgAllocDragtransfer;          External 'PMDRAG'   Index    4;
  357.   Function DrgDeleteDraginfoStrHandles;   External 'PMDRAG'   Index    5;
  358.   Function DrgDeleteStrHandle;            External 'PMDRAG'   Index    6;
  359.   Function DrgDrag;                       External 'PMDRAG'   Index    7;
  360.   Function DrgDragFiles;                  External 'PMDRAG'   Index   63;
  361.   Function DrgFreeDraginfo;               External 'PMDRAG'   Index    8;
  362.   Function DrgFreeDragtransfer;           External 'PMDRAG'   Index    9;
  363.   Function DrgGetPS;                      External 'PMDRAG'   Index   10;
  364.   Function DrgPostTransferMsg;            External 'PMDRAG'   Index   11;
  365.   Function DrgPushDraginfo;               External 'PMDRAG'   Index   12;
  366.   Function DrgQueryDragitem;              External 'PMDRAG'   Index   13;
  367.   Function DrgQueryDragitemCount;         External 'PMDRAG'   Index   14;
  368.   Function DrgQueryDragitemPtr;           External 'PMDRAG'   Index   15;
  369.   Function DrgQueryNativeRMF;             External 'PMDRAG'   Index   16;
  370.   Function DrgQueryNativeRMFLen;          External 'PMDRAG'   Index   17;
  371.   Function DrgQueryStrName;               External 'PMDRAG'   Index   18;
  372.   Function DrgQueryStrNameLen;            External 'PMDRAG'   Index   19;
  373.   Function DrgQueryTrueType;              External 'PMDRAG'   Index   20;
  374.   Function DrgQueryTrueTypeLen;           External 'PMDRAG'   Index   21;
  375.   Function DrgReleasePS;                  External 'PMDRAG'   Index   22;
  376.   Function DrgSendTransferMsg;            External 'PMDRAG'   Index   23;
  377.   Function DrgSetDragPointer;             External 'PMDRAG'   Index   24;
  378.   Function DrgSetDragImage;               External 'PMDRAG'   Index   25;
  379.   Function DrgSetDragitem;                External 'PMDRAG'   Index   26;
  380.   Function DrgVerifyNativeRMF;            External 'PMDRAG'   Index   27;
  381.   Function DrgVerifyRMF;                  External 'PMDRAG'   Index   28;
  382.   Function DrgVerifyTrueType;             External 'PMDRAG'   Index   29;
  383.   Function DrgVerifyType;                 External 'PMDRAG'   Index   30;
  384.   Function DrgVerifyTypeSet;              External 'PMDRAG'   Index   31;
  385. End.
  386.