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
This commit is contained in:
Robert Roebling
2006-11-17 09:29:39 +00:00
parent 5600fb6e6f
commit 515a31bf65
3 changed files with 11 additions and 2 deletions

View File

@@ -675,13 +675,16 @@ wxWidgets.
\membersection{wxApp::SetUseBestVisual}\label{wxappsetusebestvisual} \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 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 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 case under Solaris and IRIX, where the default visual is only 8-bit whereas certain
applications are supposed to run in TrueColour mode. 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} 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. instance and won't have any effect when called later on.

View File

@@ -463,7 +463,8 @@ public:
virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; } virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; }
// set use of best visual flag (see below) // 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; } bool GetUseBestVisual() const { return m_useBestVisual; }
// set/get printing mode: see wxPRINT_XXX constants. // 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 // true if the app wants to use the best visual on systems where
// more than one are available (Sun, SGI, XFree86 4.0 ?) // more than one are available (Sun, SGI, XFree86 4.0 ?)
bool m_useBestVisual; bool m_useBestVisual;
// force TrueColour just in case "best" isn't TrueColour
bool m_forceTrueColour;
// does any of our windows have focus? // does any of our windows have focus?
bool m_isActive; bool m_isActive;

View File

@@ -74,7 +74,10 @@ wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoop)
wxAppBase::wxAppBase() wxAppBase::wxAppBase()
{ {
m_topWindow = (wxWindow *)NULL; m_topWindow = (wxWindow *)NULL;
m_useBestVisual = false; m_useBestVisual = false;
m_forceTrueColour = false;
m_isActive = true; m_isActive = true;
m_mainLoop = NULL; m_mainLoop = NULL;