mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-13 17:49:14 +01:00
822326eea9
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.
261 lines
8.3 KiB
C++
261 lines
8.3 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/generic/mdig.h
|
|
// Purpose: Generic MDI (Multiple Document Interface) classes
|
|
// Author: Hans Van Leemputten
|
|
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
|
// Created: 29/07/2002
|
|
// Copyright: (c) 2002 Hans Van Leemputten
|
|
// (c) 2008 Vadim Zeitlin
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_GENERIC_MDIG_H_
|
|
#define _WX_GENERIC_MDIG_H_
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// headers
|
|
// ----------------------------------------------------------------------------
|
|
|
|
#include "wx/panel.h"
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
|
|
class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent;
|
|
class WXDLLIMPEXP_FWD_CORE wxIcon;
|
|
class WXDLLIMPEXP_FWD_CORE wxIconBundle;
|
|
class WXDLLIMPEXP_FWD_CORE wxNotebook;
|
|
|
|
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
|
#define wxGenericMDIParentFrame wxMDIParentFrame
|
|
#define wxGenericMDIChildFrame wxMDIChildFrame
|
|
#define wxGenericMDIClientWindow wxMDIClientWindow
|
|
#else // !wxUSE_GENERIC_MDI_AS_NATIVE
|
|
class WXDLLIMPEXP_FWD_CORE wxGenericMDIParentFrame;
|
|
class WXDLLIMPEXP_FWD_CORE wxGenericMDIChildFrame;
|
|
class WXDLLIMPEXP_FWD_CORE wxGenericMDIClientWindow;
|
|
#endif // wxUSE_GENERIC_MDI_AS_NATIVE/!wxUSE_GENERIC_MDI_AS_NATIVE
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxGenericMDIParentFrame
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxGenericMDIParentFrame : public wxMDIParentFrameBase
|
|
{
|
|
public:
|
|
wxGenericMDIParentFrame() { Init(); }
|
|
wxGenericMDIParentFrame(wxWindow *parent,
|
|
wxWindowID winid,
|
|
const wxString& title,
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
const wxSize& size = wxDefaultSize,
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
|
const wxString& name = wxFrameNameStr)
|
|
{
|
|
Init();
|
|
|
|
Create(parent, winid, title, pos, size, style, name);
|
|
}
|
|
|
|
bool Create(wxWindow *parent,
|
|
wxWindowID winid,
|
|
const wxString& title,
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
const wxSize& size = wxDefaultSize,
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
virtual ~wxGenericMDIParentFrame();
|
|
|
|
// implement base class pure virtuals
|
|
static bool IsTDI() { return true; }
|
|
|
|
virtual void ActivateNext() { AdvanceActive(true); }
|
|
virtual void ActivatePrevious() { AdvanceActive(false); }
|
|
|
|
#if wxUSE_MENUS
|
|
virtual void SetWindowMenu(wxMenu* pMenu);
|
|
|
|
virtual void SetMenuBar(wxMenuBar *pMenuBar);
|
|
#endif // wxUSE_MENUS
|
|
|
|
virtual wxGenericMDIClientWindow *OnCreateGenericClient();
|
|
|
|
|
|
// implementation only from now on
|
|
void WXSetChildMenuBar(wxGenericMDIChildFrame *child);
|
|
void WXUpdateChildTitle(wxGenericMDIChildFrame *child);
|
|
void WXActivateChild(wxGenericMDIChildFrame *child);
|
|
void WXRemoveChild(wxGenericMDIChildFrame *child);
|
|
bool WXIsActiveChild(wxGenericMDIChildFrame *child) const;
|
|
bool WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const;
|
|
|
|
// return the book control used by the client window to manage the pages
|
|
wxBookCtrlBase *GetBookCtrl() const;
|
|
|
|
protected:
|
|
#if wxUSE_MENUS
|
|
wxMenuBar *m_pMyMenuBar;
|
|
#endif // wxUSE_MENUS
|
|
|
|
// advance the activation forward or backwards
|
|
void AdvanceActive(bool forward);
|
|
|
|
private:
|
|
void Init();
|
|
|
|
#if wxUSE_MENUS
|
|
void RemoveWindowMenu(wxMenuBar *pMenuBar);
|
|
void AddWindowMenu(wxMenuBar *pMenuBar);
|
|
|
|
void OnWindowMenu(wxCommandEvent& event);
|
|
#endif // wxUSE_MENUS
|
|
|
|
virtual bool ProcessEvent(wxEvent& event);
|
|
|
|
void OnClose(wxCloseEvent& event);
|
|
|
|
// return the client window, may be NULL if we hadn't been created yet
|
|
wxGenericMDIClientWindow *GetGenericClientWindow() const;
|
|
|
|
// close all children, return false if any of them vetoed it
|
|
bool CloseAll();
|
|
|
|
|
|
// this pointer is non-NULL if we're currently inside our ProcessEvent()
|
|
// and we forwarded the event to this child (as we do with menu events)
|
|
wxMDIChildFrameBase *m_childHandler;
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
|
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIParentFrame);
|
|
};
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxGenericMDIChildFrame
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxGenericMDIChildFrame : public wxTDIChildFrame
|
|
{
|
|
public:
|
|
wxGenericMDIChildFrame() { Init(); }
|
|
wxGenericMDIChildFrame(wxGenericMDIParentFrame *parent,
|
|
wxWindowID winid,
|
|
const wxString& title,
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
const wxSize& size = wxDefaultSize,
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
const wxString& name = wxFrameNameStr)
|
|
{
|
|
Init();
|
|
|
|
Create(parent, winid, title, pos, size, style, name);
|
|
}
|
|
|
|
bool Create(wxGenericMDIParentFrame *parent,
|
|
wxWindowID winid,
|
|
const wxString& title,
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
const wxSize& size = wxDefaultSize,
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
virtual ~wxGenericMDIChildFrame();
|
|
|
|
// implement MDI operations
|
|
virtual void Activate();
|
|
|
|
|
|
#if wxUSE_MENUS
|
|
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
|
virtual wxMenuBar *GetMenuBar() const;
|
|
#endif // wxUSE_MENUS
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
|
virtual void SetTitle(const wxString& title);
|
|
|
|
virtual bool TryAfter(wxEvent& event);
|
|
|
|
// implementation only from now on
|
|
|
|
wxGenericMDIParentFrame* GetGenericMDIParent() const
|
|
{
|
|
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
|
return GetMDIParent();
|
|
#else // generic != native
|
|
return m_mdiParentGeneric;
|
|
#endif
|
|
}
|
|
|
|
protected:
|
|
wxString m_title;
|
|
|
|
#if wxUSE_MENUS
|
|
wxMenuBar *m_pMenuBar;
|
|
#endif // wxUSE_MENUS
|
|
|
|
#if !wxUSE_GENERIC_MDI_AS_NATIVE
|
|
wxGenericMDIParentFrame *m_mdiParentGeneric;
|
|
#endif
|
|
|
|
protected:
|
|
void Init();
|
|
|
|
private:
|
|
void OnMenuHighlight(wxMenuEvent& event);
|
|
void OnClose(wxCloseEvent& event);
|
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame);
|
|
wxDECLARE_EVENT_TABLE();
|
|
|
|
friend class wxGenericMDIClientWindow;
|
|
};
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxGenericMDIClientWindow
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxGenericMDIClientWindow : public wxMDIClientWindowBase
|
|
{
|
|
public:
|
|
wxGenericMDIClientWindow() { }
|
|
|
|
// unfortunately we need to provide our own version of CreateClient()
|
|
// because of the difference in the type of the first parameter and
|
|
// implement the base class pure virtual method in terms of it
|
|
// (CreateGenericClient() is virtual itself to allow customizing the client
|
|
// window creation by overriding it in the derived classes)
|
|
virtual bool CreateGenericClient(wxWindow *parent);
|
|
virtual bool CreateClient(wxMDIParentFrame *parent,
|
|
long WXUNUSED(style) = wxVSCROLL | wxHSCROLL)
|
|
{
|
|
return CreateGenericClient(parent);
|
|
}
|
|
|
|
// implementation only
|
|
wxBookCtrlBase *GetBookCtrl() const;
|
|
wxGenericMDIChildFrame *GetChild(size_t pos) const;
|
|
int FindChild(wxGenericMDIChildFrame *child) const;
|
|
|
|
private:
|
|
void PageChanged(int OldSelection, int newSelection);
|
|
|
|
void OnPageChanged(wxBookCtrlEvent& event);
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
// the notebook containing all MDI children as its pages
|
|
wxNotebook *m_notebook;
|
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIClientWindow);
|
|
};
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// inline functions implementation
|
|
// ----------------------------------------------------------------------------
|
|
|
|
inline bool
|
|
wxGenericMDIParentFrame::
|
|
WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const
|
|
{
|
|
return child == m_childHandler;
|
|
}
|
|
|
|
#endif // _WX_GENERIC_MDIG_H_
|