]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/fl/controlbar.cpp
Baked files for 2.6.1
[wxWidgets.git] / contrib / src / fl / controlbar.cpp
index f0c1d021052d288ac2cef3d23ca3f094005addb0..9183ec91d3c1dc51c0cff76bd3157c890c945e80 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        No names yet.
-// Purpose:     Contrib. demo
+// Name:        controlbar.cpp
+// Purpose:     Implementation for main controlbar classes.
 // Author:      Aleksandras Gluchovas
 // Modified by:
 // Created:     06/09/98
@@ -50,7 +50,6 @@
 // meet the new event paradigm as of wx2.3.0.  Probably we
 // should find a way to make these be non-global, but this
 // works for right now.
-#if wxCHECK_VERSION(2,3,0)
     wxEventType cbEVT_PL_LEFT_DOWN = wxNewEventType();
     wxEventType cbEVT_PL_LEFT_UP = wxNewEventType();
     wxEventType cbEVT_PL_RIGHT_DOWN = wxNewEventType();
     wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT = wxNewEventType();
 
     wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT = wxNewEventType();
-#endif // #if wxCHECK_VERSION(2,3,0)
 
 // some ascii-art, still can't get these *nice* cursors working on wx... :-(
 
+/*
+// FIXME:: see places where _gHorizCursorImg is used
+
 static const char* _gHorizCursorImg[] = 
 {
     "............XX....XX............",
@@ -128,6 +129,7 @@ static const char* _gVertCursorImg[] =
     "...............XXX..............",
     "................X..............."
 };
+*/
 
 // helper inline functions
 
@@ -233,7 +235,7 @@ bool cbBarSpy::ProcessEvent(wxEvent& event)
         else
             mpLayout->OnLDblClick( mevent );
 
-        //event.Skip(FALSE);
+        //event.Skip(false);
     }
 
     return handled;
@@ -256,10 +258,6 @@ BEGIN_EVENT_TABLE( wxFrameLayout, wxEvtHandler )
     EVT_LEFT_DCLICK( wxFrameLayout::OnLDblClick   )
 
     EVT_IDLE       ( wxFrameLayout::OnIdle        )
-    EVT_SET_FOCUS  ( wxFrameLayout::OnSetFocus    )
-    EVT_KILL_FOCUS ( wxFrameLayout::OnKillFocus   )
-
-    EVT_ACTIVATE   ( wxFrameLayout::OnActivate    )
 
     EVT_ERASE_BACKGROUND( wxFrameLayout::OnEraseBackground )
 
@@ -287,9 +285,9 @@ wxFrameLayout::wxFrameLayout(void)
       mpTopPlugin   ( NULL ),
       mpCaputesInput( NULL ),
 
-      mClientWndRefreshPending( FALSE ),
-      mRecalcPending( TRUE ),
-      mCheckFocusWhenIdle( FALSE )
+      mClientWndRefreshPending( false ),
+      mRecalcPending( true ),
+      mCheckFocusWhenIdle( false )
 {
     CreateCursors();
 
@@ -316,14 +314,14 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo
       mpPaneInFocus( NULL ),
       mpLRUPane    ( NULL ),
       
-      mFloatingOn   ( TRUE ),
+      mFloatingOn   ( true ),
                  
       mpTopPlugin   ( NULL ),
       mpCaputesInput( NULL ),
       
-      mClientWndRefreshPending( FALSE ),
-      mRecalcPending( TRUE ),
-      mCheckFocusWhenIdle( FALSE ),
+      mClientWndRefreshPending( false ),
+      mRecalcPending( true ),
+      mCheckFocusWhenIdle( false ),
       
       mpUpdatesMgr( NULL )
 {
@@ -347,18 +345,20 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo
     mFloatingOn = CanReparent();
 }
 
-// NOTE:: below are the only plaftorm-check "ifdef"s in the docking system!
+// NOTE:: below are the only platform-check "ifdef"s in the docking system!
 
 bool wxFrameLayout::CanReparent()
 {
 #ifdef __WXMSW__
+    return true;
+#elif defined(__WXGTK20__)
     return TRUE;
 #elif defined (__WXGTK__)
-    //return TRUE;
-    return FALSE;
+    //return true;
+    return false;
 #else
 
-    return FALSE; // reparenting is not yet supported by Motif and others
+    return false; // reparenting is not yet supported by Motif and others
 #endif
 }
 
@@ -389,7 +389,11 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent )
     pChild->Reparent(pNewParent);
 
     return;
-#elif defined(__WXGTK__)
+#elif defined(__WXGTK20__)
+    pChild->Reparent(pNewParent);
+
+    return;
+#elif defined(__WXGTK__) || defined(__WXX11__)
     // FOR NOW:: floating with wxGtk still very buggy
 
     return;
