Merge branch 'rehash-msw-cursor-hide'
This commit is contained in:
commit
1bd42b7acc
|
@ -201,6 +201,8 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
|||
</Command>
|
||||
<Message>Copying Data\* to $(TargetDir)</Message>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
|
||||
<ClCompile>
|
||||
|
@ -387,4 +389,4 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -2,3 +2,7 @@
|
|||
//
|
||||
#include "resource.h"
|
||||
IDI_ICON1 ICON "..\\..\\..\\Installer\\Dolphin.ico"
|
||||
"dolphin" ICON "..\\..\\..\\Installer\\Dolphin.ico"
|
||||
#define wxUSE_NO_MANIFEST 1
|
||||
#include <wx/msw/wx.rc>
|
||||
|
||||
|
|
|
@ -71,30 +71,7 @@ extern "C" {
|
|||
};
|
||||
|
||||
|
||||
// Windows functions. Setting the cursor with wxSetCursor() did not work in
|
||||
// this instance. Probably because it's somehow reset from the WndProc() in
|
||||
// the child window
|
||||
#ifdef _WIN32
|
||||
// Declare a blank icon and one that will be the normal cursor
|
||||
HCURSOR hCursor = NULL, hCursorBlank = NULL;
|
||||
|
||||
// Create the default cursor
|
||||
void CreateCursor()
|
||||
{
|
||||
hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
}
|
||||
|
||||
void MSWSetCursor(bool Show)
|
||||
{
|
||||
if(Show)
|
||||
SetCursor(hCursor);
|
||||
else
|
||||
{
|
||||
SetCursor(hCursorBlank);
|
||||
//wxSetCursor(wxCursor(wxNullCursor));
|
||||
}
|
||||
}
|
||||
|
||||
// I could not use FindItemByHWND() instead of this, it crashed on that occation I used it */
|
||||
HWND MSWGetParent_(HWND Parent)
|
||||
{
|
||||
|
@ -133,10 +110,11 @@ CPanel::CPanel(
|
|||
|
||||
case WM_USER_SETCURSOR:
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
|
||||
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN)
|
||||
MSWSetCursor(!SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor);
|
||||
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN &&
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
SetCursor(wxCURSOR_BLANK);
|
||||
else
|
||||
MSWSetCursor(true);
|
||||
SetCursor(wxNullCursor);
|
||||
break;
|
||||
|
||||
case WIIMOTE_DISCONNECT:
|
||||
|
@ -435,9 +413,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||
// Commit
|
||||
m_Mgr->Update();
|
||||
|
||||
// Create cursors
|
||||
#ifdef _WIN32
|
||||
CreateCursor();
|
||||
SetToolTip(wxT(""));
|
||||
GetToolTip()->SetAutoPop(25000);
|
||||
#endif
|
||||
|
@ -494,20 +470,6 @@ void CFrame::OnActive(wxActivateEvent& event)
|
|||
{
|
||||
if (event.GetActive() && event.GetEventObject() == m_RenderFrame)
|
||||
{
|
||||
// 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
|
||||
|
||||
#ifdef __WXMSW__
|
||||
::SetFocus((HWND)m_RenderParent->GetHandle());
|
||||
#else
|
||||
|
@ -516,7 +478,7 @@ void CFrame::OnActive(wxActivateEvent& event)
|
|||
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
|
||||
Core::GetState() == Core::CORE_RUN)
|
||||
m_RenderParent->SetCursor(cursor_transparent);
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -646,12 +608,12 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef __WXGTK__
|
||||
case WM_USER_CREATE:
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
break;
|
||||
|
||||
#ifdef __WXGTK__
|
||||
case IDM_PANIC:
|
||||
{
|
||||
wxString caption = event.GetString().BeforeFirst(':');
|
||||
|
|
|
@ -139,9 +139,9 @@ void CFrame::CreateMenu()
|
|||
emulationMenu->Append(IDM_RECORDEXPORT, GetMenuLabel(HK_EXPORT_RECORDING));
|
||||
emulationMenu->Append(IDM_RECORDREADONLY, GetMenuLabel(HK_READ_ONLY_MODE), wxEmptyString, wxITEM_CHECK);
|
||||
emulationMenu->Append(IDM_TASINPUT, _("TAS Input"));
|
||||
emulationMenu->AppendCheckItem(IDM_TOGGLE_PAUSEMOVIE, _("Pause at end of movie"));
|
||||
emulationMenu->AppendCheckItem(IDM_TOGGLE_PAUSEMOVIE, _("Pause at end of movie"));
|
||||
emulationMenu->Check(IDM_TOGGLE_PAUSEMOVIE, SConfig::GetInstance().m_PauseMovie);
|
||||
emulationMenu->AppendCheckItem(IDM_SHOWLAG, _("Show lag counter"));
|
||||
emulationMenu->AppendCheckItem(IDM_SHOWLAG, _("Show lag counter"));
|
||||
emulationMenu->Check(IDM_SHOWLAG, SConfig::GetInstance().m_ShowLag);
|
||||
emulationMenu->Check(IDM_RECORDREADONLY, true);
|
||||
emulationMenu->AppendSeparator();
|
||||
|
@ -1055,27 +1055,14 @@ void CFrame::DoPause()
|
|||
{
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_ARROW);
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
}
|
||||
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(cursor_transparent);
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
}
|
||||
UpdateGUI();
|
||||
}
|
||||
|
@ -1151,7 +1138,7 @@ void CFrame::DoStop()
|
|||
wxMouseEventHandler(CFrame::OnMouse),
|
||||
(wxObject*)0, this);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_ARROW);
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
DoFullscreen(false);
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||
m_RenderFrame->Destroy();
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<BaseAddress>0x00400000</BaseAddress>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
Loading…
Reference in New Issue