home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mod201j.zip / modula2.exe / os2api / winstdva.def < prev    next >
Text File  |  1994-05-03  |  9KB  |  168 lines

  1. DEFINITION MODULE WINSTDVALSET;
  2.  
  3. (************************************************************************
  4.   OS/2 2.0 interface for Presentation Manager
  5.            CUA value set control class.
  6.  
  7.   Copyright (c) 1992 by Juergen Neuhoff
  8. *************************************************************************)
  9.  
  10. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  11. (*$CDECL+    C-style procedures                                         *)
  12. (*$A         default alignment for record fields                        *)
  13.  
  14. FROM OS2DEF        IMPORT TYPEPREFIX, HWND, PSZ;
  15. FROM WINSTDDRAG    IMPORT PDRAGINFO;
  16.  
  17. (*************************************************************************)
  18. (*    Define messages for the value set control                          *)
  19. (*************************************************************************)
  20. CONST
  21.   VM_QUERYITEM         = 0375H;    (* Query item at location    *)
  22.   VM_QUERYITEMATTR     = 0376H;    (* Query item attributes     *)
  23.   VM_QUERYMETRICS      = 0377H;    (* Query metrics of control  *)
  24.   VM_QUERYSELECTEDITEM = 0378H;    (* Query selected item       *)
  25.   VM_SELECTITEM        = 0379H;    (* Set selected item         *)
  26.   VM_SETITEM           = 037AH;    (* Set item at location      *)
  27.   VM_SETITEMATTR       = 037BH;    (* Set item attributes       *)
  28.   VM_SETMETRICS        = 037CH;    (* Set metrics of control    *)
  29.   VN_SELECT            = 120;      (* Item selected by user     *)
  30.   VN_ENTER             = 121;      (* Item entered by user      *)
  31.   VN_DRAGLEAVE         = 122;      (* Drag left control         *)
  32.   VN_DRAGOVER          = 123;      (* Drag is over item         *)
  33.   VN_DROP              = 124;      (* Drop occurred on item     *)
  34.   VN_DROPHELP          = 125;      (* Request help for drop     *)
  35.   VN_INITDRAG          = 126;      (* Drag initiated on item    *)
  36.   VN_SETFOCUS          = 127;      (* Value set gaining focus   *)
  37.   VN_KILLFOCUS         = 128;      (* Value set losing focus    *)
  38.   VN_HELP              = 129;      (* Help requested by user    *)
  39.  
  40. (*************************************************************************)
  41. (*    Value set control data structure                                   *)
  42. (*************************************************************************)
  43. TYPE
  44.   VSCDATA              = RECORD      (* vscd *)
  45.     CASE                 : TYPEPREFIX OF
  46.     | TRUE               :
  47.       cbSize             : LONGCARD; (* Size of control block             *)
  48.       usRowCount         : CARDINAL; (* Number of rows in value set       *)
  49.       usColumnCount      : CARDINAL; (* Number of columns in value set    *)
  50.     | FALSE              :
  51.       Size               : LONGCARD; (* Size of control block             *)
  52.       RowCount           : CARDINAL; (* Number of rows in value set       *)
  53.       ColumnCount        : CARDINAL; (* Number of columns in value set    *)
  54.     END;                 END;
  55.   PVSCDATA             = POINTER TO VSCDATA;
  56.  
  57. (**************+**********************************************************)
  58. (*    Value set drag initialization structure                            *)
  59. (*************************************************************************)
  60. TYPE
  61.   VSDRAGINIT           = RECORD      (* vsdinit *)
  62.     CASE                 : TYPEPREFIX OF
  63.     | TRUE               :
  64.       hwnd               : HWND;     (* Window handle of value set control*)
  65.     | FALSE              :
  66.       WinHandle          : HWND;     (* Window handle of value set control*)
  67.     END;
  68.     x                    : LONGINT;  (* X coordinate of pointer on desktop*)
  69.     y                    : LONGINT;  (* Y coordinate of pointer on desktop*)
  70.     CASE                 : TYPEPREFIX OF
  71.     | TRUE               :
  72.       cx                 : LONGINT;  (* X offset from pointer hot spot    *)
  73.       cy                 : LONGINT;  (* Y offset from pointer hot spot    *)
  74.       usRow              : CARDINAL; (* Number of rows in value set       *)
  75.       usColumn           : CARDINAL; (* Number of columns in value set    *)
  76.     | FALSE              :
  77.       xOffset            : LONGINT;  (* X offset from pointer hot spot    *)
  78.       yOffset            : LONGINT;  (* Y offset from pointer hot spot    *)
  79.       RowCount           : CARDINAL; (* Number of rows in value set       *)
  80.       ColumnCount        : CARDINAL; (* Number of columns in value set    *)
  81.     END;                 END;
  82.   PVSDRAGINIT          = POINTER TO VSDRAGINIT;
  83.  
  84. (*************************************************************************)
  85. (*       Value set drag information structure                            *)
  86. (*************************************************************************)
  87. TYPE
  88.   VSDRAGINFO           = RECORD       (* vsdinfo *)
  89.     CASE                 : TYPEPREFIX OF
  90.     | TRUE               :
  91.       pDragInfo          : PDRAGINFO; (* Pointer to a drag info structure *)
  92.       usRow              : CARDINAL;  (* Number of rows in value set      *)
  93.       usColumn           : CARDINAL;  (* Number of columns in value set   *)
  94.     | FALSE              :
  95.       DragInfo           : PDRAGINFO; (* Pointer to a drag info structure *)
  96.       RowCount           : CARDINAL;  (* Number of rows in value set      *)
  97.       ColumnCount        : CARDINAL;  (* Number of columns in value set   *)
  98.     END;                 END;
  99.   PVSDRAGINFO          = POINTER TO VSDRAGINFO;
  100.  
  101. (*************************************************************************)
  102. (*    Value set query item text structure                                *)
  103. (*************************************************************************)
  104. TYPE
  105.   VSTEXT               = RECORD      (* vstext *)
  106.     CASE                 : TYPEPREFIX OF
  107.     | TRUE               :
  108.       pszItemText        : PSZ;      (* Pointer to string for item text  *)
  109.       ulBufLen           : LONGCARD; (* Buffer len to copy string into   *)
  110.     | FALSE              :
  111.       ItemText           : PSZ;      (* Pointer to string for item text  *)
  112.       BufLen             : LONGCARD; (* Buffer len to copy string into   *)
  113.     END;                 END;
  114.   PVSTEXT              = POINTER TO VSTEXT;
  115.  
  116. (*************************************************************************)
  117. (*    Value set control style flag definition                            *)
  118. (*************************************************************************)
  119. CONST
  120.   VS_BITMAP            = 0001H;   (* Default all items to bitmaps      *)
  121.   VS_ICON              = 0002H;   (* Default all items to icons        *)
  122.   VS_TEXT              = 0004H;   (* Default all items to text strings *)
  123.   VS_RGB               = 0008H;   (* Default all items to color info   *)
  124.   VS_COLORINDEX        = 0010H;   (* Default all items to color indices*)
  125.   VS_BORDER            = 0020H;   (* Add a border around the control   *)
  126.   VS_ITEMBORDER        = 0040H;   (* Add a border around each item     *)
  127.   VS_SCALEBITMAPS      = 0080H;   (* Scale bitmaps to cell size        *)
  128.   VS_RIGHTTOLEFT       = 0100H;   (* Support right to left ordering    *)
  129.   VS_OWNERDRAW         = 0200H;   (* Owner draws value set background  *)
  130.  
  131. (*************************************************************************)
  132. (*    Value set item attribute definition                                *)
  133. (*************************************************************************)
  134. CONST
  135.   VIA_BITMAP           = 0001H;  (* If set, item contains a bitmap    *)
  136.   VIA_ICON             = 0002H;  (* If set, item contains an icon     *)
  137.   VIA_TEXT             = 0004H;  (* If set, item contains text string *)
  138.   VIA_RGB              = 0008H;  (* If set, item contains color value *)
  139.   VIA_COLORINDEX       = 0010H;  (* If set, item contains color index *)
  140.   VIA_OWNERDRAW        = 0020H;  (* If set, item is ownerdraw         *)
  141.   VIA_DISABLED         = 0040H;  (* If set, item is unselectable      *)
  142.   VIA_DRAGGABLE        = 0080H;  (* If set, item can be source of drag*)
  143.   VIA_DROPONABLE       = 0100H;  (* If set, item can be target of drop*)
  144.  
  145. (*************************************************************************)
  146. (*    Message parameter attributes for sizing and spacing of items       *)
  147. (*************************************************************************)
  148. CONST
  149.   VMA_ITEMSIZE         = 0001H;
  150.   VMA_ITEMSPACING      = 0002H;
  151.  
  152. (*************************************************************************)
  153. (*    Ownerdraw flag definitions                                         *)
  154. (*************************************************************************)
  155. CONST
  156.   VDA_ITEM             = 0001H;
  157.   VDA_ITEMBACKGROUND   = 0002H;
  158.   VDA_SURROUNDING      = 0003H;
  159.   VDA_BACKGROUND       = 0004H;
  160.  
  161. (*************************************************************************)
  162. (*    Error return codes                                                 *)
  163. (*************************************************************************)
  164. CONST
  165.   VSERR_INVALID_PARAMETERS  = -1;
  166.  
  167. END WINSTDVALSET.
  168.