Пример #1
0
/**
 * sgens_window_show(): Show the VDP Layer Options window.
 * @param parent Parent window.
 */
void MDP_FNCALL sgens_window_show(void *parent)
{
	if (sgens_window)
	{
		// Sonic Gens window is already visible. Set focus.
		// TODO: Figure out how to do this.
		ShowWindow(sgens_window, SW_SHOW);
		return;
	}
	
	// Initialize the Win32 Unicode Translation Layer.
	w32u_init();
	
	sgens_window_child_windows_created = FALSE;
	
	// If no HINSTANCE was specified, use the main executable's HINSTANCE.
	if (!sgens_hInstance)
		sgens_hInstance = GetModuleHandle(NULL);
	
	if (sgens_wndclass.lpfnWndProc != sgens_window_wndproc)
	{
		// Create the window class.
		sgens_wndclass.style = 0;
		sgens_wndclass.lpfnWndProc = sgens_window_wndproc;
		sgens_wndclass.cbClsExtra = 0;
		sgens_wndclass.cbWndExtra = 0;
		sgens_wndclass.hInstance = sgens_hInstance;
		sgens_wndclass.hIcon = LoadIconA(sgens_hInstance, MAKEINTRESOURCE(IDI_SGENS));
		sgens_wndclass.hCursor = LoadCursorA(NULL, IDC_ARROW);
		sgens_wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
		sgens_wndclass.lpszMenuName = NULL;
		sgens_wndclass.lpszClassName = "mdp_misc_sgens_window";
		
		pRegisterClassU(&sgens_wndclass);
	}
	
	// Create the window.
	sgens_window = pCreateWindowU("mdp_misc_sgens_window", "Sonic Gens",
					WS_DLGFRAME | WS_POPUP | WS_SYSMENU | WS_CAPTION,
					CW_USEDEFAULT, CW_USEDEFAULT,
					SGENS_WINDOW_WIDTH, SGENS_WINDOW_HEIGHT,
					(HWND)parent, NULL, sgens_hInstance, NULL);
	
	// Window adjustment.
	gsft_win32_set_actual_window_size(sgens_window, SGENS_WINDOW_WIDTH, SGENS_WINDOW_HEIGHT);
	gsft_win32_center_on_window(sgens_window, (HWND)parent);
	
	// Update the current ROM type and information display.
	sgens_window_update_rom_type();
	sgens_window_update();
	
	UpdateWindow(sgens_window);
	ShowWindow(sgens_window, TRUE);
	
	// Register the window with MDP Host Services.
	sgens_host_srv->window_register(&mdp, sgens_window);
}
Пример #2
0
/**
 * vlopt_window_show(): Show the VDP Layer Options window.
 * @param parent Parent window.
 */
void vlopt_window_show(void *parent)
{
	if (vlopt_window)
	{
		// VDP Layer Options window is already visible.
		// Set focus.
		// TODO
		return;
	}
	
	// Initialize the Win32 Unicode Translation Layer.
	w32u_init();
	
	vlopt_window_child_windows_created = FALSE;
	
	// If no HINSTANCE was specified, use the main executable's HINSTANCE.
	if (!vlopt_hInstance)
		vlopt_hInstance = pGetModuleHandleU(NULL);
	
	// Create the window class.
	if (vlopt_window_wndclass.lpfnWndProc != vlopt_window_wndproc)
	{
		vlopt_window_wndclass.style = 0;
		vlopt_window_wndclass.lpfnWndProc = vlopt_window_wndproc;
		vlopt_window_wndclass.cbClsExtra = 0;
		vlopt_window_wndclass.cbWndExtra = 0;
		vlopt_window_wndclass.hInstance = vlopt_hInstance;
		vlopt_window_wndclass.hIcon = LoadIconA(vlopt_hInstance, MAKEINTRESOURCE(IDI_VLOPT));
		vlopt_window_wndclass.hCursor = LoadCursorA(NULL, IDC_ARROW);
		vlopt_window_wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
		vlopt_window_wndclass.lpszMenuName = NULL;
		vlopt_window_wndclass.lpszClassName = "vlopt_window_wndclass";
		
		pRegisterClassU(&vlopt_window_wndclass);
	}
	
	// Create the window.
	vlopt_window = pCreateWindowU("vlopt_window_wndclass", "VDP Layer Options",
					WS_DLGFRAME | WS_POPUP | WS_SYSMENU | WS_CAPTION,
					CW_USEDEFAULT, CW_USEDEFAULT,
					DLU_X(VLOPT_WINDOW_WIDTH), DLU_Y(VLOPT_WINDOW_HEIGHT),
					(HWND)parent, NULL, vlopt_hInstance, NULL);
	
	// Window adjustment.
	gsft_win32_set_actual_window_size(vlopt_window, DLU_X(VLOPT_WINDOW_WIDTH), DLU_Y(VLOPT_WINDOW_HEIGHT));
	gsft_win32_center_on_window(vlopt_window, (HWND)parent);
	
	UpdateWindow(vlopt_window);
	ShowWindow(vlopt_window, TRUE);
	
	// Register the window with MDP Host Services.
	vlopt_host_srv->window_register(&mdp, vlopt_window);
}
Пример #3
0
/**
 * genopt_window_show(): Show the General Options window.
 */
void genopt_window_show(void)
{
	if (genopt_window)
	{
		// Controller Configuration window is already visible. Set focus.
		// TODO: Figure out how to do this.
		ShowWindow(genopt_window, SW_SHOW);
		return;
	}
	
	// Create the window class.
	if (genopt_wndclass.lpfnWndProc != genopt_window_wndproc)
	{
		// Create the window class.
		genopt_wndclass.style = 0;
		genopt_wndclass.lpfnWndProc = genopt_window_wndproc;
		genopt_wndclass.cbClsExtra = 0;
		genopt_wndclass.cbWndExtra = 0;
		genopt_wndclass.hInstance = ghInstance;
		genopt_wndclass.hIcon = LoadIcon(ghInstance, MAKEINTRESOURCE(IDI_GENS_APP));
		genopt_wndclass.hCursor = NULL;
		genopt_wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
		genopt_wndclass.lpszMenuName = NULL;
		genopt_wndclass.lpszClassName = TEXT("genopt_window");
		
		RegisterClass(&genopt_wndclass);
	}
	
	// Create the window.
	genopt_window = CreateWindow(TEXT("genopt_window"), TEXT("General Options"),
				     WS_DLGFRAME | WS_POPUP | WS_SYSMENU | WS_CAPTION,
				     CW_USEDEFAULT, CW_USEDEFAULT,
				     GENOPT_WINDOW_WIDTH, GENOPT_WINDOW_HEIGHT,
				     gens_window, NULL, ghInstance, NULL);
	
	// Set the actual window size.
	gsft_win32_set_actual_window_size(genopt_window, GENOPT_WINDOW_WIDTH, GENOPT_WINDOW_HEIGHT);
	
	// Center the window on the Gens window.
	gsft_win32_center_on_window(genopt_window, gens_window);
	
	UpdateWindow(genopt_window);
	ShowWindow(genopt_window, SW_SHOW);
}
Пример #4
0
/**
 * zipsel_dialog_init(): Initialize the Zip Select dialog.
 * @param hWndDlg hWnd of the Zip Select dialog.
 * @param z_list File list.
 */
static void WINAPI zipsel_dialog_init(HWND hWndDlg, mdp_z_entry_t *z_list)
{
	gsft_win32_center_on_window(hWndDlg, gens_window);
	
	// Get the listbox hWnd.
	HWND lstFiles = GetDlgItem(hWndDlg, IDC_ZIPSELECT_LSTFILES);
	
	// Add all strings.
	mdp_z_entry_t *z_entry_cur = z_list;
	while (z_entry_cur)
	{
		int index = ListBox_InsertStringU(lstFiles, -1, z_entry_cur->filename);
		ListBox_SetItemDataU(lstFiles, index, z_entry_cur);
		
		// Next file.
		z_entry_cur = z_entry_cur->next;
	}
	
	// Select the first item by default.
	ListBox_SetCurSelU(lstFiles, 0);
}