Beispiel #1
0
 public ToolBar(Resco.Controls.CommonControls.TabControl aParent)
 {
     if (aParent == null)
     {
         throw new UnauthorizedAccessException("Error: This control is a part of the TabControl. Please use ToolbarControl in your application.");
     }
     base.Height = 0x1a;
     this.Dock = DockStyle.Top;
     this.m_ToolbarControl = new ToolbarControl();
     this.m_ToolbarControl.Height = 0x1a;
     this.m_ToolbarControl.Dock = DockStyle.Fill;
     this.m_ToolbarControl.SelectionChanged += new EventHandler(this.ToolbarControl_SelectionChanged);
     this.m_ToolbarControl.ItemEntered += new EventHandler(this.ToolbarControl_ItemEntered);
     base.Controls.Add(this.m_ToolbarControl);
 }
Beispiel #2
0
 public ToolbarConversion(ISite site, ToolbarControl.DesignTimeCallback _designTimeCallback)
 {
     this.m_htImageLists = new Hashtable();
     this.m_site = site;
     this.m_DesignTimeCallback = _designTimeCallback;
 }
Beispiel #3
0
 private void ReadImage(ToolbarControl aControl, XmlReader reader)
 {
     try
     {
         if (reader.Name == "Image")
         {
             Bitmap bitmap = ToolbarConversion.ImageFromString(reader["Data"]);
             this.m_Conversion.SetProperty(aControl, reader["Name"], bitmap);
         }
     }
     catch (Exception)
     {
     }
 }
Beispiel #4
0
 public static bool FillManaged(Graphics gr, Rectangle rc, Color startColor, Color endColor, FillDirection fillDirection)
 {
     if (fillDirection == FillDirection.Horizontal)
     {
         int num   = endColor.R - startColor.R;
         int num2  = endColor.G - startColor.G;
         int num3  = endColor.B - startColor.B;
         int width = rc.Width;
         int right = rc.Right;
         int top   = rc.Top;
         int num6  = rc.Bottom - 1;
         if (top == num6)
         {
             int num7 = 0;
             int left = rc.Left;
             while (num7 < width)
             {
                 int   red   = startColor.R + ((num7 * num) / width);
                 int   green = startColor.G + ((num7 * num2) / width);
                 int   blue  = startColor.B + ((num7 * num3) / width);
                 Color c     = Color.FromArgb(red, green, blue);
                 ToolbarControl.DrawPixel(gr, c, left, top);
                 left++;
                 num7++;
             }
         }
         else
         {
             int num12 = 0;
             int num13 = rc.Left;
             while (num12 < width)
             {
                 int   num14  = startColor.R + ((num12 * num) / width);
                 int   num15  = startColor.G + ((num12 * num2) / width);
                 int   num16  = startColor.B + ((num12 * num3) / width);
                 Color color2 = Color.FromArgb(num14, num15, num16);
                 gr.DrawLine(ToolbarControl.GetPen(color2), num13, top, num13, num6);
                 num13++;
                 num12++;
             }
         }
     }
     else if (fillDirection == FillDirection.Vertical)
     {
         int num17  = endColor.R - startColor.R;
         int num18  = endColor.G - startColor.G;
         int num19  = endColor.B - startColor.B;
         int height = rc.Height;
         int x      = rc.Left;
         int num22  = rc.Right - 1;
         int bottom = rc.Bottom;
         if (x == num22)
         {
             int num23 = 0;
             for (int i = rc.Top; num23 < height; i++)
             {
                 int   num25  = startColor.R + ((num23 * num17) / height);
                 int   num26  = startColor.G + ((num23 * num18) / height);
                 int   num27  = startColor.B + ((num23 * num19) / height);
                 Color color3 = Color.FromArgb(num25, num26, num27);
                 ToolbarControl.DrawPixel(gr, color3, x, i);
                 num23++;
             }
         }
         else
         {
             int num28 = 0;
             for (int j = rc.Top; num28 < height; j++)
             {
                 int   num30  = startColor.R + ((num28 * num17) / height);
                 int   num31  = startColor.G + ((num28 * num18) / height);
                 int   num32  = startColor.B + ((num28 * num19) / height);
                 Color color4 = Color.FromArgb(num30, num31, num32);
                 gr.DrawLine(ToolbarControl.GetPen(color4), x, j, num22, j);
                 num28++;
             }
         }
     }
     return(true);
 }