From 822326eea9734a25a7dd36fd9367b7e0af71fc8e Mon Sep 17 00:00:00 2001 From: EmptyChaos Date: Sun, 26 Jun 2016 05:25:29 +0000 Subject: Update wxWidgets to 3.1.0 From wxWidgets master 81570ae070b35c9d52de47b1f14897f3ff1a66c7. include/wx/defs.h -- __w64 warning disable patch by comex brought forward. include/wx/msw/window.h -- added GetContentScaleFactor() which was not implemented on Windows but is necessary for wxBitmap scaling on Mac OS X so it needs to work to avoid #ifdef-ing the code. src/gtk/window.cpp -- Modified DoSetClientSize() to direct call wxWindowGTK::DoSetSize() instead of using public wxWindowBase::SetSize() which now prevents derived classes (like wxAuiToolbar) intercepting the call and breaking it. This matches Windows which does NOT need to call DoSetSize internally. End result is this fixes Dolphin's debug tools toolbars on Linux. src/osx/window_osx.cpp -- Same fix as for GTK since it has the same issue. src/msw/radiobox.cpp -- Hacked to fix display in HiDPI (was clipping off end of text). Updated CMakeLists for Linux and Mac OS X. Small code changes to Dolphin to fix debug error boxes, deprecation warnings, and retain previous UI behavior on Windows. --- Source/Core/DolphinWX/AboutDolphin.cpp | 2 +- Source/Core/DolphinWX/Debugger/CodeView.cpp | 6 +-- Source/Core/DolphinWX/Debugger/DebuggerUIUtil.cpp | 3 +- Source/Core/DolphinWX/Debugger/MemoryView.cpp | 6 +-- Source/Core/DolphinWX/DolphinWX.vcxproj | 5 ++- Source/Core/DolphinWX/FrameTools.cpp | 2 +- .../Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp | 6 +-- Source/Core/DolphinWX/TASInputDlg.cpp | 50 +++++++++------------- 8 files changed, 38 insertions(+), 42 deletions(-) (limited to 'Source/Core') diff --git a/Source/Core/DolphinWX/AboutDolphin.cpp b/Source/Core/DolphinWX/AboutDolphin.cpp index 71004e9417..2cd29278a4 100644 --- a/Source/Core/DolphinWX/AboutDolphin.cpp +++ b/Source/Core/DolphinWX/AboutDolphin.cpp @@ -117,7 +117,7 @@ AboutDolphin::AboutDolphin(wxWindow* parent, wxWindowID id, const wxString& titl wxBoxSizer* const sFooter = new wxBoxSizer(wxVERTICAL); sFooter->AddSpacer(15); - sFooter->Add(Copyright, 0, wxALIGN_BOTTOM | wxALIGN_CENTER_HORIZONTAL); + sFooter->Add(Copyright, 0, wxALIGN_CENTER_HORIZONTAL); sFooter->AddSpacer(5); wxBoxSizer* const sMain = new wxBoxSizer(wxVERTICAL); diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 2eb9ad093d..22119b6bac 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -411,15 +411,15 @@ void CCodeView::OnPaint(wxPaintEvent& event) wxPen nullPen(bgColor); wxPen currentPen(*wxBLACK_PEN); wxPen selPen(*wxGREY_PEN); - nullPen.SetStyle(wxTRANSPARENT); - currentPen.SetStyle(wxSOLID); + nullPen.SetStyle(wxPENSTYLE_TRANSPARENT); + currentPen.SetStyle(wxPENSTYLE_SOLID); wxBrush currentBrush(*wxLIGHT_GREY_BRUSH); wxBrush pcBrush(*wxGREEN_BRUSH); wxBrush bpBrush(*wxRED_BRUSH); wxBrush bgBrush(bgColor); wxBrush nullBrush(bgColor); - nullBrush.SetStyle(wxTRANSPARENT); + nullBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT); ctx->SetPen(nullPen); ctx->SetBrush(bgBrush); diff --git a/Source/Core/DolphinWX/Debugger/DebuggerUIUtil.cpp b/Source/Core/DolphinWX/Debugger/DebuggerUIUtil.cpp index 1dc7d4547a..ac4ff03fef 100644 --- a/Source/Core/DolphinWX/Debugger/DebuggerUIUtil.cpp +++ b/Source/Core/DolphinWX/Debugger/DebuggerUIUtil.cpp @@ -6,4 +6,5 @@ #include // The default font -wxFont DebuggerFont = wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false, "monospace"); +wxFont DebuggerFont{9, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, + false, "monospace"}; diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index 2af3dba977..195cd965b3 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -253,19 +253,19 @@ void CMemoryView::OnPaint(wxPaintEvent& event) // TODO: Add any drawing code here... int width = rc.width; int numRows = (rc.height / rowHeight) / 2 + 2; - dc.SetBackgroundMode(wxTRANSPARENT); + dc.SetBackgroundMode(wxPENSTYLE_TRANSPARENT); const wxColour bgColor = *wxWHITE; wxPen nullPen(bgColor); wxPen currentPen(*wxBLACK_PEN); wxPen selPen(*wxGREY_PEN); - nullPen.SetStyle(wxTRANSPARENT); + nullPen.SetStyle(wxPENSTYLE_TRANSPARENT); wxBrush currentBrush(*wxLIGHT_GREY_BRUSH); wxBrush pcBrush(*wxGREEN_BRUSH); wxBrush mcBrush(*wxBLUE_BRUSH); wxBrush bgBrush(bgColor); wxBrush nullBrush(bgColor); - nullBrush.SetStyle(wxTRANSPARENT); + nullBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT); dc.SetPen(nullPen); dc.SetBrush(bgBrush); diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj index ba66d9a20c..56a434ae64 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcxproj +++ b/Source/Core/DolphinWX/DolphinWX.vcxproj @@ -1,4 +1,4 @@ - + @@ -50,6 +50,9 @@ + + true + diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 44de0e8e99..b46efcb715 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -554,7 +554,7 @@ void CFrame::PopulateToolbar(wxToolBar* ToolBar) // Delete and recreate the toolbar void CFrame::RecreateToolbar() { - static const long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT; + static const long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT | wxTB_FLAT; if (m_ToolBar != nullptr) { diff --git a/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp b/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp index 4f3725e222..a2652d2d2f 100644 --- a/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp +++ b/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp @@ -142,9 +142,9 @@ NetPlaySetupFrame::NetPlaySetupFrame(wxWindow* const parent, const CGameListCtrl wxBoxSizer* const top_szr = new wxBoxSizer(wxHORIZONTAL); - top_szr->Add(m_ip_lbl, 0, wxCENTER | wxRIGHT, 5); + top_szr->Add(m_ip_lbl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5); top_szr->Add(m_connect_ip_text, 3); - top_szr->Add(m_client_port_lbl, 0, wxCENTER | wxRIGHT | wxLEFT, 5); + top_szr->Add(m_client_port_lbl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5); top_szr->Add(m_connect_port_text, 1); wxBoxSizer* const con_szr = new wxBoxSizer(wxVERTICAL); @@ -195,7 +195,7 @@ NetPlaySetupFrame::NetPlaySetupFrame(wxWindow* const parent, const CGameListCtrl top_szr->Add(m_host_port_text, 0); #ifdef USE_UPNP m_upnp_chk = new wxCheckBox(host_tab, wxID_ANY, _("Forward port (UPnP)")); - top_szr->Add(m_upnp_chk, 0, wxALL | wxALIGN_RIGHT, 5); + top_szr->Add(m_upnp_chk, 0, wxALL, 5); #endif wxBoxSizer* const bottom_szr = new wxBoxSizer(wxHORIZONTAL); bottom_szr->Add(m_traversal_listen_port_enabled, 0, wxCENTER | wxLEFT, 5); diff --git a/Source/Core/DolphinWX/TASInputDlg.cpp b/Source/Core/DolphinWX/TASInputDlg.cpp index edad81cc59..f732f65871 100644 --- a/Source/Core/DolphinWX/TASInputDlg.cpp +++ b/Source/Core/DolphinWX/TASInputDlg.cpp @@ -263,9 +263,7 @@ wxBoxSizer* TASInputDlg::CreateCCLayout() m_cc_r_stick_szr = CreateStickLayout(&m_cc_r_stick, _("Right stick")); m_cc_l = CreateControl(wxSL_VERTICAL, -1, 100, false, 31, 0); - ; m_cc_r = CreateControl(wxSL_VERTICAL, -1, 100, false, 31, 0); - ; wxStaticBoxSizer* const shoulder_box = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Shoulder Buttons")); @@ -289,7 +287,8 @@ wxBoxSizer* TASInputDlg::CreateCCLayout() cc_buttons_dpad->AddSpacer(20); for (auto button : m_cc_buttons) - cc_buttons_grid->Add(button.checkbox); + if (!button.checkbox->GetContainingSizer()) + cc_buttons_grid->Add(button.checkbox); cc_buttons_grid->AddSpacer(5); cc_buttons_box->Add(cc_buttons_grid); @@ -442,26 +441,23 @@ TASInputDlg::Stick TASInputDlg::CreateStick(int id_stick, int xRange, int yRange tempStick.bitmap->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this); tempStick.x_cont = CreateControl(wxSL_HORIZONTAL | (reverseX ? wxSL_INVERSE : 0), 120, -1, reverseX, xRange, defaultX); - tempStick.y_cont = CreateControl(wxSL_VERTICAL | (reverseY ? wxSL_INVERSE : 0), -1, 120, reverseY, - yRange, defaultY); + tempStick.y_cont = CreateControl(wxSL_VERTICAL | wxSL_LEFT | (reverseY ? wxSL_INVERSE : 0), -1, + 120, reverseY, yRange, defaultY); return tempStick; } wxStaticBoxSizer* TASInputDlg::CreateStickLayout(Stick* tempStick, const wxString& title) { wxStaticBoxSizer* const temp_box = new wxStaticBoxSizer(wxHORIZONTAL, this, title); - wxBoxSizer* const temp_xslider_box = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* const temp_yslider_box = new wxBoxSizer(wxVERTICAL); - wxBoxSizer* const temp_stick_box = new wxBoxSizer(wxVERTICAL); - - temp_xslider_box->Add(tempStick->x_cont.slider, 0, wxALIGN_TOP); - temp_xslider_box->Add(tempStick->x_cont.text, 0, wxALIGN_TOP); - temp_stick_box->Add(temp_xslider_box); - temp_stick_box->Add(tempStick->bitmap, 0, wxALL | wxALIGN_CENTER, 3); - temp_box->Add(temp_stick_box); - temp_yslider_box->Add(tempStick->y_cont.slider, 0, wxALIGN_CENTER_VERTICAL); - temp_yslider_box->Add(tempStick->y_cont.text, 0, wxALIGN_CENTER_VERTICAL); - temp_box->Add(temp_yslider_box); + wxFlexGridSizer* grid = new wxFlexGridSizer(2, 3, 3); + + grid->Add(tempStick->x_cont.slider, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_BOTTOM); + grid->Add(tempStick->x_cont.text, 0, wxEXPAND); + grid->Add(tempStick->bitmap, 0, wxALL | wxALIGN_CENTER, 3); + grid->Add(tempStick->y_cont.slider, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); + grid->Add(1, 1); + grid->Add(tempStick->y_cont.text, 0, wxEXPAND); + temp_box->Add(grid, 1, wxEXPAND | wxALL, 3); return temp_box; } @@ -473,12 +469,12 @@ wxStaticBoxSizer* TASInputDlg::CreateAccelLayout(Control* x, Control* y, Control wxStaticBoxSizer* const yBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Y")); wxStaticBoxSizer* const zBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Z")); - xBox->Add(x->slider, 0, wxALIGN_CENTER_VERTICAL); - xBox->Add(x->text, 0, wxALIGN_CENTER_VERTICAL); - yBox->Add(y->slider, 0, wxALIGN_CENTER_VERTICAL); - yBox->Add(y->text, 0, wxALIGN_CENTER_VERTICAL); - zBox->Add(z->slider, 0, wxALIGN_CENTER_VERTICAL); - zBox->Add(z->text, 0, wxALIGN_CENTER_VERTICAL); + xBox->Add(x->slider, 0, wxALIGN_CENTER_HORIZONTAL); + xBox->Add(x->text, 0, wxALIGN_CENTER_HORIZONTAL); + yBox->Add(y->slider, 0, wxALIGN_CENTER_HORIZONTAL); + yBox->Add(y->text, 0, wxALIGN_CENTER_HORIZONTAL); + zBox->Add(z->slider, 0, wxALIGN_CENTER_HORIZONTAL); + zBox->Add(z->text, 0, wxALIGN_CENTER_HORIZONTAL); temp_box->Add(xBox, 0, wxLEFT | wxBOTTOM | wxRIGHT, 5); temp_box->Add(yBox, 0, wxRIGHT, 5); temp_box->Add(zBox, 0, wxRIGHT, 5); @@ -1208,13 +1204,9 @@ wxBitmap TASInputDlg::CreateStickBitmap(int x, int y) memDC.SetBackground(*wxLIGHT_GREY_BRUSH); memDC.Clear(); memDC.SetBrush(*wxWHITE_BRUSH); - memDC.DrawCircle(65, 65, 64); - memDC.SetBrush(*wxRED_BRUSH); + memDC.DrawCircle(64, 64, 64); + memDC.SetPen(wxPen(*wxBLACK, 3, wxPENSTYLE_SOLID)); memDC.DrawLine(64, 64, x, y); - memDC.DrawLine(63, 64, x - 1, y); - memDC.DrawLine(65, 64, x + 1, y); - memDC.DrawLine(64, 63, x, y - 1); - memDC.DrawLine(64, 65, x, y + 1); memDC.SetPen(*wxBLACK_PEN); memDC.CrossHair(64, 64); memDC.SetBrush(*wxBLUE_BRUSH); -- cgit v1.2.3