Ejemplo n.º 1
0
	static void save_string(HWND wnd)
	{
		int id = g_cur_tab2;
		if (id >= 0 && id < 2)
		{
			if (id == 0) cfg_globalstring = string_utf8_from_window(wnd, IDC_STRING);
			else if (id == 1) cfg_colour = string_utf8_from_window(wnd, IDC_STRING);
		}
	}
Ejemplo n.º 2
0
void CMyPreferences::apply() {
	char temp[16];
	int t = GetDlgItemInt( IDC_SAMPLERATE, NULL, FALSE );
	if ( t < 6000 ) t = 6000;
	else if ( t > 96000 ) t = 96000;
	SetDlgItemInt( IDC_SAMPLERATE, t, FALSE );
	itoa( t, temp, 10 );
	cfg_history_rate.add_item(temp);
	cfg_sample_rate = t;
	cfg_vgm_loop_count = SendDlgItemMessage( IDC_VGMLOOPCOUNT, CB_GETCURSEL );
	cfg_spc_interpolation = SendDlgItemMessage( IDC_INTERPOLATION, CB_GETCURSEL ) - 2;
	t = parse_time_crap( string_utf8_from_window( GetDlgItem( IDC_DLENGTH ) ) );
	if ( t != BORK_TIME ) cfg_default_length = t;
	else
	{
		print_time_crap( cfg_default_length, (char *)&temp );
		uSetDlgItemText( m_hWnd, IDC_DLENGTH, (char *)&temp );
	}
	t = parse_time_crap( string_utf8_from_window( GetDlgItem( IDC_DFADE ) ) );
	if ( t != BORK_TIME ) cfg_default_fade = t;
	else
	{
		print_time_crap( cfg_default_fade, (char *)&temp );
		uSetDlgItemText( m_hWnd, IDC_DFADE, (char *)&temp );
	}
	cfg_indefinite = SendDlgItemMessage( IDC_INDEFINITE, BM_GETCHECK );
	cfg_write = SendDlgItemMessage( IDC_WRITE, BM_GETCHECK );
	cfg_write_nsfe = SendDlgItemMessage( IDC_WNSFE, BM_GETCHECK );
	cfg_nsfe_ignore_playlists = SendDlgItemMessage( IDC_NSFEPL, BM_GETCHECK );
	cfg_nsf_ignore_w4011 = SendDlgItemMessage( IDC_NSF4011, BM_GETCHECK );
	cfg_spc_anti_surround = SendDlgItemMessage( IDC_ANTISURROUND, BM_GETCHECK );
	cfg_vgm_gd3_prefers_japanese = SendDlgItemMessage( IDC_GD3JAPANESE, BM_GETCHECK );
	cfg_effects_enable = SendDlgItemMessage( IDC_EFFECTS, BM_GETCHECK );
	cfg_format_enable = ~0;
	for (unsigned wp = IDC_FORMAT_NSF; wp <= IDC_FORMAT_SFM; wp++)
	{
		unsigned bit = 1 << ( wp - IDC_FORMAT_NSF );
		unsigned mask = ~0 ^ bit;
		cfg_format_enable = ( cfg_format_enable & mask ) | ( bit * SendDlgItemMessage( wp, BM_GETCHECK ) );
	}
	cfg_effects_bass = SendDlgItemMessage( IDC_SLIDER_BASS, TBM_GETPOS );
	cfg_effects_treble = SendDlgItemMessage( IDC_SLIDER_TREBLE, TBM_GETPOS );
	cfg_effects_echo_depth = SendDlgItemMessage( IDC_SLIDER_ECHO_DEPTH, TBM_GETPOS );
	
	OnChanged(); //our dialog content has not changed but the flags have - our currently shown values now match the settings so the apply button can be disabled
}
Ejemplo n.º 3
0
BOOL t_config_tab2::DialogProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
{
	switch (msg)
	{
		case WM_INITDIALOG:
		{
			m_initialising = true;
			m_wnd_artwork_string = GetDlgItem(wnd, IDC_ARTWORK_STRING);
			m_wnd_add_artwork = GetDlgItem(wnd, IDC_ADDARTWORK);
			m_wnd_add_gapless = GetDlgItem(wnd, IDC_SCANGAPLESS);
			m_wnd_dummy_gapless = GetDlgItem(wnd, IDC_USEDUMMYGAPLESS);
			m_wnd_video_thumbailer_enabled = GetDlgItem(wnd, IDC_THUMBAILVIDEOS);

			m_wnd_fb2k_artwork = GetDlgItem(wnd, IDC_FB2KARTWORK);

			uSetWindowText(m_wnd_artwork_string, settings::artwork_sources);
			Button_SetCheck(m_wnd_add_artwork, settings::add_artwork ? BST_CHECKED : BST_UNCHECKED);
			Button_SetCheck(m_wnd_add_gapless, settings::add_gapless ? BST_CHECKED : BST_UNCHECKED);
			Button_SetCheck(m_wnd_fb2k_artwork, settings::use_fb2k_artwork ? BST_CHECKED : BST_UNCHECKED);
			Button_SetCheck(m_wnd_dummy_gapless, settings::use_dummy_gapless_data ? BST_CHECKED : BST_UNCHECKED);
			Button_SetCheck(m_wnd_video_thumbailer_enabled, settings::video_thumbnailer_enabled ? BST_CHECKED : BST_UNCHECKED);

			on_add_artwork_change();
			on_add_gapless_change();
			m_initialising = false;
		}
		break;
		case WM_COMMAND:
			switch (wp)
			{
				case IDC_ADDARTWORK | (BN_CLICKED << 16) :
					settings::add_artwork = Button_GetCheck(m_wnd_add_artwork) == BST_CHECKED;
					on_add_artwork_change();
					break;
				case IDC_FB2KARTWORK | (BN_CLICKED << 16) :
					settings::use_fb2k_artwork = Button_GetCheck(m_wnd_fb2k_artwork) == BST_CHECKED;
					break;
				case IDC_THUMBAILVIDEOS | (BN_CLICKED << 16) :
					settings::video_thumbnailer_enabled = Button_GetCheck(m_wnd_video_thumbailer_enabled) == BST_CHECKED;
					break;
				case IDC_SCANGAPLESS | (BN_CLICKED << 16) :
					settings::add_gapless = Button_GetCheck(m_wnd_add_gapless) == BST_CHECKED;
					on_add_gapless_change();
					break;
				case IDC_USEDUMMYGAPLESS | (BN_CLICKED << 16) :
					settings::use_dummy_gapless_data = Button_GetCheck(m_wnd_add_gapless) == BST_CHECKED;
					break;
				case IDC_ARTWORK_STRING | (EN_CHANGE << 16) :
					if (!m_initialising)
						settings::artwork_sources = string_utf8_from_window((HWND)lp);
					break;
			}
			break;
		case WM_DESTROY:
			break;
	}
	return FALSE;
}
Ejemplo n.º 4
0
bool CMyPreferences::HasChanged() {
	//returns whether our dialog content is different from the current configuration (whether the apply button should be enabled or not)
	bool changed = false;
	if ( !changed && GetDlgItemInt( IDC_SAMPLERATE, NULL, FALSE ) != cfg_sample_rate ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_INTERPOLATION, CB_GETCURSEL ) != cfg_spc_interpolation + 2 ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_VGMLOOPCOUNT, CB_GETCURSEL ) != cfg_vgm_loop_count ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_INDEFINITE, BM_GETCHECK ) != cfg_indefinite ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_WRITE, BM_GETCHECK ) != cfg_write ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_WNSFE, BM_GETCHECK ) != cfg_write_nsfe ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_NSFEPL, BM_GETCHECK ) != cfg_nsfe_ignore_playlists ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_NSF4011, BM_GETCHECK ) != cfg_nsf_ignore_w4011 ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_ANTISURROUND, BM_GETCHECK ) != cfg_spc_anti_surround ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_GD3JAPANESE, BM_GETCHECK ) != cfg_vgm_gd3_prefers_japanese ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_EFFECTS, BM_GETCHECK ) != cfg_effects_enable ) changed = true;
	if ( !changed )
	{
		unsigned format_enable = ~0;
		for (unsigned wp = IDC_FORMAT_NSF; wp <= IDC_FORMAT_SFM; wp++)
		{
			unsigned bit = 1 << ( wp - IDC_FORMAT_NSF );
			unsigned mask = ~0 ^ bit;
			format_enable = ( format_enable & mask ) | ( bit * SendDlgItemMessage( wp, BM_GETCHECK ) );
		}
		if ( format_enable != cfg_format_enable ) changed = true;
	}
	if ( !changed && SendDlgItemMessage( IDC_SLIDER_BASS, TBM_GETPOS ) != cfg_effects_bass ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_SLIDER_TREBLE, TBM_GETPOS ) != cfg_effects_treble ) changed = true;
	if ( !changed && SendDlgItemMessage( IDC_SLIDER_ECHO_DEPTH, TBM_GETPOS ) != cfg_effects_echo_depth ) changed = true;
	if ( !changed )
	{
		int t = parse_time_crap( string_utf8_from_window( GetDlgItem( IDC_DLENGTH ) ) );
		if ( t != BORK_TIME && t != cfg_default_length ) changed = true;
	}
	if ( !changed )
	{
		int t = parse_time_crap( string_utf8_from_window( GetDlgItem( IDC_DFADE ) ) );
		if ( t != BORK_TIME && t != cfg_default_fade ) changed = true;
	}
	return changed;
}
Ejemplo n.º 5
0
	static BOOL CALLBACK ConfigProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
	{
		switch (msg)
		{
		case WM_INITDIALOG:
		{
			uTCITEM tabs;
			memset(&tabs, 0, sizeof(tabs));

			HWND wnd_tab = GetDlgItem(wnd, IDC_TAB1);

			tabs.mask = TCIF_TEXT;
			tabs.pszText = "Variables";
			uTabCtrl_InsertItem(wnd_tab, 0, &tabs);
			tabs.pszText = "Style";
			uTabCtrl_InsertItem(wnd_tab, 1, &tabs);

			TabCtrl_SetCurSel(wnd_tab, g_cur_tab2);

			uSendDlgItemMessageText(wnd, IDC_CHAR7, WM_SETTEXT, 0, "\x07");
			colour_code_gen(wnd, IDC_COLOUR, false, true);

			uSendDlgItemMessage(wnd, IDC_STRING, EM_LIMITTEXT, 0, 0);

			refresh_me(wnd);
			editproc = (WNDPROC)SetWindowLongPtr(GetDlgItem(wnd, IDC_STRING), GWLP_WNDPROC, (LPARAM)EditHook);

			g_editor_font_notify.set(GetDlgItem(wnd, IDC_STRING));
		}

		break;

		case WM_NOTIFY:
			switch (((LPNMHDR)lp)->idFrom)
			{
			case IDC_TAB1:
				switch (((LPNMHDR)lp)->code)
				{
				case TCN_SELCHANGE:
				{
					save_string(wnd);
					int id = TabCtrl_GetCurSel(GetDlgItem(wnd, IDC_TAB1));
					g_cur_tab2 = id;
					uSendDlgItemMessageText(wnd, IDC_STRING, WM_SETTEXT, 0, (g_cur_tab2 == 0 ? cfg_globalstring : cfg_colour));
				}
				break;
				}
				break;
			}
			break;

		case WM_DESTROY:
		{
			g_editor_font_notify.release();
			save_string(wnd);
			refresh_all_playlist_views();
			pvt::ng_playlist_view_t::g_update_all_items();
		}
		break;

		case WM_COMMAND:
			switch (wp)
			{
			case IDC_GLOBAL:
				cfg_global = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_DATE:
				cfg_playlist_date = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				set_day_timer();
				pvt::ng_playlist_view_t::g_on_use_date_info_change();
				break;
			case IDC_TFHELP:
			{
				RECT rc;
				GetWindowRect(GetDlgItem(wnd, IDC_TFHELP), &rc);
				//		MapWindowPoints(HWND_DESKTOP, wnd, (LPPOINT)(&rc), 2);
				HMENU menu = CreatePopupMenu();


				enum { IDM_TFHELP = 1, IDM_GHELP = 2, IDM_SPEEDTEST, IDM_PREVIEW, IDM_EDITORFONT, IDM_RESETSTYLE };

				uAppendMenu(menu, (MF_STRING), IDM_TFHELP, "Titleformatting &help");
				uAppendMenu(menu, (MF_STRING), IDM_GHELP, "&Global help");
				uAppendMenu(menu, (MF_SEPARATOR), 0, "");
				uAppendMenu(menu, (MF_STRING), IDM_SPEEDTEST, "&Speed test");
				uAppendMenu(menu, (MF_STRING), IDM_PREVIEW, "&Preview to console");
				uAppendMenu(menu, (MF_SEPARATOR), 0, "");
				uAppendMenu(menu, (MF_STRING), IDM_EDITORFONT, "Change editor &font");
				uAppendMenu(menu, (MF_SEPARATOR), 0, "");
				uAppendMenu(menu, (MF_STRING), IDM_RESETSTYLE, "&Reset style string");


				int cmd = TrackPopupMenu(menu, TPM_LEFTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, 0, wnd, 0);
				DestroyMenu(menu);
				if (cmd == IDM_TFHELP)
				{
					standard_commands::main_titleformat_help();
				}
				else if (cmd == IDM_GHELP)
				{
					uMessageBox(wnd, COLOUR_HELP "\n\nNew global format: $set_global(var, val), retreive values using $get_global(var)", "Global help", 0);
				}
				else if (cmd == IDM_SPEEDTEST)
				{
					speedtest(g_columns, cfg_global != 0, cfg_oldglobal != 0, cfg_playlist_date != 0);
				}
				else if (cmd == IDM_PREVIEW)
				{
					preview_to_console(string_utf8_from_window(wnd, IDC_STRING), g_cur_tab2 != 0 && cfg_global);
				}
				else if (cmd == IDM_EDITORFONT)
				{
					if (font_picker(wnd, cfg_editor_font))
						g_editor_font_notify.on_change();
				}
				else if (cmd == IDM_RESETSTYLE)
				{
					extern const char * g_default_colour;
					cfg_colour = g_default_colour;
					if (g_cur_tab2 == 1)
						uSendDlgItemMessageText(wnd, IDC_STRING, WM_SETTEXT, 0, cfg_colour);
					refresh_all_playlist_views();
					pvt::ng_playlist_view_t::g_update_all_items();
				}
			}


			break;
			case IDC_OLDGLOBAL:
				cfg_oldglobal = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_GLOBALSORT:
				cfg_global_sort = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_APPLY:
				save_string(wnd);
				refresh_all_playlist_views();
				pvt::ng_playlist_view_t::g_update_all_items();
				break;
			case IDC_PICK_COLOUR:
				colour_code_gen(wnd, IDC_COLOUR, false, false);
				break;
			}
		}
		return 0;
	}
