[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnetlib/System.Windows.Forms ColorDialog.cs, 1.1,
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnetlib/System.Windows.Forms ColorDialog.cs, 1.1, 1.2 ListBox.cs, 1.6, 1.7 ScrollBar.cs, 1.7, 1.8 TextBox.cs, 1.14, 1.15 |
Date: |
Mon, 29 Sep 2003 03:56:41 +0000 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv28227/System.Windows.Forms
Modified Files:
ColorDialog.cs ListBox.cs ScrollBar.cs TextBox.cs
Log Message:
More fixes for build profiles, particularly those lacking floating point.
Index: ScrollBar.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ScrollBar.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ScrollBar.cs 28 Sep 2003 21:55:00 -0000 1.7
--- ScrollBar.cs 29 Sep 2003 03:56:39 -0000 1.8
***************
*** 55,58 ****
--- 55,82 ----
private MouseEventArgs idleMouse;
+ // Helpers, to replace the missing "Math" class in some profiles.
+ private static int Math_Max(int a, int b)
+ {
+ if(a > b)
+ {
+ return a;
+ }
+ else
+ {
+ return b;
+ }
+ }
+ private static int Math_Min(int a, int b)
+ {
+ if(a < b)
+ {
+ return a;
+ }
+ else
+ {
+ return b;
+ }
+ }
+
// Constructors
public ScrollBar() : base()
***************
*** 483,487 ****
percentage = (double) zeroVal / zeroMax;
thumbPos = (int)( percentage * trackHeight );
! thumbPos = Math.Min(thumbPos, trackHeight - thumbHeight);
this.bar = new Rectangle(0, s.Width + thumbPos,
s.Width, thumbHeight);
--- 507,511 ----
percentage = (double) zeroVal / zeroMax;
thumbPos = (int)( percentage * trackHeight );
! thumbPos = Math_Min(thumbPos, trackHeight - thumbHeight);
this.bar = new Rectangle(0, s.Width + thumbPos,
s.Width, thumbHeight);
***************
*** 1005,1010 ****
}
! value = Math.Max(minimum, value);
! value = Math.Min(maximum, value);
}
private static Rectangle SwapRectValues(Rectangle rect)
--- 1029,1034 ----
}
! value = Math_Max(minimum, value);
! value = Math_Min(maximum, value);
}
private static Rectangle SwapRectValues(Rectangle rect)
Index: ListBox.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ListBox.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ListBox.cs 29 Sep 2003 00:23:49 -0000 1.6
--- ListBox.cs 29 Sep 2003 03:56:39 -0000 1.7
***************
*** 34,37 ****
--- 34,61 ----
public class ListBox : ListControl
{
+ // Helpers, to replace the missing "Math" class in some profiles.
+ private static int Math_Max(int a, int b)
+ {
+ if(a > b)
+ {
+ return a;
+ }
+ else
+ {
+ return b;
+ }
+ }
+ private static int Math_Min(int a, int b)
+ {
+ if(a < b)
+ {
+ return a;
+ }
+ else
+ {
+ return b;
+ }
+ }
+
public class ObjectCollection : IList
{
***************
*** 115,119 ****
List[index] = value;
! this.maxWidth = Math.Max(this.maxWidth,
TextWidth(value));
this.owner.CalculateScrollbars();
--- 139,143 ----
List[index] = value;
! this.maxWidth = Math_Max(this.maxWidth,
TextWidth(value));
this.owner.CalculateScrollbars();
***************
*** 140,144 ****
List[index] = value;
! this.maxWidth = Math.Max(this.maxWidth,
TextWidth(value));
this.owner.CalculateScrollbars();
--- 164,168 ----
List[index] = value;
! this.maxWidth = Math_Max(this.maxWidth,
TextWidth(value));
this.owner.CalculateScrollbars();
***************
*** 164,168 ****
result = List.Add(value);
! this.maxWidth = Math.Max(this.maxWidth,
TextWidth(value));
this.owner.CalculateScrollbars();
--- 188,192 ----
result = List.Add(value);
! this.maxWidth = Math_Max(this.maxWidth,
TextWidth(value));
this.owner.CalculateScrollbars();
***************
*** 180,184 ****
foreach(object value in items)
! this.maxWidth = Math.Max(this.maxWidth,
TextWidth(value));
if(this.owner.Sorted)
--- 204,208 ----
foreach(object value in items)
! this.maxWidth = Math_Max(this.maxWidth,
TextWidth(value));
if(this.owner.Sorted)
***************
*** 208,212 ****
public void Insert(int index, Object value)
{
! this.maxWidth = Math.Max(this.maxWidth,
TextWidth(value));
if(this.owner.Sorted)
--- 232,236 ----
public void Insert(int index, Object value)
{
! this.maxWidth = Math_Max(this.maxWidth,
TextWidth(value));
if(this.owner.Sorted)
***************
*** 1439,1443 ****
// the longest string, unfortunately.
foreach(object value in (IList) base.dataSource)
! maxWidth = Math.Max(maxWidth, (int)
this.nonClientGraphics.MeasureString(value.ToString(), this.Font).Width);
}
--- 1463,1467 ----
// the longest string, unfortunately.
foreach(object value in (IList) base.dataSource)
! maxWidth = Math_Max(maxWidth, (int)
this.nonClientGraphics.MeasureString(value.ToString(), this.Font).Width);
}
***************
*** 2076,2080 ****
int row = this.FocusedItem -
this.NumItemsPerColumn * col;
col--;
! this.FocusedItem = Math.Max(row,
row + col *
this.NumItemsPerColumn);
}
--- 2100,2104 ----
int row = this.FocusedItem -
this.NumItemsPerColumn * col;
col--;
! this.FocusedItem = Math_Max(row,
row + col *
this.NumItemsPerColumn);
}
***************
*** 2097,2101 ****
if(col < this.NumDataColumns)
{
! this.FocusedItem =
Math.Min(maxInd,
row + col *
this.NumItemsPerColumn);
}
--- 2121,2125 ----
if(col < this.NumDataColumns)
{
! this.FocusedItem =
Math_Min(maxInd,
row + col *
this.NumItemsPerColumn);
}
***************
*** 2111,2115 ****
case Keys.PageUp:
! this.FocusedItem = Math.Max(
0,
this.FocusedItem -
this.NumItemsVisible);
--- 2135,2139 ----
case Keys.PageUp:
! this.FocusedItem = Math_Max(
0,
this.FocusedItem -
this.NumItemsVisible);
***************
*** 2122,2126 ****
case Keys.PageDown:
! this.FocusedItem = Math.Min(
maxInd,
this.FocusedItem +
this.NumItemsVisible);
--- 2146,2150 ----
case Keys.PageDown:
! this.FocusedItem = Math_Min(
maxInd,
this.FocusedItem +
this.NumItemsVisible);
Index: TextBox.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/TextBox.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** TextBox.cs 27 Sep 2003 01:53:24 -0000 1.14
--- TextBox.cs 29 Sep 2003 03:56:39 -0000 1.15
***************
*** 67,70 ****
--- 67,105 ----
private int chosenHeight;
+ // Helpers, to replace the missing "Math" class in some profiles.
+ private static int Math_Max(int a, int b)
+ {
+ if(a > b)
+ {
+ return a;
+ }
+ else
+ {
+ return b;
+ }
+ }
+ private static int Math_Min(int a, int b)
+ {
+ if(a < b)
+ {
+ return a;
+ }
+ else
+ {
+ return b;
+ }
+ }
+ private static int Math_Abs(int a)
+ {
+ if(a < 0)
+ {
+ return -a;
+ }
+ else
+ {
+ return a;
+ }
+ }
+
public TextBox()
{
***************
*** 783,787 ****
{
Region update = new Region(RectangleF.Empty);
! for (int i=0;i < Math.Max(oldText.Length,
text.Length);i++)
{
if (i >= oldText.Length)
--- 818,822 ----
{
Region update = new Region(RectangleF.Empty);
! for (int i=0;i < Math_Max(oldText.Length,
text.Length);i++)
{
if (i >= oldText.Length)
***************
*** 804,808 ****
internal override int GetSelectionLength()
{
! return Math.Abs(selectionLengthActual);
}
--- 839,843 ----
internal override int GetSelectionLength()
{
! return Math_Abs(selectionLengthActual);
}
***************
*** 811,815 ****
internal override int GetSelectionStart()
{
! return Math.Min(selectionStartActual, selectionStartActual +
selectionLengthActual);
}
--- 846,850 ----
internal override int GetSelectionStart()
{
! return Math_Min(selectionStartActual, selectionStartActual +
selectionLengthActual);
}
***************
*** 941,945 ****
{
xViewOffset -= widthText -
layout.Items[layout.Items.Length - 1].bounds.Right;
! xViewOffset =
Math.Max(xViewOffset, maxXY/2 - ClientSize.Width/2);
UpdateClientArea();
}
--- 976,980 ----
{
xViewOffset -= widthText -
layout.Items[layout.Items.Length - 1].bounds.Right;
! xViewOffset =
Math_Max(xViewOffset, maxXY/2 - ClientSize.Width/2);
UpdateClientArea();
}
***************
*** 947,951 ****
{
xViewOffset -= widthText -
layout.Items[layout.Items.Length - 1].bounds.Right;
! xViewOffset =
Math.Max(xViewOffset, 0);
UpdateClientArea();
}
--- 982,986 ----
{
xViewOffset -= widthText -
layout.Items[layout.Items.Length - 1].bounds.Right;
! xViewOffset =
Math_Max(xViewOffset, 0);
UpdateClientArea();
}
Index: ColorDialog.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ColorDialog.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ColorDialog.cs 28 Sep 2003 22:03:07 -0000 1.1
--- ColorDialog.cs 29 Sep 2003 03:56:39 -0000 1.2
***************
*** 85,89 ****
int i = 0;
if (value != null)
! i = Math.Min(value.Length, 16);
if (i > 0)
Array.Copy(value, 0, customColors, 0,
i);
--- 85,98 ----
int i = 0;
if (value != null)
! {
! if(value.Length < 16)
! {
! i = value.Length;
! }
! else
! {
! i = 16;
! }
! }
if (i > 0)
Array.Copy(value, 0, customColors, 0,
i);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnetlib/System.Windows.Forms ColorDialog.cs, 1.1, 1.2 ListBox.cs, 1.6, 1.7 ScrollBar.cs, 1.7, 1.8 TextBox.cs, 1.14, 1.15,
Rhys Weatherley <address@hidden> <=