]> git.saurik.com Git - wxWidgets.git/commitdiff
Add forceTrueColour option to SetBestVisual().
authorRobert Roebling <robert@roebling.de>
Fri, 17 Nov 2006 09:29:39 +0000 (09:29 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 17 Nov 2006 09:29:39 +0000 (09:29 +0000)
  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
include/wx/app.h
src/common/appcmn.cpp

index 76e50a1c1e9fc419573d74361a6d4506a76c4081..1c50ac52ebc0872ef456ed21c1a8f612aaa7b4a6 100644 (file)
@@ -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.
 
index 2f1ffac900dc0ed5193b14e0310f7019e15e32f5..058ac76b42f503069200f6d65b4244c40540ab2d 100644 (file)
@@ -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;
index 44c63efd1a0f9d4cda31b99ac7da23ff6a343592..ad67fbd657458c3b41d168e92e4321ebc61d1c38 100644 (file)
@@ -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;