/// <summary> /// Initializes a new instance of the <see cref="ThumbnailAppearanceSettingsForm"/> class. /// </summary> /// <param name="thumbnailAppearance">The appearance of thumbnail.</param> public ThumbnailAppearanceSettingsForm(ThumbnailAppearance thumbnailAppearance) : this() { _thumbnailAppearance = thumbnailAppearance; ShowSettings(); }
/// <summary> /// Shows settings of the appearance. /// </summary> /// <param name="thumbnailAppearance">The appearance of thumbnail.</param> private void InitAppearance(ThumbnailAppearance thumbnailAppearance) { thumbnailAppearanceBackColorPanelControl.Color = thumbnailAppearance.BackColor; thumbnailAppearanceBorderColorPanelControl.Color = thumbnailAppearance.BorderColor; borderWidthValueLabel.Text = thumbnailAppearance.BorderWidth.ToString(); borderStyleValueLabel.Text = thumbnailAppearance.BorderStyle.ToString(); }
/// <summary> /// Initializes a new instance of the <see cref="ThumbnailAppearanceSettingsForm"/> class. /// </summary> /// <param name="thumbnailAppearance">The appearance of thumbnail.</param> /// <param name="title">The title of the form.</param> public ThumbnailAppearanceSettingsForm(ThumbnailAppearance thumbnailAppearance, string title) : this() { Text = title; _thumbnailAppearance = thumbnailAppearance; ShowSettings(); }
/// <summary> /// Initializes a new instance of the <see cref="ThumbnailViewerSettingsForm"/> class. /// </summary> /// <param name="viewer">The thumbnail viewer.</param> public ThumbnailViewerSettingsForm(ThumbnailViewer viewer) : this() { _viewer = viewer; _normalThumbnailAppearance = new ThumbnailAppearance(viewer.ThumbnailAppearance); _focusedThumbnailAppearance = new ThumbnailAppearance(viewer.FocusedThumbnailAppearance); _hoveredThumbnailAppearance = new ThumbnailAppearance(viewer.HoveredThumbnailAppearance); _selectedThumbnailAppearance = new ThumbnailAppearance(viewer.SelectedThumbnailAppearance); _notReadyThumbnailAppearance = new ThumbnailAppearance(viewer.NotReadyThumbnailAppearance); thumbnailAppearanceComboBox.SelectedIndex = 0; ShowSettings(); }
/// <summary> /// Handles the Click event of FocusedImageAppearance object. /// </summary> private void focusedImageAppearance_Click(object sender, EventArgs e) { // if focused image appearance does not exist if (_focusedImageAppearance == null) { // create focused image appearance _focusedImageAppearance = new ThumbnailAppearance(_viewer.FocusedImageAppearance); } // create image appearance settings form using (ThumbnailAppearanceSettingsForm dialog = new ThumbnailAppearanceSettingsForm(_focusedImageAppearance, "Focused Image Appearance Settings")) { // show dialog dialog.ShowDialog(); } }
/// <summary> /// Handles the Click event of EditThumbnailAppearanceButton object. /// </summary> private void editThumbnailAppearanceButton_Click(object sender, EventArgs e) { // get selected appearance ThumbnailAppearance appearance = GetSelectedAppearance(); // create appearance settings form using (ThumbnailAppearanceSettingsForm thumbnailAppearanceSettingsDialog = new ThumbnailAppearanceSettingsForm(appearance)) { // if appearance is changed if (thumbnailAppearanceSettingsDialog.ShowDialog() == DialogResult.OK) { // init appearance InitAppearance(appearance); } } }
/// <summary> /// Shows settings of the image viewer. /// </summary> private void ShowSettings() { // image anchor imageAnchorTypeEditor.SelectedAnchorType = _viewer.ImageAnchor; // rendering quality renderingQualityComboBox.SelectedItem = _viewer.RenderingQuality; // focus point focusPointAnchorTypeEditor.SelectedAnchorType = _viewer.FocusPointAnchor; focusPointIsFixedCheckBox.Checked = _viewer.IsFocusPointFixed; // buffering rendererCacheSizeNumericUpDown.Value = (int)Math.Round(_viewer.RendererCacheSize); viewerBufferSizeNumericUpDown.Value = (int)Math.Round(_viewer.ViewerBufferSize); minImageSizeWhenZoomBufferUsedNumericUpDown.Value = (int)Math.Round(_viewer.MinImageSizeWhenZoomBufferUsed); // backgroud color backgoundColorPanelControl.Color = _viewer.BackColor; // rendering _renderingSettings = _viewer.ImageRenderingSettings; previewIntervalOfVectorImagesNumericUpDown.Value = _viewer.IntermediateImagePreviewInterval; vectorRenderingQualityFactorTrackBar.Value = (int)((_viewer.VectorRenderingQualityFactor - 1) * 4f); maxThreadsNumericUpDown.Value = _viewer.MaxThreadsForRendering; renderOnlyVisibleImagesCheckBox.Checked = _viewer.RenderOnlyVisibleImages; // image display mode multipageDisplayModeComboBox.SelectedItem = _viewer.MultipageDisplayMode; layoutDirectionComboBox.SelectedItem = _viewer.MultipageDisplayLayoutDirection; imagesInRowColumnNumericUpDown.Value = _viewer.MultipageDisplayRowCount; imagesPaddingNumericUpDown.Value = (decimal)_viewer.MultipageDisplayImagePadding.All; _imageAppearance = _viewer.ImageAppearance; _focusedImageAppearance = _viewer.FocusedImageAppearance; useImageAppearancesInSinglepageModeCheckBox.Checked = _viewer.UseImageAppearancesInSinglePageMode; // keyboard keyboardNavigationCheckBox.Checked = _viewer.IsKeyboardNavigationEnabled; keyboardNavigationGroupBox.Enabled = keyboardNavigationCheckBox.Checked; keyboardNavigationScrollStepNumericUpDown.Value = _viewer.KeyboardNavigationScrollStep; keyboardNavigationZoomStepNumericUpDown.Value = (decimal)_viewer.KeyboardNavigationZoomStep; }