@@ -404,11 +408,11 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent )
 
 void wxFrameLayout::DestroyBarWindows()
 {
-    wxNode* pSpy = mBarSpyList.First();
+    wxObjectList::compatibility_iterator pSpy = mBarSpyList.GetFirst();
 
     while( pSpy )
     {
-        cbBarSpy& spy = *((cbBarSpy*)pSpy->Data());
+        cbBarSpy& spy = *((cbBarSpy*)pSpy->GetData());
 
         if ( spy.mpBarWnd->GetEventHandler() == &spy )
 
@@ -416,7 +420,7 @@ void wxFrameLayout::DestroyBarWindows()
 
         delete &spy;
 
-        pSpy = pSpy->Next();
+        pSpy = pSpy->GetNext();
     }
 
     mBarSpyList.Clear();
@@ -434,20 +438,22 @@ void wxFrameLayout::DestroyBarWindows()
 
 void wxFrameLayout::ShowFloatedWindows( bool show )
 {
-    wxNode* pNode = mFloatedFrames.First();
+    wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
 
     while( pNode )
     {
-        cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data());
+        cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData());
 
         pFFrm->Show( show );
 
-        pNode = pNode->Next();
+        pNode = pNode->GetNext();
     }
 }
 
 wxFrameLayout::~wxFrameLayout()
 {
+    size_t i;
+
     UnhookFromFrame();
 
     if ( mpUpdatesMgr )
@@ -476,7 +482,6 @@ wxFrameLayout::~wxFrameLayout()
 
     // destroy contents of arrays and lists
 
-    size_t i = 0;
     for ( i = 0; i != MAX_PANES; ++i )
     {
         if ( mPanes[i] ) 
@@ -493,11 +498,11 @@ wxFrameLayout::~wxFrameLayout()
     if ( mpNECursor     ) 
         delete mpNECursor;
 
-    wxNode* pSpy = mBarSpyList.First();
+    wxObjectList::compatibility_iterator pSpy = mBarSpyList.GetFirst();
 
     while( pSpy )
     {
-        cbBarSpy& spy = *((cbBarSpy*)pSpy->Data());
+        cbBarSpy& spy = *((cbBarSpy*)pSpy->GetData());
 
         if ( spy.mpBarWnd->GetEventHandler() == &spy )
 
@@ -505,7 +510,7 @@ wxFrameLayout::~wxFrameLayout()
 
         delete &spy;
 
-        pSpy = pSpy->Next();
+        pSpy = pSpy->GetNext();
     }
 
     for ( i = 0; i != mAllBars.Count(); ++i )
@@ -521,14 +526,14 @@ void wxFrameLayout::Activate()
 {
     HookUpToFrame();
 
-    RefreshNow( TRUE );
+    RefreshNow( true );
 
-    ShowFloatedWindows( TRUE );
+    ShowFloatedWindows( true );
 }
 
 void wxFrameLayout::Deactivate()
 {
-    ShowFloatedWindows( FALSE );
+    ShowFloatedWindows( false );
 
     UnhookFromFrame();
 
@@ -595,6 +600,7 @@ void wxFrameLayout::AddBar( wxWindow*        pBarWnd,
     pInfo->mName      = name;
     pInfo->mpBarWnd   = pBarWnd;
     pInfo->mDimInfo   = dimInfo;
+    pInfo->mDimInfo.mLRUPane = alignment;
     pInfo->mState     = state;
     pInfo->mAlignment = alignment;
     pInfo->mRowNo     = rowNo;
@@ -616,7 +622,7 @@ bool wxFrameLayout::RedockBar( cbBarInfo*    pBar,
 
     if ( !pToPane ) 
         
-        return FALSE; // bar's shape does not hit any pane 
+        return false; // bar's shape does not hit any pane 
                      // - redocking is NOT possible
 
     cbDockPane* pBarPane = GetBarPane( pBar );
@@ -627,16 +633,16 @@ bool wxFrameLayout::RedockBar( cbBarInfo*    pBar,
 
     pBarPane->RemoveBar( pBar );
 
-    // FIXME FIXME:: the below recalc. may be a *huge* performance
+    // FIXME FIXME:: the recalculation below may be a *huge* performance
     //               hit, it could be eliminated though...
     //               but first the "pane-postion-changed" problem 
-    //               have to be fixed 
+    //               has to be fixed 
 
-    RecalcLayout( FALSE );
+    RecalcLayout( false );
 
     pToPane->InsertBar( pBar, shapeInParent );
 
-    RecalcLayout( FALSE );
+    RecalcLayout( false );
 
     // finish update "transaction"
 
@@ -646,7 +652,7 @@ bool wxFrameLayout::RedockBar( cbBarInfo*    pBar,
         GetUpdatesManager().UpdateNow();
     }
 
-    return TRUE;
+    return true;
 }
 
 cbBarInfo* wxFrameLayout::FindBarByName( const wxString& name )
@@ -676,7 +682,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;
 
@@ -684,7 +690,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
 
         GetUpdatesManager().OnStartChanges();
 
-    pBar->mUMgrData.SetDirty(TRUE);
+    pBar->mUMgrData.SetDirty(true);
 
     // check bar's previous state
 
@@ -693,7 +699,10 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
         cbDockPane* pPane;
         cbRowInfo*  pRow;
 
-        bool success = LocateBar( pBar, &pRow, &pPane );
+        #ifdef  __WXDEBUG__
+        bool success = 
+        #endif
+                       LocateBar( pBar, &pRow, &pPane );
 
         wxASSERT( success ); // DBG::
 
@@ -710,22 +719,22 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
 
     if ( pBar->mState == wxCBAR_FLOATING && newState != wxCBAR_FLOATING )
     {
-        // remove bar's window form the containing mini-frame
-        // and set it's parent to be layout's parent frame
+        // remove bar's window from the containing mini-frame
+        // and set its parent to be layout's parent frame
 
         if ( pBar->mpBarWnd )
         {
-            pBar->mpBarWnd->Show(FALSE); // to avoid flicker upon reparenting
+            pBar->mpBarWnd->Show(false); // to avoid flicker upon reparenting
 
-            wxNode* pNode = mFloatedFrames.First();
+            wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
 
             while( pNode )
             {
-                cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data());
+                cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData());
 
                 if ( pFFrm->GetBar() == pBar )
                 {
-                    pFFrm->Show( FALSE ); // reduces flicker sligthly 
+                    pFFrm->Show( false ); // reduces flicker sligthly 
 
                     ReparentWindow( pBar->mpBarWnd, &GetParentFrame() );
 
@@ -735,29 +744,34 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
 
                         pBar->mAlignment = pBar->mDimInfo.mLRUPane;
 
-                    mFloatedFrames.DeleteNode( pNode );
+                    mFloatedFrames.Erase( pNode );
 
-                    pFFrm->Show( FALSE );
+                    pFFrm->Show( false );
                     pFFrm->Destroy(); break;
                 }
 
-                pNode = pNode->Next();
+                pNode = pNode->GetNext();
             }
 
             // FOR NOW:: excessive!
             //if ( mpFrameClient ) mpFrameClient->Refresh();
             if ( mpFrameClient )
-                mClientWndRefreshPending = TRUE;
+                mClientWndRefreshPending = true;
         }
     }
 
+    if ( pBar->mDimInfo.GetDimHandler() )
+    {
+        pBar->mDimInfo.GetDimHandler()->OnChangeBarState( pBar, newState );
+    }
+
     pBar->mState = newState;
 
     DoSetBarState( pBar );
 
     if ( updateNow )
     {
-        RecalcLayout(FALSE);
+        RecalcLayout(false);
 
         GetUpdatesManager().OnFinishChanges();
         GetUpdatesManager().UpdateNow();
@@ -770,7 +784,7 @@ void wxFrameLayout::InverseVisibility( cbBarInfo* pBar )
 
     // "inverse" bar-visibility of the selected bar
 
-    int newState = 0;
+    int newState;
 
     if ( pBar->mState == wxCBAR_HIDDEN )
     {
@@ -796,7 +810,7 @@ void wxFrameLayout::InverseVisibility( cbBarInfo* pBar )
             pBar->mAlignment = -1;
     }
 
-    this->SetBarState( pBar, newState, TRUE );
+    this->SetBarState( pBar, newState, true );
 
     if ( newState == wxCBAR_FLOATING )
 
@@ -821,13 +835,13 @@ void wxFrameLayout::ApplyBarProperties( cbBarInfo* pBar )
 
 void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar )
 {
-    if ( !mFloatingOn ) return;
+    if ( !(mFloatingOn && pBar->mFloatingOn)) return;
 
-    wxNode* pNode = mFloatedFrames.First();
+    wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
 
     while( pNode )
     {
-        cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data());
+        cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData());
 
         if ( pFFrm->GetBar() == pBar )
         {
@@ -845,7 +859,7 @@ void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar )
             break;
         }
 
-        pNode = pNode->Next();
+        pNode = pNode->GetNext();
     }
 }
 
@@ -864,11 +878,12 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
 
         if ( pBar->mpBarWnd )
 
-            pBar->mpBarWnd->Show( FALSE );
+            pBar->mpBarWnd->Show( false );
     }
     else
     {                   
-        if ( !mFloatingOn ) return;
+        if ( !(mFloatingOn && pBar->mFloatingOn) )
+          return;
 
         // float it
 
@@ -878,7 +893,7 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
 
             if ( pBar->mpBarWnd )
 
-                pBar->mpBarWnd->Show( FALSE );
+                pBar->mpBarWnd->Show( false );
 
             pBar->mState = wxCBAR_HIDDEN;
 
@@ -890,10 +905,12 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
         pMiniFrm->SetBar( pBar );
         pMiniFrm->SetLayout( this );
 
-        pMiniFrm->Create( &GetParentFrame(), -1, pBar->mName, 
+        pMiniFrm->Create( &GetParentFrame(), wxID_ANY, pBar->mName, 
                           wxPoint( 50,50 ),
                           wxSize ( 0, 0  ),
-                          wxFRAME_FLOAT_ON_PARENT  |  wxFRAME_TOOL_WINDOW
+                          wxFRAME_FLOAT_ON_PARENT |
+                          wxNO_BORDER |
+                          wxFRAME_NO_TASKBAR
                         );
 
         pMiniFrm->SetClient( pBar->mpBarWnd );
@@ -930,10 +947,11 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
             mNextFloatedWndPos.y += mFloatingPosStep.y;
         }
 
-        pMiniFrm->Show( TRUE );
+        pMiniFrm->Show( true );
+        RepositionFloatedBar(pMiniFrm->GetBar());
 
         // FIXME:: this is excessive
-        pBar->mpBarWnd->Show(TRUE);
+        pBar->mpBarWnd->Show(true);
     }
 }
 
@@ -964,14 +982,14 @@ void wxFrameLayout::RemoveBar( cbBarInfo* pBarInfo )
 #endif
             if ( pBarInfo->mpBarWnd ) // hides it's window
 
-                pBarInfo->mpBarWnd->Show( FALSE );
+                pBarInfo->mpBarWnd->Show( false );
 
             delete pBarInfo;
 
             return;
         }
     }
-    wxFAIL_MSG("bar info should be present in the list of all bars of all panes");
+    wxFAIL_MSG(wxT("bar info should be present in the list of all bars of all panes"));
 }
 
 bool wxFrameLayout::LocateBar( cbBarInfo* pBarInfo, 
@@ -993,20 +1011,19 @@ bool wxFrameLayout::LocateBar( cbBarInfo* pBarInfo,
                 (*ppPane) = mPanes[n];
                 (*ppRow ) = &i.RowInfo();
 
-                return TRUE;
+                return true;
             }
     }
 
-    return FALSE;
+    return false;
 }
 
 void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
 {
-    mRecalcPending = FALSE;
+    mRecalcPending = false;
 
     int frmWidth, frmHeight;
     mpFrame->GetClientSize( &frmWidth, &frmHeight );
-    int paneHeight = 0;
 
     int curY = 0;
     int curX = 0;
@@ -1022,7 +1039,7 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
     pPane->SetPaneWidth( frmWidth );
     pPane->RecalcLayout();
 
-    paneHeight = pPane->GetPaneHeight();
+    int paneHeight = pPane->GetPaneHeight();
 
     rect.x      = curX;
     rect.y      = curY;
@@ -1129,10 +1146,10 @@ void wxFrameLayout::PositionClientWindow()
 
             if ( !mpFrameClient->IsShown() )
 
-                mpFrameClient->Show( TRUE );
+                mpFrameClient->Show( true );
         }
         else
-            mpFrameClient->Show( FALSE );
+            mpFrameClient->Show( false );
     }
 }
 
@@ -1150,9 +1167,17 @@ void wxFrameLayout::PositionPanes()
 
 void wxFrameLayout::OnSize( wxSizeEvent& event )
 {
+    mpFrame->ProcessEvent( event );
+    event.Skip( false ); // stop its progpagation
+
     if ( event.GetEventObject() == (wxObject*) mpFrame )
-    
-        RecalcLayout(TRUE);
+    {
+        GetUpdatesManager().OnStartChanges();
+        RecalcLayout(true);
+        GetUpdatesManager().OnFinishChanges();
+        GetUpdatesManager().UpdateNow();
+    }
+
 }
 
 /*** protected members ***/
@@ -1162,29 +1187,29 @@ void wxFrameLayout::HideBarWindows()
     size_t i;
     for ( i = 0; i != mAllBars.Count(); ++i )
         if ( mAllBars[i]->mpBarWnd && mAllBars[i]->mState != wxCBAR_FLOATING )
-            mAllBars[i]->mpBarWnd->Show( FALSE );
+            mAllBars[i]->mpBarWnd->Show( false );
 
     // then floated frames
 
-    ShowFloatedWindows( FALSE );
+    ShowFloatedWindows( false );
 
     if ( mpFrameClient )
 
-        mpFrameClient->Show( FALSE );
+        mpFrameClient->Show( false );
 }
 
 void wxFrameLayout::UnhookFromFrame()
 {
     // NOTE:: the SetEvtHandlerEnabled() method is not used
-    //        here, since it is assumed, that unhooking layout
+    //        here, since it is assumed that unhooking layout
     //        from window may result destroying of the layout itself
     //       
     //        BUG BUG BUG (wx):: this would not be a problem if 
-    //                           wxEvtHandler's destructor would check if 
+    //                           wxEvtHandler's destructor checked if 
     //                           this handler is currently the top-most 
     //                           handler of some window, and additionally 
-    //                           to the reconnecting itself from the chain
-    //                           it would also re-setup current event handler 
+    //                           to the reconnecting itself from the chain.
+    //                           It would also re-setup current event handler 
     //                           of the window using wxWindow::SetEventHandler()
 
     // FOR NOW::
@@ -1348,11 +1373,6 @@ void wxFrameLayout::ForwardMouseEvent( wxMouseEvent& event,
         cbMotionEvent evt( pos, pToPane );
         FirePluginEvent( evt );
     }
-    else 
-    {
-        int avoidCompilerWarning = 0;
-        wxASSERT(avoidCompilerWarning); // DBG::
-    }
 }  // wxFrameLayout::ForwardMouseEvent()
 
 
@@ -1440,7 +1460,7 @@ void wxFrameLayout::OnMouseMove( wxMouseEvent& event )
 void wxFrameLayout::OnPaint( wxPaintEvent& event )
 {
     if ( mRecalcPending  )
-        RecalcLayout( TRUE );
+        RecalcLayout( true );
 
     wxPaintDC dc(mpFrame);
 
@@ -1459,7 +1479,7 @@ void wxFrameLayout::OnPaint( wxPaintEvent& event )
     event.Skip();
 }
 
-void wxFrameLayout::OnEraseBackground( wxEraseEvent& event )
+void wxFrameLayout::OnEraseBackground( wxEraseEvent& WXUNUSED(event) )
 {
     // do nothing
 }
@@ -1470,49 +1490,17 @@ void wxFrameLayout::OnIdle( wxIdleEvent& event )
 
     if ( !focus && mCheckFocusWhenIdle )
     {
-        wxMessageBox( "Hi, no more focus in this app!" );
+        wxMessageBox(wxT("Hi, no more focus in this app!"));
 
-        mCheckFocusWhenIdle = FALSE;
-        //ShowFloatedWindows( FALSE );
+        mCheckFocusWhenIdle = false;
+        //ShowFloatedWindows( false );
     }
 
-    mCheckFocusWhenIdle = FALSE;
+    mCheckFocusWhenIdle = false;
 
     event.Skip();
 }
 
-
-void wxFrameLayout::OnKillFocus( wxFocusEvent& event )
-{
-    //wxMessageBox( "wxFrameLayoutGot Kill Focus!" );
-    //ShowFloatedWindows( FALSE );
-}
-
-void wxFrameLayout::OnSetFocus( wxFocusEvent& event )
-{
-    //ShowFloatedWindows( TRUE );
-}
-
-void wxFrameLayout::OnActivate( wxActivateEvent& event )
-{
-#if 0
-    if ( event.GetActive() == FALSE )               
-    {
-        wxWindow* focus = wxWindow::FindFocus();
-
-        if ( !focus || focus == &GetParentFrame() )
-        {
-            mCheckFocusWhenIdle = TRUE;
-
-            if ( !focus )
-
-                wxMessageBox("Deactivated!" );
-
-        }
-    }
-#endif
-}
-
 void wxFrameLayout::GetPaneProperties( cbCommonPaneProperties& props, int alignment )
 {
     props = mPanes[alignment]->mProps;
@@ -1553,9 +1541,11 @@ void wxFrameLayout::SetPaneBackground( const wxColour& colour )
 
 void wxFrameLayout::RefreshNow( bool recalcLayout )
 {
-    if ( recalcLayout ) RecalcLayout( TRUE );
+    if ( recalcLayout )
+        RecalcLayout( true );
 
-    if ( mpFrame ) mpFrame->Refresh();
+    if ( mpFrame )
+        mpFrame->Refresh();
 }
 
 /*** plugin-related methods ***/
@@ -1566,14 +1556,14 @@ void wxFrameLayout::FirePluginEvent( cbPluginEvent& event )
 
     if ( mpCaputesInput ) 
     {
-        bool isInputEvt = TRUE;
+        bool isInputEvt = true;
 #if wxCHECK_VERSION(2,3,0)
-        if ( event.m_eventType != cbEVT_PL_LEFT_DOWN &&
-             event.m_eventType != cbEVT_PL_LEFT_UP &&
-             event.m_eventType != cbEVT_PL_RIGHT_DOWN &&
-             event.m_eventType != cbEVT_PL_RIGHT_UP &&
-             event.m_eventType != cbEVT_PL_MOTION )
-            isInputEvt = FALSE;
+        if ( event.GetEventType() != cbEVT_PL_LEFT_DOWN &&
+             event.GetEventType() != cbEVT_PL_LEFT_UP &&
+             event.GetEventType() != cbEVT_PL_RIGHT_DOWN &&
+             event.GetEventType() != cbEVT_PL_RIGHT_UP &&
+             event.GetEventType() != cbEVT_PL_MOTION )
+            isInputEvt = false;
 #else
         switch ( event.m_eventType )
         {
@@ -1583,7 +1573,7 @@ void wxFrameLayout::FirePluginEvent( cbPluginEvent& event )
             case cbEVT_PL_RIGHT_UP   : break;
             case cbEVT_PL_MOTION     : break;
             
-            default : isInputEvt = FALSE; break;
+            default : isInputEvt = false; break;
         }
 #endif  // #if wxCHECK_VERSION(2,3,0)
 
@@ -1606,7 +1596,7 @@ void wxFrameLayout::CaptureEventsForPlugin ( cbPluginBase* pPlugin )
 
 }
 
-void wxFrameLayout::ReleaseEventsFromPlugin( cbPluginBase* pPlugin )
+void wxFrameLayout::ReleaseEventsFromPlugin( cbPluginBase* WXUNUSED(pPlugin) )
 {
     // events should be captured first
     wxASSERT( mpCaputesInput != NULL );
@@ -1624,7 +1614,7 @@ void wxFrameLayout::CaptureEventsForPane( cbDockPane* toPane )
     mpPaneInFocus = toPane;
 }
 
-void wxFrameLayout::ReleaseEventsFromPane( cbDockPane* fromPane )
+void wxFrameLayout::ReleaseEventsFromPane( cbDockPane* WXUNUSED(fromPane) )
 {
     // cannot release events without capturing them
     wxASSERT( mpPaneInFocus != NULL );
@@ -1796,7 +1786,8 @@ IMPLEMENT_DYNAMIC_CLASS( cbUpdateMgrData, wxObject )
 cbUpdateMgrData::cbUpdateMgrData() 
 
     : mPrevBounds( -1,-1,0,0 ),
-      mIsDirty( TRUE )           // inidicate initial change
+      mIsDirty( true ),           // inidicate initial change
+      mpCustomData(0)
 {}
 
 void cbUpdateMgrData::StoreItemState( const wxRect& boundsInParent )
@@ -1841,7 +1832,7 @@ bool wxBarIterator::Next()
         {
             if ( mpRow->mBars.GetCount() == 0 )
             {
-                return FALSE
+                return false
             }
 
             mpBar = mpRow->mBars[0];
@@ -1857,13 +1848,13 @@ bool wxBarIterator::Next()
     
                 mpBar = mpRow->mBars[0];
             else
-                return FALSE;
+                return false;
         }
     
-        return TRUE;
+        return true;
     }
     else
-        return FALSE;
+        return false;
 }
 
 cbBarInfo& wxBarIterator::BarInfo()
@@ -1903,7 +1894,7 @@ cbDimInfo::cbDimInfo()
     : mVertGap ( 0 ), 
       mHorizGap( 0 ),
 
-      mIsFixed(TRUE),
+      mIsFixed(true),
       mpHandler( NULL )
 {
     size_t i;
@@ -2035,28 +2026,65 @@ IMPLEMENT_DYNAMIC_CLASS( cbCommonPaneProperties, wxObject )
 
 cbCommonPaneProperties::cbCommonPaneProperties(void)
 
-    : mRealTimeUpdatesOn    ( TRUE  ),
-      mOutOfPaneDragOn      ( TRUE  ),
-      mExactDockPredictionOn( FALSE ),
-      mNonDestructFirctionOn( FALSE ),
-      mShow3DPaneBorderOn   ( TRUE  ),
-      mBarFloatingOn        ( FALSE ),
-      mRowProportionsOn     ( FALSE ),
-      mColProportionsOn     ( TRUE  ),
-      mBarCollapseIconsOn   ( FALSE ),
-      mBarDragHintsOn       ( FALSE ),
+    : mRealTimeUpdatesOn    ( true  ),
+      mOutOfPaneDragOn      ( true  ),
+      mExactDockPredictionOn( false ),
+      mNonDestructFrictionOn( false ),
+      mShow3DPaneBorderOn   ( true  ),
+      mBarFloatingOn        ( false ),
+      mRowProportionsOn     ( false ),
+      mColProportionsOn     ( true  ),
+      mBarCollapseIconsOn   ( false ),
+      mBarDragHintsOn       ( false ),
 
       mMinCBarDim( 16, 16 ),
       mResizeHandleSize( 4 )
 {}
 
+cbCommonPaneProperties::cbCommonPaneProperties(const cbCommonPaneProperties& props)
+
+    : wxObject(),
+      mRealTimeUpdatesOn    (props.mRealTimeUpdatesOn),
+      mOutOfPaneDragOn      (props.mOutOfPaneDragOn),
+      mExactDockPredictionOn(props.mExactDockPredictionOn),
+      mNonDestructFrictionOn(props.mNonDestructFrictionOn),
+      mShow3DPaneBorderOn   (props.mShow3DPaneBorderOn),
+      mBarFloatingOn        (props.mBarFloatingOn),
+      mRowProportionsOn     (props.mRowProportionsOn),
+      mColProportionsOn     (props.mColProportionsOn),
+      mBarCollapseIconsOn   (props.mBarCollapseIconsOn),
+      mBarDragHintsOn       (props.mBarDragHintsOn),
+
+      mMinCBarDim(props.mMinCBarDim),
+      mResizeHandleSize(props.mResizeHandleSize)
+{}
+
+cbCommonPaneProperties& cbCommonPaneProperties::operator=(const cbCommonPaneProperties& props)
+{
+    mRealTimeUpdatesOn     = props.mRealTimeUpdatesOn;
+    mOutOfPaneDragOn       = props.mOutOfPaneDragOn;
+    mExactDockPredictionOn = props.mExactDockPredictionOn;
+    mNonDestructFrictionOn = props.mNonDestructFrictionOn;
+    mShow3DPaneBorderOn    = props.mShow3DPaneBorderOn;
+    mBarFloatingOn         = props.mBarFloatingOn;
+    mRowProportionsOn      = props.mRowProportionsOn;
+    mColProportionsOn      = props.mColProportionsOn;
+    mBarCollapseIconsOn    = props.mBarCollapseIconsOn;
+    mBarDragHintsOn        = props.mBarDragHintsOn;
+    
+    mMinCBarDim            = props.mMinCBarDim;
+    mResizeHandleSize      = props.mResizeHandleSize;
+
+    return *this;
+}
+
 /***** Implementation for class cbRowInfo *****/
 
 IMPLEMENT_DYNAMIC_CLASS( cbRowInfo, wxObject )
 
 cbRowInfo::cbRowInfo(void)
 
-    : mNotFixedBarsCnt( FALSE ),
+    : mNotFixedBarsCnt( false ),
       mpNext          ( NULL ),
       mpPrev          ( NULL ),
       mpExpandedBar   ( NULL )
@@ -2075,7 +2103,7 @@ IMPLEMENT_DYNAMIC_CLASS( cbBarInfo, wxObject )
 cbBarInfo::cbBarInfo(void)
 
     : mpRow( NULL ),
-
+      mFloatingOn( true ),
       mpNext( NULL ),
       mpPrev( NULL )
 {}
@@ -2126,7 +2154,7 @@ cbDockPane::~cbDockPane()
     for ( i = 0; i != mRows.Count(); ++i )
         delete mRows[i];
 
-    mRowShapeData.DeleteContents( TRUE );
+    WX_CLEAR_LIST(wxList,mRowShapeData)
     
     // NOTE:: control bar infromation structures are cleaned-up
     //        in wxFrameLayout's destructor, using global control-bar list
@@ -2182,7 +2210,7 @@ void cbDockPane::PaintRowBackground ( cbRowInfo* pRow, wxDC& dc )
 
 void cbDockPane::PaintRowDecorations( cbRowInfo* pRow, wxDC& dc )
 {
-    size_t i = 0;
+    size_t i;
 
     // decorations first
     for ( i = 0; i != pRow->mBars.Count(); ++i )
@@ -2218,9 +2246,9 @@ void cbDockPane::PaintPaneDecorations( wxDC& dc )
 
 void cbDockPane::PaintPane( wxDC& dc )
 {
-    PaintPaneBackground( dc );
+    size_t i;
 
-    size_t i = 0;
+    PaintPaneBackground( dc );
 
     // first decorations
     for ( i = 0; i != mRows.Count(); ++i )
@@ -2298,7 +2326,7 @@ int cbDockPane::GetNotFixedBarsCount( cbRowInfo* pRow )
 
 void cbDockPane::RemoveBar( cbBarInfo* pBar )
 {
-    bool needsRestoring = mProps.mNonDestructFirctionOn && 
+    bool needsRestoring = mProps.mNonDestructFrictionOn && 
                           mpStoredRow == pBar->mpRow;
 
     cbRemoveBarEvent evt( pBar, this );
@@ -2316,7 +2344,7 @@ void cbDockPane::RemoveBar( cbBarInfo* pBar )
 void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
 {
     // setup mHasOnlyFixedBars flag for the row information
-    pRow->mHasOnlyFixedBars = TRUE;
+    pRow->mHasOnlyFixedBars = true;
 
     pRow->mNotFixedBarsCnt = 0;
 
@@ -2329,7 +2357,7 @@ void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
 
         if ( !bar.IsFixed() )
         {
-            pRow->mHasOnlyFixedBars = FALSE;
+            pRow->mHasOnlyFixedBars = false;
             ++pRow->mNotFixedBarsCnt;
         }
     }
@@ -2447,7 +2475,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY )
     int range    = lowerY - upperY;
     int oneThird = range / 3;
 
-    wxNode* pRow = mRows.First();
+    wxNode* pRow = mRows.GetFirst();
     int row = 0;
     int curY = 0;
 
@@ -2455,7 +2483,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY )
 
     while( pRow )
     {
-        int rowHeight = GetRowHeight( (wxList*)pRow->Data() );
+        int rowHeight = GetRowHeight( (wxList*)pRow->GetData() );
 
         if ( upperY >= curY &&
              lowerY < curY ) return row;
@@ -2474,7 +2502,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY )
 
         ++row;
         curY += rowHeight;
-        pRow = pRow->Next();
+        pRow = pRow->GetNext();
     }
     */
 
@@ -2522,10 +2550,10 @@ bool cbDockPane::HasNotFixedRowsAbove( cbRowInfo* pRow )
 
         if ( pRow->mHasOnlyFixedBars )
 
-            return TRUE;
+            return true;
     } 
 
-    return FALSE;
+    return false;
 }
 
 bool cbDockPane::HasNotFixedRowsBelow( cbRowInfo* pRow )
@@ -2536,10 +2564,10 @@ bool cbDockPane::HasNotFixedRowsBelow( cbRowInfo* pRow )
 
         if ( pRow->mHasOnlyFixedBars )
 
-            return TRUE;
+            return true;
     }
 
-    return FALSE;
+    return false;
 }
 
 bool cbDockPane::HasNotFixedBarsLeft( cbBarInfo* pBar )
@@ -2550,10 +2578,10 @@ bool cbDockPane::HasNotFixedBarsLeft( cbBarInfo* pBar )
 
         if ( pBar->IsFixed() )
 
-            return TRUE;
+            return true;
     }
         
-    return FALSE;
+    return false;
 }
 
 bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
@@ -2564,19 +2592,19 @@ bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
 
         if ( pBar->IsFixed() )
 
-            return TRUE;
+            return true;
     }
         
-    return FALSE;
+    return false;
 }
 
 void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
 {
-    int totalWidth = 0;
+    size_t i;
 
-    size_t i = 0;
+    int totalWidth = 0;
 
-    // clac current-maximal-total-length of all maximized bars
+    // calc current-maximal-total-length of all maximized bars
 
     for ( i = 0; i != pInRow->mBars.GetCount(); ++i )
     {
@@ -2586,7 +2614,7 @@ void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
             totalWidth += bar.mBounds.width;
     }
 
-    // set up persentages of occupied space for each maximized bar
+    // set up percentages of occupied space for each maximized bar
 
     for ( i = 0; i != pInRow->mBars.Count(); ++i )
     {
@@ -2645,7 +2673,7 @@ void cbDockPane::ExpandBar( cbBarInfo* pBar )
 
     pBar->mpRow->mpExpandedBar = pBar;
 
-    mpLayout->RecalcLayout( FALSE );
+    mpLayout->RecalcLayout( false );
 
     mpLayout->GetUpdatesManager().OnFinishChanges();
     mpLayout->GetUpdatesManager().UpdateNow();
@@ -2682,7 +2710,7 @@ void cbDockPane::ContractBar( cbBarInfo* pBar )
 
     pBar->mpRow->mpExpandedBar = NULL;
 
-    mpLayout->RecalcLayout( FALSE );
+    mpLayout->RecalcLayout( false );
 
     mpLayout->GetUpdatesManager().OnFinishChanges();
     mpLayout->GetUpdatesManager().UpdateNow();
@@ -2728,7 +2756,7 @@ void cbDockPane::InitLinksForRows()
 
 void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo )
 {
-    cbRowInfo* pRow = NULL;
+    cbRowInfo* pRow;
 
     if ( rowNo == -1 || rowNo >= (int)mRows.Count() )
     {
@@ -2746,7 +2774,7 @@ void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo )
     {
         pRow = mRows[rowNo];
 
-        if ( mProps.mNonDestructFirctionOn == TRUE )
+        if ( mProps.mNonDestructFrictionOn == true )
         {
             // store original shape of the row (before the bar is inserted)
 
@@ -2795,8 +2823,8 @@ void cbDockPane::InsertBar( cbBarInfo* pBarInfo )
     // set transient properties
 
     pBarInfo->mpRow           = NULL;
-    pBarInfo->mHasLeftHandle  = FALSE;
-    pBarInfo->mHasRightHandle = FALSE;
+    pBarInfo->mHasLeftHandle  = false;
+    pBarInfo->mHasRightHandle = false;
     pBarInfo->mLenRatio       = 0.0;
 
     // set preferred bar dimensions, according to the state in which
@@ -2815,12 +2843,12 @@ void cbDockPane::RemoveRow( cbRowInfo* pRow )
     for ( i = 0; i != pRow->mBars.Count(); ++i )
     {
         if ( pRow->mBars[i]->mpBarWnd )
-            pRow->mBars[i]->mpBarWnd->Show( FALSE );
+            pRow->mBars[i]->mpBarWnd->Show( false );
     }
 
     mRows.Remove( pRow );
 
-    pRow->mUMgrData.SetDirty(TRUE);
+    pRow->mUMgrData.SetDirty(true);
 }
 
 void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
@@ -2833,11 +2861,11 @@ void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
 
     InitLinksForRows();
 
-    pRow->mUMgrData.SetDirty(TRUE);
+    pRow->mUMgrData.SetDirty(true);
 
     size_t i;
     for ( i = 0; i != pRow->mBars.Count(); ++i )
-        pRow->mBars[i]->mUMgrData.SetDirty( TRUE );
+        pRow->mBars[i]->mUMgrData.SetDirty( true );
 
     SyncRowFlags( pRow );
 }
@@ -2942,9 +2970,9 @@ bool cbDockPane::BarPresent( cbBarInfo* pBar )
 
     while( iter.Next() )
     
-        if ( &iter.BarInfo() == pBar ) return TRUE;
+        if ( &iter.BarInfo() == pBar ) return true;
 
-    return FALSE;
+    return false;
 }
 
 cbRowInfo* cbDockPane::GetRow( int row )
@@ -2963,7 +2991,7 @@ int cbDockPane::GetRowIndex( cbRowInfo* pRow )
             return i;
     }
 
