mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-13 01:29:11 +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.
140 lines
4.4 KiB
C++
140 lines
4.4 KiB
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/generic/infobar.h
|
|
// Purpose: generic wxInfoBar class declaration
|
|
// Author: Vadim Zeitlin
|
|
// Created: 2009-07-28
|
|
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
|
// Licence: wxWindows licence
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_GENERIC_INFOBAR_H_
|
|
#define _WX_GENERIC_INFOBAR_H_
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
|
|
class WXDLLIMPEXP_FWD_CORE wxStaticBitmap;
|
|
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxInfoBar
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxInfoBarGeneric : public wxInfoBarBase
|
|
{
|
|
public:
|
|
// the usual ctors and Create() but remember that info bar is created
|
|
// hidden
|
|
wxInfoBarGeneric() { Init(); }
|
|
|
|
wxInfoBarGeneric(wxWindow *parent, wxWindowID winid = wxID_ANY)
|
|
{
|
|
Init();
|
|
Create(parent, winid);
|
|
}
|
|
|
|
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY);
|
|
|
|
|
|
// implement base class methods
|
|
// ----------------------------
|
|
|
|
virtual void ShowMessage(const wxString& msg,
|
|
int flags = wxICON_INFORMATION) wxOVERRIDE;
|
|
|
|
virtual void Dismiss() wxOVERRIDE;
|
|
|
|
virtual void AddButton(wxWindowID btnid, const wxString& label = wxString()) wxOVERRIDE;
|
|
|
|
virtual void RemoveButton(wxWindowID btnid) wxOVERRIDE;
|
|
|
|
virtual size_t GetButtonCount() const wxOVERRIDE;
|
|
virtual wxWindowID GetButtonId(size_t idx) const wxOVERRIDE;
|
|
virtual bool HasButtonId(wxWindowID btnid) const wxOVERRIDE;
|
|
|
|
// methods specific to this version
|
|
// --------------------------------
|
|
|
|
// set the effect(s) to use when showing/hiding the bar, may be
|
|
// wxSHOW_EFFECT_NONE to disable any effects entirely
|
|
//
|
|
// by default, slide to bottom/top is used when it's positioned on the top
|
|
// of the window for showing/hiding it and top/bottom when it's positioned
|
|
// at the bottom
|
|
void SetShowHideEffects(wxShowEffect showEffect, wxShowEffect hideEffect)
|
|
{
|
|
m_showEffect = showEffect;
|
|
m_hideEffect = hideEffect;
|
|
}
|
|
|
|
// get effect used when showing/hiding the window
|
|
wxShowEffect GetShowEffect() const;
|
|
wxShowEffect GetHideEffect() const;
|
|
|
|
// set the duration of animation used when showing/hiding the bar, in ms
|
|
void SetEffectDuration(int duration) { m_effectDuration = duration; }
|
|
|
|
// get the currently used effect animation duration
|
|
int GetEffectDuration() const { return m_effectDuration; }
|
|
|
|
|
|
// overridden base class methods
|
|
// -----------------------------
|
|
|
|
// setting the font of this window sets it for the text control inside it
|
|
// (default font is a larger and bold version of the normal one)
|
|
virtual bool SetFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
// same thing with the colour: this affects the text colour
|
|
virtual bool SetForegroundColour(const wxColor& colour) wxOVERRIDE;
|
|
|
|
protected:
|
|
// info bar shouldn't have any border by default, the colour difference
|
|
// between it and the main window separates it well enough
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
|
|
|
|
|
|
// update the parent to take our new or changed size into account (notably
|
|
// should be called when we're shown or hidden)
|
|
void UpdateParent();
|
|
|
|
private:
|
|
// common part of all ctors
|
|
void Init();
|
|
|
|
// handler for the close button
|
|
void OnButton(wxCommandEvent& event);
|
|
|
|
// show/hide the bar
|
|
void DoShow();
|
|
void DoHide();
|
|
|
|
// determine the placement of the bar from its position in the containing
|
|
// sizer
|
|
enum BarPlacement
|
|
{
|
|
BarPlacement_Top,
|
|
BarPlacement_Bottom,
|
|
BarPlacement_Unknown
|
|
};
|
|
|
|
BarPlacement GetBarPlacement() const;
|
|
|
|
|
|
// different controls making up the bar
|
|
wxStaticBitmap *m_icon;
|
|
wxStaticText *m_text;
|
|
wxBitmapButton *m_button;
|
|
|
|
// the effects to use when showing/hiding and duration for them: by default
|
|
// the effect is determined by the info bar automatically depending on its
|
|
// position and the default duration is used
|
|
wxShowEffect m_showEffect,
|
|
m_hideEffect;
|
|
int m_effectDuration;
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
|
wxDECLARE_NO_COPY_CLASS(wxInfoBarGeneric);
|
|
};
|
|
|
|
#endif // _WX_GENERIC_INFOBAR_H_
|
|
|