/// <summary> /// Initialize a new instance of the PaletteRedirectRibbonDouble class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabledBack">Redirection for back disabled state requests.</param> /// <param name="normalBack">Redirection for back normal state requests.</param> /// <param name="pressedBack">Redirection for back pressed state requests.</param> /// <param name="trackingBack">Redirection for back tracking state requests.</param> /// <param name="selectedBack">Redirection for selected states requests.</param> /// <param name="focusOverrideBack">Redirection for back focus override state requests.</param> /// <param name="disabledText">Redirection for text disabled state requests.</param> /// <param name="normalText">Redirection for text normal state requests.</param> /// <param name="pressedText">Redirection for text pressed state requests.</param> /// <param name="trackingText">Redirection for text tracking state requests.</param> /// <param name="selectedText">Redirection for text selected states requests.</param> /// <param name="focusOverrideText">Redirection for text focus override state requests.</param> public PaletteRedirectRibbonDouble(IPalette target, IPaletteRibbonBack disabledBack, IPaletteRibbonBack normalBack, IPaletteRibbonBack pressedBack, IPaletteRibbonBack trackingBack, IPaletteRibbonBack selectedBack, IPaletteRibbonBack focusOverrideBack, IPaletteRibbonText disabledText, IPaletteRibbonText normalText, IPaletteRibbonText pressedText, IPaletteRibbonText trackingText, IPaletteRibbonText selectedText, IPaletteRibbonText focusOverrideText ) : base(target) { // Remember state specific inheritance _disabledBack = disabledBack; _normalBack = normalBack; _pressedBack = pressedBack; _trackingBack = trackingBack; _selectedBack = selectedBack; _focusOverrideBack = focusOverrideBack; _disabledText = disabledText; _normalText = normalText; _pressedText = pressedText; _trackingText = trackingText; _selectedText = selectedText; _focusOverrideText = focusOverrideText; }
public static byte[] GetBytesForImage(byte[] pixels, int width, int height, IPalette palette) { int overhang = 0;// (4 - ((width * 4) % 4)); int stride = (width * 4) + overhang; byte[] imgData = new byte[stride * height]; int curPosition = 0; for (int i = 0; i < height; i++) { for (int x = 0; x < width; x++) { byte pixel = 0; int idx = width * i + x; if (idx < pixels.Length) pixel = pixels[idx]; if (pixel > 0) { byte[] rgb = palette.GetRGBBytesForPixel(pixel); imgData[curPosition] = rgb[2]; imgData[curPosition + 1] = rgb[1]; imgData[curPosition + 2] = rgb[0]; imgData[curPosition + 3] = 0xFF; } curPosition += 4; } curPosition += overhang; } return imgData; }
public static Brush CreatePaletteBrush(IPalette palette, int width = 256) { const double dpi = 96; WriteableBitmap bmp = new WriteableBitmap(width, 1, dpi, dpi, PixelFormats.Bgra32, null); int[] pixels = new int[width]; for (int i = 0; i < width; i++) { double ratio = i / ((double)width); Color color = palette.GetColor(ratio); int argb = color.ToArgb(); pixels[i] = argb; } bmp.WritePixels( new Int32Rect(0, 0, width, 1), pixels, bmp.BackBufferStride, 0); return new ImageBrush(bmp); }
public PaletteReference(string name, int index, IPalette palette, HardwarePalette hardwarePalette) { Name = name; Palette = palette; this.index = index; this.hardwarePalette = hardwarePalette; }
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, IPalette p) { var image = RenderSprites.GetImage(info); using (var s = GlobalFileSystem.OpenWithExts(image, tileset.Extensions)) { var shp = new ShpReader(s); var bitmap = RenderShp(shp, p); try { using (var s2 = GlobalFileSystem.OpenWithExts(image + "2", tileset.Extensions)) { var shp2 = new ShpReader(s2); var roofBitmap = RenderShp(shp2, p); using (var g = System.Drawing.Graphics.FromImage(bitmap)) g.DrawImage(roofBitmap, 0, 0); } } catch { } return new ActorTemplate { Bitmap = bitmap, Info = info, Appearance = info.Traits.GetOrDefault<EditorAppearanceInfo>() }; } }
/// <summary> /// Initialize a new instance of the PaletteBorderToPalette class. /// </summary> /// <param name="palette">Source for getting all values.</param> /// <param name="style">Style of values required.</param> public PaletteBorderToPalette(IPalette palette, PaletteBorderStyle style) { // Remember inheritance _palette = palette; _style = style; }
public StaticColorMaps(ObservableCollection<VisualizationDataSource> dataSources, Host host) { dataSources.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(dataSources_CollectionChanged); this.host = host; colorMapLayers = new List<ColorMapLayer>(); palette = new LinearPalette(); }
/// <summary> /// Initialize a new instance of the ContextMenuProvider class. /// </summary> /// <param name="viewManager">View manager used to organize keyboard events.</param> /// <param name="menuCollection">Top level set of menu items.</param> /// <param name="viewColumns">Stack used for adding new columns.</param> /// <param name="palette">Local palette setting to use initially.</param> /// <param name="paletteMode">Palette mode setting to use initially.</param> /// <param name="redirector">Redirector used for obtaining palette values.</param> /// <param name="needPaintDelegate">Delegate used to when paint changes occur.</param> public AppButtonMenuProvider(ViewContextMenuManager viewManager, KryptonContextMenuItemCollection menuCollection, ViewLayoutStack viewColumns, IPalette palette, PaletteMode paletteMode, PaletteRedirect redirector, NeedPaintHandler needPaintDelegate) { // Store incoming state _viewManager = viewManager; _menuCollection = menuCollection; _viewColumns = viewColumns; _palette = palette; _paletteMode = paletteMode; _redirector = redirector; _needPaintDelegate = needPaintDelegate; // Create all other state _parent = null; _enabled = true; _canCloseMenu = true; _showHorz = KryptonContextMenuPositionH.After; _showVert = KryptonContextMenuPositionV.Top; _stateCommon = new PaletteContextMenuRedirect(redirector, needPaintDelegate); _stateNormal = new PaletteContextMenuItemState(_stateCommon); _stateDisabled = new PaletteContextMenuItemState(_stateCommon); _stateHighlight = new PaletteContextMenuItemStateHighlight(_stateCommon); _stateChecked = new PaletteContextMenuItemStateChecked(_stateCommon); _redirectorImages = new PaletteRedirectContextMenu(redirector, new ContextMenuImages(needPaintDelegate)); }
/// <summary> /// Gets the button visible value. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button visibiliy.</returns> public override bool GetVisible(IPalette palette) { // We do not show if the custom chrome is combined with composition, // in which case the form buttons are handled by the composition if (KryptonForm.ApplyComposition && KryptonForm.ApplyCustomChrome) return false; // The minimize button is never present on tool windows switch (KryptonForm.FormBorderStyle) { case FormBorderStyle.FixedToolWindow: case FormBorderStyle.SizableToolWindow: return false; } // Have all buttons been turned off? if (!KryptonForm.ControlBox) return false; // Has the minimize/maximize buttons been turned off? if (!KryptonForm.MinimizeBox && !KryptonForm.MaximizeBox) return false; return true; }
/// <summary> /// Initialize a new instance of the PaletteRedirectTriple class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabled">Redirection for disabled state requests.</param> /// <param name="normal">Redirection for normal state requests.</param> /// <param name="tracking">Redirection for tracking state requests.</param> public PaletteRedirectTriple(IPalette target, IPaletteTriple disabled, IPaletteTriple normal, IPaletteTriple tracking) : this(target, disabled, normal, null, tracking, null, null, null, null, null) { }
/// <summary> /// Initialize a new instance of the PaletteRedirectBreadCrumb class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteRedirectBreadCrumb(IPalette target) : base(target) { _left = false; _right = false; _topBottom = true; }
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, TileSet tileset, IPalette p) { var image = ResolveFilename(info.EditorSprite, tileset); using (var s = GlobalFileSystem.Open(image)) { // TODO: Do this properly var shp = new ShpTDSprite(s); var frame = shp.Frames.Last(); var bitmap = new Bitmap(frame.Size.Width, frame.Size.Height, PixelFormat.Format8bppIndexed); bitmap.Palette = p.AsSystemPalette(); var data = bitmap.LockBits(bitmap.Bounds(), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed); unsafe { var q = (byte*)data.Scan0.ToPointer(); var stride = data.Stride; for (var i = 0; i < frame.Size.Width; i++) for (var j = 0; j < frame.Size.Height; j++) q[j * stride + i] = frame.Data[i + frame.Size.Width * j]; } bitmap.UnlockBits(data); return new ResourceTemplate { Bitmap = bitmap, Info = info, Value = shp.Frames.Count - 1 }; } }
/// <summary> /// Initialize a new instance of the PaletteRedirectRibbonDouble class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteRedirectRibbonTabContent(IPalette target) : this(target, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null) { }
public PaletteImage8(uint Width, uint Height, IPalette Palette) { this.Width = Width; this.Height = Height; this.Palette = Palette; Data = new byte[Width * Height]; }
public MyUserControl() { // To remove flicker we use double buffering for drawing SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); // Cache the current global palette setting _palette = KryptonManager.CurrentGlobalPalette; // Hook into palette events if (_palette != null) _palette.PalettePaint += new EventHandler<PaletteLayoutEventArgs>(OnPalettePaint); // We want to be notified whenever the global palette changes KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); // Create redirection object to the base palette _paletteRedirect = new PaletteRedirect(_palette); // Create accessor objects for the back, border and content _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); }
/// <summary> /// Initialize a new instance of the PageToTooltipMapping class. /// </summary> /// <param name="palette">Palette for sourcing information.</param> /// <param name="buttonSpec">Source button spec instance.</param> public ButtonSpecToContent(IPalette palette, ButtonSpec buttonSpec) { Debug.Assert(palette != null); Debug.Assert(buttonSpec != null); _palette = palette; _buttonSpec = buttonSpec; }
/// <summary> /// Initialize a new instance of the PaletteRedirectDouble class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabled">Redirection for disabled state requests.</param> /// <param name="normal">Redirection for normal state requests.</param> /// <param name="pressed">Redirection for pressed state requests.</param> /// <param name="tracking">Redirection for tracking state requests.</param> public PaletteRedirectDouble(IPalette target, IPaletteDouble disabled, IPaletteDouble normal, IPaletteDouble pressed, IPaletteDouble tracking) : this(target, disabled, normal, pressed, tracking, null, null, null, null, null) { }
/// <summary> /// Initialize a new instance of the KryptonProfessionalCustomKCT class. /// </summary> /// <param name="headerColors">Set of header colors to customize with.</param> /// <param name="colorTableColors">Set of ColorTable colors to customize with.</param> /// <param name="useSystemColors">Should be forced to use system colors.</param> /// <param name="palette">Associated palette instance.</param> public KryptonProfessionalCustomKCT(Color[] headerColors, Color[] colorTableColors, bool useSystemColors, IPalette palette) : base(headerColors, useSystemColors, palette) { _colors = colorTableColors; }
/// <summary> /// Gets the button enabled state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button enabled state.</returns> public override ButtonEnabled GetEnabled(IPalette palette) { // Has the minimize buttons been turned off? if (!KryptonForm.MinimizeBox) return ButtonEnabled.False; return ButtonEnabled.True; }
/// <summary> /// Initialize a new instance of the PaletteRedirectContextMenu class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="images">Reference to source of context menu images.</param> public PaletteRedirectContextMenu(IPalette target, ContextMenuImages images) : base(target) { Debug.Assert(images != null); // Remember incoming target _images = images; }
/// <summary> /// Initialize a new instance of the PaletteRedirectCheckBox class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="images">Reference to source of check box images.</param> public PaletteRedirectCheckBox(IPalette target, CheckBoxImages images) : base(target) { Debug.Assert(images != null); // Remember incoming target _images = images; }
public IndexedColorRemap(IPalette basePalette, int[] ramp, int[] remap) { this.basePalette = basePalette; if (ramp.Length != remap.Length) throw new InvalidDataException("ramp and remap lengths do no match."); for (var i = 0; i < ramp.Length; i++) replacements[ramp[i]] = remap[i]; }
/// <summary> /// Initialize a new instance of the KryptonColorTable2010 class. /// </summary> /// <param name="colors">Source of </param> /// <param name="roundedEdges">Should have rounded edges.</param> /// <param name="palette">Associated palette instance.</param> public KryptonColorTable2010(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; _roundedEdges = roundedEdges; }
/// <summary> /// Initialize a new instance of the PaletteRedirectTripleMetric class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabled">Redirection for disabled state requests.</param> /// <param name="disableMetric">Redirection for disabled metric requests.</param> /// <param name="normal">Redirection for normal state requests.</param> /// <param name="normalMetric">Redirection for normal metric requests.</param> public PaletteRedirectTripleMetric(IPalette target, IPaletteTriple disabled, IPaletteMetric disableMetric, IPaletteTriple normal, IPaletteMetric normalMetric) : base(target, disabled, normal) { // Remember state specific inheritance _disabled = disableMetric; _normal = normalMetric; }
/// <summary> /// Initialize a new instance of the PaletteRedirectBorderEdge class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabled">Redirection for disabled state requests.</param> /// <param name="normal">Redirection for normal state requests.</param> public PaletteRedirectBorderEdge(IPalette target, PaletteBorderEdge disabled, PaletteBorderEdge normal) : base(target) { // Remember state specific inheritance _disabled = disabled; _normal = normal; }
/// <summary> /// Initialize a new instance of the KryptonProfessionalKCT class. /// </summary> /// <param name="colors">Set of colors to customize with.</param> /// <param name="useSystemColors">Should be forced to use system colors.</param> /// <param name="palette">Reference to associated palette.</param> public KryptonProfessionalKCT(Color[] colors, bool useSystemColors, IPalette palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; UseSystemColors = useSystemColors; }
/// <summary> /// Initialize a new instance of the PaletteRedirectDropDownButton class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="images">Reference to source of drop down button images.</param> public PaletteRedirectDropDownButton(IPalette target, DropDownButtonImages images) : base(target) { Debug.Assert(images != null); // Remember incoming target _images = images; }
/// <summary> /// Initialize a new instance of the PaletteTripleToPalette class. /// </summary> /// <param name="palette">Inheritence of values.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> public PaletteTripleToPalette(IPalette palette, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) { // Store the inherit instances _back = new PaletteBackToPalette(palette, backStyle); _border = new PaletteBorderToPalette(palette, borderStyle); _content = new PaletteContentToPalette(palette, contentStyle); }
public void ReplacePalette(string name, IPalette p) { if (modifiablePalettes.ContainsKey(name)) CopyPaletteToBuffer(indices[name], modifiablePalettes[name] = new MutablePalette(p)); else if (palettes.ContainsKey(name)) CopyPaletteToBuffer(indices[name], palettes[name] = new ImmutablePalette(p)); else throw new InvalidOperationException("Palette `{0}` does not exist".F(name)); Texture.SetData(buffer); }
public StaticIsolines(ObservableCollection<VisualizationDataSource> dataSources, Host host) { dataSources.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(dataSources_CollectionChanged); this.host = host; layers = new List<IsolinesLayer>(); palette = new LinearPalette(swm.Colors.Blue, swm.Colors.Green, swm.Colors.Red); runningIsoline = new RunningIsoline(null, host); host.Actors.Add(runningIsoline); }
/// <summary> /// Initialize a new instance of the PaletteRedirectButtonSpec class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="inherit">Redirection button spec requests.</param> public PaletteRedirectButtonSpec(IPalette target, IPaletteButtonSpec inherit) : base(target) { _inherit = inherit; }
public static void InitColors() { // add Palette Handler if (_palette != null) { _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint); } KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect = new PaletteRedirect(_palette); //Init Colors // hot state thumbColours[0, 0] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(96, 111, 148); // border color thumbColours[0, 1] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(232, 233, 233); // left/top start color thumbColours[0, 2] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(230, 233, 241); // left/top end color thumbColours[0, 3] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(233, 237, 242); // right/bottom line color thumbColours[0, 4] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(209, 218, 228); // right/bottom start color thumbColours[0, 5] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(218, 227, 235); // right/bottom end color thumbColours[0, 6] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(190, 202, 219); // right/bottom middle color thumbColours[0, 7] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(96, 11, 148); // left/top line color // over state thumbColours[1, 0] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(60, 110, 176); thumbColours[1, 1] = _palette.GetBackColor2(PaletteBackStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(187, 204, 228); thumbColours[1, 2] = _palette.GetBackColor1(PaletteBackStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(205, 227, 254); thumbColours[1, 3] = _palette.GetBackColor2(PaletteBackStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(252, 253, 255); thumbColours[1, 4] = _palette.GetBackColor1(PaletteBackStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(170, 207, 247); thumbColours[1, 5] = _palette.GetBackColor2(PaletteBackStyle.ButtonAlternate, PaletteState.Normal); //Color.FromArgb(219, 232, 251); thumbColours[1, 6] = _palette.GetBackColor2(PaletteBackStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(190, 202, 219); thumbColours[1, 7] = _palette.GetBackColor2(PaletteBackStyle.ButtonCluster, PaletteState.Normal); //Color.FromArgb(233, 233, 235); // pressed state thumbColours[2, 0] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(23, 73, 138); thumbColours[2, 1] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(154, 184, 225); thumbColours[2, 2] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); // Color.FromArgb(166, 202, 250); thumbColours[2, 3] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(221, 235, 251); thumbColours[2, 4] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(110, 166, 240); thumbColours[2, 5] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(194, 218, 248); thumbColours[2, 6] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(190, 202, 219); thumbColours[2, 7] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); //Color.FromArgb(194, 211, 231); /* picture of colors and indices *(0,0) * ----------------------------------------------- * | | * | |-----------------------------------------| | * | | (2) | | * | | |-------------------------------------| | | * | | | (0) | | | * | | | | | | * | | | | | | * | |3| (1) |3| | * | |6| (4) |6| | * | | | | | | * | | | (5) | | | * | | |-------------------------------------| | | * | | (12) | | * | |-----------------------------------------| | * | | * ----------------------------------------------- (15,17) */ // hot state arrowColours[0, 0] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(223, 236, 252); arrowColours[0, 1] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(207, 225, 248); arrowColours[0, 2] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(245, 249, 255); arrowColours[0, 3] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(237, 244, 252); arrowColours[0, 4] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(244, 249, 255); arrowColours[0, 5] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(244, 249, 255); arrowColours[0, 6] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(251, 253, 255); arrowColours[0, 7] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(251, 253, 255); // over state arrowColours[1, 0] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(205, 222, 243); //Colore bottone sul tracking arrowColours[1, 1] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(186, 208, 235); arrowColours[1, 2] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(238, 244, 252); arrowColours[1, 3] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(229, 237, 247); arrowColours[1, 4] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(223, 234, 247); arrowColours[1, 5] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(241, 246, 254); arrowColours[1, 6] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(243, 247, 252); arrowColours[1, 7] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(250, 252, 255); // pressed state arrowColours[2, 0] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(215, 220, 225); arrowColours[2, 1] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(195, 202, 210); arrowColours[2, 2] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(242, 244, 245); arrowColours[2, 3] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(232, 235, 238); arrowColours[2, 4] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(226, 228, 230); arrowColours[2, 5] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(230, 233, 236); arrowColours[2, 6] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(244, 245, 245); arrowColours[2, 7] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); //Color.FromArgb(245, 247, 248); // background colors backgroundColours[0] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(235, 237, 239); backgroundColours[1] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(252, 252, 252); backgroundColours[2] = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(247, 247, 247); backgroundColours[3] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(238, 238, 238); backgroundColours[4] = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(240, 240, 240); // track colors trackColours[0] = _palette.ColorTable.StatusStripGradientEnd; //Color.FromArgb(204, 204, 204); trackColours[1] = _palette.ColorTable.StatusStripGradientBegin; //Color.FromArgb(220, 220, 220); // arrow border colors arrowBorderColours[0] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(135, 146, 160); arrowBorderColours[1] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(140, 151, 165); arrowBorderColours[2] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(128, 139, 153); arrowBorderColours[3] = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.Normal); //Color.FromArgb(99, 110, 125); //Border colors borderColours[0] = _palette.GetBorderColor1(PaletteBorderStyle.InputControlCustom1, PaletteState.Normal); borderColours[1] = _palette.GetBorderColor1(PaletteBorderStyle.InputControlCustom1, PaletteState.Normal);; //Grip colors gripColours[0] = _palette.ColorTable.GripLight; gripColours[1] = _palette.ColorTable.GripDark; }
/// <summary> /// Gets the button enabled state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button enabled state.</returns> public override ButtonEnabled GetEnabled(IPalette palette) { // Has the minimize buttons been turned off? return(!KryptonForm.MinimizeBox ? ButtonEnabled.False : ButtonEnabled.True); }
/// <summary> /// Initialize a new instance of the PaletteContentToPalette class. /// </summary> /// <param name="palette">Source for getting all values.</param> /// <param name="style">Style of values required.</param> public PaletteContentToPalette(IPalette palette, PaletteContentStyle style) { // Remember source palette _palette = palette; ContentStyle = style; }
/// <summary> /// Gets the button checked state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button checked state.</returns> public override ButtonCheckState GetChecked(IPalette palette) => ButtonCheckState.Unchecked;
public IndexColorConverter(IIndexCalculator indexCalculator, IPalette palette) { _indexCalculator = indexCalculator; _palette = palette; }
/// <summary> /// Gets the button checked state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button checked state.</returns> public override ButtonCheckState GetChecked(IPalette palette) { return(ButtonCheckState.Unchecked); }
public TransparentLimitsPalette(IPalette palette) : base(palette) { }
/// <summary> /// Gets the button checked state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button checked state.</returns> public override ButtonCheckState GetChecked(IPalette palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton;
/// <summary> /// Initialize a new instance of the PaletteRedirectRibbonBack class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteRedirectRibbonBack(IPalette target) : this(target, null, null, null, null, null, null) { }
/// <summary> /// Gets the button visible value. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button visibility.</returns> public override bool GetVisible(IPalette palette) => Visible;
/// <summary> /// Initialize a new instance of the PaletteRedirectRibbonBack class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabledBack">Redirection for back disabled state requests.</param> /// <param name="normalBack">Redirection for back normal state requests.</param> public PaletteRedirectRibbonBack(IPalette target, IPaletteRibbonBack disabledBack, IPaletteRibbonBack normalBack) : this(target, disabledBack, normalBack, null, null, null, null) { }
/// <summary> /// Gets the button checked state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button checked state.</returns> public override ButtonCheckState GetChecked(IPalette palette) { // Previous button is never shown as checked return(ButtonCheckState.NotCheckButton); }
/// <summary> /// Initialize a new instance of the ButtonSpecRemapByContentCache class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="buttonSpec">Reference to button specification.</param> public ButtonSpecRemapByContentCache(IPalette target, ButtonSpec buttonSpec) : base(target, buttonSpec) { }
public override void ReloadPalette() { base.ReloadPalette(); _palette = KryptonManager.CurrentGlobalPalette; if (_palette != null) { HeaderA = _palette.GetBackColor2(PaletteBackStyle.HeaderForm, PaletteState.Normal); HeaderB = _palette.GetBackColor1(PaletteBackStyle.HeaderForm, PaletteState.Normal); TodayA = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); TodayB = _palette.GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.CheckedNormal); HeaderBackColourAngle = _palette.GetBackColorAngle(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); ColourTable.Background = _palette.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal); ColourTable.DayBackgroundOdd = _palette.GetBackColor1(PaletteBackStyle.TabOneNote, PaletteState.Normal); ColourTable.DayBackgroundEven = _palette.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Disabled); ColourTable.DayBackgroundSelected = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Tracking); ColourTable.DayBorder = _palette.GetBorderColor1(PaletteBorderStyle.GridDataCellSheet, PaletteState.Normal); ColourTable.DayHeaderBackground = _palette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); ColourTable.DayHeaderText = _palette.GetContentShortTextColor2(PaletteContentStyle.HeaderForm, PaletteState.Normal); ColourTable.DayHeaderSecondaryText = _palette.GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal); ColourTable.DayTopBorder = ColourTable.DayBorder; ColourTable.DayTopSelectedBorder = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.CheckedPressed); ColourTable.DayTopBackground = _palette.GetBackColor1(PaletteBackStyle.InputControlStandalone, PaletteState.Normal); ColourTable.DayTopSelectedBackground = _palette.GetBackColor2(PaletteBackStyle.InputControlStandalone, PaletteState.Tracking); ColourTable.ItemBorder = _palette.GetBorderColor2(PaletteBorderStyle.InputControlStandalone, PaletteState.Normal); ColourTable.ItemBackground = _palette.GetBackColor2(PaletteBackStyle.InputControlStandalone, PaletteState.Normal); ColourTable.ItemText = _palette.GetContentShortTextColor1(PaletteContentStyle.InputControlStandalone, PaletteState.Normal); ColourTable.ItemShadow = Color.LightGray; ColourTable.ItemSecondaryText = Color.Red; //palette.GetContentShortTextColor1(PaletteBackStyle.InputControlRibbon, PaletteState.Normal) ColourTable.ItemSelectedBorder = _palette.GetBorderColor1(PaletteBorderStyle.InputControlRibbon, PaletteState.Tracking); ColourTable.ItemSelectedBackground = _palette.GetBackColor1(PaletteBackStyle.InputControlRibbon, PaletteState.Tracking); ColourTable.ItemSelectedText = _palette.GetContentShortTextColor1(PaletteContentStyle.InputControlRibbon, PaletteState.Normal); ColourTable.WeekHeaderBackground = Color.Transparent; //palette.GetBorderColor1(PaletteBackStyle.InputControlRibbon, PaletteState.Pressed) ColourTable.WeekHeaderBorder = Color.Transparent; //palette.GetBackColor1(PaletteBackStyle.InputControlRibbon, PaletteState.Normal) ColourTable.WeekHeaderText = _palette.GetContentShortTextColor1(PaletteContentStyle.HeaderForm, PaletteState.Normal); ColourTable.WeekDayName = _palette.GetContentShortTextColor1(PaletteContentStyle.HeaderForm, PaletteState.Normal); ColourTable.TodayBorder = _palette.GetBorderColor1(PaletteBorderStyle.ButtonStandalone, PaletteState.CheckedTracking); //ColourTable.TodayTopBackground = Color.Red ColourTable.TimeScaleLine = _palette.GetBorderColor1(PaletteBorderStyle.HeaderPrimary, PaletteState.Normal); ColourTable.TimeScaleHours = _palette.GetContentShortTextColor1(PaletteContentStyle.HeaderPrimary, PaletteState.Normal); //palette.GetBorderColor2(PaletteBorderStyle.GridDataCellSheet, PaletteState.Normal) ColourTable.TimeScaleMinutes = _palette.GetContentShortTextColor1(PaletteContentStyle.HeaderPrimary, PaletteState.Normal); ColourTable.TimeUnitBackground = _palette.GetBackColor1(PaletteBackStyle.InputControlStandalone, PaletteState.Disabled); ColourTable.TimeUnitHighlightedBackground = _palette.GetBackColor1(PaletteBackStyle.InputControlStandalone, PaletteState.Normal); ColourTable.TimeUnitSelectedBackground = _palette.GetBackColor1(PaletteBackStyle.ButtonButtonSpec, PaletteState.Tracking); ColourTable.TimeUnitBorderLight = _palette.GetBorderColor2(PaletteBorderStyle.GridDataCellSheet, PaletteState.Normal); ColourTable.TimeUnitBorderDark = _palette.GetBorderColor1(PaletteBorderStyle.HeaderPrimary, PaletteState.Normal); ItemRoundness = _palette.GetBorderRounding(PaletteBorderStyle.ButtonStandalone, PaletteState.Normal); } }
/// <summary> /// Gets the button enabled state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button enabled state.</returns> public override ButtonEnabled GetEnabled(IPalette palette) { return(ButtonEnabled.True); }
/// <summary> /// Gets the button edge to position against. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Edge position.</returns> public override RelativeEdgeAlign GetEdge(IPalette palette) => _edge;
/// <summary> /// Gets the button edge to position against. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Edge position.</returns> public override RelativeEdgeAlign GetEdge(IPalette palette) { return(_edge); }
/// <summary> /// Gets the button enabled state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button enabled state.</returns> public override ButtonEnabled GetEnabled(IPalette palette) => Enabled ? ButtonEnabled.Container : ButtonEnabled.False;
/// <summary> /// Initialize a new instance of the ViewDrawCheckBox class. /// </summary> /// <param name="palette">Palette for source of drawing values.</param> public ViewDrawCheckBox(IPalette palette) { Debug.Assert(palette != null); _palette = palette; }
/// <summary> /// Initialize a new instance of the VisualPanel class. /// </summary> protected VisualPanel() { #region Default ControlStyle Values // Default style values for Control are:- // True - AllPaintingInWmPaint // False - CacheText // False - ContainerControl // False - EnableNotifyMessage // False - FixedHeight // False - FixedWidth // False - Opaque // False - OptimizedDoubleBuffer // False - ResizeRedraw // True - Selectable // True - StandardClick // True - StandardDoubleClick // False - SupportsTransparentBackColor // False - UserMouse // True - UserPaint // True - UseTextForAccessibility #endregion // We use double buffering to reduce drawing flicker SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); // We need to allow a transparent background SetStyle(ControlStyles.SupportsTransparentBackColor, true); // We need to repaint entire control whenever resized SetStyle(ControlStyles.ResizeRedraw, true); // We act as a container for child controls SetStyle(ControlStyles.ContainerControl, true); // Cannot select a panel SetStyle(ControlStyles.Selectable, false); // Yes, we want to be drawn double buffered by default DoubleBuffered = true; // Setup the invoke used to refresh display _refreshCall = new SimpleCall(OnPerformRefresh); // Setup the need paint delegate _needPaintDelegate = new NeedPaintHandler(OnNeedPaint); // Must layout before first draw attempt _layoutDirty = true; _evalTransparent = true; _lastLayoutSize = Size.Empty; // Set the palette to the defaults as specified by the manager _localPalette = null; SetPalette(KryptonManager.CurrentGlobalPalette); _paletteMode = PaletteMode.Global; // Create constant target for resolving palette delegates _redirector = new PaletteRedirect(_palette); AttachGlobalEvents(); }
/// <summary> /// Initialize a new instance of the PaletteRedirectRibbonGeneral class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteRedirectRibbonGeneral(IPalette target) : this(target, null, null, null, null) { }
/// <summary> /// Gets the button visible value. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button visibiliy.</returns> public override bool GetVisible(IPalette palette) { return(Visible); }
/// <summary> /// Initialize a new instance of the PaletteRedirectTripleMetric class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteRedirectTripleMetric(IPalette target) : this(target, null, null, null, null) { }
/// <summary> /// Initialize a new instance of the PaletteRedirectDouble class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteRedirectDouble(IPalette target) : this(target, null, null, null, null, null, null, null, null, null) { }
/// <summary> /// Initialize a new instance of the PaletteCaptionRedirect class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> public PaletteCaptionRedirect(IPalette target) : base(target) { }
private static XDesign_LayoutSite[] XDesign_LayoutSites(Node node, IPalette palette) { return(XDesign_LayoutSites(GetLayoutSites(node), palette)); }
/// <summary> /// Gets the button enabled state. /// </summary> /// <param name="palette">Palette to use for inheriting values.</param> /// <returns>Button enabled state.</returns> public override ButtonEnabled GetEnabled(IPalette palette) { return(Enabled ? ButtonEnabled.Container : ButtonEnabled.False); }
/// <summary> /// Initialize a new instance of the PaletteRedirectDouble class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="disabled">Redirection for disabled state requests.</param> /// <param name="normal">Redirection for normal state requests.</param> public PaletteRedirectDouble(IPalette target, IPaletteDouble disabled, IPaletteDouble normal) : this(target, disabled, normal, null, null, null, null, null, null, null) { }
private static XDesign_LayoutSite[] XDesign_LayoutSites(IEnumerable <LayoutSite> layoutSites, IPalette palette) { var result = new List <XDesign_LayoutSite>(); foreach (var layoutSite in layoutSites) { FabricStyle fabricStyle = null; if (layoutSite.Style != null) { fabricStyle = palette.GetFabricStyle(int.Parse(layoutSite.Style)); } result.Add(XDesign_LayoutSite(layoutSite, fabricStyle)); } return(result.ToArray()); }