protected internal override void Draw(int X, int Y) { Renderer.SetTexture(null); GumpPaint.DrawRaised3D(X, Y, this.m_Width, this.m_Height); Gump focus = Gumps.Focus; if ((focus == this) || ((focus != null) && focus.IsChildOf(this))) { Renderer.GradientRectLR(GumpColors.ActiveCaption, GumpColors.ActiveCaptionGradient, X + 4, Y + 4, this.Width - 8, 0x12); this.m_CaptionLabel.Hue = GumpHues.ActiveCaptionText; } else { Renderer.GradientRectLR(GumpColors.InactiveCaption, GumpColors.InactiveCaptionGradient, X + 4, Y + 4, this.Width - 8, 0x12); this.m_CaptionLabel.Hue = GumpHues.InactiveCaptionText; } }
protected internal override void Draw(int x, int y) { Renderer.SetTexture(null); int num = 0; switch (this.m_Style) { case WindowsButtonStyle.Normal: switch (this.m_State) { case 0: GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height); this.CaptionDown = false; goto Label_0143; case 1: GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height); this.CaptionDown = false; goto Label_0143; case 2: GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDark, GumpColors.Control); this.CaptionDown = true; num = 1; goto Label_0143; } break; case WindowsButtonStyle.Flat: switch (this.m_State) { case 0: GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.Control); this.CaptionDown = false; goto Label_0143; case 1: GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.ControlAlternate); this.CaptionDown = false; goto Label_0143; case 2: GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpPaint.Blend(GumpColors.ControlAlternate, GumpColors.ControlLightLight, 0x80)); this.CaptionDown = false; goto Label_0143; } break; } Label_0143: if (this.m_Image != null) { if (this.m_vCache == null) { this.m_vCache = new VertexCache(); } if (this.m_ImageColor == -1) { this.m_vCache.Draw(this.m_Image, ((num + x) + ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2)) - this.m_Image.xMin, ((num + y) + ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2)) - this.m_Image.yMin); } else { Renderer.SetAlphaEnable(true); Renderer.SetAlpha(1f); this.m_vCache.Draw(this.m_Image, ((num + x) + ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2)) - this.m_Image.xMin, ((num + y) + ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2)) - this.m_Image.yMin, this.m_ImageColor); Renderer.SetAlphaEnable(false); } } }
protected internal override unsafe void Draw(int X, int Y) { if (this.m_ScrollTexture == null) { this.m_ScrollTexture = new Texture(0x10, 0x10, true); LockData data = this.m_ScrollTexture.Lock(LockFlags.WriteOnly); ushort num = Engine.C32216(GumpColors.ControlLightLight); ushort num2 = Engine.C32216(GumpColors.ScrollBar); for (int i = 0; i < 0x10; i++) { ushort *numPtr = (ushort *)(data.pvSrc + (i * data.Pitch)); for (int j = 0; j < 0x10; j++) { if ((((i & 1) + j) & 1) == 0) { numPtr++; numPtr[0] = num; } else { numPtr++; numPtr[0] = num2; } } } this.m_ScrollTexture.Unlock(); } this.m_ScrollTexture.Draw(X, Y, this.Width, this.Height); int barHeight = this.GetBarHeight(); int num6 = Y + 0x10; int num7 = this.Height - 0x20; int position = base.GetPosition(num7 - barHeight); Renderer.SetTexture(null); if (this.m_State == State.LargeScrollUp) { if (position > 0) { Renderer.SetAlphaEnable(true); Renderer.SetAlpha(0.9f); Renderer.SolidRect(GumpColors.ControlDarkDark, X, Y + this.Width, this.Width, position); Renderer.SetAlphaEnable(false); int num9 = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)).Y - 0x10; if (position > num9) { base.Value -= base.LargeOffset; } else { this.m_State = State.Inactive; } } } else if ((this.m_State == State.LargeScrollDown) && (((num7 - position) - barHeight) > 0)) { Renderer.SetAlphaEnable(true); Renderer.SetAlpha(0.9f); Renderer.SolidRect(GumpColors.ControlDarkDark, X, (num6 + position) + barHeight, this.Width, (num7 - position) - barHeight); Renderer.SetAlphaEnable(false); int num10 = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)).Y - 0x10; if ((position + barHeight) < num10) { base.Value += base.LargeOffset; } else { this.m_State = State.Inactive; } } GumpPaint.DrawRaised3D(X, num6 + position, 0x10, barHeight); if (this.m_State == State.SmallScrollUp) { GumpPaint.DrawFlat(X, Y, this.Width, this.Width); Renderer.SetAlphaEnable(true); Renderer.SetAlpha(1f); Engine.m_WinScrolls[0].Draw(X + 5, Y + 7, GumpColors.ControlText); Renderer.SetAlphaEnable(false); base.Value -= base.SmallOffset; } else { GumpPaint.DrawRaised3D(X, Y, this.Width, this.Width); Renderer.SetAlphaEnable(true); Renderer.SetAlpha(1f); Engine.m_WinScrolls[0].Draw(X + 4, Y + 6, GumpColors.ControlText); Renderer.SetAlphaEnable(false); } Renderer.SetTexture(null); if (this.m_State == State.SmallScrollDown) { GumpPaint.DrawFlat(X, (Y + this.Height) - this.Width, this.Width, this.Width); Renderer.SetAlphaEnable(true); Renderer.SetAlpha(1f); Engine.m_WinScrolls[1].Draw(X + 5, ((Y + this.Height) - this.Width) + 7, GumpColors.ControlText); Renderer.SetAlphaEnable(false); base.Value += base.SmallOffset; } else { GumpPaint.DrawRaised3D(X, (Y + this.Height) - this.Width, this.Width, this.Width); Renderer.SetAlphaEnable(true); Renderer.SetAlpha(1f); Engine.m_WinScrolls[1].Draw(X + 4, ((Y + this.Height) - this.Width) + 6, GumpColors.ControlText); Renderer.SetAlphaEnable(false); } }