home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mod201j.zip / modula2.exe / os2api / winbutto.def < prev    next >
Text File  |  1992-10-20  |  3KB  |  93 lines

  1. DEFINITION MODULE WINBUTTONS;
  2.  
  3. (************************************************************************
  4.   OS/2 2.0 interface for window button controls.
  5.  
  6.   Copyright (c) 1992 by Juergen Neuhoff
  7. *************************************************************************)
  8.  
  9. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  10. (*$A         default alignment for record fields                        *)
  11.  
  12. FROM   OS2DEF  IMPORT TYPEPREFIX, LHANDLE, HWND, HPS;
  13.  
  14. CONST (* Button control styles *)
  15.   BS_PUSHBUTTON       = 0;
  16.   BS_CHECKBOX         = 1;
  17.   BS_AUTOCHECKBOX     = 2;
  18.   BS_RADIOBUTTON      = 3;
  19.   BS_AUTORADIOBUTTON  = 4;
  20.   BS_3STATE           = 5;
  21.   BS_AUTO3STATE       = 6;
  22.   BS_USERBUTTON       = 7;
  23.   BS_PRIMARYSTYLES    = 0000000FH;
  24.   BS_BITMAP           = 00000040H;
  25.   BS_ICON             = 00000080H;
  26.   BS_HELP             = 00000100H;
  27.   BS_SYSCOMMAND       = 00000200H;
  28.   BS_DEFAULT          = 00000400H;
  29.   BS_NOPOINTERFOCUS   = 00000800H;
  30.   BS_NOBORDER         = 00001000H;
  31.   BS_NOCURSORSELECT   = 00002000H;
  32.   BS_AUTOSIZE         = 00004000H;
  33.  
  34. TYPE
  35.   (* Binary resources may be bound into application executables or *)
  36.   (* passed as a parameter when creating a window or dialog        *)
  37.   (* Currently they must be the same for both 16-bit and 32-bit    *)
  38.   (* so we pack the structures.                                    *)
  39.   (*                                                               *)
  40.   (*$A2 WORD alignment for record fields                           *)
  41.   BTNCDATA            = RECORD
  42.     CASE                : TYPEPREFIX OF
  43.     | TRUE              :
  44.       cb                : CARDINAL;
  45.       fsCheckState      : CARDINAL;
  46.       fsHiliteState     : CARDINAL;
  47.       hImage            : LHANDLE;
  48.     | FALSE             :
  49.       Count             : CARDINAL;
  50.       CheckState        : CARDINAL;
  51.       HiliteState       : CARDINAL;
  52.       ImageHandle       : LHANDLE;
  53.     END;                END;
  54.   PBTNCDATA           = POINTER TO BTNCDATA;
  55.   (*$A2 restore default alignment for record fields                *)
  56.  
  57. TYPE (* User button structure (passed in WM_CONTROL msg) *)
  58.   USERBUTTON          = RECORD
  59.     CASE                : TYPEPREFIX OF
  60.     | TRUE              :
  61.       hwnd              : HWND;
  62.       hps               : HPS;
  63.       fsState           : LONGCARD;
  64.       fsStateOld        : LONGCARD;
  65.     | FALSE             :
  66.       WinHandle         : HWND;
  67.       PresSpaceHandle   : HPS;
  68.       State             : LONGCARD;
  69.       StateOld          : LONGCARD;
  70.     END;                END;
  71.   PUSERBUTTON         = POINTER TO USERBUTTON;
  72.  
  73. CONST (* Button control messages *)
  74.   BM_CLICK            = 0120H;
  75.   BM_QUERYCHECKINDEX  = 0121H;
  76.   BM_QUERYHILITE      = 0122H;
  77.   BM_SETHILITE        = 0123H;
  78.   BM_QUERYCHECK       = 0124H;
  79.   BM_SETCHECK         = 0125H;
  80.   BM_SETDEFAULT       = 0126H;
  81.  
  82. CONST (* Button notification codes *)
  83.   BN_CLICKED          = 1;
  84.   BN_DBLCLICKED       = 2;
  85.   BN_PAINT            = 3;
  86.  
  87. CONST (* BN_PAINT button draw state codes (must be in high byte) *)
  88.   BDS_HILITED         = 0100H;
  89.   BDS_DISABLED        = 0200H;
  90.   BDS_DEFAULT         = 0400H;
  91.  
  92. END WINBUTTONS.
  93.