/** * 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); }
/** * 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); }
/** * gens_window_create_menubar(): Create the menu bar. */ void gens_window_create_menubar(void) { if (MainMenu) { // Menu bar already exists. Delete it. DestroyMenu(MainMenu); gens_menu_clear(); } DestroyMenu(MainMenu); // Create the main menu. if (!vdraw_get_fullscreen() && Settings.showMenuBar) { // Create a menu bar. MainMenu = CreateMenu(); } else { // Create a popup menu. MainMenu = CreatePopupMenu(); } // Parse the menus. gens_menu_parse(&gmiMain[0], MainMenu); // Synchronize the menus. Sync_Gens_Window(); // Set the menu bar. if (!vdraw_get_fullscreen() && Settings.showMenuBar) SetMenu(gens_window, MainMenu); else SetMenu(gens_window, NULL); if (!vdraw_get_fullscreen()) { // Resize the window after the menu bar is rebuilt. if (vdraw_scale <= 0) return; const int w = 320 * vdraw_scale; const int h = 240 * vdraw_scale; gsft_win32_set_actual_window_size(gens_window, w, h); } }
/** * 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); }