Advertisement
Old_But_Gold

Untitled

Oct 2nd, 2024 (edited)
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void CustomTable::OnLButtonDown(LPARAM lParam) {
  2.     int xPos = GET_X_LPARAM(lParam);
  3.     int yPos = GET_Y_LPARAM(lParam);
  4.  
  5.     if (HandleColumnResize(xPos, yPos)) {
  6.         return;
  7.     }
  8.  
  9.     if (HandleHeaderClick(xPos, yPos, WM_HEADER_CLICK, true)) {
  10.         return;
  11.     }
  12.  
  13.     HandleCellClick(xPos, yPos, WM_CELL_CLICK, true);
  14. }
  15.  
  16. void CustomTable::OnRButtonDown(LPARAM lParam) {
  17.     int xPos = GET_X_LPARAM(lParam);
  18.     int yPos = GET_Y_LPARAM(lParam);
  19.  
  20.     if (HandleHeaderClick(xPos, yPos, WM_HEADER_RCLICK, false)) {
  21.         return;
  22.     }
  23.  
  24.     HandleCellClick(xPos, yPos, WM_CELL_RCLICK, false);
  25. }
  26.  
  27. void CustomTable::OnLButtonDblClk(LPARAM lParam) {
  28.     int xPos = GET_X_LPARAM(lParam);
  29.     int yPos = GET_Y_LPARAM(lParam);
  30.  
  31.     if (!HandleHeaderClick(xPos, yPos, WM_HEADER_DBLCLICK, true)) {
  32.         HandleCellClick(xPos, yPos, WM_CELL_DBLCLICK, true);
  33.     }
  34.  
  35.     int itemIndex = this->selectedItem;
  36.     int columnIndex = this->selectedColumn;
  37.  
  38.     if (hEdit) {
  39.         DestroyWindow(hEdit);
  40.     }
  41.  
  42.     InvalidateRect(this->hwnd, NULL, TRUE);
  43.  
  44.     // Calculate the position and size of the edit control
  45.     POINT editPosition = CalculateEditPosition(itemIndex, columnIndex);
  46.     SIZE editSize = CalculateEditSize(itemIndex, columnIndex);
  47.  
  48.     // Create the edit control
  49.     CreateEditControl(itemIndex, columnIndex, editPosition, editSize);
  50. }
  51.  
  52. void CustomTable::OnRButtonDblClk(LPARAM lParam) {
  53.     int xPos = GET_X_LPARAM(lParam);
  54.     int yPos = GET_Y_LPARAM(lParam);
  55.  
  56.     if (HandleHeaderClick(xPos, yPos, WM_HEADER_RDBLCLICK, false)) {
  57.         return;
  58.     }
  59.  
  60.     HandleCellClick(xPos, yPos, WM_CELL_RDBLCLICK, false);
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement