INT_PTR dialog_proc(int msg, int param1, void* param2) { if (msg == DN_CLOSE && param1 >= 0 && param1 != cancel_ctrl_id) { options = read_controls(); } else if (msg == DN_INITDIALOG) { set_control_state(); } else if (msg == DN_BTNCLICK) { set_control_state(); } else if (msg == DN_EDITCHANGE && param1 == module_ctrl_id) { set_control_state(); } else if (msg == DN_EDITCHANGE && param1 == profile_ctrl_id) { unsigned profile_idx = get_list_pos(profile_ctrl_id); if (profile_idx != -1 && profile_idx < profiles.size()) { write_controls(profiles[profile_idx].options); set_control_state(); } } if (msg == DN_EDITCHANGE || msg == DN_BTNCLICK) { unsigned profile_idx = static_cast<unsigned>(profiles.size()); SfxOptions options; bool valid_options = true; try { options = read_controls(); } catch (const Error&) { valid_options = false; } if (valid_options) { for (unsigned i = 0; i < profiles.size(); i++) { if (options == profiles[i].options) { profile_idx = i; break; } } } if (profile_idx != get_list_pos(profile_ctrl_id)) { DisableEvents de(*this); set_list_pos(profile_ctrl_id, profile_idx); set_control_state(); } } return default_dialog_proc(msg, param1, param2); }
intptr_t dialog_proc(intptr_t msg, intptr_t param1, void* param2) { if ((msg == DN_CLOSE) && (param1 >= 0) && (param1 != cancel_ctrl_id)) { options.use_full_install_ui = get_check(use_full_install_ui_ctrl_id); options.update_stable_builds = get_check(update_stable_builds_ctrl_id); options.logged_install = get_check(logged_install_ctrl_id); options.open_changelog = get_check(open_changelog_ctrl_id); options.install_properties = get_text(install_properties_ctrl_id); options.http.use_proxy = get_check(use_proxy_ctrl_id); options.http.proxy_server = get_text(proxy_server_ctrl_id); options.http.proxy_port = str_to_int(get_text(proxy_port_ctrl_id)); options.http.proxy_auth_scheme = get_list_pos(proxy_auth_scheme_ctrl_id); options.http.proxy_user_name = get_text(proxy_user_name_ctrl_id); options.http.proxy_password = get_text(proxy_password_ctrl_id); options.cache_enabled = get_check(cache_enabled_ctrl_id); options.cache_max_size = str_to_int(get_text(cache_max_size_ctrl_id)); options.cache_dir = get_text(cache_dir_ctrl_id); } else if (msg == DN_INITDIALOG) { bool f_enabled = get_check(use_proxy_ctrl_id); for (int ctrl_id = use_proxy_ctrl_id + 1; ctrl_id <= proxy_password_ctrl_id; ctrl_id++) enable(ctrl_id, f_enabled); f_enabled = get_check(cache_enabled_ctrl_id); for (int ctrl_id = cache_enabled_ctrl_id + 1; ctrl_id <= cache_dir_ctrl_id; ctrl_id++) enable(ctrl_id, f_enabled); return TRUE; } else if ((msg == DN_BTNCLICK) && (param1 == use_proxy_ctrl_id)) { bool f_enabled = param2 ? true : false; for (int ctrl_id = use_proxy_ctrl_id + 1; ctrl_id <= proxy_password_ctrl_id; ctrl_id++) enable(ctrl_id, f_enabled); } else if ((msg == DN_BTNCLICK) && (param1 == cache_enabled_ctrl_id)) { bool f_enabled = param2 ? true : false; for (int ctrl_id = cache_enabled_ctrl_id + 1; ctrl_id <= cache_dir_ctrl_id; ctrl_id++) enable(ctrl_id, f_enabled); } return default_dialog_proc(msg, param1, param2); }
virtual INT_PTR dialog_proc(int msg, int param1, void* param2) { return default_dialog_proc(msg, param1, param2); }