public MainViewModel(Window window) { Sliders = new ObservableCollection <SliderViewModel>(); brightnessControl = new BrightnessControl(); InitializeSliders(); }
public static void ObjectSetup(GameObject go, VectorLine line, Visibility visibility, Brightness brightness) { if (visibility == Visibility.Dynamic) { VisibilityControl vc = go.AddComponent(typeof(VisibilityControl)) as VisibilityControl; vc.Setup(line); } else if (visibility == Visibility.Static) { VisibilityControlStatic vcs = go.AddComponent(typeof(VisibilityControlStatic)) as VisibilityControlStatic; vcs.Setup(line); } else if (visibility == Visibility.Always) { VisibilityControlAlways vca = go.AddComponent(typeof(VisibilityControlAlways)) as VisibilityControlAlways; vca.Setup(line); } if (brightness == Brightness.Fog) { BrightnessControl bc = go.AddComponent(typeof(BrightnessControl)) as BrightnessControl; bc.Setup(line); } if (visibility >= Visibility.NotControlled && brightness >= Brightness.Normal) { Debug.LogWarning("VectorManager: Nothing to do for " + line.vectorObject.name + " in ObjectSetup"); } }
public MainViewModel(Window window) { Sliders = new ObservableCollection <SliderViewModel>(); var wih = new WindowInteropHelper(window); brightnessControl = new BrightnessControl(wih.Handle); InitializeSliders(); }
public ColorDialog () : base() { form = new DialogForm (this); form.SuspendLayout (); form.Text = "Color"; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; satTextBox = new TextBox (); briTextBox = new TextBox (); blueTextBox = new TextBox (); greenTextBox = new TextBox (); redTextBox = new TextBox (); hueTextBox = new TextBox (); redLabel = new Label (); blueLabel = new Label (); greenLabel = new Label (); colorBaseLabel = new Label (); hueLabel = new Label (); satLabel = new Label (); briLabel = new Label (); okButton = new Button (); cancelButton = new Button (); form.CancelButton = cancelButton; helpButton = new Button (); defineColoursButton = new Button (); addColoursButton = new Button (); baseColorControl = new BaseColorControl (this); colorMatrixControl = new ColorMatrixControl (this); brightnessControl = new BrightnessControl (this); triangleControl = new TriangleControl (this); selectedColorPanel = new Panel (); // hueTextBox hueTextBox.Location = new Point (324, 203); hueTextBox.Size = new Size (27, 21); hueTextBox.TabIndex = 11; hueTextBox.MaxLength = 3; // satTextBox satTextBox.Location = new Point (324, 225); satTextBox.Size = new Size (27, 21); satTextBox.TabIndex = 15; satTextBox.MaxLength = 3; // greenTextBox greenTextBox.Location = new Point (404, 225); greenTextBox.Size = new Size (27, 21); greenTextBox.TabIndex = 18; greenTextBox.MaxLength = 3; // briTextBox briTextBox.Location = new Point (324, 247); briTextBox.Size = new Size (27, 21); briTextBox.TabIndex = 16; briTextBox.MaxLength = 3; // blueTextBox blueTextBox.Location = new Point (404, 247); blueTextBox.Size = new Size (27, 21); blueTextBox.TabIndex = 19; blueTextBox.MaxLength = 3; // redTextBox redTextBox.Location = new Point (404, 203); redTextBox.Size = new Size (27, 21); redTextBox.TabIndex = 17; redTextBox.MaxLength = 3; // redLabel redLabel.FlatStyle = FlatStyle.System; redLabel.Location = new Point (361, 206); redLabel.Size = new Size (40, 16); redLabel.TabIndex = 25; redLabel.Text = Locale.GetText ("Red") + ":"; redLabel.TextAlign = ContentAlignment.MiddleRight; // blueLabel blueLabel.FlatStyle = FlatStyle.System; blueLabel.Location = new Point (361, 250); blueLabel.Size = new Size (40, 16); blueLabel.TabIndex = 26; blueLabel.Text = Locale.GetText ("Blue") + ":"; blueLabel.TextAlign = ContentAlignment.MiddleRight; // greenLabel greenLabel.FlatStyle = FlatStyle.System; greenLabel.Location = new Point (361, 228); greenLabel.Size = new Size (40, 16); greenLabel.TabIndex = 27; greenLabel.Text = Locale.GetText ("Green") + ":"; greenLabel.TextAlign = ContentAlignment.MiddleRight; // colorBaseLabel colorBaseLabel.Location = new Point (228, 247); colorBaseLabel.Size = new Size (60, 25); colorBaseLabel.TabIndex = 28; colorBaseLabel.Text = Locale.GetText ("Color"); colorBaseLabel.TextAlign = ContentAlignment.MiddleCenter; // hueLabel hueLabel.FlatStyle = FlatStyle.System; hueLabel.Location = new Point (287, 206); hueLabel.Size = new Size (36, 16); hueLabel.TabIndex = 23; hueLabel.Text = Locale.GetText ("Hue") + ":"; hueLabel.TextAlign = ContentAlignment.MiddleRight; // satLabel satLabel.FlatStyle = FlatStyle.System; satLabel.Location = new Point (287, 228); satLabel.Size = new Size (36, 16); satLabel.TabIndex = 22; satLabel.Text = Locale.GetText ("Sat") + ":"; satLabel.TextAlign = ContentAlignment.MiddleRight; // briLabel briLabel.FlatStyle = FlatStyle.System; briLabel.Location = new Point (287, 250); briLabel.Size = new Size (36, 16); briLabel.TabIndex = 24; briLabel.Text = Locale.GetText ("Bri") + ":"; briLabel.TextAlign = ContentAlignment.MiddleRight; // defineColoursButton defineColoursButton.FlatStyle = FlatStyle.System; defineColoursButton.Location = new Point (5, 244); defineColoursButton.Size = new Size (210, 22); defineColoursButton.TabIndex = 6; // FIXME: update resource files defineColoursButton.Text = "Define Custom Colors >>"; //defineColoursButton.Text = Locale.GetText ("Define Custom Colors >>"); // okButton okButton.FlatStyle = FlatStyle.System; okButton.Location = new Point (5, 271); okButton.Size = new Size (66, 22); okButton.TabIndex = 0; okButton.Text = Locale.GetText ("OK"); // cancelButton cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point (78, 271); cancelButton.Size = new Size (66, 22); cancelButton.TabIndex = 1; cancelButton.Text = Locale.GetText ("Cancel"); // helpButton helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point (149, 271); helpButton.Size = new Size (66, 22); helpButton.TabIndex = 5; helpButton.Text = Locale.GetText ("Help"); helpButton.Hide (); // addColoursButton addColoursButton.FlatStyle = FlatStyle.System; addColoursButton.Location = new Point (227, 271); addColoursButton.Size = new Size (213, 22); addColoursButton.TabIndex = 7; // FIXME: update resource files addColoursButton.Text = "Add To Custom Colors"; //addColoursButton.Text = Locale.GetText ("Add To Custom Colors"); // baseColorControl baseColorControl.Location = new Point (3, 6); baseColorControl.Size = new Size (212, 231); baseColorControl.TabIndex = 13; // colorMatrixControl colorMatrixControl.Location = new Point (227, 7); colorMatrixControl.Size = new Size (179, 190); colorMatrixControl.TabIndex = 14; // triangleControl triangleControl.Location = new Point (432, 0); triangleControl.Size = new Size (16, 204); triangleControl.TabIndex = 12; // brightnessControl brightnessControl.Location = new Point (415, 7); brightnessControl.Size = new Size (14, 190); brightnessControl.TabIndex = 20; // selectedColorPanel selectedColorPanel.BackColor = SystemColors.Desktop; selectedColorPanel.BorderStyle = BorderStyle.Fixed3D; selectedColorPanel.Location = new Point (227, 202); selectedColorPanel.Size = new Size (60, 42); selectedColorPanel.TabIndex = 10; form.Controls.Add (hueTextBox); form.Controls.Add (satTextBox); form.Controls.Add (briTextBox); form.Controls.Add (redTextBox); form.Controls.Add (greenTextBox); form.Controls.Add (blueTextBox); form.Controls.Add (defineColoursButton); form.Controls.Add (okButton); form.Controls.Add (cancelButton); form.Controls.Add (addColoursButton); form.Controls.Add (helpButton); form.Controls.Add (baseColorControl); form.Controls.Add (colorMatrixControl); form.Controls.Add (brightnessControl); form.Controls.Add (triangleControl); form.Controls.Add (colorBaseLabel); form.Controls.Add (greenLabel); form.Controls.Add (blueLabel); form.Controls.Add (redLabel); form.Controls.Add (briLabel); form.Controls.Add (hueLabel); form.Controls.Add (satLabel); form.Controls.Add (selectedColorPanel); form.ResumeLayout (false); Color = Color.Black; defineColoursButton.Click += new EventHandler (OnClickButtonDefineColours); addColoursButton.Click += new EventHandler (OnClickButtonAddColours); helpButton.Click += new EventHandler (OnClickHelpButton); cancelButton.Click += new EventHandler (OnClickCancelButton); okButton.Click += new EventHandler (OnClickOkButton); hueTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); satTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); briTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); redTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); greenTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); blueTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); hueTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); satTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); briTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); redTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); greenTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); blueTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); hueTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); satTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); briTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); redTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); greenTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); blueTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); hueTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); satTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); briTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); redTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); greenTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); blueTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); ResetCustomColors (); }
public void init(params GameObject[] objRefs) { fogController = GameObject.Find("FogController").GetComponent <FogControl>(); lightController = GameObject.Find("Lights/Solar Light").GetComponent <BrightnessControl>(); updateUIValues(); }