private void HandleRGBChange(object sender, System.EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate) { changeType = ChangeStyle.RGB; RGB = new ColorHandler.RGB((int)nudRed.Value, (int)nudGreen.Value, (int)nudBlue.Value); SetHSV(ColorHandler.RGBtoHSV(RGB)); this.Invalidate(); } }
private void HandleHSVChange(object sender, EventArgs e) { // If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate) { changeType = ChangeStyle.HSV; HSV = new ColorHandler.HSV((int)(nudHue.Value), (int)(nudSaturation.Value), (int)(nudBrightness.Value)); SetRGB(ColorHandler.HSVtoRGB(HSV)); this.Invalidate(); } }
private void Watchnewdata_Click(object sender, RoutedEventArgs e) { try { TreeNode node = LYTunnelTreeview.SelectedItem as TreeNode; if ((node == null) || (node.Level != 2)) { return; } DataImporter_Excel dataImporter = new DataImporter_Excel(); string path = Runtime.dataPath + "\\ProjectData\\LYTunnel.xls"; DataTable _newdatatable = dataImporter.Import(path, LYTunnelStandard, node.Context); if (_newdatatable.Columns.Count == 0) { StageDef stage = LYTunnelStandard.StageContainer.Find(x => x.Code == node.Parent); DGObjectDef dGObject = stage.DGObjectContainer.Find(x => x.Code == node.Code); if (dGObject != null) { foreach (PropertyMeta meta in dGObject.PropertyContainer) { _newdatatable.Columns.Add(meta.LangStr); } } } string[] distinctcols = new string[(_newdatatable.Columns.Count)]; foreach (DataColumn dataColumn in _newdatatable.Columns) { distinctcols[dataColumn.Ordinal] = dataColumn.ColumnName; } DataView mydataview = new DataView(_newdatatable); _newdatatable = mydataview.ToTable(true, distinctcols); //去重复 datatable_clean(_newdatatable); //去空白行 Comparetables(currenttable, _newdatatable); DataView view = new DataView(_newdatatable); DataDG.ItemsSource = view; ChangeStyle style = new ChangeStyle(_newdatatable, ref DataDG, LYTunnelStandard); style.RefreshStyle(); DataDG.ScrollIntoView(DataDG.Items[0]); DataDG.UpdateLayout(); Statelabel.Content = "校核结果如上,如无误则点击“上传新数据”按钮"; newdatatable = _newdatatable; } catch (Exception ex) { MessageBox.Show("请保存Excel模板文件,并关闭它!"); } }
/// <summary> /// import Data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void DataTemplateTreeview_SelectedItemChanged(object sender, RoutedEventArgs e) { try { TreeNode node = LYTunnelTreeview.SelectedItem as TreeNode; if ((node == null) || (node.Level != 2)) { return; } StageDef stage = LYTunnelStandard.StageContainer.Find(x => x.Code == node.Parent); DGObjectDef dGObject = stage.DGObjectContainer.Find(x => x.Code == node.Code); Project _prj = Globals.project; Domain _domain = _prj.getDomain(stage.Code); DGObjects objs = _domain.DGObjectsList.Where(x => x.definition.Type == dGObject.Code).FirstOrDefault(); await GetData(objs); if (currenttable.Columns.Count == 0) { if (dGObject != null) { foreach (PropertyMeta meta in dGObject.PropertyContainer) { currenttable.Columns.Add(meta.LangStr); } } } DataView view = new DataView(currenttable); DataDG.ItemsSource = view; DataDG.UpdateLayout(); ChangeStyle style = new ChangeStyle(currenttable, ref DataDG, LYTunnelStandard); style.IDindex = currenttable_IDindex; style.Addattachment(); DataDG.UpdateLayout(); DataDG.ScrollIntoView(DataDG.Items[0]); DataDG.UpdateLayout(); Statelabel.Content = "请查看" + currenttable.TableName + "的所有数据!"; } catch (Exception ex) { MessageBox.Show("读取云端数据发生意外,读取失败!"); } }
private void ColorChooser1_Load(object sender, System.EventArgs e) { // Turn on double-buffering, so the form looks better. this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); // These properties are set in design view, as well, but they // have to be set to false in order for the Paint // event to be able to display their contents. // Never hurts to make sure they're invisible. pnlSelectedColor.Visible = false; pnlBrightness.Visible = false; pnlColor.Visible = false; // Calculate the coordinates of the three // required regions on the form. Rectangle SelectedColorRectangle = new Rectangle(pnlSelectedColor.Location, pnlSelectedColor.Size); Rectangle BrightnessRectangle = new Rectangle(pnlBrightness.Location, pnlBrightness.Size); Rectangle ColorRectangle = new Rectangle(pnlColor.Location, pnlColor.Size); // Create the new ColorWheel class, indicating // the locations of the color wheel itself, the // brightness area, and the position of the selected color. myColorWheel = new ColorWheel( ColorRectangle, BrightnessRectangle, SelectedColorRectangle); myColorWheel.ColorChanged += new ColorWheel.ColorChangedEventHandler( this.myColorWheel_ColorChanged); // Set the RGB and HSV values // of the NumericUpDown controls. SetRGB(RGB); HSV = ColorHandler.RGBtoHSV(RGB); SetHSV(HSV); changeType = ChangeStyle.RGB; }
private void HandleRGBChange(object sender, System.EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate) { changeType = ChangeStyle.RGB; RGB = new ColorManagerWheel.RGB((int)nudRed.Value, (int)nudGreen.Value, (int)nudBlue.Value); SetHSV(ColorManagerWheel.RGBtoHSV(RGB)); this.Invalidate(); ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs(); rgs.Color = Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue); if (ColorChanged != null) { ColorChanged(Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue), rgs); } } }
private void HandleHSVChange(object sender, EventArgs e) { // If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate) { changeType = ChangeStyle.HSV; HSV = new ColorManagerWheel.HSV((int)(nudHue.Value), (int)(nudSaturation.Value), (int)(nudBrightness.Value)); ColorManagerWheel.RGB rgb = ColorManagerWheel.HSVtoRGB(HSV); SetRGB(rgb); this.Invalidate(); ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs(); rgs.Color = Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue); if (ColorChanged != null) { ColorChanged(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue), rgs); } } }
private void HandleRGBChange(object sender, System.EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate ) { changeType = ChangeStyle.RGB; RGB = new ColorHandler.RGB((int)nudRed.Value, (int)nudGreen.Value, (int)nudBlue.Value); SetHSV(ColorHandler.RGBtoHSV(RGB)); RGBOUT = RGB; this.Invalidate(); } }
private void HandleHSVChange( object sender, EventArgs e) { // If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (! isInUpdate ) { changeType = ChangeStyle.HSV; HSV = new ColorHandler.HSV((int)(nudHue.Value), (int)(nudSaturation.Value), (int)(nudBrightness.Value)); SetRGB(ColorHandler.HSVtoRGB(HSV)); this.Invalidate(); } }
private void OnMouseUp(object sender, MouseEventArgs e) { colorWheel.SetMouseUp(); changeType = ChangeStyle.None; }
private void HandleMouse(object sender, MouseEventArgs e) { // If you have the left mouse button down, // then update the selectedPoint value and // force a repaint of the color wheel. if (e.Button == MouseButtons.Left) { changeType = ChangeStyle.MouseMove; selectedPoint = new Point(e.X, e.Y); this.ColorTab.Invalidate(); } }
private void frmMain_MouseUp(object sender, MouseEventArgs e) { myColorWheel.SetMouseUp(); changeType = ChangeStyle.None; }
/// <summary> /// The tb alpha scroll. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void TbAlphaScroll(object sender, EventArgs e) { this.changeType = ChangeStyle.RGB; this.argb = new ColorHandler.ARGB(this.tbAlpha.Value, this.tbRed.Value, this.tbGreen.Value, this.tbBlue.Value); RefreshText(this.lblAlpha2, this.tbAlpha.Value); this.tbHexCode.Text = string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", this.argb.Alpha, this.argb.Red, this.argb.Green, this.argb.Blue); this.Invalidate(); }
/// <summary> /// The handle hsv scroll. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void HandleHSVScroll(object sender, EventArgs e) // If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events { // when you update the NumericUpdownControls. this.changeType = ChangeStyle.HSV; this.hsv = new ColorHandler.HSV(this.tbAlpha.Value, this.tbHue.Value, this.tbSaturation.Value, this.tbValue.Value); this.SetRGB(ColorHandler.HSVtoRGB(this.hsv)); this.SetHSVLabels(this.hsv); this.Invalidate(); }
private void HandleHSVScroll(object sender, ScrollEventArgs e) // If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. { changeType = ChangeStyle.HSV; HSV = new ColorHandler.HSV(hsbHue.Value, hsbSaturation.Value, hsbBrightness.Value); SetRGB(ColorHandler.HSVtoRGB(HSV)); SetHSVLabels(HSV); this.Invalidate(); }
private void frmMain_MouseUp(object sender, MouseEventArgs e) { _colourWheel.SetMouseUp(); _changeType = ChangeStyle.NONE; }
private void OnMouseLeave(object sender, EventArgs e) { colorWheel.SetMouseUp(); changeType = ChangeStyle.None; selectedPoint = Point.Empty; }
// If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. private void HandleRGBScroll(object sender, ScrollEventArgs e) { _changeType = ChangeStyle.RGB; RGB = new DRColor.RGB(hsbRed.Value, hsbGreen.Value, hsbBlue.Value); SetHSV(new DRColor.HSV(RGB)); SetRGBLabels(RGB); this.Invalidate(); RainbowUtils.fillBoth(RGB); }
// If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. private void HandleHSVScroll(object sender, ScrollEventArgs e) { _changeType = ChangeStyle.HSV; HSV = new DRColor.HSV(hsbHue.Value, hsbSaturation.Value, hsbBrightness.Value); SetRGB(new DRColor.RGB(HSV)); SetHSVLabels(HSV); this.Invalidate(); RainbowUtils.fillBoth(RGB); }
private void tbFloatVals_TextChanged(object sender, EventArgs e) { if (isInUpdate) { return; } if (COLOR_INFO[colorInfoMode].ToString() == COLOR_INFO_FLOAT) { string[] parts = tbFloatVals.Text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (parts.Length != 3) { return; } ColorHandler.RGB rgb = new ColorHandler.RGB(); float c; if (!float.TryParse(parts[0].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out c)) { return; } rgb.Red = (int)(General.Clamp(Math.Abs(c), 0.0f, 1.0f) * 255); if (!float.TryParse(parts[1].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out c)) { return; } rgb.Green = (int)(General.Clamp(Math.Abs(c), 0.0f, 1.0f) * 255); if (!float.TryParse(parts[2].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out c)) { return; } rgb.Blue = (int)(General.Clamp(Math.Abs(c), 0.0f, 1.0f) * 255); changeType = ChangeStyle.RGB; UpdateColorInfo(rgb); this.Invalidate(); } else if (COLOR_INFO[colorInfoMode].ToString() == COLOR_INFO_HEX) { string hexColor = tbFloatVals.Text.Trim().Replace("-", ""); if (hexColor.Length != 6) { return; } ColorHandler.RGB rgb = new ColorHandler.RGB(); int color; string colorStr = hexColor.Substring(0, 2); if (!int.TryParse(colorStr, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out color)) { return; } rgb.Red = color; colorStr = hexColor.Substring(2, 2); if (!int.TryParse(colorStr, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out color)) { return; } rgb.Green = color; colorStr = hexColor.Substring(4, 2); if (!int.TryParse(colorStr, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out color)) { return; } rgb.Blue = color; changeType = ChangeStyle.RGB; UpdateColorInfo(rgb); this.Invalidate(); } }
// If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. private void HandleHSVScroll(object sender, EventArgs e) { changeType = ChangeStyle.HSV; hsv = new ColorHandler.HSV(tbAlpha.Value, tbHue.Value, tbSaturation.Value, tbValue.Value); SetRGB(ColorHandler.HSVtoRGB(hsv)); SetHSVLabels(hsv); Invalidate(); }
private void HandleMouseU(object sender, MouseEventArgs e) { _colorWheel.SetMouseUp(); _changeType = ChangeStyle.None; }
/// <summary> /// The form main mouse up. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void FormMainMouseUp(object sender, MouseEventArgs e) { this.myColorWheel.SetMouseUp(); this.changeType = ChangeStyle.None; }
void Update() { if (!init) { init = true; ChangeStage(RoundManager.instance.stage); } int lastBreak = breakIndex; for (int i = 0; i < breakingPoints.Length; ++i) { if (audio.time > breakingPoints[i].timeIndex) { breakIndex = i; } } if (lastBreak != breakIndex) { if (changeStyle == ChangeStyle.WAIT_FOR_END) { float earlyTime = 0; foreach (EarlyTrigger early in breakingPoints[breakIndex].earlyTriggers) { if (RoundManager.instance.stage == early.round) { earlyTime = early.earlyTime; break; } } RoundManager.RoundStage stagePreempt = RoundManager.instance.GetFutureStage(earlyTime); ChangeStage(stagePreempt); } if (changeStyle == ChangeStyle.WAIT_FOR_END) { audio.volume = targetVolume; } changeStyle = breakingPoints[breakIndex].changeStyle; fadeDuration = breakingPoints[breakIndex].fadeDuration; oldVolume = audio.volume; timer = 0; } if (changeStyle == ChangeStyle.CROSS_FADE) { if (timer < fadeDuration) { timer += Time.deltaTime; if (timer >= fadeDuration) { audio.volume = targetVolume; } else { float t = timer / fadeDuration; audio.volume = (1 - t) * oldVolume + t * targetVolume; } } } }
/// <summary> /// The handle rgb scroll. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void HandleRGBScroll(object sender, EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. this.changeType = ChangeStyle.RGB; this.argb = new ColorHandler.ARGB(this.tbAlpha.Value, this.tbRed.Value, this.tbGreen.Value, this.tbBlue.Value); this.SetHSV(ColorHandler.RGBtoHSV(this.argb)); this.SetRGBLabels(this.argb); this.Invalidate(); }
private void HandleARGBScroll(object sender, ScrollEventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. changeType = ChangeStyle.ARGB; ARGB = new ColorHandler.ARGB(hsbAlpha.Value, hsbRed.Value, hsbGreen.Value, hsbBlue.Value); SetAHSV(ColorHandler.ARGBtoAHSV(ARGB)); SetARGBLabels(ARGB); this.Invalidate(); }
private void Window_MouseUp(object sender, MouseEventArgs e) { _colourWheel.SetMouseUp(); _changeStyle = ChangeStyle.NONE; }
// If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. private void HandleHSVScroll(object sender, ScrollEventArgs e) { changeType = ChangeStyle.AHSV; AHSV = new ColorHandler.AHSV(hsbAlpha.Value, hsbHue.Value, hsbSaturation.Value, hsbBrightness.Value); SetARGB(ColorHandler.AHSVtoARGB(AHSV)); SetAHSVLabels(AHSV); this.Invalidate(); }
// If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. private void HandleHSVScroll(object sender, ScrollEventArgs e) { changeType = ChangeStyle.HSV; HSV = new ColorHandler.HSV(Hue.Value, Saturation.Value, Brightness.Value); SetRGB(ColorHandler.HSVtoRGB(HSV)); SetHSVLabels(HSV); this.ColorTab.Invalidate(); }
private void HandleRGBChange(object sender, System.EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate) { changeType = ChangeStyle.RGB; RGB = new ColorManagerWheel.RGB((int) nudRed.Value, (int) nudGreen.Value, (int) nudBlue.Value); SetHSV(ColorManagerWheel.RGBtoHSV(RGB)); this.Invalidate(); ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs(); rgs.Color = Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue); if (ColorChanged != null) ColorChanged(Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue), rgs); } }
private void HandleRGBScroll(object sender, ScrollEventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. changeType = ChangeStyle.RGB; RGB = new ColorHandler.RGB(redSc.Value, greenSc.Value, blueSC.Value); SetHSV(ColorHandler.RGBtoHSV(RGB)); SetRGBLabels(RGB); this.ColorTab.Invalidate(); }
private void HandleHSVChange(object sender, EventArgs e) { // If the H, S, or V values change, use this // code to update the RGB values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (! isInUpdate) { changeType = ChangeStyle.HSV; HSV = new ColorManagerWheel.HSV((int) (nudHue.Value), (int) (nudSaturation.Value), (int) (nudBrightness.Value)); ColorManagerWheel.RGB rgb = ColorManagerWheel.HSVtoRGB(HSV); SetRGB(rgb); this.Invalidate(); ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs(); rgs.Color = Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue); if (ColorChanged != null) ColorChanged(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue), rgs); } }