Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CustomTable::OnLButtonDown(LPARAM lParam) {
- int xPos = GET_X_LPARAM(lParam);
- int yPos = GET_Y_LPARAM(lParam);
- if (HandleColumnResize(xPos, yPos)) {
- return;
- }
- if (HandleHeaderClick(xPos, yPos, WM_HEADER_CLICK, true)) {
- return;
- }
- HandleCellClick(xPos, yPos, WM_CELL_CLICK, true);
- }
- void CustomTable::OnRButtonDown(LPARAM lParam) {
- int xPos = GET_X_LPARAM(lParam);
- int yPos = GET_Y_LPARAM(lParam);
- if (HandleHeaderClick(xPos, yPos, WM_HEADER_RCLICK, false)) {
- return;
- }
- HandleCellClick(xPos, yPos, WM_CELL_RCLICK, false);
- }
- void CustomTable::OnLButtonDblClk(LPARAM lParam) {
- int xPos = GET_X_LPARAM(lParam);
- int yPos = GET_Y_LPARAM(lParam);
- if (!HandleHeaderClick(xPos, yPos, WM_HEADER_DBLCLICK, true)) {
- HandleCellClick(xPos, yPos, WM_CELL_DBLCLICK, true);
- }
- int itemIndex = this->selectedItem;
- int columnIndex = this->selectedColumn;
- if (hEdit) {
- DestroyWindow(hEdit);
- }
- InvalidateRect(this->hwnd, NULL, TRUE);
- // Calculate the position and size of the edit control
- POINT editPosition = CalculateEditPosition(itemIndex, columnIndex);
- SIZE editSize = CalculateEditSize(itemIndex, columnIndex);
- // Create the edit control
- CreateEditControl(itemIndex, columnIndex, editPosition, editSize);
- }
- void CustomTable::OnRButtonDblClk(LPARAM lParam) {
- int xPos = GET_X_LPARAM(lParam);
- int yPos = GET_Y_LPARAM(lParam);
- if (HandleHeaderClick(xPos, yPos, WM_HEADER_RDBLCLICK, false)) {
- return;
- }
- HandleCellClick(xPos, yPos, WM_CELL_RDBLCLICK, false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement