]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied [ 639060 ] Individual bar floating in contrib/fl
authorJulian Smart <julian@anthemion.co.uk>
Mon, 9 Dec 2002 09:21:23 +0000 (09:21 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 9 Dec 2002 09:21:23 +0000 (09:21 +0000)
In the current contrib/fl implementation, all control bars
in the frame layout either float or they don't. I added
code to allow the bar floating to be determined on a bar-
by-bar basis. That is, this patch enables some control
bars to float while keeping others locked.

Kevin Yochum

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/include/wx/fl/controlbar.h
contrib/src/fl/controlbar.cpp

index db829bc6183ab7cd3d9d505e348aa32e288ef691..f485ef7c513a77e57c11eaca1550fe8d9f371540 100644 (file)
@@ -904,6 +904,13 @@ public:
     bool          mHasLeftHandle;
     bool          mHasRightHandle;
 
+    // determines if this bar can float. The layout's setting as priority. For 
+    // example, if the layout's mFloatingOn is false, this setting is irrelevant
+    // since nothing will float at all. If the layout's floating is on, use this
+    // setting to prevent specific bars from floating. In other words, all bars 
+    // float by default and floating can be turned off on individual bars.
+    bool          mFloatingOn;    // default: ON (which is also the layout's mFloatingOn default setting)
+
     cbDimInfo     mDimInfo;       // preferred sizes for each, control bar state
 
     int           mState;         // (see definition of controlbar states)
index afe63e5af0990485fdfcac11a3917c00bcd93e67..15390fcc7075e1022cce2ee0dca9efd5ed0445ac 100644 (file)
@@ -674,7 +674,7 @@ BarArrayT& wxFrameLayout::GetBars()
 
 void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
 {
-    if ( newState == wxCBAR_FLOATING && !mFloatingOn )
+    if ( newState == wxCBAR_FLOATING && !(mFloatingOn && pBar->mFloatingOn))
 
         return;
 
@@ -824,7 +824,7 @@ void wxFrameLayout::ApplyBarProperties( cbBarInfo* pBar )
 
 void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar )
 {
-    if ( !mFloatingOn ) return;
+    if ( !(mFloatingOn && pBar->mFloatingOn)) return;
 
     wxNode* pNode = mFloatedFrames.First();
 
@@ -871,7 +871,8 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
     }
     else
     {                   
-        if ( !mFloatingOn ) return;
+        if ( !(mFloatingOn && pBar->mFloatingOn) )
+          return;
 
         // float it
 
@@ -2124,9 +2125,9 @@ IMPLEMENT_DYNAMIC_CLASS( cbBarInfo, wxObject )
 cbBarInfo::cbBarInfo(void)
 
     : mpRow( NULL ),
-
       mpNext( NULL ),
-      mpPrev( NULL )
+      mpPrev( NULL ),
+      mFloatingOn( TRUE )
 {}
 
 cbBarInfo::~cbBarInfo()