//-/////////////////////////////////////////////////////////////////////// //-/////////////////////////////////////////////////////////////////////// public static void SetBadColour(params TextBox[] textBoxes) { double h, s, v; Misc.ColorToHSV(TextBox.DefaultBackColor, out h, out s, out v); h = 0;//red s = 0.25; SetTextBoxesColour(textBoxes, Misc.ColorFromHSV(h, s, v)); }
private void ArrangeControls() { // update Y coordinates and add labels appropriately int y = 0; int labelsW = 0; double h, s, v; Misc.ColorToHSV(Control.DefaultBackColor, out h, out s, out v); // "v-0.1" is highly unscientific Color[] colours = { Control.DefaultBackColor, Misc.ColorFromHSV(h, s, Math.Max(v - 0.1, 0.0)) }; int colourIdx = 0; foreach (Tweakable t in _tweakables) { labelsW = Math.Max(labelsW, t.Label.PreferredWidth); t.Label.Top = y; t.Label.Height = t.TweakControl.Height; t.Label.BackColor = colours[colourIdx]; t.Label.TextAlign = ContentAlignment.MiddleLeft; t.TweakControl.Top = y; t.TweakControl.BackColor = colours[colourIdx]; //t.TweakControl.SetValue(t.Attr.GetValue()); y += t.TweakControl.Height; colourIdx ^= 1; } // expand panels and splitter panel. _leftPanel.Height = y; _rightPanel.Height = y; _splitContainer.Height = y; // set split position _splitContainer.SplitterDistance = labelsW + 10; }