/// <summary> /// Reset copy command parameter to default value. /// </summary> public void ResetToDefaultValue() { bool bIsMetrice = dll.IsMetricCountry(); m_scaling = 100; m_scanMode = EnumCopyScanMode.Photo; m_nin1 = EnumNin1._1up; m_dpi = EnumCopyResln._300x300; m_mediaType = EnumMediaType.Plain; m_density = 2; chkBtnIDCardCopy.IsChecked = false; spinCtlCopies.Value = 1; if (bIsMetrice) { m_docSize = EnumPaperSizeInput._A4; m_outputSize = EnumPaperSizeOutput._A4; } else { m_docSize = EnumPaperSizeInput._Letter; m_outputSize = EnumPaperSizeOutput._Letter; } }
private void chkNin1_Checked(object sender, RoutedEventArgs e) { if (m_isWindowLoaded) { if (EnumNin1._4up == m_preNin1 || EnumNin1._9up == m_preNin1) { m_nin1 = m_preNin1; } else { m_nin1 = EnumNin1._2up; } InitNin1(); ScalingGroup.IsEnabled = EnumNin1._1up == m_nin1; rdbtn2.IsEnabled = true; tk2in1.IsEnabled = true; tk2in1.Foreground = m_brEnable; if (false == m_disable4or9in1) { rdbtn4.IsEnabled = true; tk4in1.IsEnabled = true; tk9in1.IsEnabled = true; rdbtn9.IsEnabled = true; tk4in1.Foreground = m_brEnable; tk9in1.Foreground = m_brEnable; } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (EnumCopyScanMode.Text == m_scanMode) { rdBtnScanModeTxt.IsChecked = true; rdBtnScanModePhoto.IsChecked = false; } else if (EnumCopyScanMode.Photo == m_scanMode) { rdBtnScanModeTxt.IsChecked = false; rdBtnScanModePhoto.IsChecked = true; } decimal nOriginalScaling = spinnerScaling.Value; InitCboDocSize(); InitCboResolution(); InitCboOutputSize(); InitCboMediaType(); InitNin1(); m_preNin1 = m_nin1; m_isWindowLoaded = true; SetOutputSizeViaNin1(); spinnerScaling.Value = nOriginalScaling; if (m_isIDCardCopy) { //spinnerScaling.IsEnabled = false; spinnerScaling.Value = 100; ScalingGroup.IsEnabled = false; } if (EnumNin1._1up != m_nin1) { //spinnerScaling.IsEnabled = false; ScalingGroup.IsEnabled = false; } TextBox tb = spinnerScaling.Template.FindName("tbTextBox", spinnerScaling) as TextBox; tb.TextChanged += new TextChangedEventHandler(SpinnerTextBox_TextChanged); tb.PreviewTextInput += new TextCompositionEventHandler(SpinnerTextBox_PreviewTextInput); tb.PreviewKeyDown += new KeyEventHandler(OnPreviewKeyDown); chkpopupIDCard.IsChecked = m_popupDlgIDCardCopy; chkpopupNIn1.IsChecked = m_popupDlgNIn1Copy; InitFontSize(); }
private void btnDefault_Click(object sender, RoutedEventArgs e) { cboDocSize.Items.Clear(); cboResolution.Items.Clear(); cboOutputSize.Items.Clear(); cboMediaType.Items.Clear(); bool bIsMetrice = dll.IsMetricCountry(); spinnerScaling.Value = 100; m_scanMode = EnumCopyScanMode.Photo; if (bIsMetrice) { m_docSize = EnumPaperSizeInput._A4; m_outputSize = EnumPaperSizeOutput._A4; } else { m_docSize = EnumPaperSizeInput._Letter; m_outputSize = EnumPaperSizeOutput._Letter; } //if ( true == m_isIDCardCopy ) // m_outputSize = EnumPaperSizeOutput._A4; m_nin1 = EnumNin1._1up; m_dpi = m_isIDCardCopy ? EnumCopyResln._600x600 : EnumCopyResln._300x300; m_mediaType = EnumMediaType.Plain; m_preNin1 = EnumNin1._2up; InitCboDocSize(); InitCboResolution(); InitCboOutputSize(); InitCboMediaType(); InitNin1(); if (EnumCopyScanMode.Text == m_scanMode) { rdBtnScanModeTxt.IsChecked = true; rdBtnScanModePhoto.IsChecked = false; } else if (EnumCopyScanMode.Photo == m_scanMode) { rdBtnScanModeTxt.IsChecked = false; rdBtnScanModePhoto.IsChecked = true; } chkpopupIDCard.IsChecked = true; chkpopupNIn1.IsChecked = true; }
/// <summary> /// Reset value of constrained items for id card copy. /// </summary> private void ResetValueForIDCardCopy() { m_scaling = 100; m_nin1 = EnumNin1._1up; m_dpi = EnumCopyResln._600x600; //m_outputSize = EnumPaperSizeOutput._A4; bool bIsMetrice = dll.IsMetricCountry(); if (bIsMetrice) { m_outputSize = EnumPaperSizeOutput._A4; } else { m_outputSize = EnumPaperSizeOutput._Letter; } }
private void chkNin1_Unchecked(object sender, RoutedEventArgs e) { if (m_isWindowLoaded) { m_nin1 = EnumNin1._1up; ScalingGroup.IsEnabled = EnumNin1._1up == m_nin1; InitNin1(); rdbtn2.IsEnabled = false; rdbtn4.IsEnabled = false; rdbtn9.IsEnabled = false; tk2in1.IsEnabled = false; tk4in1.IsEnabled = false; tk9in1.IsEnabled = false; tk2in1.Foreground = m_brDisable; tk4in1.Foreground = m_brDisable; tk9in1.Foreground = m_brDisable; } }
private void SettingBtnClick(object sender, RoutedEventArgs e) { CopySetting win = new CopySetting(); if (true == chkBtnIDCardCopy.IsChecked) { win.m_isIDCardCopy = true; ResetValueForIDCardCopy(); } win.Owner = m_MainWin; win.spinnerScaling.Value = m_scaling; win.m_scanMode = m_scanMode; win.m_docSize = m_docSize; win.m_outputSize = m_outputSize; win.m_nin1 = m_nin1; win.m_dpi = m_dpi; win.m_mediaType = m_mediaType; win.m_popupDlgIDCardCopy = m_MainWin.m_popupIDCard; win.m_popupDlgNIn1Copy = m_MainWin.m_popupNIn1; if (true == win.ShowDialog()) { m_scaling = (ushort)win.spinnerScaling.Value; m_scanMode = win.m_scanMode; m_docSize = win.m_docSize; m_outputSize = win.m_outputSize; m_nin1 = win.m_nin1; m_dpi = win.m_dpi; m_mediaType = win.m_mediaType; m_MainWin.m_popupIDCard = win.m_popupDlgIDCardCopy; m_MainWin.m_popupNIn1 = win.m_popupDlgNIn1Copy; } }
private void RdbtnChecked(object sender, RoutedEventArgs e) { if (true == chkNin1.IsChecked) { if (true == rdbtn2.IsChecked) { m_preNin1 = EnumNin1._2up; m_nin1 = EnumNin1._2up; ScalingGroup.IsEnabled = EnumNin1._1up == m_nin1; } else if (true == rdbtn4.IsChecked) { m_preNin1 = EnumNin1._4up; m_nin1 = EnumNin1._4up; ScalingGroup.IsEnabled = EnumNin1._1up == m_nin1; } else if (true == rdbtn9.IsChecked) { m_preNin1 = EnumNin1._9up; m_nin1 = EnumNin1._9up; ScalingGroup.IsEnabled = EnumNin1._1up == m_nin1; } } }