home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spiele Shareware / os2games.iso / os2games / addons / gi / c / pmtools / listbox.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-10  |  2.2 KB  |  37 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*   Main-Module   :                                                        */
  4. /*                                                                          */
  5. /*   Version       : V0.00                                                  */
  6. /*                                                                          */
  7. /*   Date          : 22.04.92                                               */
  8. /*                                                                          */
  9. /*   Written       : MH                                                     */
  10. /*                                                                          */
  11. /*     Revision History :
  12.  
  13.     10.05.93    RF  PreCompiled-Headers, os2.h wird vom Modul geholt
  14.                                                                             */
  15. /*--------------------------------------------------------------------------*/
  16.  
  17. class LISTBOX
  18.     {
  19.     private:
  20.         HWND    win;
  21.  
  22.     public:
  23.         LISTBOX (HWND w=0) : win(w) {};
  24.         void Set (HWND w) {win = w;};
  25.  
  26.         void        DeleteAll () {WinSendMsg (win, LM_DELETEALL, 0, 0);};
  27.         USHORT        Delete (SHORT item) {return ((USHORT)WinSendMsg (win, LM_DELETEITEM, item, 0));};
  28.         USHORT        Insert (SHORT index, PSZ text) {return ((USHORT)WinSendMsg (win, LM_INSERTITEM, index, (ULONG)text));};
  29.         USHORT        InsertAsc (SHORT index, PSZ text) {return ((USHORT)WinSendMsg (win, LM_INSERTITEM, LIT_SORTASCENDING, (ULONG)text));};
  30.         USHORT        InsertDesc (SHORT index, PSZ text) {return ((USHORT)WinSendMsg (win, LM_INSERTITEM, LIT_SORTDESCENDING, (ULONG)text));};
  31.         USHORT        InsertEnd (SHORT index, PSZ text) {return ((USHORT)WinSendMsg (win, LM_INSERTITEM, LIT_END, (ULONG)text));};
  32.         USHORT        Count () {return ((USHORT)WinSendMsg (win, LM_QUERYITEMCOUNT, 0, 0));};
  33.         SHORT        Selection () {return ((SHORT)WinSendMsg (win, LM_QUERYSELECTION, LIT_FIRST, 0));};
  34.         void        SetSelection (SHORT index) {WinSendMsg (win, LM_SELECTITEM, MPFROMSHORT (index), TRUE);};
  35.         SHORT        GetText (SHORT index, PSZ buffer, SHORT maxlen=255) {return ((SHORT)WinSendMsg (win, LM_QUERYITEMTEXT, MPFROM2SHORT (index, maxlen), (ULONG)buffer));};
  36.     };
  37.