#include "stdafx.h" #include "PoroMediaDialogShare.h" ////////////////////////////////////////////////////////////////////////////////////////////////// // // Call the following to disable/enable common user input fields // ////////////////////////////////////////////////////////////////////////////////////////////////// void PoroMediaDialogShare::DisableCommonInputs(){ // input and output controls and variables, all should be disabled button_directory_input.EnableWindow(FALSE); field_directory_and_file_input_cntrl.EnableWindow(FALSE); button_directory_output.EnableWindow(FALSE); field_directory_work_cntrl.EnableWindow(FALSE); field_name_output_cntrl.EnableWindow(FALSE); // input parameter variables and controls, all should be disabled field_start_slice_cntrl.EnableWindow(FALSE); field_start_X_cntrl.EnableWindow(FALSE); field_start_Y_cntrl.EnableWindow(FALSE); field_width_slices_cntrl.EnableWindow(FALSE); field_width_X_cntrl.EnableWindow(FALSE); field_width_Y_cntrl.EnableWindow(FALSE); field_end_slice_cntrl.EnableWindow(FALSE); field_end_X_cntrl.EnableWindow(FALSE); field_end_Y_cntrl.EnableWindow(FALSE); check_auto_calc_params.EnableWindow(FALSE); field_pixel_size_cntrl.EnableWindow(FALSE); //disable 'cancel' and 'ok', enable 'stop button_OK.EnableWindow(FALSE); button_CANCEL.EnableWindow(FALSE); button_STOP.EnableWindow(TRUE); // Binarization Settings, if (is_control_enabled(BINARIZE_CONTROLS) ) { check_image_is_inverted.EnableWindow(FALSE); combo_threshold_method.EnableWindow(FALSE); field_manual_threshold.EnableWindow(FALSE); pbar_threshold_sensitivity.EnableWindow(FALSE); txt_field_threshold_val.EnableWindow(FALSE); txt_field_threshold_sensitive.EnableWindow(FALSE); } // filters if (is_control_enabled(FILTER_CONTROLS) ) { check_filter_contrast_enable.EnableWindow(FALSE); check_filter_convolve_enable.EnableWindow(FALSE); check_filter_aniso_enable.EnableWindow(FALSE); check_filter_voxrem_enable.EnableWindow(FALSE); check_filter_close_enable.EnableWindow(FALSE); } // save options if (is_control_enabled(FILESAVE_CONTROLS) ) { check_save_raw_stack.EnableWindow(FALSE); check_save_cbin_stack.EnableWindow(FALSE); } if (is_control_enabled(PROGRESS_CONTROLS) ) { pbar_simulation_progress.SetBkColor(RGB(100, 170, 100)); } } void PoroMediaDialogShare::EnableCommonInputs(){ // input and output controls and variables, all should be disabled button_directory_input.EnableWindow(TRUE); field_directory_and_file_input_cntrl.EnableWindow(TRUE); button_directory_output.EnableWindow(TRUE); field_directory_work_cntrl.EnableWindow(TRUE); field_name_output_cntrl.EnableWindow(TRUE); //buttons button_OK.EnableWindow(TRUE); button_CANCEL.EnableWindow(TRUE); button_STOP.EnableWindow(FALSE); // input parameter variables and controls field_width_slices_cntrl.EnableWindow(TRUE); field_width_X_cntrl.EnableWindow(TRUE); field_width_Y_cntrl.EnableWindow(TRUE); check_auto_calc_params.EnableWindow(TRUE); field_pixel_size_cntrl.EnableWindow(TRUE); //if mult file input, enable first/last slice fields if ( (input_file_ext == INPUT_IS_CBIN) || (input_file_ext == INPUT_IS_BIN) || (input_file_ext == INPUT_IS_RAW) || (input_file_ext == INPUT_IS_BMP)){ field_start_slice_cntrl.EnableWindow(TRUE); field_end_slice_cntrl.EnableWindow(TRUE); } //if bmp, enable cropping if (input_file_ext == INPUT_IS_BMP){ field_start_X_cntrl.EnableWindow(TRUE); field_start_Y_cntrl.EnableWindow(TRUE); field_end_X_cntrl.EnableWindow(TRUE); field_end_Y_cntrl.EnableWindow(TRUE); } // if bmp, raw, or stack.raw, reenable binarization options and RAW filters if ( (input_file_ext == INPUT_IS_BMP) || (input_file_ext == INPUT_IS_RAW) || (input_file_ext == INPUT_IS_RAW_STACK)){ if (is_control_enabled(FILTER_CONTROLS) ) { check_filter_contrast_enable.EnableWindow(TRUE); check_filter_convolve_enable.EnableWindow(TRUE); check_filter_aniso_enable.EnableWindow(TRUE); } if (is_control_enabled(BINARIZE_CONTROLS) ) { check_image_is_inverted.EnableWindow(TRUE); combo_threshold_method.EnableWindow(TRUE); if (combo_threshold_method.GetCurSel() == 0){ field_manual_threshold.EnableWindow(TRUE); pbar_threshold_sensitivity.EnableWindow(TRUE); txt_field_threshold_val.EnableWindow(TRUE); txt_field_threshold_sensitive.EnableWindow(TRUE); } } } if (is_control_enabled(FILESAVE_CONTROLS) ) { //if BMP reenable all save options if ( input_file_ext == INPUT_IS_BMP ){ //save options check_save_raw_stack.EnableWindow(TRUE); check_save_cbin_stack.EnableWindow(TRUE); }//if RAW then reenable Bin save option if ( (input_file_ext == INPUT_IS_RAW) || (input_file_ext == INPUT_IS_RAW_STACK) ) check_save_cbin_stack.EnableWindow(TRUE); } if (is_control_enabled(FILTER_CONTROLS) ) { check_filter_voxrem_enable.EnableWindow(TRUE); check_filter_close_enable.EnableWindow(TRUE); } //color of progress bar if (is_control_enabled(PROGRESS_CONTROLS) ) { pbar_simulation_progress.SetBkColor(RGB(100, 100, 100)); } }