Ejemplo n.º 6
0
	static BOOL CALLBACK ConfigProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
	{

		switch (msg)
		{
		case WM_INITDIALOG:
		{
			refresh_me(wnd);
			initialised = true;
		}

		break;
		case WM_DESTROY:
		{
			initialised = false;
		}
		break;
		case WM_COMMAND:
			switch (wp)
			{


			case (EN_CHANGE << 16) | IDC_STRING:
				main_window::config_notification_icon_script.set(string_utf8_from_window((HWND)lp));
				break;

			case IDC_NOWPL:
			{
				cfg_np = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;
			case IDC_USE_CUSTOM_ICON:
			{
				cfg_custom_icon = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				create_icon_handle(); create_systray_icon();
			}
			break;
			case IDC_BROWSE_ICON:
			{
				pfc::string8 path = cfg_tray_icon_path;
				if (uGetOpenFileName(wnd, "Icon Files (*.ico)|*.ico|All Files (*.*)|*.*", 0, "ico", "Choose Icon", NULL, path, FALSE))
				{
					cfg_tray_icon_path = path;
					if (cfg_custom_icon) { create_icon_handle(); create_systray_icon(); }
				}
			}
			break;


			case IDC_MINIMISE_TO_SYSTRAY:
			{
				cfg_minimise_to_tray = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;
			case IDC_SHOW_SYSTRAY:
			{
				cfg_show_systray = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				//				EnableWindow(GetDlgItem(wnd, IDC_MINIMISE_TO_SYSTRAY), cfg_show_systray);

				if (g_main_window)
				{
					auto is_iconic = IsIconic(g_main_window) != 0;
					if (cfg_show_systray && !g_icon_created)
					{
						create_systray_icon();
					}
					else if (!cfg_show_systray && g_icon_created && (!is_iconic || !cfg_minimise_to_tray))
					{
						destroy_systray_icon();
						if (is_iconic)
							standard_commands::main_activate();
					}
					if (g_status) update_systray();
				}
			}
			break;
			case IDC_BALLOON:
			{
				cfg_balloon = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;
			}
		}
		return 0;
	}
Ejemplo n.º 7
0
BOOL CALLBACK item_details_config_t::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
{
	switch (msg)
	{
		/*case DM_GETDEFID:
		SetWindowLongPtr(wnd, DWL_MSGRESULT, MAKELONG(m_modal ? IDOK : IDCANCEL, DC_HASDEFID));
		return TRUE;*/
	case WM_INITDIALOG:
	{
		m_wnd = wnd;

		if (!m_modal)
		{
			modeless_dialog_manager::g_add(wnd);
			m_this->set_config_wnd(wnd);
			ShowWindow(GetDlgItem(wnd, IDOK), SW_HIDE);
			SetWindowText(GetDlgItem(wnd, IDCANCEL), L"Close");
		}

		uSetWindowText(GetDlgItem(wnd, IDC_SCRIPT), m_script);
		HWND wnd_combo = GetDlgItem(wnd, IDC_EDGESTYLE);
		ComboBox_AddString(wnd_combo, L"None");
		ComboBox_AddString(wnd_combo, L"Sunken");
		ComboBox_AddString(wnd_combo, L"Grey");
		ComboBox_SetCurSel(wnd_combo, m_edge_style);

		wnd_combo = GetDlgItem(wnd, IDC_HALIGN);
		ComboBox_AddString(wnd_combo, L"Left");
		ComboBox_AddString(wnd_combo, L"Centre");
		ComboBox_AddString(wnd_combo, L"Right");
		ComboBox_SetCurSel(wnd_combo, m_horizontal_alignment);

		wnd_combo = GetDlgItem(wnd, IDC_VALIGN);
		ComboBox_AddString(wnd_combo, L"Top");
		ComboBox_AddString(wnd_combo, L"Centre");
		ComboBox_AddString(wnd_combo, L"Bottom");
		ComboBox_SetCurSel(wnd_combo, m_vertical_alignment);

		LOGFONT lf;
		static_api_ptr_t<cui::fonts::manager>()->get_font(g_guid_item_details_font_client, lf);
		m_font_code_generator.initialise(lf, wnd, IDC_FONT_CODE);

		colour_code_gen(wnd, IDC_COLOUR_CODE, false, true);

		if (!m_modal)
		{
			SendMessage(wnd, DM_SETDEFID, IDCANCEL, NULL);
			SetFocus(GetDlgItem(wnd, IDCANCEL));
			return FALSE;
		}
		else
			return FALSE;

	}
	return FALSE;// m_modal ? FALSE : TRUE;
	case WM_DESTROY:
		if (m_timer_active)
			on_timer();
		if (!m_modal)
			m_this->set_config_wnd(NULL);
		break;
	case WM_NCDESTROY:
		m_wnd = NULL;
		if (!m_modal)
		{
			modeless_dialog_manager::g_remove(wnd);
			SetWindowLongPtr(wnd, DWL_USER, NULL);
			delete this;
		}
		break;
	case WM_ERASEBKGND:
		SetWindowLongPtr(wnd, DWL_MSGRESULT, TRUE);
		return TRUE;
	case WM_PAINT:
		ui_helpers::innerWMPaintModernBackground(wnd, GetDlgItem(wnd, IDOK));
		return TRUE;
	case WM_CTLCOLORSTATIC:
		SetBkColor((HDC)wp, GetSysColor(COLOR_WINDOW));
		SetTextColor((HDC)wp, GetSysColor(COLOR_WINDOWTEXT));
		return (BOOL)GetSysColorBrush(COLOR_WINDOW);
	case WM_CLOSE:
		if (m_modal)
		{
			SendMessage(wnd, WM_COMMAND, IDCANCEL, NULL);
			return TRUE;
		}
		break;
	case WM_TIMER:
		if (wp == timer_id) on_timer();
		break;
	case WM_COMMAND:
		switch (LOWORD(wp))
		{
		case IDOK:
			if (m_modal)
				EndDialog(wnd, 1);
			return TRUE;
		case IDCANCEL:
			if (m_modal)
				EndDialog(wnd, 0);
			else
			{
				DestroyWindow(wnd);
			}
			return TRUE;
		case IDC_GEN_COLOUR:
			colour_code_gen(wnd, IDC_COLOUR_CODE, false, false);
			break;
		case IDC_GEN_FONT:
			m_font_code_generator.run(wnd, IDC_FONT_CODE);
			break;
		case IDC_SCRIPT:
			switch (HIWORD(wp))
			{
			case EN_CHANGE:
				m_script = string_utf8_from_window(HWND(lp));
				if (!m_modal)
					start_timer();
				break;
			}
			break;
		case IDC_EDGESTYLE:
			switch (HIWORD(wp))
			{
			case CBN_SELCHANGE:
				m_edge_style = ComboBox_GetCurSel((HWND)lp);
				if (!m_modal)
				{
					m_this->set_edge_style(m_edge_style);
					cfg_item_details_edge_style = m_edge_style;
				}
				break;
			}
			break;
		case IDC_HALIGN:
			switch (HIWORD(wp))
			{
			case CBN_SELCHANGE:
				m_horizontal_alignment = ComboBox_GetCurSel((HWND)lp);
				if (!m_modal)
				{
					m_this->set_horizontal_alignment(m_horizontal_alignment);
					cfg_item_details_horizontal_alignment = m_horizontal_alignment;
				}
				break;
			}
			break;
		case IDC_VALIGN:
			switch (HIWORD(wp))
			{
			case CBN_SELCHANGE:
				m_vertical_alignment = ComboBox_GetCurSel((HWND)lp);
				if (!m_modal)
				{
					m_this->set_vertical_alignment(m_vertical_alignment);
					cfg_item_details_vertical_alignment = m_vertical_alignment;
				}
				break;
			}
			break;
		}
		break;
	}
	return FALSE;
}
Ejemplo n.º 8
0
BOOL t_config_tab3::DialogProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
{
	switch (msg)
	{
		case WM_INITDIALOG:
		{
			m_initialising = true;
			m_wnd_enabled = GetDlgItem(wnd, IDC_ENABLED);
			Button_SetCheck(m_wnd_enabled, settings::mobile_devices_enabled ? BST_CHECKED : BST_UNCHECKED);
			m_initialising = false;
		}
		break;
		case WM_COMMAND:
			switch (wp)
			{
				case IDC_ENABLED | (BN_CLICKED << 16) :
					settings::mobile_devices_enabled = Button_GetCheck(m_wnd_enabled) == BST_CHECKED;
					break;
#if 0
				case IDC_DIR:
				{
					string_utf8_from_window dir(wnd, IDC_PATH);
					pfc::string8 dir_can, output;
					try
					{
						filesystem::g_get_canonical_path(dir, dir_can);
						directory_callback_full_impl list(false);
						filesystem::g_list_directory(dir_can, list, abort_callback_dummy());
						t_size i, count = list.get_count();
						for (i = 0; i<count; i++)
						{
							if (list[i].m_subdir)
								output << "<dir> ";
							output << list[i].m_path;
							//output << "     " << list[i].m_stats.m_size;
							//if (list[i].m_stats.m_timestamp != filetimestamp_invalid)
							//	output << "     " << format_filetimestamp(list[i].m_stats.m_timestamp);
							output << "\r\n";
						}
					}
					catch (const pfc::exception & ex)
					{
						output << "\r\nError: " << ex.what();
					}
					uSendDlgItemMessageText(wnd, IDC_OUTPUT, WM_SETTEXT, NULL, output.get_ptr());
				}
				break;
				case IDC_STATS:
				{
					pfc::string8 output;
					try
					{
						pfc::list_t<stats_t> stats;
						g_get_stats_list(string_utf8_from_window(wnd, IDC_PATH), stats);
						t_size i, count = stats.get_count();
						for (i = 0; i<count; i++)
							output << stats[i].name << "=" << stats[i].value << "\r\n";
					}
					catch (const pfc::exception & ex)
					{
						output << "\r\nError: " << ex.what();
					}
					uSendDlgItemMessageText(wnd, IDC_OUTPUT, WM_SETTEXT, NULL, output.get_ptr());
				}
				break;
				case IDC_TEST:
				{
					//console::formatter() << pfc::format_hex(IOCTL_SCSI_PASS_THROUGH);
					mobile_device_api_t::ptr api = g_get_mobile_device_api();
					mobile_device_api_t::device_handle_t::ptr handle;
					if (api.is_valid() && api->is_initialised())
					{
						{
							insync(api->m_devices_sync);
							if (api->m_devices.get_count())
								handle = api->m_devices[0];
						}
						if (handle.is_valid())
						{
							try
							{
								pfc::string8 msg;
								CFTypeRef ref = NULL;
								msg << "\r\n1:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, api->_CFSTR("com.apple.mobile.iTunes"), NULL);
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								msg << "\r\n2:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, NULL, NULL);
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								msg << "\r\n3:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, api->_CFSTR("com.apple.mobile.battery"), NULL);
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								msg << "\r\n4:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, api->_CFSTR("com.apple.disk_usage"), NULL);
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								msg << "\r\n5:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, api->_CFSTR("com.apple.mobile.sync_data_class"), NULL);
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								msg << "\r\n6:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, NULL, api->_CFSTR("DeviceClass"));
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								msg << "\r\n7:\r\n";
								ref = api->AMDeviceCopyValue(api->m_devices[0]->m_device, NULL, api->_CFSTR("DeviceName"));
								msg << "Ref: " << pfc::format_hex((t_uint64)ref, 8) << "\r\n";
								if (ref)
								{
									g_print_CFTypeRef(api, ref, msg);
									api->CFRelease(ref);
									ref = NULL;
								}
								popup_message::g_show(msg, "Test Results");
								//NULL
								//com.apple.mobile.iTunes
								//com.apple.mobile.battery
								//com.apple.disk_usage
								//com.apple.mobile.sync_data_class
								//DeviceClass
								//DeviceName
							}
							catch (const pfc::exception & ex)
							{
								popup_message::g_show(ex.what(), "Test Error");
							}
						}
					}
				}
				break;
#endif
			}
			break;
		case WM_DESTROY:
			m_wnd_enabled = NULL;
			break;
	}
	return FALSE;
}
Ejemplo n.º 9
0
	BOOL CALLBACK on_message(HWND wnd,UINT msg,WPARAM wp,LPARAM lp)
	{

		switch(msg)
		{
		case WM_INITDIALOG:
			{
				{
					HWND list = uGetDlgItem(wnd,IDC_DBLCLK);
					uSendMessageText(list,CB_ADDSTRING,0,"Send to autosend playlist");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to autosend playlist and play");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to playlist");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to playlist and play");
					uSendMessageText(list,CB_ADDSTRING,0,"Add to active playlist");
					SendMessage(list,CB_SETCURSEL,filter_panel::cfg_doubleclickaction,0);
					
					list = uGetDlgItem(wnd,IDC_MIDDLE);
					uSendMessageText(list,CB_ADDSTRING,0,"None");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to autosend playlist");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to autosend playlist and play");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to playlist");
					uSendMessageText(list,CB_ADDSTRING,0,"Send to playlist and play");
					uSendMessageText(list,CB_ADDSTRING,0,"Add to active playlist");
					SendMessage(list,CB_SETCURSEL,filter_panel::cfg_middleclickaction,0);

					uSendDlgItemMessageText(wnd,IDC_EDGESTYLE,CB_ADDSTRING,0,"None");
					uSendDlgItemMessageText(wnd,IDC_EDGESTYLE,CB_ADDSTRING,0,"Sunken");
					uSendDlgItemMessageText(wnd,IDC_EDGESTYLE,CB_ADDSTRING,0,"Grey");
					uSendDlgItemMessageText(wnd,IDC_EDGESTYLE,CB_SETCURSEL,filter_panel::cfg_edgestyle,0);

					uSendDlgItemMessageText(wnd,IDC_PRECEDENCE,CB_ADDSTRING,0,"By position in splitter");
					uSendDlgItemMessageText(wnd,IDC_PRECEDENCE,CB_ADDSTRING,0,"By field list above");
					uSendDlgItemMessageText(wnd,IDC_PRECEDENCE,CB_SETCURSEL,filter_panel::cfg_orderedbysplitters ? 0 : 1,0);

					SendDlgItemMessage(wnd,IDC_SPINPADDING,UDM_SETRANGE32,-100,100);

					HWND wnd_fields = m_field_list.create_in_dialog_units(wnd, ui_helpers::window_position_t(20,17,278,79));
					SetWindowPos(wnd_fields, HWND_TOP, 0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
					ShowWindow(wnd_fields, SW_SHOWNORMAL);

				}
				refresh_me(wnd);
			}
			break;
		case WM_DESTROY:
			{
				//if (m_changed)
				//	filter_panel::g_on_fields_change();
				m_field_list.destroy();
			}
			break;
		case WM_COMMAND:
			switch(wp)
			{
			case IDC_FILTER_HELP:
				{
					const char * text = 
						"You can use either enter field names (for remappings, separate multiple field names by a semi-colon) or titleformatting scripts to specify fields. "
						"For example, \"Album Artist;Artist\" or \"%album artist%\".\r\n\r\n"
						"Only the former format supports multiple values per field and is compatible with inline metadata editing.";
					message_window_t::g_run(wnd, "Filter Field Help", text);
				}
				break;
			case IDC_UP:
				{
					if (m_field_list.get_selection_count(2) == 1)
					{
						t_size index = 0, count = m_field_list.get_item_count();
						while (!m_field_list.get_item_selected(index) && index < count) index++;
						if (index && filter_panel::cfg_field_list.get_count())
						{
							filter_panel::cfg_field_list.swap_items(index, index-1);
							filter_panel::filter_panel_t::g_on_fields_swapped(index, index - 1);

							pfc::list_t<t_list_view::t_item_insert> items;
							get_insert_items(index-1, 2, items);
							m_field_list.replace_items(index-1, items);
							m_field_list.set_item_selected_single(index-1);
						}
					}
				}
				break;
			case IDC_DOWN:
				{
					if (m_field_list.get_selection_count(2) == 1)
					{
						t_size index = 0, count = m_field_list.get_item_count();
						while (!m_field_list.get_item_selected(index) && index < count) index++;
						if (index+1 < count && index + 1 < filter_panel::cfg_field_list.get_count())
						{
							filter_panel::cfg_field_list.swap_items(index, index+1);
							filter_panel::filter_panel_t::g_on_fields_swapped(index, index + 1);

							pfc::list_t<t_list_view::t_item_insert> items;
							get_insert_items(index, 2, items);
							m_field_list.replace_items(index, items);
							m_field_list.set_item_selected_single(index+1);
						}
					}
				}
				break;
			case IDC_NEW:
				{
					filter_panel::field_t temp;
					temp.m_name = "<enter name here>";
					temp.m_field = "<enter field here>";
					t_size index = filter_panel::cfg_field_list.add_item(temp);
					filter_panel::filter_panel_t::g_on_new_field(temp);

					pfc::list_t<t_list_view::t_item_insert> items;
					get_insert_items(index, 1, items);
					m_field_list.insert_items(index, 1, items.get_ptr());
					m_field_list.set_item_selected_single(index);
					SetFocus(m_field_list.get_wnd());
					m_field_list.activate_inline_editing();

				}
				break;
			case IDC_REMOVE:
				{
					if (m_field_list.get_selection_count(2) == 1)
					{
						bit_array_bittable mask(m_field_list.get_item_count());
						m_field_list.get_selection_state(mask);
						//bool b_found = false;
						t_size index=0, count=m_field_list.get_item_count();
						while (index < count)
						{
							if (mask[index]) break;
							index++;
						}
						if (index < count && index < filter_panel::cfg_field_list.get_count())
						{
							filter_panel::cfg_field_list.remove_by_idx(index);
							m_field_list.remove_item(index);
							filter_panel::filter_panel_t::g_on_field_removed(index);
							t_size new_count = m_field_list.get_item_count();
							if (new_count)
							{
								if (index < new_count)
									m_field_list.set_item_selected_single(index);
								else if (index)
									m_field_list.set_item_selected_single(index-1);
							}
						}
					}
				}
				break;
			case IDC_SORT:
				{
					filter_panel::cfg_sort = (Button_GetCheck((HWND)lp) != BST_UNCHECKED);
				}
				break;
			case IDC_AUTOSEND:
				filter_panel::cfg_autosend = (Button_GetCheck((HWND)lp) != BST_UNCHECKED);
				break;
			case IDC_SHOWEMPTY:
				filter_panel::cfg_showemptyitems = (Button_GetCheck((HWND)lp) != BST_UNCHECKED);
				filter_panel::filter_panel_t::g_on_showemptyitems_change(filter_panel::cfg_showemptyitems);
				break;
			case (EN_CHANGE<<16)|IDC_SORT_STRING:
				{
					filter_panel::cfg_sort_string = string_utf8_from_window((HWND)lp);
				}
				break;
			case (EN_CHANGE<<16)|IDC_PADDING:
				if (!initialising)
				{
					filter_panel::cfg_vertical_item_padding = strtol(string_utf8_from_window((HWND)lp).get_ptr(), NULL, 10);
					filter_panel::filter_panel_t::g_on_vertical_item_padding_change();
				}
				break;
			case IDC_PRECEDENCE | (CBN_SELCHANGE<<16):
				filter_panel::cfg_orderedbysplitters = SendMessage((HWND)lp,CB_GETCURSEL,0,0) == 0;
				filter_panel::filter_panel_t::g_on_orderedbysplitters_change();
				break;
			case IDC_MIDDLE | (CBN_SELCHANGE<<16):
				filter_panel::cfg_middleclickaction = SendMessage((HWND)lp,CB_GETCURSEL,0,0);
				break;
			case IDC_DBLCLK | (CBN_SELCHANGE<<16):
				filter_panel::cfg_doubleclickaction = SendMessage((HWND)lp,CB_GETCURSEL,0,0);
				break;
			case IDC_EDGESTYLE | (CBN_SELCHANGE<<16):
				filter_panel::cfg_edgestyle = SendMessage((HWND)lp,CB_GETCURSEL,0,0);
				filter_panel::filter_panel_t::g_on_edgestyle_change();
				break;
			}
		}
		return 0;
	}
Ejemplo n.º 10
0
	static BOOL CALLBACK ConfigProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
	{

		switch (msg)
		{
		case WM_INITDIALOG:
		{
			uSendDlgItemMessageText(wnd, IDC_PLISTEDGE, CB_ADDSTRING, 0, "None");
			uSendDlgItemMessageText(wnd, IDC_PLISTEDGE, CB_ADDSTRING, 0, "Sunken");
			uSendDlgItemMessageText(wnd, IDC_PLISTEDGE, CB_ADDSTRING, 0, "Grey");

			uSendDlgItemMessage(wnd, IDC_SPINPL, UDM_SETRANGE32, -100, 100);
			uSendDlgItemMessage(wnd, IDC_SWITCH_SPIN, UDM_SETRANGE32, 0, 10000);

			refresh_me(wnd);
			initialised = true;
		}

		break;
		case WM_DESTROY:
		{
			initialised = false;
			SendMessage(wnd, WM_COMMAND, IDC_APPLY, 0);

		}
		break;
		case WM_COMMAND:
			switch (wp)
			{

			case (EN_CHANGE << 16) | IDC_PLHEIGHT:
			{
				if (initialised)
				{
					BOOL result;
					int new_height = GetDlgItemInt(wnd, IDC_PLHEIGHT, &result, TRUE);
					if (result) cfg_plheight = new_height;
					//						if (g_plist) uSendMessage(g_plist, LB_SETITEMHEIGHT, 0, get_pl_item_height());
					playlist_switcher_t::g_on_vertical_item_padding_change();
				}

			}
			break;
			case IDC_APPLY:
				if (playlist_switcher_string_changed)
				{
					playlist_switcher_t::g_refresh_all_items();
					playlist_switcher_string_changed = false;
				}
				break;

			case IDC_PLAUTOHIDE:
			{
				cfg_pl_autohide = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				g_on_autohide_tabs_change();
				//					if (g_main_window)
				//					{
				//						bool move = false;
				//					if (create_plist()) move = true;
				//						if (create_tabs()) move = true; 
				//						if (move) {move_window_controls();RedrawWindow(g_main_window, 0, 0, RDW_INVALIDATE|RDW_UPDATENOW);}
				//					}
			}
			break;
			case IDC_MCLICK:
				cfg_mclick = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
				//case IDC_SHIFT_LMB:
				//		cfg_playlists_shift_lmb = SendMessage((HWND)lp,BM_GETCHECK,0,0);
				//		break;
				//case IDC_DELETE:
				//cfg_playlist_panel_delete = uSendMessage((HWND)lp,BM_GETCHECK,0,0);
				//break;
			case (EN_CHANGE << 16) | IDC_PLAYLIST_TF:
				cfg_playlist_switcher_tagz = string_utf8_from_window((HWND)lp);
				playlist_switcher_string_changed = true;
				break;
			case IDC_SIDEBAR_TOOLTIPS:
				cfg_playlist_sidebar_tooltips = SendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_USE_PLAYLIST_TF:
				cfg_playlist_switcher_use_tagz = SendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				playlist_switcher_t::g_refresh_all_items();
				playlist_switcher_string_changed = false;
				break;
			case IDC_TABS_MULTILINE:
			{
				cfg_tabs_multiline = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				g_on_multiline_tabs_change();
#if 0
				if (g_main_window && g_tab)
				{
					//		create_tabs();
					long flags = WS_CHILD | TCS_HOTTRACK | TCS_TABS | (cfg_tabs_multiline ? TCS_MULTILINE : TCS_SINGLELINE) | WS_VISIBLE | WS_CLIPSIBLINGS | TCS_SINGLELINE;

					uSetWindowLong(g_tab, GWL_STYLE, flags);
					move_window_controls();
				}
#endif
			}
			break;
			case IDC_MCLICK3:
			{
				cfg_plm_rename = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;
			case IDC_PLDRAG:
			{
				cfg_drag_pl = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;
#if 0
			case IDC_MCLICK2:
			{
				cfg_mclick2 = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;
			case IDC_TABS:
			{
				cfg_tabs = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				if (g_main_window)
				{
					create_tabs();
					move_window_controls();
				}
			}
			break;
#endif
			case (CBN_SELCHANGE << 16) | IDC_PLISTEDGE:
			{
				cfg_plistframe = uSendMessage((HWND)lp, CB_GETCURSEL, 0, 0);
				playlist_switcher_t::g_on_edgestyle_change();
			}
			break;

			}
		}
		return 0;
	}
Ejemplo n.º 11
0
	static BOOL CALLBACK ConfigProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
	{

		switch (msg)
		{
		case WM_INITDIALOG:
		{

			uSendDlgItemMessage(wnd, IDC_SPINPL, UDM_SETRANGE32, -100, 100);
			uSendDlgItemMessage(wnd, IDC_SWITCH_SPIN, UDM_SETRANGE32, 0, 10000);

			refresh_me(wnd);
			initialised = true;
		}

		break;
		case WM_DESTROY:
		{
			initialised = false;
		}
		break;
		case WM_COMMAND:
			switch (wp)
			{

			case (EN_CHANGE << 16) | IDC_SWITCH_DELAY:
			{
				if (initialised)
				{
					BOOL result;
					unsigned new_height = GetDlgItemInt(wnd, IDC_SWITCH_DELAY, &result, FALSE);
					if (result) cfg_autoswitch_delay = new_height;
				}
			}
			break;
			case (EN_CHANGE << 16) | IDC_DROP_STRING:
				cfg_pgenstring = string_utf8_from_window((HWND)lp);
				break;
#if 0
			case IDC_DROP_NAME:
				cfg_pgen_dir = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_DROP_PLAYLIST:
				cfg_pgen_playlist = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
#endif
			case IDC_REMOVE_UNDERSCORES:
				cfg_replace_drop_underscores = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_DROP_USE_STRING:
				cfg_pgen_tf = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
				break;
			case IDC_ACTIVATE_TARGET:
				main_window::config_set_activate_target_playlist_on_dropped_items(0 != SendMessage((HWND)lp, BM_GETCHECK, 0, 0));
				break;
			case IDC_AUTOSWITCH:
			{
				cfg_drag_autoswitch = uSendMessage((HWND)lp, BM_GETCHECK, 0, 0);
			}
			break;

			}
		}
		return 0;
	}
Ejemplo n.º 12
0
	BOOL CALLBACK on_message(HWND wnd,UINT msg,WPARAM wp,LPARAM lp)
	{

		switch(msg)
		{
		case WM_INITDIALOG:
			{
				HWND wnd_fields = m_source_list.create_in_dialog_units(wnd, ui_helpers::window_position_t(20,44,276,80));
				SetWindowPos(wnd_fields, HWND_TOP, 0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);

				refresh_me(wnd);

				ShowWindow(wnd_fields, SW_SHOWNORMAL);
			}
			break;
		case WM_DESTROY:
			{
				on_scripts_change();
			}
			break;
		case WM_COMMAND:
			switch(wp)
			{
#if 0
			case (EN_CHANGE<<16)|IDC_FRONT:
				artwork_panel::cfg_front = string_utf8_from_window((HWND)lp);
				m_changed = true;
				break;
			case (EN_CHANGE<<16)|IDC_BACK:
				artwork_panel::cfg_back = string_utf8_from_window((HWND)lp);
				m_changed = true;
				break;
			case (EN_CHANGE<<16)|IDC_DISC:
				artwork_panel::cfg_disc = string_utf8_from_window((HWND)lp);
				m_changed = true;
				break;
			case (EN_KILLFOCUS<<16)|IDC_FRONT:
			case (EN_KILLFOCUS<<16)|IDC_BACK:
			case (EN_KILLFOCUS<<16)|IDC_DISC:
				on_scripts_change();
				break;
#endif
			/*case (EN_CHANGE<<16)|IDC_ICON:
				artwork_panel::cfg_icon = string_utf8_from_window((HWND)lp);
				m_changed = true;
				break;*/
			case IDC_FB2KARTWORK|(CBN_SELCHANGE<<16):
				artwork_panel::cfg_fb2k_artwork_mode = ComboBox_GetCurSel((HWND)lp);
				break;
			case IDC_EDGESTYLE|(CBN_SELCHANGE<<16):
				artwork_panel::cfg_edge_style = ComboBox_GetCurSel((HWND)lp);
				artwork_panel::artwork_panel_t::g_on_edge_style_change();
				break;
			case IDC_ADD:
				{
					RECT rc;
					GetWindowRect((HWND)lp, &rc);
					HMENU menu = CreatePopupMenu();

					enum {IDM_FRONT = 1};

					t_size index, indexcount = tabsize(g_artwork_sources);
					for (index = 0; index < indexcount; index++)
					{
						AppendMenuW(menu,(MF_STRING),index+1,pfc::stringcvt::string_wide_from_utf8(g_artwork_sources[index].m_name));
					}
								
					int cmd = TrackPopupMenu(menu,TPM_LEFTBUTTON|TPM_NONOTIFY|TPM_RETURNCMD,rc.left,rc.bottom,0,wnd,0);
					DestroyMenu(menu);
					if (cmd>0 && (t_size)cmd <= indexcount)
					{
						index = cmd-1;
						t_size subindex = g_artwork_sources[index].m_scripts->add_item("<enter script>");

						t_size combined_index = get_combined_index(index, subindex);

						t_list_view::t_item_insert item;
						item.m_groups.add_item(g_artwork_sources[index].m_name);
						item.m_subitems.add_item("<enter script>");
						m_source_list.insert_items(combined_index, 1, &item);
						SetFocus(m_source_list.get_wnd());
						m_source_list.set_item_selected_single(combined_index);
						m_source_list.activate_inline_editing();
						m_source_list.m_changed = true;
					}
				}
				break;
			case IDC_REMOVE:
				{
					if (m_source_list.get_selection_count(2) == 1)
					{
						bit_array_bittable mask(m_source_list.get_item_count());
						m_source_list.get_selection_state(mask);
						//bool b_found = false;
						t_size combined_index=0, count=m_source_list.get_item_count();
						while (combined_index < count)
						{
							if (mask[combined_index]) break;
							combined_index++;
						}
						t_size index, subindex;
						if (combined_index < count && get_separated_index(combined_index, index, subindex))
						{
							g_artwork_sources[index].m_scripts->remove_by_idx(subindex);
							m_source_list.remove_item(combined_index);
							m_source_list.m_changed = true;
							t_size new_count = m_source_list.get_item_count();
							if (new_count)
							{
								if (combined_index < new_count)
									m_source_list.set_item_selected_single(combined_index);
								else if (combined_index)
									m_source_list.set_item_selected_single(combined_index-1);
							}
						}
					}
				}
				break;
			case IDC_UP:
				{
					if (m_source_list.get_selection_count(2) == 1)
					{
						t_size combined_index = 0;
						{
							t_size count = m_source_list.get_item_count();
							while (!m_source_list.get_item_selected(combined_index) && combined_index < count) combined_index++;
						}

						t_size index, subindex, combined_index_start, count;

						get_group_from_combined_index(combined_index, index, subindex, combined_index_start, count);

						if (subindex && count)
						{
							g_artwork_sources[index].m_scripts->swap_items(subindex, subindex-1);

							pfc::list_t<t_list_view::t_item_insert> items;
							items.set_count(2);

							items[0].m_groups.add_item(g_artwork_sources[index].m_name);
							items[1].m_groups.add_item(g_artwork_sources[index].m_name);
							items[0].m_subitems.add_item((*g_artwork_sources[index].m_scripts)[subindex-1]);
							items[1].m_subitems.add_item((*g_artwork_sources[index].m_scripts)[subindex]);
							m_source_list.replace_items(combined_index-1, items);
							m_source_list.set_item_selected_single(combined_index-1);
							m_source_list.m_changed = true;
						}
					}
				}
				break;
			case IDC_DOWN:
				{
					if (m_source_list.get_selection_count(2) == 1)
					{
						t_size combined_index = 0;
						{
							t_size count = m_source_list.get_item_count();
							while (!m_source_list.get_item_selected(combined_index) && combined_index < count) combined_index++;
						}

						t_size index, subindex, combined_index_start, count;

						get_group_from_combined_index(combined_index, index, subindex, combined_index_start, count);

						if (subindex + 1 < count)
						{
							g_artwork_sources[index].m_scripts->swap_items(subindex, subindex+1);
							pfc::list_t<t_list_view::t_item_insert> items;
							items.set_count(2);

							items[0].m_groups.add_item(g_artwork_sources[index].m_name);
							items[1].m_groups.add_item(g_artwork_sources[index].m_name);
							items[0].m_subitems.add_item((*g_artwork_sources[index].m_scripts)[subindex]);
							items[1].m_subitems.add_item((*g_artwork_sources[index].m_scripts)[subindex+1]);

							m_source_list.replace_items(combined_index, items);
							m_source_list.set_item_selected_single(combined_index+1);
							m_source_list.m_changed = true;
						}
					}
				}
				break;
			}
		}
		return 0;
	}