EmptyChaos 822326eea9 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.
2016-06-26 15:25:29 +10:00

97 lines
3.0 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: wx/persist/treebook.h
// Purpose: persistence support for wxBookCtrl
// Author: Vadim Zeitlin
// Created: 2009-01-19
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PERSIST_TREEBOOK_H_
#define _WX_PERSIST_TREEBOOK_H_
#include "wx/persist/bookctrl.h"
#include "wx/arrstr.h"
#include "wx/treebook.h"
// ----------------------------------------------------------------------------
// string constants used by wxPersistentTreeBookCtrl
// ----------------------------------------------------------------------------
#define wxPERSIST_TREEBOOK_KIND "TreeBook"
// this key contains the indices of all expanded nodes in the tree book
// separated by wxPERSIST_TREEBOOK_EXPANDED_SEP
#define wxPERSIST_TREEBOOK_EXPANDED_BRANCHES "Expanded"
#define wxPERSIST_TREEBOOK_EXPANDED_SEP ','
// ----------------------------------------------------------------------------
// wxPersistentTreeBookCtrl: supports saving/restoring open tree branches
// ----------------------------------------------------------------------------
class wxPersistentTreeBookCtrl : public wxPersistentBookCtrl
{
public:
wxPersistentTreeBookCtrl(wxTreebook *book)
: wxPersistentBookCtrl(book)
{
}
virtual void Save() const wxOVERRIDE
{
const wxTreebook * const book = GetTreeBook();
wxString expanded;
const size_t count = book->GetPageCount();
for ( size_t n = 0; n < count; n++ )
{
if ( book->IsNodeExpanded(n) )
{
if ( !expanded.empty() )
expanded += wxPERSIST_TREEBOOK_EXPANDED_SEP;
expanded += wxString::Format("%u", static_cast<unsigned>(n));
}
}
SaveValue(wxPERSIST_TREEBOOK_EXPANDED_BRANCHES, expanded);
wxPersistentBookCtrl::Save();
}
virtual bool Restore() wxOVERRIDE
{
wxTreebook * const book = GetTreeBook();
wxString expanded;
if ( RestoreValue(wxPERSIST_TREEBOOK_EXPANDED_BRANCHES, &expanded) )
{
const wxArrayString
indices(wxSplit(expanded, wxPERSIST_TREEBOOK_EXPANDED_SEP));
const size_t pageCount = book->GetPageCount();
const size_t count = indices.size();
for ( size_t n = 0; n < count; n++ )
{
unsigned long idx;
if ( indices[n].ToULong(&idx) && idx < pageCount )
book->ExpandNode(idx);
}
}
return wxPersistentBookCtrl::Restore();
}
virtual wxString GetKind() const wxOVERRIDE { return wxPERSIST_TREEBOOK_KIND; }
wxTreebook *GetTreeBook() const { return static_cast<wxTreebook *>(Get()); }
};
inline wxPersistentObject *wxCreatePersistentObject(wxTreebook *book)
{
return new wxPersistentTreeBookCtrl(book);
}
#endif // _WX_PERSIST_TREEBOOK_H_