Leaked source code of windows server 2003
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.

170 lines
5.3 KiB

  1. #if !defined(__Combo_h__INCLUDED)
  2. #define __Combo_h__INCLUDED
  3. //---------------------------------------------------------------------------//
  4. //
  5. // Controls Controls
  6. //
  7. //---------------------------------------------------------------------------//
  8. //
  9. // Combobox animation time in MS
  10. //
  11. #define CMS_QANIMATION 165
  12. //
  13. // ID numbers (hMenu) for the child controls in the combo box
  14. //
  15. #define CBLISTBOXID 1000
  16. #define CBEDITID 1001
  17. #define CBBUTTONID 1002
  18. //
  19. // For CBOX.c. BoxType field, we define the following combo box styles. These
  20. // numbers are the same as the CBS_ style codes as defined in winuser.h.
  21. //
  22. #define SDROPPABLE CBS_DROPDOWN
  23. #define SEDITABLE CBS_SIMPLE
  24. #define SSIMPLE SEDITABLE
  25. #define SDROPDOWNLIST SDROPPABLE
  26. #define SDROPDOWN (SDROPPABLE | SEDITABLE)
  27. //
  28. // Combobox & Listbox OwnerDraw types
  29. //
  30. #define OWNERDRAWFIXED 1
  31. #define OWNERDRAWVAR 2
  32. #define UPPERCASE 1
  33. #define LOWERCASE 2
  34. //
  35. // Special styles for static controls, edit controls & listboxes so that we
  36. // can do combo box specific stuff in their wnd procs.
  37. //
  38. #define LBS_COMBOBOX 0x8000L
  39. //
  40. // The default minimun number of items that should fit in a dropdown list before
  41. // the list should start showing in scrollbars.
  42. //
  43. #define DEFAULT_MINVISIBLE 30
  44. //
  45. // Combobox macros
  46. //
  47. #define IsComboVisible(pcbox) \
  48. (!pcbox->fNoRedraw && IsWindowVisible(pcbox->hwnd))
  49. //
  50. // Combine two DBCS WM_CHAR messages to
  51. // a single WORD value.
  52. //
  53. #define CrackCombinedDbcsLB(c) \
  54. ((BYTE)(c))
  55. #define CrackCombinedDbcsTB(c) \
  56. ((c) >> 8)
  57. //
  58. // Instance data pointer access functions
  59. //
  60. #define ComboBox_GetPtr(hwnd) \
  61. (PCBOX)GetWindowPtr(hwnd, 0)
  62. #define ComboBox_SetPtr(hwnd, p) \
  63. (PCBOX)SetWindowPtr(hwnd, 0, p)
  64. //
  65. // Combobox WndProc Prototype
  66. //
  67. extern LRESULT
  68. ComboBox_WndProc(
  69. HWND hwnd,
  70. UINT uMsg,
  71. WPARAM wParam,
  72. LPARAM lParam);
  73. typedef struct tagCBox
  74. {
  75. HWND hwnd; // Window for the combo box
  76. HWND hwndParent; // Parent of the combo box
  77. HTHEME hTheme; // Handle to the theme manager
  78. RECT editrc; // Rectangle for the edit control/static text area
  79. RECT buttonrc; // Rectangle where the dropdown button is
  80. int cxCombo; // Width of sunken area
  81. int cyCombo; // Height of sunken area
  82. int cxDrop; // 0x24 Width of dropdown
  83. int cyDrop; // Height of dropdown or shebang if simple
  84. HWND hwndEdit; // Edit control window handle
  85. HWND hwndList; // List box control window handle
  86. UINT CBoxStyle:2; // Combo box style
  87. UINT fFocus:1; // Combo box has focus?
  88. UINT fNoRedraw:1; // Stop drawing?
  89. UINT fMouseDown:1; // Was the popdown button just clicked and mouse still down?
  90. UINT fButtonPressed:1; // Is the dropdown button in an inverted state?
  91. UINT fLBoxVisible:1; // Is list box visible? (dropped down?)
  92. UINT OwnerDraw:2; // Owner draw combo box if nonzero. value
  93. // specifies either fixed or varheight
  94. UINT fKeyboardSelInListBox:1; // Is the user keyboarding through the
  95. // listbox. So that we don't hide the
  96. // listbox on selchanges caused by the
  97. // user keyboard through it but we do
  98. // hide it if the mouse causes the selchange.
  99. UINT fExtendedUI:1; // Are we doing TandyT's UI changes on this combo box?
  100. UINT fCase:2;
  101. UINT f3DCombo:1; // 3D or flat border?
  102. UINT fNoEdit:1; // True if editing is not allowed in the edit window.
  103. UINT fButtonHotTracked:1; // Is the dropdown hot-tracked?
  104. UINT fRightAlign:1; // used primarily for MidEast right align
  105. UINT fRtoLReading:1; // used only for MidEast, text rtol reading order
  106. HANDLE hFont; // Font for the combo box
  107. LONG styleSave; // Temp to save the style bits when creating
  108. // window. Needed because we strip off some
  109. // bits and pass them on to the listbox or edit box.
  110. PWW pww; // RO pointer into the pwnd to ExStyle, Style, State, State2
  111. int iMinVisible; // The minimun number of visible items before scrolls
  112. } CBOX, *PCBOX;
  113. // Combobox function prototypes.
  114. // Defined in combo.c
  115. BOOL ComboBox_HideListBoxWindow(PCBOX, BOOL, BOOL);
  116. VOID ComboBox_ShowListBoxWindow(PCBOX, BOOL);
  117. VOID ComboBox_InternalUpdateEditWindow(PCBOX, HDC);
  118. // Defined in comboini.c
  119. LONG ComboBox_NcCreateHandler(PCBOX, HWND);
  120. LRESULT ComboBox_CreateHandler(PCBOX, HWND);
  121. VOID ComboBox_NcDestroyHandler(PWND, PCBOX);
  122. VOID ComboBox_SetFontHandler(PCBOX, HANDLE, BOOL);
  123. LONG ComboBox_SetEditItemHeight(PCBOX, int);
  124. VOID ComboBox_SizeHandler(PCBOX);
  125. VOID ComboBox_Position(PCBOX);
  126. // Defined in combodir.c
  127. INT CBDir(PCBOX, UINT, LPWSTR);
  128. #endif // __Combo_h__INCLUDED