if(parent.IsExpanded())
{
DataRow search;
- int index;
+ int ix;
if(value)
{
}
}
- 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);
{
DataRow search;
- int index = this.index;
+ int ix = index;
for(search = this; search; search = search.GetNextRow())
- search.index = index++;
+ search.index = ix++;
}
if(scrollToCurrent)
{
for(search = row.GetNextRow(); search; search = search.GetNextRow())
search.index++;
- this.rowCount++;
+ rowCount++;
row.cells.Clear();
firstRowShown = row;
for(search = row.GetNextRow(); search; search = search.GetNextRow())
search.index++;
- this.rowCount++;
+ rowCount++;
row.cells.Clear();
for(c = 0; c<fields.count; c++)
{
{
for(search = row.GetNextRow(); search; search = search.GetNextRow())
search.index--;
- this.rowCount--;
+ rowCount--;
}
HideEditBox(false, false, true);
//HideEditBox(false, false, true);
SetScrollArea(
- this.width,
- (this.rowCount * rowHeight) +
+ width,
+ (rowCount * rowHeight) +
((style.header) ? rowHeight : 0) -
((!((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
currentRow.Edit(currentField);
- this.rowCount = 0;
+ rowCount = 0;
SetScrollArea(
- this.width,
- (this.rowCount * rowHeight) +
+ width,
+ (rowCount * rowHeight) +
((style.header) ? rowHeight : 0) -
((rowHeight && !((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
Update(null);
Font font = fontObject;
Font boldFont = this.boldFont.font;
-
// Draw gray grid
if(style.alwaysEdit && style.fullRowSelect)
{
break;
}
if(firstRowShown) surface.Clip(null);
- if(this.dragRow && this.dropIndex != -1)
+ if(dragRow && dropIndex != -1)
{
- int dropIndex = this.dropIndex;
+ int ix = dropIndex;
int y;
- if(!style.multiSelect && currentRow.index < this.dropIndex)
- dropIndex++;
+ if(!style.multiSelect && currentRow.index < dropIndex)
+ ix++;
surface.DrawingChar(223);
y = style.header ? rowHeight : 0;
- y += dropIndex * rowHeight - scroll.y;
+ y += ix * rowHeight - scroll.y;
surface.SetForeground(Color { 85, 85, 255 });
surface.HLine(0, clientSize.w-1, y);
void OnDrawOverChildren(Surface surface)
{
- if(draggingField && this.dropField)
+ if(draggingField && dropField)
{
- int position = this.dropField.x;
+ int position = dropField.x;
if(draggingField.x < position)
- position += this.dropField.width + EXTRA_SPACE;
+ position += dropField.width + EXTRA_SPACE;
surface.SetForeground(Color { 85, 85, 255 });
surface.VLine(0, rowHeight - 1, position - scroll.x - 2);
if(field.fixed) return false;
resizingField = field;
- this.resizeX = x + control.position.x;
- this.startWidth = field.width;
- this.oldX = x - scroll.x;
+ resizeX = x + control.position.x;
+ startWidth = field.width;
+ oldX = x - scroll.x;
return false;
}
else if(field)
x += control.position.x;
// Tweak to prevent shrinking field if we're actually moving right
- if(x - scroll.x > 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);
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;
SetScrollPosition(position, scroll.y);
}
- this.movingFields = true;
+ movingFields = true;
}
Update(null);
}
break;
}
}
- if(switchField && draggingField != switchField && this.dropField)
+ if(switchField && draggingField != switchField && dropField)
{
for(field = fields.first; field; field = field.next)
{
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)
}
if(!*h)
{
- *h = Min(this.maxShown, this.rowCount) * rowHeight;
+ *h = Min(maxShown, rowCount) * rowHeight;
}
}
else
{
// 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);
if(x == MAXINT && y == MAXINT)
{
- x = this.mouseX;
- y = this.mouseY;
+ x = mouseX;
+ y = mouseY;
isTimer = true;
}
if(row && currentRow != row)
{
- if(this.dragRow && style.moveRows)
+ if(dragRow && style.moveRows)
{
if(row.selectedFlag == selected || row.selectedFlag == tempSelected)
rowIndex = -1;
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))
{
if(Abs(x - vx) < 2)
{
resizingField = field.prev;
- this.resizeX = x;
- this.startWidth = resizingField.width;
+ resizeX = x;
+ startWidth = resizingField.width;
Capture();
SetMouseRangeToClient();
break;
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) &&
row.selectedFlag = selected;
}
clickedRow = row;
- //this.clickedRowIndex = rowIndex;
+ //clickedRowIndex = rowIndex;
}
else
{
else
row.selectedFlag = tempSelected;
clickedRow = row;
- //this.clickedRowIndex = rowIndex;
+ //clickedRowIndex = rowIndex;
}
}
}
{
if(style.moveRows)
{
- this.dragRow = currentRow;
- this.dropIndex = -1;
- this.movedRow = false;
+ dragRow = currentRow;
+ dropIndex = -1;
+ movedRow = false;
Capture();
}
}
}
else if(!(mods.ctrl) && numSelected <= 1)
- this.editRow = currentRow;
+ editRow = currentRow;
if(style.noDragging && newCurrentRow)
NotifyReclick(master, this, newCurrentRow, mods);
}
else
{
- this.dragging = false;
+ dragging = false;
OnLeftButtonUp(x, y, mods);
}
return result;
break;
}
}
- if(this.editRow == switchRow && y >= 0)
+ if(editRow == switchRow && y >= 0)
{
// Find which field
DataField field;
}
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))
{
{
for(row = rows.first; row; row = row.GetNextRow())
{
- if(row == switchRow || row == this.dragRow)
+ if(row == switchRow || row == dragRow)
break;
}
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;
}
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;
HideEditBox(false, false, false);
if(resizingField)
{
- resizingField.width = this.startWidth;
+ resizingField.width = startWidth;
AdaptToFieldWidth(resizingField, true);
resizingField = null;
ReleaseCapture();
ReleaseCapture();
}
- this.movingFields = false;
+ movingFields = false;
draggingField = null;
Update(null);
return false;