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

  1. DEFINITION MODULE WINLISTBOXES;
  2.  
  3. (************************************************************************
  4.   OS/2 2.0 interface for Presentation Manager List box controls.
  5.  
  6.   Copyright (c) 1992 by Juergen Neuhoff
  7. *************************************************************************)
  8.  
  9. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  10. (*$CDECL+    C-style procedures                                         *)
  11. (*$A         default alignment for record fields                        *)
  12.  
  13. FROM   OS2DEF        IMPORT HWND;
  14.  
  15. CONST (* List box styles *)
  16.   LS_MULTIPLESEL          = 00000001H;
  17.   LS_OWNERDRAW            = 00000002H;
  18.   LS_NOADJUSTPOS          = 00000004H;
  19.   LS_HORZSCROLL           = 00000008H;
  20.   LS_EXTENDEDSEL          = 00000010H;
  21.  
  22. CONST (* List box notification messages *)
  23.   LN_SELECT               = 1;
  24.   LN_SETFOCUS             = 2;
  25.   LN_KILLFOCUS            = 3;
  26.   LN_SCROLL               = 4;
  27.   LN_ENTER                = 5;
  28.  
  29. CONST (* List box messages *)
  30.   LM_QUERYITEMCOUNT       = 0160H;
  31.   LM_INSERTITEM           = 0161H;
  32.   LM_SETTOPINDEX          = 0162H;
  33.   LM_DELETEITEM           = 0163H;
  34.   LM_SELECTITEM           = 0164H;
  35.   LM_QUERYSELECTION       = 0165H;
  36.   LM_SETITEMTEXT          = 0166H;
  37.   LM_QUERYITEMTEXTLENGTH  = 0167H;
  38.   LM_QUERYITEMTEXT        = 0168H;
  39.   LM_SETITEMHANDLE        = 0169H;
  40.   LM_QUERYITEMHANDLE      = 016AH;
  41.   LM_SEARCHSTRING         = 016BH;
  42.   LM_SETITEMHEIGHT        = 016CH;
  43.   LM_QUERYTOPINDEX        = 016DH;
  44.   LM_DELETEALL            = 016EH;
  45.  
  46. CONST (* List box constants *)
  47.   LIT_CURSOR              = -4;
  48.   LIT_ERROR               = -3;
  49.   LIT_MEMERROR            = -2;
  50.   LIT_NONE                = -1;
  51.   LIT_FIRST               = -1;
  52.  
  53. CONST (* for LM_INSERTITEM msg *)
  54.   LIT_END                 = -1;
  55.   LIT_SORTASCENDING       = -2;
  56.   LIT_SORTDESCENDING      = -3;
  57.  
  58. CONST (* for LM_SEARCHSTRING msg *)
  59.   LSS_SUBSTRING           = 0001H;
  60.   LSS_PREFIX              = 0002H;
  61.   LSS_CASESENSITIVE       = 0004H;
  62.  
  63.  
  64. (***************************************************************************
  65. *    WinDeleteLboxItem() deletes an item index from the listbox,
  66. *    returning the number of items left.
  67. ***************************************************************************)
  68. PROCEDURE WinDeleteLboxItem
  69. ( ListBoxWinHandle       : HWND;
  70.   Index                  : LONGINT
  71. )                        : LONGINT;
  72.  
  73. (***************************************************************************
  74. *    WinInsertLboxItem() inserts psz into a listbox at index.
  75. *    Index may be an LIT_ constant.
  76. *    Returns the actual index where it was inserted.
  77. ***************************************************************************)
  78. PROCEDURE WinInsertLboxItem
  79. ( ListBoxWinHandle       : HWND;
  80.   Index                  : LONGINT;
  81.   Text                   : ARRAY OF CHAR
  82. )                        : LONGINT;
  83.  
  84. (***************************************************************************
  85. *    WinQueryLboxCount() returns the number of items in the listbox.
  86. ***************************************************************************)
  87. PROCEDURE WinQueryLboxCount
  88. ( ListBoxWinHandle       : HWND
  89. )                        : LONGINT;
  90.  
  91. (***************************************************************************
  92. *    WinQueryLboxItemText() fills 'Text' with the text if item index and
  93. *    returns the text length copied.
  94. ***************************************************************************)
  95. PROCEDURE WinQueryLboxItemText
  96. ( ListBoxWinHandle       : HWND;
  97.   Index                  : LONGINT;
  98.   VAR Text               : ARRAY OF CHAR;
  99.   TextMax                : LONGINT
  100. )                        : LONGINT;
  101.  
  102. (***************************************************************************
  103. *    WinQueryLboxItemTextLength() returns the length of item index.
  104. ***************************************************************************)
  105. PROCEDURE WinQueryLboxItemTextLength
  106. ( ListBoxWinHandle       : HWND;
  107.   Index                  : LONGINT
  108. )                        : INTEGER;
  109.  
  110. (***************************************************************************
  111. *    WinSetLboxItemText() sets the text of item index to psz.
  112. *    returns fSuccess.
  113. ***************************************************************************)
  114. PROCEDURE WinSetLboxItemText
  115. ( ListBoxWinHandle       : HWND;
  116.   Index                  : LONGINT;
  117.   Text                   : ARRAY OF CHAR
  118. )                        : BOOLEAN;
  119.  
  120. (***************************************************************************
  121. *    WinQueryLboxSelectedItem() returns the item index selected.
  122. *    (for single selection only)
  123. ***************************************************************************)
  124. PROCEDURE WinQueryLboxSelectedItem
  125. ( ListBoxWinHandle       : HWND
  126. )                        : LONGINT;
  127.  
  128. END WINLISTBOXES.
  129.