-    wxFAIL_MSG("Row must be present to call cbDockPane::GetRowIndex()");
+    wxFAIL_MSG(wxT("Row must be present to call cbDockPane::GetRowIndex()"));
 
     return 0;
 }
@@ -3011,7 +3039,7 @@ bool cbDockPane::MatchesMask( int paneMask )
         case FL_ALIGN_RIGHT  : thisMask = FL_ALIGN_RIGHT_PANE; break;
 
         default:
-            wxFAIL_MSG("Bad FL alignment type detected in cbDockPane::MatchesMask()");
+            wxFAIL_MSG(wxT("Bad FL alignment type detected in cbDockPane::MatchesMask()"));
     }
 
     return ( thisMask & paneMask ) != 0;
@@ -3346,7 +3374,7 @@ void cbDockPane::ResizeBar( cbBarInfo* pBar, int ofs,
 
     InsertBar( pBar, pToRow );
 
-    mpLayout->RecalcLayout(FALSE);
+    mpLayout->RecalcLayout(false);
 
     mpLayout->GetUpdatesManager().OnFinishChanges();
     mpLayout->GetUpdatesManager().UpdateNow();
@@ -3417,7 +3445,11 @@ cbBarInfo* cbDockPane::GetBarInfoByWindow( wxWindow* pBarWnd )
 
 void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
 {
-    pLst->DeleteContents( TRUE );
+    if(pLst)
+    {
+        WX_CLEAR_LIST(wxList,*pLst);
+    }
+
     pLst->Clear();
 
     size_t i;
@@ -3436,10 +3468,10 @@ void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
 
 void cbDockPane::SetRowShapeData( cbRowInfo* pRow, wxList* pLst )
 {
-    if ( pLst->First() == NULL )
+    if ( pLst->GetFirst() == NULL )
         return;
 
-    wxNode* pData = pLst->First();
+    wxObjectList::compatibility_iterator pData = pLst->GetFirst();
 
     size_t i;
     for ( i = 0; i != pRow->mBars.Count(); ++i )
@@ -3448,12 +3480,12 @@ void cbDockPane::SetRowShapeData( cbRowInfo* pRow, wxList* pLst )
 
         cbBarInfo& bar = *pRow->mBars[i];;
 
-        cbBarShapeData& data = *((cbBarShapeData*)pData->Data());
+        cbBarShapeData& data = *((cbBarShapeData*)pData->GetData());
 
         bar.mBounds   = data.mBounds;
         bar.mLenRatio = data.mLenRatio;
 
-        pData = pData->Next();
+        pData = pData->GetNext();
     }
 }
 
@@ -3505,8 +3537,8 @@ bool cbPluginBase::ProcessEvent(wxEvent& event)
 
     if ( GetNextHandler() && GetNextHandler()->ProcessEvent( event ) )
 
-        return TRUE;
+        return true;
     else
-        return FALSE;
+        return false;
 }