diff options
Diffstat (limited to 'Source/Core/DolphinWX/Src/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Src/FrameTools.cpp | 75 |
1 files changed, 46 insertions, 29 deletions
diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 607c920906..a987ddebcd 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -632,12 +632,12 @@ void CFrame::BootGame(const std::string& filename) bootfile = m_GameListCtrl->GetSelectedISO()->GetFileName(); } else if (!StartUp.m_strDefaultGCM.empty() - && wxFileExists(wxString(StartUp.m_strDefaultGCM.c_str(), wxConvUTF8))) + && wxFileExists(wxSafeConvertMB2WX(StartUp.m_strDefaultGCM.c_str()))) bootfile = StartUp.m_strDefaultGCM; else { if (!SConfig::GetInstance().m_LastFilename.empty() - && wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) + && wxFileExists(wxSafeConvertMB2WX(SConfig::GetInstance().m_LastFilename.c_str()))) bootfile = SConfig::GetInstance().m_LastFilename; else { @@ -663,8 +663,8 @@ void CFrame::DoOpen(bool Boot) wxString path = wxFileSelector( _("Select the file to load"), wxEmptyString, wxEmptyString, wxEmptyString, - _("All GC/Wii files (elf, dol, gcm, iso, ciso, gcz, wad)") + - wxString::Format(wxT("|*.elf;*.dol;*.gcm;*.iso;*.ciso;*.gcz;*.wad;*.dff;*.tmd|%s"), + _("All GC/Wii files (elf, dol, gcm, iso, wbfs, ciso, gcz, wad)") + + wxString::Format(wxT("|*.elf;*.dol;*.gcm;*.iso;*.wbfs;*.ciso;*.gcz;*.wad;*.dff;*.tmd|%s"), wxGetTranslation(wxALL_FILES)), wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); @@ -826,11 +826,9 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event) SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight = height; } #if defined(HAVE_X11) && HAVE_X11 - int x, y; - m_RenderParent->GetClientSize(&width, &height); - m_RenderParent->GetPosition(&x, &y); + wxRect client_rect = m_RenderParent->GetClientRect(); X11Utils::SendClientEvent(X11Utils::XDisplayFromHandle(GetHandle()), - "RESIZE", x, y, width, height); + "RESIZE", client_rect.x, client_rect.y, client_rect.width, client_rect.height); #endif m_LogWindow->Refresh(); m_LogWindow->Update(); @@ -892,7 +890,6 @@ void CFrame::ToggleDisplayMode(bool bFullscreen) if (w != x || h != y || d != 32) continue;; - CGDisplayCapture(CGMainDisplayID()); CGDisplaySwitchToMode(CGMainDisplayID(), mode); } @@ -916,6 +913,10 @@ void CFrame::StartGame(const std::string& filename) m_RenderParent = m_Panel; m_RenderFrame = this; + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bKeepWindowOnTop) + m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() | wxSTAY_ON_TOP); + else + m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() & ~wxSTAY_ON_TOP); } else { @@ -930,6 +931,11 @@ void CFrame::StartGame(const std::string& filename) #endif m_RenderFrame = new CRenderFrame((wxFrame*)this, wxID_ANY, _("Dolphin"), position); + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bKeepWindowOnTop) + m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() | wxSTAY_ON_TOP); + else + m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() & ~wxSTAY_ON_TOP); + wxSize size(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth, SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight); m_RenderFrame->SetClientSize(size.GetWidth(), size.GetHeight()); @@ -1037,10 +1043,23 @@ void CFrame::DoPause() } else { + // 32x32, 8bpp b/w image + // We want all transparent, so we can just use the same buffer for + // the "image" as for the transparency mask + static const char cursor_data[32 * 32] = { 0 }; +#ifdef __WXGTK__ + wxCursor cursor_transparent = wxCursor(cursor_data, 32, 32, 6, 14, + cursor_data, wxWHITE, wxBLACK); +#else + wxBitmap cursor_bitmap(cursor_data, 32, 32); + cursor_bitmap.SetMask(new wxMask(cursor_bitmap)); + wxCursor cursor_transparent = wxCursor(cursor_bitmap.ConvertToImage()); +#endif + Core::SetState(Core::CORE_RUN); if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor && RendererHasFocus()) - m_RenderParent->SetCursor(wxCURSOR_BLANK); + m_RenderParent->SetCursor(cursor_transparent); } UpdateGUI(); } @@ -1375,17 +1394,13 @@ void CFrame::OnInstallWAD(wxCommandEvent& event) wxProgressDialog dialog(_("Installing WAD..."), _("Working..."), - 1000, // range - this, // parent + 1000, + this, wxPD_APP_MODAL | - wxPD_ELAPSED_TIME | - wxPD_ESTIMATED_TIME | - wxPD_REMAINING_TIME | - wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_SMOOTH ); - dialog.CenterOnParent(); - u64 titleID = DiscIO::CNANDContentManager::Access().Install_WiiWAD(fileName); if (titleID == TITLEID_SYSMENU) { @@ -1551,16 +1566,21 @@ void CFrame::UpdateGUI() bool Initialized = Core::IsRunning(); bool Running = Core::GetState() == Core::CORE_RUN; bool Paused = Core::GetState() == Core::CORE_PAUSE; + bool RunningWii = Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii; + bool RunningGamecube = Initialized && !SConfig::GetInstance().m_LocalCoreStartupParameter.bWii; // Make sure that we have a toolbar if (m_ToolBar) { // Enable/disable the Config and Stop buttons m_ToolBar->EnableTool(wxID_OPEN, !Initialized); - m_ToolBar->EnableTool(wxID_REFRESH, !Initialized); // Don't allow refresh when we don't show the list + // Don't allow refresh when we don't show the list + m_ToolBar->EnableTool(wxID_REFRESH, !Initialized); m_ToolBar->EnableTool(IDM_STOP, Running || Paused); m_ToolBar->EnableTool(IDM_TOGGLE_FULLSCREEN, Running || Paused); m_ToolBar->EnableTool(IDM_SCREENSHOT, Running || Paused); + // Don't allow wiimote config while in Gamecube mode + m_ToolBar->EnableTool(IDM_CONFIG_WIIMOTE_PLUGIN, !RunningGamecube); } // File @@ -1590,15 +1610,12 @@ void CFrame::UpdateGUI() if (DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU).IsValid()) GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(!Initialized); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)-> - Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)-> - Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)-> - Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)-> - Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii); - if (Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Enable(RunningWii); + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Enable(RunningWii); + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Enable(RunningWii); + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Enable(RunningWii); + GetMenuBar()->FindItem(IDM_CONFIG_WIIMOTE_PLUGIN)->Enable(!RunningGamecube); + if (RunningWii) { GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Check(GetUsbPointer()-> AccessWiiMote(0x0100)->IsConnected()); @@ -1644,7 +1661,7 @@ void CFrame::UpdateGUI() } // Prepare to load last selected file, enable play button else if (!SConfig::GetInstance().m_LastFilename.empty() - && wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) + && wxFileExists(wxSafeConvertMB2WX(SConfig::GetInstance().m_LastFilename.c_str()))) { if (m_ToolBar) m_ToolBar->EnableTool(IDM_PLAY, true); |
