From 515a31bf6503ba2e66be621019c8b92fa31d48a3 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 17 Nov 2006 09:29:39 +0000 Subject: [PATCH] Add forceTrueColour option to SetBestVisual(). Currently API only, implement later. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/app.tex | 5 ++++- include/wx/app.h | 5 ++++- src/common/appcmn.cpp | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/latex/wx/app.tex b/docs/latex/wx/app.tex index 76e50a1c1e..1c50ac52eb 100644 --- a/docs/latex/wx/app.tex +++ b/docs/latex/wx/app.tex @@ -675,13 +675,16 @@ wxWidgets. \membersection{wxApp::SetUseBestVisual}\label{wxappsetusebestvisual} -\func{void}{SetUseBestVisual}{\param{bool}{ flag}} +\func{void}{SetUseBestVisual}{\param{bool}{ flag}, \param{bool}{ forceTrueColour = false}} Allows the programmer to specify whether the application will use the best visual on systems that support several visual on the same display. This is typically the case under Solaris and IRIX, where the default visual is only 8-bit whereas certain applications are supposed to run in TrueColour mode. +If \arg{forceTrueColour} is true then the application will try to force +using a TrueColour visual and abort the app if none is found. + Note that this function has to be called in the constructor of the {\tt wxApp} instance and won't have any effect when called later on. diff --git a/include/wx/app.h b/include/wx/app.h index 2f1ffac900..058ac76b42 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -463,7 +463,8 @@ public: virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; } // set use of best visual flag (see below) - void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; } + void SetUseBestVisual( bool flag, bool forceTrueColour = false ) + { m_useBestVisual = flag; m_forceTrueColour = forceTrueColour; } bool GetUseBestVisual() const { return m_useBestVisual; } // set/get printing mode: see wxPRINT_XXX constants. @@ -534,6 +535,8 @@ protected: // true if the app wants to use the best visual on systems where // more than one are available (Sun, SGI, XFree86 4.0 ?) bool m_useBestVisual; + // force TrueColour just in case "best" isn't TrueColour + bool m_forceTrueColour; // does any of our windows have focus? bool m_isActive; diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 44c63efd1a..ad67fbd657 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -74,7 +74,10 @@ wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoop) wxAppBase::wxAppBase() { m_topWindow = (wxWindow *)NULL; + m_useBestVisual = false; + m_forceTrueColour = false; + m_isActive = true; m_mainLoop = NULL; -- 2.45.2