Removed main configuration show/hide mouse options and associated wxTimer in

linux.  This could confuse users, as it does nothing in linux.  Mouse hiding is
set from the GL video plugin.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5008 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-02-04 21:50:02 +00:00
parent 6e2104b050
commit 0bad7e2a71
4 changed files with 27 additions and 17 deletions

View File

@ -51,8 +51,10 @@ EVT_BUTTON(wxID_CLOSE, CConfigMain::CloseClick)
EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_USEPANICHANDLERS, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_USEPANICHANDLERS, CConfigMain::CoreSettingsChanged)
#if wxUSE_TIMER && defined _WIN32
EVT_CHECKBOX(ID_INTERFACE_HIDECURSOR, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_HIDECURSOR, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_AUTOHIDECURSOR, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_AUTOHIDECURSOR, CConfigMain::CoreSettingsChanged)
#endif
EVT_RADIOBOX(ID_INTERFACE_THEME, CConfigMain::CoreSettingsChanged) EVT_RADIOBOX(ID_INTERFACE_THEME, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_WIIMOTE_LEDS, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_WIIMOTE_LEDS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_WIIMOTE_SPEAKERS, CConfigMain::CoreSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_WIIMOTE_SPEAKERS, CConfigMain::CoreSettingsChanged)
@ -242,12 +244,14 @@ void CConfigMain::CreateGUIControls()
UsePanicHandlers = new wxCheckBox(GeneralPage, ID_INTERFACE_USEPANICHANDLERS, wxT("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); UsePanicHandlers = new wxCheckBox(GeneralPage, ID_INTERFACE_USEPANICHANDLERS, wxT("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UsePanicHandlers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers); UsePanicHandlers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers);
#if wxUSE_TIMER && defined _WIN32
// Hide Cursor // Hide Cursor
wxStaticText *HideCursorText = new wxStaticText(GeneralPage, ID_INTERFACE_HIDECURSOR_TEXT, wxT("Hide Cursor:"), wxDefaultPosition, wxDefaultSize); wxStaticText *HideCursorText = new wxStaticText(GeneralPage, ID_INTERFACE_HIDECURSOR_TEXT, wxT("Hide Cursor:"), wxDefaultPosition, wxDefaultSize);
AutoHideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_AUTOHIDECURSOR, wxT("Auto")); AutoHideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_AUTOHIDECURSOR, wxT("Auto"));
AutoHideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor); AutoHideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor);
HideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_HIDECURSOR, wxT("Always")); HideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_HIDECURSOR, wxT("Always"));
HideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor); HideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor);
#endif
// Wiimote status in statusbar // Wiimote status in statusbar
wxStaticText *WiimoteStatusText = new wxStaticText(GeneralPage, ID_INTERFACE_WIIMOTE_TEXT, wxT("Show wiimote status:"), wxDefaultPosition, wxDefaultSize); wxStaticText *WiimoteStatusText = new wxStaticText(GeneralPage, ID_INTERFACE_WIIMOTE_TEXT, wxT("Show wiimote status:"), wxDefaultPosition, wxDefaultSize);
WiimoteStatusLEDs = new wxCheckBox(GeneralPage, ID_INTERFACE_WIIMOTE_LEDS, wxT("LEDs"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); WiimoteStatusLEDs = new wxCheckBox(GeneralPage, ID_INTERFACE_WIIMOTE_LEDS, wxT("LEDs"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
@ -278,9 +282,11 @@ void CConfigMain::CreateGUIControls()
UsePanicHandlers->SetToolTip(wxT("Show a message box when a potentially serious error has occured.") UsePanicHandlers->SetToolTip(wxT("Show a message box when a potentially serious error has occured.")
wxT(" Disabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin") wxT(" Disabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin")
wxT(" suddenly crashes without any explanation at all.")); wxT(" suddenly crashes without any explanation at all."));
#if wxUSE_TIMER && defined _WIN32
AutoHideCursor->SetToolTip(wxT("This will auto hide the cursor in fullscreen mode.")); AutoHideCursor->SetToolTip(wxT("This will auto hide the cursor in fullscreen mode."));
HideCursor->SetToolTip(wxT("This will always hide the cursor when it's over the rendering window.") HideCursor->SetToolTip(wxT("This will always hide the cursor when it's over the rendering window.")
wxT("\nIt can be convenient in a Wii game that already has a cursor.")); wxT("\nIt can be convenient in a Wii game that already has a cursor."));
#endif
WiimoteStatusLEDs->SetToolTip(wxT("Show which wiimotes are connected in the statusbar.")); WiimoteStatusLEDs->SetToolTip(wxT("Show which wiimotes are connected in the statusbar."));
WiimoteStatusSpeakers->SetToolTip(wxT("Show wiimote speaker status in the statusbar.")); WiimoteStatusSpeakers->SetToolTip(wxT("Show wiimote speaker status in the statusbar."));
DSPThread->SetToolTip(wxT("Run DSPLLE on a dedicated thread (not recommended).")); DSPThread->SetToolTip(wxT("Run DSPLLE on a dedicated thread (not recommended)."));
@ -324,11 +330,13 @@ void CConfigMain::CreateGUIControls()
sbInterface = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Interface Settings")); sbInterface = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Interface Settings"));
sbInterface->Add(ConfirmStop, 0, wxALL, 5); sbInterface->Add(ConfirmStop, 0, wxALL, 5);
sbInterface->Add(UsePanicHandlers, 0, wxALL, 5); sbInterface->Add(UsePanicHandlers, 0, wxALL, 5);
#if wxUSE_TIMER && defined _WIN32
wxBoxSizer *sHideCursor = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *sHideCursor = new wxBoxSizer(wxHORIZONTAL);
sHideCursor->Add(HideCursorText); sHideCursor->Add(HideCursorText);
sHideCursor->Add(AutoHideCursor, 0, wxLEFT, 5); sHideCursor->Add(AutoHideCursor, 0, wxLEFT, 5);
sHideCursor->Add(HideCursor, 0, wxLEFT, 5); sHideCursor->Add(HideCursor, 0, wxLEFT, 5);
sbInterface->Add(sHideCursor, 0, wxALL, 5); sbInterface->Add(sHideCursor, 0, wxALL, 5);
#endif
wxBoxSizer *sWiimoteStatus = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *sWiimoteStatus = new wxBoxSizer(wxHORIZONTAL);
sWiimoteStatus->Add(WiimoteStatusText); sWiimoteStatus->Add(WiimoteStatusText);
sWiimoteStatus->Add(WiimoteStatusLEDs, 0, wxLEFT, 5); sWiimoteStatus->Add(WiimoteStatusLEDs, 0, wxLEFT, 5);
@ -661,6 +669,7 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers = UsePanicHandlers->IsChecked(); SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers = UsePanicHandlers->IsChecked();
SetEnableAlert(UsePanicHandlers->IsChecked()); SetEnableAlert(UsePanicHandlers->IsChecked());
break; break;
#if wxUSE_TIMER && defined _WIN32
case ID_INTERFACE_AUTOHIDECURSOR: case ID_INTERFACE_AUTOHIDECURSOR:
if (AutoHideCursor->IsChecked()) HideCursor->SetValue(!AutoHideCursor->IsChecked()); // Update the other one if (AutoHideCursor->IsChecked()) HideCursor->SetValue(!AutoHideCursor->IsChecked()); // Update the other one
SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked(); SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked();
@ -671,6 +680,7 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked(); SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked();
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked(); SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked();
break; break;
#endif
case ID_INTERFACE_THEME: case ID_INTERFACE_THEME:
SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection(); SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection();
main_frame->InitBitmaps(); main_frame->InitBitmaps();

View File

@ -48,8 +48,10 @@ private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
wxBoxSizer* sGeneralPage; // General Settings wxBoxSizer* sGeneralPage; // General Settings
wxCheckBox* ConfirmStop, *AutoHideCursor; wxCheckBox* ConfirmStop, *UsePanicHandlers;
wxCheckBox* HideCursor, *UsePanicHandlers; #if wxUSE_TIMER && defined _WIN32
wxCheckBox* HideCursor, *AutoHideCursor;
#endif
wxCheckBox* WiimoteStatusLEDs, * WiimoteStatusSpeakers; wxCheckBox* WiimoteStatusLEDs, * WiimoteStatusSpeakers;
wxArrayString arrayStringFor_InterfaceLang; wxArrayString arrayStringFor_InterfaceLang;
@ -171,7 +173,9 @@ private:
ID_INTERFACE_CONFIRMSTOP, // Interface settings ID_INTERFACE_CONFIRMSTOP, // Interface settings
ID_INTERFACE_USEPANICHANDLERS, ID_INTERFACE_USEPANICHANDLERS,
#if wxUSE_TIMER && defined _WIN32
ID_INTERFACE_HIDECURSOR_TEXT, ID_INTERFACE_HIDECURSOR, ID_INTERFACE_AUTOHIDECURSOR, ID_INTERFACE_HIDECURSOR_TEXT, ID_INTERFACE_HIDECURSOR, ID_INTERFACE_AUTOHIDECURSOR,
#endif
ID_INTERFACE_WIIMOTE_TEXT, ID_INTERFACE_WIIMOTE_LEDS, ID_INTERFACE_WIIMOTE_SPEAKERS, ID_INTERFACE_WIIMOTE_TEXT, ID_INTERFACE_WIIMOTE_LEDS, ID_INTERFACE_WIIMOTE_SPEAKERS,
ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG, ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG,
ID_INTERFACE_THEME, ID_INTERFACE_THEME,

View File

@ -285,7 +285,7 @@ EVT_SIZE(CFrame::OnResize)
EVT_MOVE(CFrame::OnMove) EVT_MOVE(CFrame::OnMove)
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated) EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated)
EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage) EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage)
#if wxUSE_TIMER #if wxUSE_TIMER && defined _WIN32
EVT_TIMER(wxID_ANY, CFrame::OnTimer) EVT_TIMER(wxID_ANY, CFrame::OnTimer)
#endif #endif
@ -323,9 +323,9 @@ CFrame::CFrame(wxFrame* parent,
, UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false) , UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
, bRenderToMain(false), bFloatLogWindow(false), bFloatConsoleWindow(false) , bRenderToMain(false), bFloatLogWindow(false), bFloatConsoleWindow(false)
, HaveLeds(false), HaveSpeakers(false) , HaveLeds(false), HaveSpeakers(false)
, m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0)
, m_bControlsCreated(false), bNoWiimoteMsg(false), m_StopDlg(NULL) , m_bControlsCreated(false), bNoWiimoteMsg(false), m_StopDlg(NULL)
#if wxUSE_TIMER #if wxUSE_TIMER && defined _WIN32
, m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0)
, m_timer(this) , m_timer(this)
#endif #endif
@ -348,7 +348,7 @@ CFrame::CFrame(wxFrame* parent,
} }
// Create timer // Create timer
#if wxUSE_TIMER #if wxUSE_TIMER && defined _WIN32
int TimesPerSecond = 10; // We don't need more than this int TimesPerSecond = 10; // We don't need more than this
m_timer.Start( floor((double)(1000 / TimesPerSecond)) ); m_timer.Start( floor((double)(1000 / TimesPerSecond)) );
#endif #endif
@ -476,9 +476,11 @@ CFrame::CFrame(wxFrame* parent,
wxTheApp->Connect(wxID_ANY, wxEVT_LEFT_DCLICK, wxTheApp->Connect(wxID_ANY, wxEVT_LEFT_DCLICK,
wxMouseEventHandler(CFrame::OnDoubleClick), wxMouseEventHandler(CFrame::OnDoubleClick),
(wxObject*)0, this); (wxObject*)0, this);
#ifdef _WIN32 && defince _WIN32
wxTheApp->Connect(wxID_ANY, wxEVT_MOTION, wxTheApp->Connect(wxID_ANY, wxEVT_MOTION,
wxMouseEventHandler(CFrame::OnMotion), wxMouseEventHandler(CFrame::OnMotion),
(wxObject*)0, this); (wxObject*)0, this);
#endif
// ---------- // ----------
// Update controls // Update controls
@ -504,7 +506,7 @@ CFrame::~CFrame()
cdio_free_device_list(drives); cdio_free_device_list(drives);
/* The statbar sample has this so I add this to, but I guess timer will be deleted after /* The statbar sample has this so I add this to, but I guess timer will be deleted after
this anyway */ this anyway */
#if wxUSE_TIMER #if wxUSE_TIMER && defined _WIN32
if (m_timer.IsRunning()) m_timer.Stop(); if (m_timer.IsRunning()) m_timer.Stop();
#endif #endif
@ -763,6 +765,7 @@ void CFrame::OnDoubleClick(wxMouseEvent& event)
// Check for mouse motion. Here we process the bHideCursor setting. // Check for mouse motion. Here we process the bHideCursor setting.
#if wxUSE_TIMER && defined _WIN32
void CFrame::OnMotion(wxMouseEvent& event) void CFrame::OnMotion(wxMouseEvent& event)
{ {
event.Skip(); event.Skip();
@ -786,15 +789,12 @@ void CFrame::OnMotion(wxMouseEvent& event)
if(IsFullScreen() && SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor) if(IsFullScreen() && SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor)
{ {
m_iLastMotionTime = Common::Timer::GetDoubleTime(); m_iLastMotionTime = Common::Timer::GetDoubleTime();
#ifdef _WIN32
MSWSetCursor(true); MSWSetCursor(true);
#endif
return; return;
} }
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor && event.GetId() == IDM_MPANEL) if(SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor && event.GetId() == IDM_MPANEL)
{ {
#ifdef _WIN32
if(bRenderToMain) MSWSetCursor(false); if(bRenderToMain) MSWSetCursor(false);
/* We only need to use this if we are rendering to a separate window. It does work /* We only need to use this if we are rendering to a separate window. It does work
@ -802,22 +802,20 @@ void CFrame::OnMotion(wxMouseEvent& event)
so we can use that instead. If we one day determine that the separate window so we can use that instead. If we one day determine that the separate window
rendering is superfluous we could do without this */ rendering is superfluous we could do without this */
else PostMessage((HWND)Core::GetWindowHandle(), WM_USER, 10, 0); else PostMessage((HWND)Core::GetWindowHandle(), WM_USER, 10, 0);
#endif
} }
// For some reason we need this to, otherwise the cursor can get stuck with the resizing arrows // For some reason we need this to, otherwise the cursor can get stuck with the resizing arrows
else else
{ {
#ifdef _WIN32
if(bRenderToMain) MSWSetCursor(true); if(bRenderToMain) MSWSetCursor(true);
else PostMessage((HWND)Core::GetWindowHandle(), WM_USER, 10, 1); else PostMessage((HWND)Core::GetWindowHandle(), WM_USER, 10, 1);
#endif
} }
} }
#endif
// Check for mouse status a couple of times per second for the auto hide option // Check for mouse status a couple of times per second for the auto hide option
#if wxUSE_TIMER #if wxUSE_TIMER && defined _WIN32
void CFrame::Update() void CFrame::Update()
{ {
// Check if auto hide is on, or if we are already hiding the cursor all the time // Check if auto hide is on, or if we are already hiding the cursor all the time
@ -830,10 +828,8 @@ void CFrame::Update()
double TmpSeconds = Common::Timer::GetDoubleTime(); // Get timestamp double TmpSeconds = Common::Timer::GetDoubleTime(); // Get timestamp
double CompareTime = TmpSeconds - HideDelay; // Compare it double CompareTime = TmpSeconds - HideDelay; // Compare it
#ifdef _WIN32
if(m_iLastMotionTime < CompareTime) // Update cursor if(m_iLastMotionTime < CompareTime) // Update cursor
MSWSetCursor(false); MSWSetCursor(false);
#endif
} }
} }
#endif #endif

View File

@ -337,10 +337,10 @@ class CFrame : public wxFrame
void BootGame(const std::string& filename); void BootGame(const std::string& filename);
// Double click and mouse move options // Double click and mouse move options
#if wxUSE_TIMER && defined _WIN32
double m_fLastClickTime, m_iLastMotionTime; double m_fLastClickTime, m_iLastMotionTime;
int LastMouseX, LastMouseY; int LastMouseX, LastMouseY;
#if wxUSE_TIMER
void Update(); void Update();
void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); } void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); }
wxTimer m_timer; wxTimer m_timer;