Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.7 KiB

  1. #ifndef H__selbox
  2. #define H__selbox
  3. /* SelBoxInit( hInst ) will register window classes and should only be called
  4. at the beginning of a program.
  5. */
  6. VOID FAR PASCAL SelBoxInit( HANDLE );
  7. /*
  8. SelBoxSetupStart( hWnd, title, noEntryMsg, numCols, lFlags );
  9. SelBoxSetupStart() gets passed a window handle that is the parent
  10. of this window and "numCols".
  11. "title" will be displayed in the caption for the user
  12. "noEntryMsg" will be display in the window when there are no
  13. entries
  14. If numCols is 0, SelBox() routines will determine the
  15. optimum # to display on the screen. Otherwise, SelBox() routines
  16. will use the number you pass.
  17. "lFlags" can be one of the following:
  18. SBSTYLE_RADIO_BUTTONS otherwise check-box style
  19. SBSTYLE_RETURN_ON_SELECTION otherwise wait for OK
  20. SBSTYLE_SORT_ENTRIES otherwise put in order of calls
  21. SBSTYLE_ENTRIES_PRESORTED put in order but knows that
  22. they're sorted
  23. */
  24. VOID FAR PASCAL SelBoxSetupStart( HWND, PSTR, PSTR, int, LONG );
  25. /*
  26. BOOL SelBoxAddEntry( string, value, wFlags )
  27. SelBoxAddEntry() gets passed a string a value and flags. If the user
  28. clicks on this string, "value" is returned by SelBoxUserSelect().
  29. The wFlags are:
  30. SBENTRY_DISABLED
  31. SBENTRY_SELECTED
  32. Return is FALSE for out of memory errors
  33. */
  34. BOOL FAR PASCAL SelBoxAddEntry( LPSTR, LONG, WORD );
  35. /* SelBoxUserSelect( hInst, lButtons, vPosition, nFixed ) actually
  36. displays the strings set up by SelBoxAddEntry(). The box is displayed
  37. at the vertical screen position specified by "vPosition"
  38. "lButtons" specifies which of the following buttons should be
  39. enabled:
  40. SB_BUTTON_NEW
  41. SB_BUTTON_MODIFY
  42. SB_BUTTON_DELETE
  43. SB_BUTTON_CANCEL
  44. SB_BUTTON_OK
  45. and returns one of the buttons:
  46. SB_BUTTON_OK
  47. SB_BUTTON_CANCEL
  48. SB_BUTTON_NEW
  49. SB_BUTTON_MODIFY
  50. SB_BUTTON_DELETE
  51. "nFixed" is set to 0 to allow free-format lengths. If nFixed is non-zero,
  52. the sizes for the entries are fixed at the length specified by nFixed.
  53. */
  54. LONG FAR PASCAL SelBoxUserSelect( HANDLE, LONG, int, int );
  55. /* SelBoxUserSelection() will return the handle of a sellist (hMem).
  56. Use
  57. SelListNumSelections( hMem )
  58. SelListGetSelection( hMem, n )
  59. SelListFree( hMem )
  60. */
  61. HANDLE FAR PASCAL SelBoxUserSelection( void );
  62. /*
  63. SelBoxCancel() simulates the user hitting the cancel button
  64. NOTE: It IS OK to call this routine when no selection box is displayed
  65. */
  66. VOID FAR PASCAL SelBoxCancel( void );
  67. /*
  68. SelBoxDoneOK( lButton ) simulates the user hitting one of the other buttons
  69. NOTE: It IS OK to call this routine when no selection box is displayed
  70. */
  71. VOID FAR PASCAL SelBoxDoneOK( LONG );
  72. #define SBSTYLE_RADIO_BUTTONS 0x00000001L
  73. #define SBSTYLE_RETURN_ON_SELECTION 0x00000002L
  74. #define SBSTYLE_SORT_ENTRIES 0x00000004L
  75. #define SBSTYLE_ENTRIES_PRESORTED 0x00000008L
  76. #define SBENTRY_DISABLED 0x0001
  77. #define SBENTRY_SELECTED 0x0002
  78. #define SBENTRY_LABEL 0x0004
  79. /** If you add an entry here, be sure to add the button name, etc.
  80. to the "buttonList" in selbox.c
  81. **/
  82. #define SB_BUTTON_NEW 0x00000001L
  83. #define SB_BUTTON_MODIFY 0x00000002L
  84. #define SB_BUTTON_DELETE 0x00000004L
  85. #define SB_BUTTON_CANCEL 0x00000010L
  86. #define SB_BUTTON_OK 0x00000020L
  87. #define SB_BUTTON_NORMAL (SB_BUTTON_CANCEL | SB_BUTTON_OK)
  88. #define SB_BUTTON_ALL (0xFFL)
  89. /*
  90. Selection list manipulation routines
  91. */
  92. int FAR PASCAL SelListNumSelections( HANDLE );
  93. LONG FAR PASCAL SelListGetSelection( HANDLE, int );
  94. VOID FAR PASCAL SelListFree( HANDLE );
  95. HANDLE FAR PASCAL SelListCreate( int, WORD );
  96. VOID FAR PASCAL SelListSetSelection( HANDLE, int, LONG );
  97. BOOL FAR PASCAL SelListIsInList( HANDLE, LONG );
  98. HANDLE FAR PASCAL SelListCopy( HANDLE );
  99. #endif