Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@@ -1 +1 @@
3ce4ab7b5741a9728bb3e05cf1ee6e332633f94e
a4a747537c315e0839c50ad99dd26b90eb018d34

View File

@@ -432,6 +432,32 @@ namespace System.Windows.Forms {
[EditorBrowsable (EditorBrowsableState.Advanced)]
public virtual DataGridViewAdvancedBorderStyle AdjustCellBorderStyle (DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow) {
if (dataGridViewAdvancedBorderStyleInput.All == DataGridViewAdvancedCellBorderStyle.Single) {
dataGridViewAdvancedBorderStylePlaceholder.Left = (isFirstDisplayedColumn && singleVerticalBorderAdded) ? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Right = DataGridViewAdvancedCellBorderStyle.Single;
dataGridViewAdvancedBorderStylePlaceholder.Top = (isFirstDisplayedRow && singleHorizontalBorderAdded)? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Bottom = DataGridViewAdvancedCellBorderStyle.Single;
return dataGridViewAdvancedBorderStylePlaceholder;
}
if ((dataGridViewAdvancedBorderStyleInput.All == DataGridViewAdvancedCellBorderStyle.NotSet) && (DataGridView != null) && (DataGridView.AdvancedCellBorderStyle == dataGridViewAdvancedBorderStyleInput)) {
if (DataGridView.CellBorderStyle == DataGridViewCellBorderStyle.SingleVertical) {
dataGridViewAdvancedBorderStylePlaceholder.Left = (isFirstDisplayedColumn && singleVerticalBorderAdded) ? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Right = DataGridViewAdvancedCellBorderStyle.Single;
dataGridViewAdvancedBorderStylePlaceholder.Top = DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Bottom = DataGridViewAdvancedCellBorderStyle.None;
return dataGridViewAdvancedBorderStylePlaceholder;
}
if (DataGridView.CellBorderStyle == DataGridViewCellBorderStyle.SingleHorizontal) {
dataGridViewAdvancedBorderStylePlaceholder.Left = DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Right = DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Top = (isFirstDisplayedRow && singleHorizontalBorderAdded)? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceholder.Bottom = DataGridViewAdvancedCellBorderStyle.Single;
return dataGridViewAdvancedBorderStylePlaceholder;
}
}
return dataGridViewAdvancedBorderStyleInput;
}
@@ -1166,62 +1192,167 @@ namespace System.Windows.Forms {
PaintErrorIcon (graphics, clipBounds, cellBounds, ErrorText);
}
private void PaintDividers (Graphics graphics, ref Rectangle bounds, DataGridViewAdvancedBorderStyle advancedBorderStyle)
{
// Paint the vertical divider
int dividerWidth = OwningColumn != null ? OwningColumn.DividerWidth : 0;
if (dividerWidth > 0) {
if (dividerWidth > bounds.Width)
dividerWidth = bounds.Width;
Color color;
switch (advancedBorderStyle.Right) {
case DataGridViewAdvancedCellBorderStyle.Single:
color = DataGridView.GridColor;
break;
case DataGridViewAdvancedCellBorderStyle.Inset:
color = SystemColors.ControlLightLight;
break;
default:
color = SystemColors.ControlDark;
break;
}
graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (color), bounds.Right - dividerWidth, bounds.Y, dividerWidth, bounds.Height);
bounds.Width -= dividerWidth;
if (bounds.Width <= 0)
return;
}
dividerWidth = OwningRow != null ? OwningRow.DividerHeight : 0;
if (dividerWidth > 0) {
if (dividerWidth > bounds.Height)
dividerWidth = bounds.Height;
Color color;
switch (advancedBorderStyle.Bottom) {
case DataGridViewAdvancedCellBorderStyle.Single:
color = DataGridView.GridColor;
break;
case DataGridViewAdvancedCellBorderStyle.Inset:
color = SystemColors.ControlLightLight;
break;
default:
color = SystemColors.ControlDark;
break;
}
graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (color), bounds.X, bounds.Bottom - dividerWidth, bounds.Width, dividerWidth);
bounds.Height -= dividerWidth;
}
}
protected virtual void PaintBorder (Graphics graphics, Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle)
{
Pen pen = new Pen (DataGridView.GridColor);
PaintDividers(graphics, ref bounds, advancedBorderStyle);
if (bounds.Height <= 0 || bounds.Width <= 0)
return;
if (advancedBorderStyle.All == DataGridViewAdvancedCellBorderStyle.None)
return;
Pen penGrid = ThemeEngine.Current.ResPool.GetPen (DataGridView.GridColor);
CPColor cpColor = ThemeEngine.Current.ResPool.GetCPColor (cellStyle.BackColor);
Pen penDark = ThemeEngine.Current.ResPool.GetPen (cpColor.Dark);
Pen penLight = ThemeEngine.Current.ResPool.GetPen (cpColor.LightLight);
int left = bounds.X;
int right = bounds.Right - 1;
int top = bounds.Y;
int bottom = bounds.Bottom - 1;
// Paint the left border, if any
switch (advancedBorderStyle.Left) {
case DataGridViewAdvancedCellBorderStyle.Single:
if (DataGridView.CellBorderStyle != DataGridViewCellBorderStyle.Single)
graphics.DrawLine (pen, bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height - 1);
graphics.DrawLine (penGrid, left, top, left, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.Outset:
case DataGridViewAdvancedCellBorderStyle.Inset:
graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height - 1);
graphics.DrawLine (penLight, left, top, left, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.Inset:
graphics.DrawLine (penDark, left, top, left, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.InsetDouble:
graphics.DrawLine(penLight, left, top, left, bottom);
graphics.DrawLine(penDark, left + 1, (advancedBorderStyle.Top != DataGridViewAdvancedCellBorderStyle.None)? top + 1 : top, left + 1, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height - 1);
graphics.DrawLine(pen, bounds.X + 2, bounds.Y, bounds.X + 2, bounds.Y + bounds.Height - 1);
graphics.DrawLine(penDark, left, top, left, bottom);
graphics.DrawLine(penLight, left + 1, (advancedBorderStyle.Top != DataGridViewAdvancedCellBorderStyle.None)? top + 1 : top, left + 1, bottom);
break;
}
// Paint the right border, if any
switch (advancedBorderStyle.Right) {
case DataGridViewAdvancedCellBorderStyle.Single:
graphics.DrawLine(pen, bounds.X + bounds.Width - 1, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1);
graphics.DrawLine(penGrid, right, top, right, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.Outset:
graphics.DrawLine (penDark, right, top, right, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.Inset:
graphics.DrawLine (penLight, right, top, right, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.InsetDouble:
graphics.DrawLine (penLight, right - 1, top, right - 1, bottom);
graphics.DrawLine (penDark, right, (advancedBorderStyle.Top != DataGridViewAdvancedCellBorderStyle.None)? top + 1 : top, right, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
graphics.DrawLine(pen, bounds.X + bounds.Width, bounds.Y, bounds.X + bounds.Width, bounds.Y + bounds.Height - 1);
graphics.DrawLine (penDark, right - 1, top, right - 1, bottom);
graphics.DrawLine (penLight, right, (advancedBorderStyle.Top != DataGridViewAdvancedCellBorderStyle.None)? top + 1 : top, right, bottom);
break;
}
// Paint the top border, if any
switch (advancedBorderStyle.Top) {
case DataGridViewAdvancedCellBorderStyle.Single:
if (DataGridView.CellBorderStyle != DataGridViewCellBorderStyle.Single)
graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y);
graphics.DrawLine(penGrid, left, top, right, top);
break;
case DataGridViewAdvancedCellBorderStyle.Outset:
case DataGridViewAdvancedCellBorderStyle.Inset:
case DataGridViewAdvancedCellBorderStyle.Outset: {
int _left = (advancedBorderStyle.Left == DataGridViewAdvancedCellBorderStyle.InsetDouble) || (advancedBorderStyle.Left == DataGridViewAdvancedCellBorderStyle.OutsetDouble) ? left + 1 : left;
int _right = (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.Inset) || (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.Outset) ? right - 1 : right;
graphics.DrawLine (penLight, _left, top, _right, top);
} break;
case DataGridViewAdvancedCellBorderStyle.Inset: {
int _left = (advancedBorderStyle.Left == DataGridViewAdvancedCellBorderStyle.InsetDouble) || (advancedBorderStyle.Left == DataGridViewAdvancedCellBorderStyle.OutsetDouble) ? left + 1 : left;
int _right = (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.Inset) || (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.Outset) ? right - 1 : right;
graphics.DrawLine (penDark, _left, top, _right, top);
} break;
case DataGridViewAdvancedCellBorderStyle.InsetDouble:
graphics.DrawLine(penLight, left, top, right, top);
graphics.DrawLine(penDark, (advancedBorderStyle.Left != DataGridViewAdvancedCellBorderStyle.None)? left + 1 : left, top + 1,
(advancedBorderStyle.Right != DataGridViewAdvancedCellBorderStyle.None)? right -1 : right, top + 1);
break;
case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y);
graphics.DrawLine(penDark, left, top, right, top);
graphics.DrawLine(penLight, (advancedBorderStyle.Left != DataGridViewAdvancedCellBorderStyle.None)? left + 1 : left, top + 1,
(advancedBorderStyle.Right != DataGridViewAdvancedCellBorderStyle.None)? right - 1 : right, top + 1);
break;
}
// Paint the bottom border, if any
switch (advancedBorderStyle.Bottom) {
case DataGridViewAdvancedCellBorderStyle.Outset:
case DataGridViewAdvancedCellBorderStyle.Inset:
case DataGridViewAdvancedCellBorderStyle.Single:
case DataGridViewAdvancedCellBorderStyle.InsetDouble:
case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
graphics.DrawLine(pen, bounds.X, bounds.Y + bounds.Height - 1, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1);
graphics.DrawLine(penGrid, left, bottom, right, bottom);
break;
case DataGridViewAdvancedCellBorderStyle.Outset: {
int _right = (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.InsetDouble) || (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.OutsetDouble) ? right - 1 : right;
graphics.DrawLine (penDark, left, bottom, _right, bottom);
} break;
case DataGridViewAdvancedCellBorderStyle.Inset:
graphics.DrawLine(penLight, left, bottom, (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.InsetDouble)? right - 1: right, bottom);
break;
}
}

View File

@@ -46,7 +46,6 @@ namespace System.Windows.Forms
public DataGridViewRow ()
{
cells = new DataGridViewCellCollection(this);
minimumHeight = 3;
height = -1;
explicit_height = -1;
@@ -64,7 +63,11 @@ namespace System.Windows.Forms
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
public DataGridViewCellCollection Cells {
get { return cells; }
get {
if (cells == null)
cells = CreateCellsInstance ();
return cells;
}
}
[DefaultValue (null)]
@@ -356,10 +359,10 @@ namespace System.Windows.Forms
row.HeaderCell = (DataGridViewRowHeaderCell)HeaderCell.Clone ();
row.SetIndex (-1);
row.cells = new DataGridViewCellCollection (row);
row.cells = null;
foreach (DataGridViewCell cell in cells)
row.cells.Add (cell.Clone () as DataGridViewCell);
foreach (DataGridViewCell cell in Cells)
row.Cells.Add (cell.Clone () as DataGridViewCell);
row.SetDataGridView (null);
@@ -374,14 +377,13 @@ namespace System.Windows.Forms
if (dataGridView.Rows.Contains(this)) {
throw new InvalidOperationException("The row already exists in the DataGridView.");
}
DataGridViewCellCollection newCellCollection = new DataGridViewCellCollection(this);
Cells.Clear ();
foreach (DataGridViewColumn column in dataGridView.Columns) {
if (column.CellTemplate == null) {
throw new InvalidOperationException("Cell template not set in column: " + column.Index.ToString() + ".");
}
newCellCollection.Add((DataGridViewCell) column.CellTemplate.Clone());
Cells.Add((DataGridViewCell) column.CellTemplate.Clone());
}
cells = newCellCollection;
}
public void CreateCells (DataGridView dataGridView, params object[] values)
@@ -391,7 +393,7 @@ namespace System.Windows.Forms
}
CreateCells(dataGridView);
for (int i = 0; i < values.Length; i++) {
cells[i].Value = values[i];
Cells[i].Value = values[i];
}
}
@@ -482,11 +484,11 @@ namespace System.Windows.Forms
/////// COLUMNAS //////////
for (int i = 0; i < values.Length; i++) {
DataGridViewCell cell;
if (cells.Count > i) {
cell = cells [i];
if (Cells.Count > i) {
cell = Cells [i];
} else {
cell = new DataGridViewTextBoxCell ();
cells.Add (cell);
Cells.Add (cell);
}
cell.Value = values[i];
}
@@ -508,8 +510,7 @@ namespace System.Windows.Forms
[EditorBrowsable (EditorBrowsableState.Advanced)]
protected virtual DataGridViewCellCollection CreateCellsInstance ()
{
cells = new DataGridViewCellCollection(this);
return cells;
return new DataGridViewCellCollection(this);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -556,6 +557,9 @@ namespace System.Windows.Forms
bounds.X += DataGridView.RowHeadersWidth;
bounds.Width -= DataGridView.RowHeadersWidth;
}
bool singleVerticalBorderAdded = !DataGridView.RowHeadersVisible;
bool singleHorizontalBorderAdded = !DataGridView.ColumnHeadersVisible;
for (int i = DataGridView.first_col_index; i < sortedColumns.Count; i++) {
DataGridViewColumn col = sortedColumns[i];
@@ -592,7 +596,7 @@ namespace System.Windows.Forms
}
DataGridViewAdvancedBorderStyle intermediateBorderStyle = (DataGridViewAdvancedBorderStyle)((ICloneable)DataGridView.AdvancedCellBorderStyle).Clone ();
DataGridViewAdvancedBorderStyle borderStyle = cell.AdjustCellBorderStyle (DataGridView.AdvancedCellBorderStyle, intermediateBorderStyle, true, true, cell.ColumnIndex == 0, cell.RowIndex == 0);
DataGridViewAdvancedBorderStyle borderStyle = cell.AdjustCellBorderStyle (DataGridView.AdvancedCellBorderStyle, intermediateBorderStyle, singleVerticalBorderAdded, singleHorizontalBorderAdded, cell.ColumnIndex == 0, cell.RowIndex == 0);
DataGridView.OnCellFormattingInternal (new DataGridViewCellFormattingEventArgs (cell.ColumnIndex, cell.RowIndex, value, cell.FormattedValueType, style));
@@ -614,7 +618,7 @@ namespace System.Windows.Forms
{
base.SetDataGridView(dataGridView);
headerCell.SetDataGridView(dataGridView);
foreach (DataGridViewCell cell in cells)
foreach (DataGridViewCell cell in Cells)
cell.SetDataGridView (dataGridView);
}

View File

@@ -211,17 +211,30 @@ namespace System.Windows.Forms {
flags |= AlignmentToFlags (cellStyle.Alignment);
Rectangle contentbounds = cellBounds;
contentbounds.Height -= 2;
contentbounds.Width -= 2;
// If we are top aligned, give ourselves some padding from the top
if (((int)cellStyle.Alignment & 7) > 0) {
contentbounds.Offset (0, 2);
contentbounds.Height -= 2;
//Border widths
Rectangle borderWidths = BorderWidths(advancedBorderStyle);
contentbounds.Offset(borderWidths.X, borderWidths.Y);
contentbounds.Width -= borderWidths.Right;
contentbounds.Height -= borderWidths.Bottom;
//Padding
if (cellStyle.Padding != Padding.Empty)
{
contentbounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
contentbounds.Width -= cellStyle.Padding.Horizontal;
contentbounds.Height -= cellStyle.Padding.Vertical;
}
if (formattedValue != null)
const int textTopAdditionalPadding = 1;
const int textBottomAdditionalPadding = 2;
const int textLeftAdditionalPadding = 0;
const int textRightAdditionalPadding = 2;
contentbounds.Offset (textLeftAdditionalPadding, textTopAdditionalPadding);
contentbounds.Width -= textLeftAdditionalPadding + textRightAdditionalPadding;
contentbounds.Height -= textTopAdditionalPadding + textBottomAdditionalPadding;
if (formattedValue != null && contentbounds.Width > 0 && contentbounds.Height > 0)
TextRenderer.DrawText (graphics, formattedValue.ToString (), cellStyle.Font, contentbounds, color, flags);
}

View File

@@ -1 +1 @@
d0223334e7d6018247664ecadbc0bb7d04241204
ef65c5b54b4bc8c52fb1c210031b3f1641bba8d9

View File

@@ -1029,11 +1029,15 @@ namespace System.Windows.Forms {
// Handle arrow keys
protected override bool IsInputKey (Keys keyData) {
switch (keyData) {
switch (keyData & ~Keys.Shift) {
case Keys.Up:
case Keys.Down:
case Keys.Right:
case Keys.Left:
case Keys.PageUp:
case Keys.PageDown:
case Keys.Home:
case Keys.End:
return true;
default:
break;
@@ -1299,15 +1303,23 @@ namespace System.Windows.Forms {
internal DateTime CurrentMonth {
set {
// only interested in if the month (not actual date) has change
if (value < MinDate || value > MaxDate) {
if (value < new DateTime(MinDate.Year, MinDate.Month, 1) || value > MaxDate) {
return;
}
if (value.Month != current_month.Month ||
value.Year != current_month.Year) {
this.SelectionRange = new SelectionRange(
this.SelectionStart.Add(value.Subtract(current_month)),
this.SelectionEnd.Add(value.Subtract(current_month)));
DateTime start = this.SelectionStart.Add(value.Subtract(current_month));
if (start < MinDate)
start = MinDate;
else if (start > MaxDate)
start = MaxDate;
DateTime end = this.SelectionEnd.Add (value.Subtract (current_month));
if (end < MinDate)
end = MinDate;
else if (end > MaxDate)
end = MaxDate;
this.SelectionRange = new SelectionRange (start, end);
current_month = value;
UpdateBoldedDates();
this.Invalidate();
@@ -1574,6 +1586,12 @@ namespace System.Windows.Forms {
}
}
// validate range
if (range.Start < MinDate)
range.Start = MinDate;
if (range.End > MaxDate)
range.End = MaxDate;
// Avoid re-setting SelectionRange to the same value and fire an extra DateChanged event
if (range.Start != selection_range.Start || range.End != selection_range.End)
SelectionRange = range;
@@ -1581,6 +1599,8 @@ namespace System.Windows.Forms {
// attempts to add the date to the selection without throwing exception
private void SelectDate (DateTime date) {
if (date < MinDate || date > MaxDate)
return;
// try and add the new date to the selction range
SelectionRange range = null;
if (is_shift_pressed || (click_state [0])) {
@@ -1594,14 +1614,12 @@ namespace System.Windows.Forms {
}
}
} else {
if (date >= MinDate && date <= MaxDate) {
range = new SelectionRange (date, date);
first_select_start_date = date;
}
range = new SelectionRange (date, date);
first_select_start_date = date;
}
// Only set if we re actually getting a different range (avoid an extra DateChanged event)
if (range != null && range.Start != selection_range.Start || range.End != selection_range.End)
if (range.Start != selection_range.Start || range.End != selection_range.End)
SelectionRange = range;
}
@@ -1723,7 +1741,10 @@ namespace System.Windows.Forms {
// called when today context menu is clicked
private void TodayMenuItemClickHandler (object sender, EventArgs e)
{
this.SetSelectionRange (DateTime.Now.Date, DateTime.Now.Date);
DateTime date = DateTime.Now.Date;
if (date < MinDate || date > MaxDate)
return;
this.SetSelectionRange (date, date);
this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
}
@@ -2010,10 +2031,14 @@ namespace System.Windows.Forms {
ShowYearUpDown = true;
}
break;
case HitArea.TodayLink:
this.SetSelectionRange (DateTime.Now.Date, DateTime.Now.Date);
this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
case HitArea.TodayLink: {
DateTime date = DateTime.Now.Date;
if (date >= MinDate && date <= MaxDate) {
this.SetSelectionRange (date, date);
this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
}
break;
}
default:
this.is_previous_clicked = false;
this.is_next_clicked = false;
@@ -2055,9 +2080,13 @@ namespace System.Windows.Forms {
if (date < first_select_start_date.AddDays ((MaxSelectionCount-1)*-1)) {
date = first_select_start_date.AddDays ((MaxSelectionCount-1)*-1);
}
if (date < MinDate)
date = MinDate;
this.SetSelectionRange (date, first_select_start_date);
} else {
DateTime date = GetFirstDateInMonth (this.SelectionStart);
if (date < MinDate)
date = MinDate;
this.SetSelectionRange (date, date);
}
e.Handled = true;
@@ -2069,9 +2098,13 @@ namespace System.Windows.Forms {
if (date > first_select_start_date.AddDays (MaxSelectionCount-1)) {
date = first_select_start_date.AddDays (MaxSelectionCount-1);
}
if (date > MaxDate)
date = MaxDate;
this.SetSelectionRange (date, first_select_start_date);
} else {
DateTime date = GetLastDateInMonth (this.SelectionStart);
if (date > MaxDate)
date = MaxDate;
this.SetSelectionRange (date, date);
}
e.Handled = true;
@@ -2082,6 +2115,8 @@ namespace System.Windows.Forms {
this.AddTimeToSelection (-1, false);
} else {
DateTime date = this.SelectionStart.AddMonths (-1);
if (date < MinDate)
date = MinDate;
this.SetSelectionRange (date, date);
}
e.Handled = true;
@@ -2092,6 +2127,8 @@ namespace System.Windows.Forms {
this.AddTimeToSelection (1, false);
} else {
DateTime date = this.SelectionStart.AddMonths (1);
if (date > MaxDate)
date = MaxDate;
this.SetSelectionRange (date, date);
}
e.Handled = true;
@@ -2102,6 +2139,8 @@ namespace System.Windows.Forms {
this.AddTimeToSelection (-7, true);
} else {
DateTime date = this.SelectionStart.AddDays (-7);
if (date < MinDate)
date = MinDate;
this.SetSelectionRange (date, date);
}
e.Handled = true;
@@ -2112,6 +2151,8 @@ namespace System.Windows.Forms {
this.AddTimeToSelection (7, true);
} else {
DateTime date = this.SelectionStart.AddDays (7);
if (date > MaxDate)
date = MaxDate;
this.SetSelectionRange (date, date);
}
e.Handled = true;
@@ -2122,7 +2163,8 @@ namespace System.Windows.Forms {
this.AddTimeToSelection (-1, true);
} else {
DateTime date = this.SelectionStart.AddDays (-1);
this.SetSelectionRange (date, date);
if (date >= MinDate)
this.SetSelectionRange (date, date);
}
e.Handled = true;
break;
@@ -2132,7 +2174,8 @@ namespace System.Windows.Forms {
this.AddTimeToSelection (1, true);
} else {
DateTime date = this.SelectionStart.AddDays (1);
this.SetSelectionRange (date, date);
if (date <= MaxDate)
this.SetSelectionRange (date, date);
}
e.Handled = true;
break;

View File

@@ -38,12 +38,12 @@ namespace System.Windows.Forms {
{
form.SuspendLayout ();
form.Text = "Open";
form.Text = Locale.GetText("Open");
CheckFileExists = true;
OpenSaveButtonText = "Open";
SearchSaveLabel = "Look in:";
OpenSaveButtonText = Locale.GetText("Open");
SearchSaveLabel = Locale.GetText("Look in:");
fileDialogType = FileDialogType.OpenFileDialog;
form.ResumeLayout (false);
@@ -139,7 +139,7 @@ namespace System.Windows.Forms {
get {
string title = base.DialogTitle;
if (title.Length == 0)
title = "Open";
title = Locale.GetText("Open");
return title;
}
}

View File

@@ -39,11 +39,11 @@ namespace System.Windows.Forms {
{
form.SuspendLayout ();
form.Text = "Save As";
form.Text = Locale.GetText("Save As");
FileTypeLabel = "Save as type:";
OpenSaveButtonText = "Save";
SearchSaveLabel = "Save in:";
FileTypeLabel = Locale.GetText("Save as type:");
OpenSaveButtonText = Locale.GetText("Save");
SearchSaveLabel = Locale.GetText("Save in:");
fileDialogType = FileDialogType.SaveFileDialog;
form.ResumeLayout (false);
@@ -103,7 +103,7 @@ namespace System.Windows.Forms {
get {
string title = base.DialogTitle;
if (title.Length == 0)
title = "Save As";
title = Locale.GetText("Save As");
return title;
}
}

View File

@@ -450,6 +450,7 @@ namespace System.Windows.Forms {
document.PasswordChar = PasswordChar.ToString ();
else
document.PasswordChar = string.Empty;
this.CalculateDocument();
Invalidate ();
}
}
@@ -504,6 +505,7 @@ namespace System.Windows.Forms {
document.PasswordChar = string.Empty;
}
this.CalculateDocument();
Invalidate();
}
}
}