From: Jerome St-Louis Date: Wed, 11 Mar 2015 18:26:46 +0000 (-0400) Subject: ecere/gui/controls/ListBox: Simplified member access X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=a1cd4a6c2cf453b6da4090df14b21a1f9bfa0f69 ecere/gui/controls/ListBox: Simplified member access - Replaced 'this.'member where there is no overshadowing --- diff --git a/ecere/src/gui/controls/ListBox.ec b/ecere/src/gui/controls/ListBox.ec index 8aee587..0532d68 100644 --- a/ecere/src/gui/controls/ListBox.ec +++ b/ecere/src/gui/controls/ListBox.ec @@ -276,7 +276,7 @@ public: if(parent.IsExpanded()) { DataRow search; - int index; + int ix; if(value) { @@ -301,10 +301,10 @@ public: } } - index = this.index+1; + ix = index+1; for(search = GetNextRow(); search; search = search.GetNextRow()) - search.index = index++; - listBox.rowCount = index; + search.index = ix++; + listBox.rowCount = ix; listBox.HideEditBox(false, false, true); @@ -907,9 +907,9 @@ private: { DataRow search; - int index = this.index; + int ix = index; for(search = this; search; search = search.GetNextRow()) - search.index = index++; + search.index = ix++; } if(scrollToCurrent) { @@ -1313,7 +1313,7 @@ public: for(search = row.GetNextRow(); search; search = search.GetNextRow()) search.index++; - this.rowCount++; + rowCount++; row.cells.Clear(); firstRowShown = row; @@ -1422,7 +1422,7 @@ public: for(search = row.GetNextRow(); search; search = search.GetNextRow()) search.index++; - this.rowCount++; + rowCount++; row.cells.Clear(); for(c = 0; c this.oldX && - this.startWidth + x - this.resizeX < field.width) + if(x - scroll.x > oldX && + startWidth + x - resizeX < field.width) { - this.oldX = x - scroll.x; + oldX = x - scroll.x; return true; } - this.oldX = x - scroll.x; + oldX = x - scroll.x; - field.width = this.startWidth + x - this.resizeX; + field.width = startWidth + x - resizeX; field.width = Max(field.width, - EXTRA_SPACE); AdaptToFieldWidth(field, true); @@ -2845,9 +2844,9 @@ private: SetScrollPosition(field.x, scroll.y); field = null; } - if(this.dropField != field) + if(dropField != field) { - this.dropField = field; + dropField = field; if(field) { int position = field.x; @@ -2865,7 +2864,7 @@ private: SetScrollPosition(position, scroll.y); } - this.movingFields = true; + movingFields = true; } Update(null); } @@ -2929,7 +2928,7 @@ private: break; } } - if(switchField && draggingField != switchField && this.dropField) + if(switchField && draggingField != switchField && dropField) { for(field = fields.first; field; field = field.next) { @@ -2961,7 +2960,7 @@ private: bool HeaderClicked(Button control, int x, int y, Modifiers mods) { - if(style.header && !this.dropField && style.sortable) + if(style.header && !dropField && style.sortable) { DataField field = (DataField)(intptr)control.id; if(sortField == field) @@ -3124,7 +3123,7 @@ private: } if(!*h) { - *h = Min(this.maxShown, this.rowCount) * rowHeight; + *h = Min(maxShown, rowCount) * rowHeight; } } else @@ -3163,7 +3162,7 @@ private: { // Resize left DataField field = resizingField; - field.width = this.startWidth + x - this.resizeX; + field.width = startWidth + x - resizeX; field.width = Max(field.width, - EXTRA_SPACE); AdaptToFieldWidth(field, true); @@ -3200,8 +3199,8 @@ private: if(x == MAXINT && y == MAXINT) { - x = this.mouseX; - y = this.mouseY; + x = mouseX; + y = mouseY; isTimer = true; } @@ -3260,7 +3259,7 @@ private: if(row && currentRow != row) { - if(this.dragRow && style.moveRows) + if(dragRow && style.moveRows) { if(row.selectedFlag == selected || row.selectedFlag == tempSelected) rowIndex = -1; @@ -3274,15 +3273,15 @@ private: if(thisRow != row) rowIndex++; } - if(this.dropIndex != rowIndex) + if(dropIndex != rowIndex) { - this.dropIndex = rowIndex; - this.editRow = null; + dropIndex = rowIndex; + editRow = null; Update(null); - this.movedRow = true; + movedRow = true; } } - else if((style.freeSelect || this.dragging) && ((realX>= 0 && realY >= 0 && realX< clientSize.w && realY < clientSize.h) || rolledOver)) + else if((style.freeSelect || dragging) && ((realX>= 0 && realY >= 0 && realX< clientSize.w && realY < clientSize.h) || rolledOver)) { if(!(style.multiSelect)) { @@ -3390,8 +3389,8 @@ private: if(Abs(x - vx) < 2) { resizingField = field.prev; - this.resizeX = x; - this.startWidth = resizingField.width; + resizeX = x; + startWidth = resizingField.width; Capture(); SetMouseRangeToClient(); break; @@ -3473,7 +3472,7 @@ private: for(selRow = rows.first; selRow; selRow = selRow.GetNextRow()) selRow.selectedFlag = unselected; clickedRow = row; - //this.clickedRowIndex = rowIndex; + //clickedRowIndex = rowIndex; } else if(style.moveRows && !(mods.shift) && (row.selectedFlag == selected || row.selectedFlag == tempSelected) && @@ -3491,7 +3490,7 @@ private: row.selectedFlag = selected; } clickedRow = row; - //this.clickedRowIndex = rowIndex; + //clickedRowIndex = rowIndex; } else { @@ -3566,7 +3565,7 @@ private: else row.selectedFlag = tempSelected; clickedRow = row; - //this.clickedRowIndex = rowIndex; + //clickedRowIndex = rowIndex; } } } @@ -3656,9 +3655,9 @@ private: { if(style.moveRows) { - this.dragRow = currentRow; - this.dropIndex = -1; - this.movedRow = false; + dragRow = currentRow; + dropIndex = -1; + movedRow = false; Capture(); } @@ -3696,7 +3695,7 @@ private: } } else if(!(mods.ctrl) && numSelected <= 1) - this.editRow = currentRow; + editRow = currentRow; if(style.noDragging && newCurrentRow) NotifyReclick(master, this, newCurrentRow, mods); @@ -3832,7 +3831,7 @@ private: } else { - this.dragging = false; + dragging = false; OnLeftButtonUp(x, y, mods); } return result; @@ -3866,7 +3865,7 @@ private: break; } } - if(this.editRow == switchRow && y >= 0) + if(editRow == switchRow && y >= 0) { // Find which field DataField field; @@ -3892,9 +3891,9 @@ private: } else if(style.moveRows && switchRow) { - if(this.dragRow == switchRow && this.movedRow == false) + if(dragRow == switchRow && movedRow == false) { - DataRow row = this.dragRow; + DataRow row = dragRow; DataRow selRow; if(!(mods.ctrl)) { @@ -3958,7 +3957,7 @@ private: { for(row = rows.first; row; row = row.GetNextRow()) { - if(row == switchRow || row == this.dragRow) + if(row == switchRow || row == dragRow) break; } @@ -4151,9 +4150,9 @@ private: looped = true; } typingTimer.Stop(); - if(this.typingTimeOut && !keyHit) + if(typingTimeOut && !keyHit) typingTimer.Start(); - if(!result || !this.typingTimeOut || keyHit) + if(!result || !typingTimeOut || keyHit) typedString[len-1] = '\0'; } if(!checkNextField || result) break; @@ -4175,7 +4174,7 @@ private: } else if(key == escape) { - if(resizingField || this.movingFields || (editData && editData.visible) || dragRow) + if(resizingField || movingFields || (editData && editData.visible) || dragRow) { if(editData && editData.visible && style.alwaysEdit && !editData.active) return true; @@ -4183,7 +4182,7 @@ private: HideEditBox(false, false, false); if(resizingField) { - resizingField.width = this.startWidth; + resizingField.width = startWidth; AdaptToFieldWidth(resizingField, true); resizingField = null; ReleaseCapture(); @@ -4198,7 +4197,7 @@ private: ReleaseCapture(); } - this.movingFields = false; + movingFields = false; draggingField = null; Update(null); return false;