protected override void OnLoad(object sender, EventArgs eventArgs) { if (SelectedImages != null && SelectedImages.Count > 1) { checkboxApplyToSelected.Text = string.Format(checkboxApplyToSelected.Text, SelectedImages.Count); } else { ConditionalControls.Hide(checkboxApplyToSelected, 6); } new LayoutManager(this) .Bind(tbAngle, pictureBox) .WidthToForm() .Bind(pictureBox) .HeightToForm() .Bind(btnOK, btnCancel, txtAngle) .RightToForm() .Bind(tbAngle, txtAngle, checkboxApplyToSelected, btnRevert, btnOK, btnCancel) .BottomToForm() .Activate(); Size = new Size(600, 600); workingImage = scannedImageRenderer.Render(Image); pictureBox.Image = (Bitmap)workingImage.Clone(); txtAngle.Text += '\u00B0'; UpdatePreviewBox(); ActiveControl = txtAngle; }
protected override void OnLoad(object sender, EventArgs eventArgs) { new LayoutManager(this) .Bind(logoPictureBox) .TopTo(() => Height / 2) .Activate(); #if INSTALLER_MSI ConditionalControls.Hide(cbCheckForUpdates, 15); ConditionalControls.Hide(lblUpdateStatus, 5); #else cbCheckForUpdates.Checked = userConfigManager.Config.CheckForUpdates; UpdateControls(); DoUpdateCheck(); #endif }
private async void ImageForm_Load(object sender, EventArgs e) { checkboxApplyToSelected.BringToFront(); btnRevert.BringToFront(); btnCancel.BringToFront(); btnOK.BringToFront(); if (SelectedImages != null && SelectedImages.Count > 1) { checkboxApplyToSelected.Text = string.Format(checkboxApplyToSelected.Text, SelectedImages.Count); } else { ConditionalControls.Hide(checkboxApplyToSelected, 6); } Size = new Size(600, 600); var maxDimen = Screen.AllScreens.Max(s => Math.Max(s.WorkingArea.Height, s.WorkingArea.Width)); if (scannedImageRenderer == null) { return; } workingImage = await scannedImageRenderer.Render(Image, maxDimen * 2); if (closed) { workingImage?.Dispose(); return; } workingImage2 = (Bitmap)workingImage.Clone(); InitTransform(); lock (this) { initComplete = true; } UpdatePreviewBox(); }
private void UpdateControls() { const int margin = 5; if (cbCheckForUpdates.Checked) { if (lblUpdateStatus.Visible == false && linkInstall.Visible == false) { ConditionalControls.Show(lblUpdateStatus, margin); } if (hasCheckedForUpdates) { if (update == null) { lblUpdateStatus.Text = MiscResources.NoUpdates; lblUpdateStatus.Visible = true; linkInstall.Visible = false; } else { linkInstall.Text = string.Format(MiscResources.Install, update.Name); lblUpdateStatus.Visible = false; linkInstall.Visible = true; } } else { lblUpdateStatus.Text = MiscResources.CheckingForUpdates; lblUpdateStatus.Visible = true; linkInstall.Visible = false; } } else { ConditionalControls.Hide(lblUpdateStatus, margin); ConditionalControls.Hide(linkInstall, margin); } }
protected override void OnLoad(object sender, EventArgs eventArgs) { if (SelectedImages != null && SelectedImages.Count > 1) { checkboxApplyToSelected.Text = string.Format(checkboxApplyToSelected.Text, SelectedImages.Count); } else { ConditionalControls.Hide(checkboxApplyToSelected, 6); } var lm = new LayoutManager(this) .Bind(pictureBox) .WidthToForm() .HeightToForm() .Bind(tbLeft, tbRight) .WidthTo(() => (int)(GetImageWidthRatio() * pictureBox.Width)) .LeftTo(() => (int)((1 - GetImageWidthRatio()) * pictureBox.Width / 2)) .Bind(tbTop, tbBottom) .HeightTo(() => (int)(GetImageHeightRatio() * pictureBox.Height)) .TopTo(() => (int)((1 - GetImageHeightRatio()) * pictureBox.Height / 2)) .Bind(tbBottom, btnOK, btnCancel) .RightToForm() .Bind(tbRight, checkboxApplyToSelected, btnRevert, btnOK, btnCancel) .BottomToForm() .Activate(); Size = new Size(600, 600); workingImage = scannedImageRenderer.Render(Image); workingImage2 = scannedImageRenderer.Render(Image); UpdateCropBounds(); UpdatePreviewBox(); lm.UpdateLayout(); }