private async void ColorPointRadioButton_DoubleTapped(object sender, RoutedEventArgs e) { ContentDialog dialog = GetCurrentContentDialog(); if (dialog != null) { dialog.Hide(); } ColorPickerDialog colorPickerDialog = new ColorPickerDialog(m_ColorPointModel.Color); await colorPickerDialog.ShowAsync(); if (colorPickerDialog.ColorPickerResult) { m_ColorPointModel.Color = colorPickerDialog.CurrentColor; ColorPatternViewModel.Self.OnCustomizeChanged(); } if (dialog != null) { await dialog.ShowAsync(); } else { MainPage.Self.ShowDeviceUpdateDialogOrNot(); } }
private void canvasColor_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ColorPickerDialog dlg = new ColorPickerDialog { Owner = this, // Owner = Application.Current != null && Application.Current.Windows.Count > 0 // ? Application.Current.Windows[0] // : null, StrokeThickness = StyleIndicator.StrokeThickness, SelectedColor = StyleIndicator.StrokeColor }; if (dlg.ShowDialog() != true) { return; } StyleIndicator.StrokeThickness = dlg.StrokeThickness; StyleIndicator.StrokeColor = dlg.SelectedColor; canvasColor.Background = new SolidColorBrush(StyleIndicator.StrokeColor); if (StyleIndicator.Panel._chartX.IndicatorTwinTitleVisibility == System.Windows.Visibility.Collapsed) { foreach (Series series in StyleIndicator._linkedSeries) { Indicator ind = series as Indicator; if (ind != null) { ind.StrokeColor = _styleIndicator._strokeColor; ind.StrokePattern = _styleIndicator._strokePattern; ind.StrokeThickness = _styleIndicator._strokeThickness; } } } }
private void BtNoAlphaOnClick(object sender, EventArgs eventArgs) { var colorPickerDialog = new ColorPickerDialog(this, _panelNoAlpha.Color); colorPickerDialog.ColorChanged += (o, args) => _panelNoAlpha.Color = args.Color; colorPickerDialog.Show(); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (value.GetType() != typeof(SDColor)) { return(value); } var color = (SDColor)value; var svc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; if (svc != null) { using (var dlg = new ColorPickerDialog()) { dlg.Color = color; dlg.ShowAlphaChannel = true; if (svc.ShowDialog(dlg) == DialogResult.OK) { return(dlg.Color); } } } return(value); }
public override object EditValue( ITypeDescriptorContext context, IServiceProvider provider, object value) { // Attempts to obtain an IWindowsFormsEditorService. IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc == null) { return(null); } // Displays a StringInputDialog Form to get a user-adjustable // string value. using (ColorPickerDialog dialog = new ColorPickerDialog()) { dialog.Color = (Color)value; if (edSvc.ShowDialog(dialog) == DialogResult.OK) { return(dialog.Color); } } // If OK was not pressed, return the original value return((Color)value); }
private void SwitchBT_Click(object sender, EventArgs e) { var sw = sender as Switch; if (sw.Checked) { if (communicationService.Connect()) { SetUIComponents(true); RequestGuiInfo(); Action <int> act = OnColorSelected; colorDialog = new ColorPickerDialog(this, Color, new ColorSelectedListener(act)); } else { WwitchBT.Checked = false; SetUIComponents(false); } } else { SetUIComponents(false); communicationService.Disconnect(); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Resource.Id.menu_color_picker_dialog: ColorPickerDialog.NewBuilder() .SetDialogType(ColorPickerDialog.DialogType.Custom) .SetAllowPresets(false) .SetDialogId(DIALOG_ID) .SetColor(Color.Black) .SetShowAlphaSlider(true) .Show(this); return(true); case Resource.Id.menu_github: try { StartActivity(new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://github.com/jaredrummler/ColorPicker"))); } catch (ActivityNotFoundException ignored) { } return(true); } return(base.OnOptionsItemSelected(item)); }
/// <summary> /// Function to retrieve a color for the hatch pattern. /// </summary> /// <returns>The selected color or NULL (Nothing in VB.Net) if canceled.</returns> private GorgonColor?GetColor(GorgonColor oldColor) { ColorPickerDialog colorDialog = null; try { colorDialog = new ColorPickerDialog { SelectedColor = oldColor, OldColor = oldColor }; if (colorDialog.ShowDialog(ParentForm) == DialogResult.OK) { return(colorDialog.SelectedColor); } } catch (Exception ex) { GorgonDialogs.ErrorBox(ParentForm, ex); } finally { if (colorDialog != null) { colorDialog.Dispose(); } } return(null); }
/// <summary> /// Handles the Click event of the buttonExpando control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void buttonExpando_Click(object sender, EventArgs e) { ColorPickerDialog picker = null; try { picker = new ColorPickerDialog { OldColor = CurrentColor }; if (picker.ShowDialog() == DialogResult.OK) { CurrentColor = picker.SelectedColor; } EditorService.CloseDropDown(); } catch (Exception ex) { GorgonDialogs.ErrorBox(null, ex); } finally { if (picker != null) { picker.Dispose(); } } }
private SolidColorBrush ChooseColor(String color) { ColorPickerDialog colorPicker = new ColorPickerDialog(); colorPicker.Height = 425; Color actCol; try { actCol = (Color)ColorConverter.ConvertFromString(color); } catch { actCol = (Color)ColorConverter.ConvertFromString("#ffffffff"); } colorPicker.StartingColor = actCol; bool?result = colorPicker.ShowDialog(); if (result != null && (bool)result == true) { return(new SolidColorBrush(colorPicker.SelectedColor)); } else { return(new SolidColorBrush(actCol)); } }
private void Init(Context context) { _richTextEditor = new Shared.RichEditor(); SetWebViewClient(new RichEditorWebViewClient(_richTextEditor)); SetWebChromeClient(new TEditorChromeWebClient()); _richTextEditor.SetJavaScriptEvaluatingFunction((input) => { EvaluateJavascript(input, null); }); _richTextEditor.SetJavaScriptEvaluatingWithResultFunction(async(input) => { var result = new JavaScriptResult(); EvaluateJavascript(input, result); var result2 = await result.GetResultAsync(); return(result2); }); _colorPickerDialog = new ColorPickerDialog(context, Color.Red); _colorPickerDialog.ColorChanged += (o, args) => { _richTextEditor.SetTextColor((int)args.Color.R, (int)args.Color.G, (int)args.Color.B); }; _richTextEditor.LaunchColorPicker = () => { _colorPickerDialog.Show(); }; LoadResource(); }
private void UI_Timer_Tick(object sender, EventArgs e) { if (UI_CheckBox_UpdateMem.IsChecked == true && UI_RadioButton_Mem.IsChecked == true) { UpdatePaletteFromMemory(); RefreshPalette(CurrentPaletteSet); } if (ColorPicker != null) { var col = ColorPicker.Color; var result = ColorPicker.DialogResult; Palettes[CurrentPaletteSet].Colours[CurrentColourSlot].Red = col.R; Palettes[CurrentPaletteSet].Colours[CurrentColourSlot].Green = col.G; Palettes[CurrentPaletteSet].Colours[CurrentColourSlot].Blue = col.B; if (result == System.Windows.Forms.DialogResult.OK) { ColorPicker = null; } else if (result == System.Windows.Forms.DialogResult.Cancel) { ColorPicker = null; Palettes[CurrentPaletteSet].Colours[CurrentColourSlot] = OldColour; } if (UI_RadioButton_Mem.IsChecked == true) { Memory.Attach("SonicMania"); int addr = PaletteAddresses[CurrentPaletteSet] + 2 * CurrentColourSlot; Memory.WriteUInt16(addr, Palettes[CurrentPaletteSet].Colours[CurrentColourSlot].ToRGB565()); } RefreshPalette(CurrentPaletteSet); } }
void Init(Context context) { _richTextEditor = new Abstractions.TEditor(); this.SetWebViewClient(new TEditorWebViewClient(_richTextEditor)); this.SetWebChromeClient(new TEditorChromeWebClient()); _richTextEditor.SetJavaScriptEvaluatingFunction((input) => { this.EvaluateJavascript(input, null); }); _richTextEditor.SetJavaScriptEvaluatingWithResultFunction((input) => { var activity = context as Activity; JavaScriptResult result = new JavaScriptResult(); this.EvaluateJavascript(input, result); if (activity != null) { activity.RunOnUiThread(() => { }); } return(result.GetResultAsync()); }); _colorPickerDialog = new ColorPickerDialog(context, Color.Red); _colorPickerDialog.ColorChanged += (o, args) => { _richTextEditor.SetTextColor((int)args.Color.R, (int)args.Color.G, (int)args.Color.B); }; _richTextEditor.LaunchColorPicker = () => { _colorPickerDialog.Show(); }; this.LoadResource(); }
/// <summary> /// Function to get the preview text color. /// </summary> /// <param name="color">Color to update.</param> private void GetColor(ref Color color) { ColorPickerDialog colorDialog = null; try { colorDialog = new ColorPickerDialog { OldColor = color }; if (colorDialog.ShowDialog(ParentForm) != DialogResult.OK) { return; } color = colorDialog.SelectedColor; panelTextColor.Refresh(); panelBackColor.Refresh(); } catch (Exception ex) { GorgonDialogs.ErrorBox(ParentForm, ex); } finally { if (colorDialog != null) { colorDialog.Dispose(); } } }
void ColorClick(object sender, EventArgs e) { if (SystemClock.ElapsedRealtime() - LastClickTime < 1000) { return; } LastClickTime = SystemClock.ElapsedRealtime(); ColorPickerDialog.NewBuilder().SetColor(Color.Red).SetDialogType(ColorPickerDialog.DialogType.Preset).SetAllowCustom(false).SetColorShape(ColorShape.Square).SetShowAlphaSlider(false).SetDialogId(1).Show(this); }
private void BackColor_Click(object sender, RoutedEventArgs e) { ColorPickerDialog cpd = new ColorPickerDialog(((SolidColorBrush)Background).Color); if ((bool)cpd.ShowDialog()) { this.Background = new SolidColorBrush(cpd.SelectedColor); } }
private void pnlBackColor_Click(object sender, EventArgs e) { ColorPickerDialog dlg = new ColorPickerDialog(); if (dlg.ShowDialog(this) == DialogResult.OK) { pnlBackColor.BackColor = dlg.ColorPicker.SelectedColor; } }
async void BGClicked(System.Object sender, System.EventArgs e) { var color = await ColorPickerDialog.Show(OuterGrid, "Background Color", BGColor, null); if (color != null) { BGColor = color; } }
public static void ColorButtonClick(Button button, Control control) { var picker = new ColorPickerDialog(); picker.SelectedColorChanged += (s, x) => button.BackColor = picker.SelectedColor; picker.SelectedColor = picker.OldColor = button.BackColor; picker.ShowDialog(control); button.BackColor = picker.SelectedColor; }
private void pictureBoxEndColor_Click(object sender, EventArgs e) { var dialog = new ColorPickerDialog(); dialog.Color = EndColor; if (dialog.ShowDialog() == DialogResult.OK) { EndColor = dialog.Color; } }
private void ColorPickerButton_Click(object sender, System.EventArgs e) { var result = ColorPickerDialog.ShowDialog(); if (result == DialogResult.OK) { BackgroundPreviewPanel.BackgroundImage = null; BackgroundPreviewPanel.BackColor = ColorPickerDialog.Color; } }
private void ButtonColor_Click(object sender, EventArgs e) { DialogResult D = ColorPickerDialog.ShowDialog(); if (D == System.Windows.Forms.DialogResult.OK) { currentColor = ColorPickerDialog.Color; ButtonColor.BackColor = currentColor; } }
private void ForeColor_Click(object sender, RoutedEventArgs e) { ColorPickerDialog cpd = new ColorPickerDialog(((SolidColorBrush)Foreground).Color); if ((bool)cpd.ShowDialog()) { Settings.Default.Foreground = new SolidColorBrush(cpd.SelectedColor); //this.Foreground = new SolidColorBrush(cpd.SelectedColor); } }
private void ColorButtonClick(object sender, EventArgs e) { var button = (Button)sender; var picker = new ColorPickerDialog(); picker.SelectedColorChanged += (s, x) => button.BackColor = picker.SelectedColor; picker.SelectedColor = picker.OldColor = button.BackColor; picker.ShowDialog(this); button.BackColor = picker.SelectedColor; }
private void mnuColors_Click(object sender, RoutedEventArgs e) { ColorPickerDialog cpd = new ColorPickerDialog(ColorScheme, ColorScheme.MainColor); cpd.ShowDialog(); if (cpd.DialogResult) { ColorScheme = new ColorScheme(cpd.SelectedColor); } }
public override void Execute() { var cp = new ColorPickerDialog(models.Settings.NaNColor); if (models.Window.ShowDialog(cp) != true) { return; } models.Settings.NaNColor = cp.Color; }
async void CellClicked(System.Object sender, System.EventArgs e) { var color = await ColorPickerDialog.Show(OuterGrid, "Cell Color", CellColor, null); if (color != null) { CellColor = color; cellpaint.Color = ToSkiaColor(color); GameGrid.InvalidateSurface(); } }
// Color picker event private async void Button_Clicked(object sender, System.EventArgs e) { var buttonColor = (sender as Button).BackgroundColor; var color = await ColorPickerDialog.Show(MainGrid, AppResourcesLisener.Languages["OptionsSelectColorText"], buttonColor); if (color != null) { (sender as Button).BackgroundColor = color; } }
private void selectPanelBackColor_Click_1(object sender, EventArgs e) { if (ColorPickerDialog.ShowDialog() == DialogResult.OK) { enVars.layoutDesign.PanelBackColor = ColorPickerDialog.Color; var dataUpdate = new updateMainAppClass(); dataUpdate.enVars = enVars; dataUpdate.updateTask = updateMainAppClass.UPDATE_LAYOUT; enVars.updateViewLayout?.Invoke(this, ref dataUpdate); } }
private void BtCursor2Color_Click(object sender, EventArgs e) { using (ColorPickerDialog dialog = new ColorPickerDialog()) { dialog.Color = Option.Cursor2Color; if (dialog.ShowDialog() == DialogResult.OK) { Option.Cursor2Color = btCursor2Color.BackColor = dialog.Color; } } }
private void browseColorButton_Click(object sender, EventArgs e) { using (ColorPickerDialog dialog = new ColorPickerDialog()) { dialog.Color = _color; if (dialog.ShowDialog(this) == DialogResult.OK) { _color = dialog.Color; panel.Invalidate(); } } }
private void browseColorButton_Click(object sender, EventArgs e) { using (ColorPickerDialog dialog = new ColorPickerDialog()) { dialog.Color = colorPreviewPanel.Color; dialog.ShowAlphaChannel = showAlphaChannelCheckBox.Checked; dialog.PreviewColorChanged += this.DialogColorChangedHandler; if (dialog.ShowDialog(this) == DialogResult.OK) { colorPreviewPanel.Color = dialog.Color; } dialog.PreviewColorChanged -= this.DialogColorChangedHandler; } }
private void PlainBorderColor_Click(object sender, RoutedEventArgs e) { ColorPickerDialog cPicker = new ColorPickerDialog(); Color color; if (string.IsNullOrEmpty(_team.LineUpSettings.PlainBorderColor)) color = (Color)ColorConverter.ConvertFromString("#774ca6"); else color = (Color)ColorConverter.ConvertFromString(_team.LineUpSettings.PlainBorderColor); cPicker.StartingColor = color; cPicker.Owner = this; bool? dialogResult = cPicker.ShowDialog(); if (dialogResult != null && (bool)dialogResult == true) { _team.LineUpSettings.PlainBorderColor = cPicker.SelectedColor.ToString(); setPlainBorderColor(); } }
private void showBgColorDialog_Click(object sender, EventArgs e) { if (this.bgColorDialog == null) { this.bgColorDialog = new ColorPickerDialog { BackColor = Color.FromArgb(212, 212, 212), OldColor = this.oldColorDialogColor, SelectedColor = this.oldColorDialogColor, AlphaEnabled = false }; } this.bgColorDialog.OldColor = Color.FromArgb( 255, this.camComp.ClearColor.R, this.camComp.ClearColor.G, this.camComp.ClearColor.B); this.bgColorDialog.PrimaryAttribute = ColorPickerDialog.PrimaryAttrib.Hue; if (this.bgColorDialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) this.bgColorDialog_ValueChanged(this.bgColorDialog, null); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case ColorMenuID: var cPicker = new ColorPickerDialog(this, m_SignatureCapture.StrokeColor); cPicker.ColorChanged += delegate(object sender, ColorChangedEventArgs args) { m_SignatureCapture.StrokeColor = args.Color; }; cPicker.Show(); return true; case ClearCanvasMenuID: m_SignatureCapture.ClearCanvas(); return true; case SaveToSDCardID: SaveToSd(); return true; case SelectStrokeWidthMenuID: StrokeWidthDialog(); return true; case SelectStrokeJoinID: StrokeJoinDialog(); return true; case SelectStrokeStyleID: StrokeStyleDialog(); return true; case SelectStrokeCapID: StrokeCapsDialog(); return true; } return base.OnOptionsItemSelected(item); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.ToolStripSplitButton.ButtonClick"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data. </param> protected override void OnButtonClick(EventArgs e) { base.OnButtonClick(e); using (ColorPickerDialog dialog = new ColorPickerDialog()) { dialog.Color = this.Color; if (dialog.ShowDialog(this.GetCurrentParent()) == DialogResult.OK) { this.Color = dialog.Color; } } }
private void GreenScreen_Click_1(object sender, RoutedEventArgs e) { try { ColorPickerDialog cPicker = new ColorPickerDialog(); Color color; if (string.IsNullOrEmpty(PolicyViewModel.Instance.VideoOverlay.GreenScreen)) color = (Color)ColorConverter.ConvertFromString("#000000"); else color = (Color)ColorConverter.ConvertFromString("#" + PolicyViewModel.Instance.VideoOverlay.GreenScreen); cPicker.StartingColor = color; Window window = Window.GetWindow(this); cPicker.Owner = window; bool? dialogResult = cPicker.ShowDialog(); if (dialogResult != null && (bool)dialogResult == true) { PolicyViewModel.Instance.VideoOverlay.GreenScreen = cPicker.SelectedColor.ToString(); GreenScreen.Foreground = new SolidColorBrush(cPicker.SelectedColor); GreenScreen.Background = new SolidColorBrush(cPicker.SelectedColor); //gets the last 6 chars in string since it throws back opacity and Hash mark. PolicyViewModel.Instance.VideoOverlay.GreenScreen = PolicyViewModel.Instance.VideoOverlay.GreenScreen.Substring(PolicyViewModel.Instance.VideoOverlay.GreenScreen.Length - 6); Logger.Instance.logMessage("setting greeen screen.", LoggerEnum.message); PolicyViewModel.Instance.savePolicyToXml(); } } catch (Exception exception) { PolicyViewModel.Instance.VideoOverlay.GreenScreen = null; Logger.Instance.logMessage("setting green screen null ", LoggerEnum.message); PolicyViewModel.Instance.savePolicyToXml(); ErrorViewModel.Save(exception, GetType(), ErrorGroupEnum.UI, additionalInformation: Logger.Instance.getLoggedMessages()); } }