home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / MSJV5-3.ZIP / VLB.ZIP / VLB.H < prev    next >
Text File  |  1990-05-01  |  5KB  |  101 lines

  1. /*
  2. **  VLB.H     Virtual List Box header file
  3. **
  4. **  Author: Robert A. Wood
  5. **
  6. **    Date: 03/19/90
  7. */
  8.  
  9. #define VLB_CALLBACK  lpVLB->CallBack
  10. #define VLBSTRLEN     255     // maximum virtual string length
  11. typedef LONG (FAR PASCAL * VLBPROC)( WORD, WORD, LONG FAR *, LPSTR );
  12.  
  13. //  VCB   Virtual CallBack function Messages
  14. //*******************************************************************
  15. #define VCB_CREATE      1   // listbox has just been created
  16. #define VCB_DESTROY     2   // listbox is to be destroyed
  17. #define VCB_SETFOCUS    3   // listbox has received focus
  18. #define VCB_KILLFOCUS   4   // listbox is to lose focus
  19. #define VCB_LENGTH      5   // request for total strings
  20. #define VCB_WIDTH       6   // request for vitual width
  21. #define VCB_FULLSTRING  7   // get the full string specified
  22. #define VCB_STRING      8   // get string specify by StringId
  23. #define VCB_VTHUMB      9   // get string specify by thumb
  24. #define VCB_SEARCH      10  // get string for search criteria
  25. #define VCB_FIRST       11  // get the first string
  26. #define VCB_LAST        12  // get the last string
  27. #define VCB_NEXT        13  // get the next string
  28. #define VCB_PREV        14  // get the previous string
  29. #define VCB_HTHUMB      15  // move str start specify thumb
  30. #define VCB_LEFT        16  // move str start left one char
  31. #define VCB_RIGHT       17  // move str start right one char
  32. #define VCB_PAGELEFT    18  // move str start left one col
  33. #define VCB_PAGERIGHT   19  // move str start right one col
  34.  
  35. //  VLB Messages Sent to the VLB Procedure
  36. //*******************************************************************
  37. #define VLB_GETCOUNT     WM_USER+1   // get total virtual strings
  38. #define VLB_GETSELCOUNT  WM_USER+2   // get total selected strings
  39. #define VLB_GETSTRLEN    WM_USER+3   // get total string length
  40. #define VLB_GETSELSTR    WM_USER+4   // get the select String
  41. #define VLB_GETSELID     WM_USER+5   // get the select StringId(s)
  42. #define VLB_SETCURSEL    WM_USER+6   // selects the specify StringId
  43. #define VLB_SETSEL       WM_USER+7   // sets selection of a StringId
  44. #define VLB_RELOAD       WM_USER+8   // reload curr. display strings
  45.  
  46. // VLB_RELOAD wParam options
  47. //*******************************************************************
  48. #define RELOAD_STRINGS   0
  49. #define RELOAD_STRINGPOS 1
  50. #define RELOAD_STRINGID  2
  51.  
  52. // Notifications Sent to the VLB Parent by the VLB Procedure
  53. //*******************************************************************
  54. #define VLBN_DBLCLK     LBN_DBLCLK    // double clicked on a string
  55. #define VLBN_ERRSPACE   LBN_ERRSPACE  // can't allocate memory
  56. #define VLBN_SELCHANGE  LBN_SELCHANGE // selected string changed
  57.  
  58. // VLB Control Information
  59. //*******************************************************************
  60. typedef struct
  61. {
  62.    WORD ListBoxId;             // list box control id
  63.    BOOL MultiSelection;        // Single or Multi selection
  64.    RECT ClientRect;            // client area rectangle
  65.    WORD CharWidth;             // character width
  66.    WORD CharHeight;            // character height
  67.    BYTE DisplayStrings;        // max number of displayed strings
  68.    BYTE DisplayChars;          // max characters in displayed strings
  69.    LONG FocusString;           // string position of focus frame
  70.    LONG TotalStrings;          // number of virtual strings
  71.    LONG TotalWidth;            // number of virtual chars per string
  72.    LONG FirstDisplayString;    // number of first displayed string
  73.    LONG TotalSelectedStrings;  // number of selected strings
  74.    LONG MaxSelectedStrings;    // maximum number of selected strings
  75.    VLBPROC CallBack;           // VLB CallBack function
  76.    HANDLE hDisplayBuffer;      // handle to buffer of display strings
  77.    HANDLE hStringIds;          // handle - array of display StringIds
  78.    HANDLE hSelectedStringIds;  // handle - array of select StringIds
  79.    LONG SelectedStringId;      // Single selection selected StringId
  80.    int ScrollWindow;           // scroll lines for ScrollWindow()
  81. } VLB, FAR *LPVLB;             // 62 bytes
  82.  
  83. // Function called by application to initialize VLB
  84. //*******************************************************************
  85. BOOL FAR PASCAL InitVLB( HANDLE, HWND, WORD, VLBPROC );
  86.  
  87. // Internal functions
  88. //*******************************************************************
  89. LONG FAR PASCAL VLBProc( HWND hCtl, unsigned message, WORD wParam ,
  90.                          LONG lParam );
  91. BOOL FAR PASCAL LoadVLB( HWND hCtl, WORD wParam, LONG lParam );
  92. BOOL FAR PASCAL ScrollVLB( HWND hCtl, WORD wParam, int Scroll );
  93. VOID FAR PASCAL SetSelectedString( HWND hCtl, WORD wParam, LPVLB);
  94. VOID FAR PASCAL SetFocusString( WORD wParam, LPVLB lpVLB );
  95. VOID InvertSelectedStrings( HDC hCtl, LPVLB lpVLB, int StringPos );
  96. VOID FrameFocusString( HWND hCtl, LPVLB lpVLB, BOOL draw );
  97. VOID FAR PASCAL PaintVLB( HWND hCtl, LPVLB lpVLB );
  98. VOID FAR PASCAL GetVLBColors( HWND hCtl, HANDLE hDC );
  99.  
  100. //*** END OF VLB.H **************************************************
  101.