]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/fl/controlbar.cpp
bug fixes for using wxTransientPopupWindow and wxDP_ALLOWNONE support from Andreas...
[wxWidgets.git] / contrib / src / fl / controlbar.cpp
index 5adc722a20cb8f2cc8c82cf3386734b65d46d86b..9183ec91d3c1dc51c0cff76bd3157c890c945e80 100644 (file)
@@ -258,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 )
 
@@ -355,6 +351,8 @@ bool wxFrameLayout::CanReparent()
 {
 #ifdef __WXMSW__
     return true;
+#elif defined(__WXGTK20__)
+    return TRUE;
 #elif defined (__WXGTK__)
     //return true;
     return false;
@@ -390,6 +388,10 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent )
 #endif
     pChild->Reparent(pNewParent);
 
+    return;
+#elif defined(__WXGTK20__)
+    pChild->Reparent(pNewParent);
+
     return;
 #elif defined(__WXGTK__) || defined(__WXX11__)
     // FOR NOW:: floating with wxGtk still very buggy
@@ -406,7 +408,7 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent )
 
 void wxFrameLayout::DestroyBarWindows()
 {
-    wxNode* pSpy = mBarSpyList.GetFirst();
+    wxObjectList::compatibility_iterator pSpy = mBarSpyList.GetFirst();
 
     while( pSpy )
     {
@@ -436,7 +438,7 @@ void wxFrameLayout::DestroyBarWindows()
 
 void wxFrameLayout::ShowFloatedWindows( bool show )
 {
-    wxNode* pNode = mFloatedFrames.GetFirst();
+    wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
 
     while( pNode )
     {
@@ -496,7 +498,7 @@ wxFrameLayout::~wxFrameLayout()
     if ( mpNECursor     ) 
         delete mpNECursor;
 
-    wxNode* pSpy = mBarSpyList.GetFirst();
+    wxObjectList::compatibility_iterator pSpy = mBarSpyList.GetFirst();
 
     while( pSpy )
     {
@@ -598,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;
@@ -723,7 +726,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
         {
             pBar->mpBarWnd->Show(false); // to avoid flicker upon reparenting
 
-            wxNode* pNode = mFloatedFrames.GetFirst();
+            wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
 
             while( pNode )
             {
@@ -741,7 +744,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
 
                         pBar->mAlignment = pBar->mDimInfo.mLRUPane;
 
-                    mFloatedFrames.DeleteNode( pNode );
+                    mFloatedFrames.Erase( pNode );
 
                     pFFrm->Show( false );
                     pFFrm->Destroy(); break;
@@ -834,7 +837,7 @@ void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar )
 {
     if ( !(mFloatingOn && pBar->mFloatingOn)) return;
 
-    wxNode* pNode = mFloatedFrames.GetFirst();
+    wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
 
     while( pNode )
     {
@@ -906,7 +909,7 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
                           wxPoint( 50,50 ),
                           wxSize ( 0, 0  ),
                           wxFRAME_FLOAT_ON_PARENT |
-                          wxFRAME_TOOL_WINDOW |
+                          wxNO_BORDER |
                           wxFRAME_NO_TASKBAR
                         );
 
@@ -945,6 +948,7 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar )
         }
 
         pMiniFrm->Show( true );
+        RepositionFloatedBar(pMiniFrm->GetBar());
 
         // FIXME:: this is excessive
         pBar->mpBarWnd->Show(true);
@@ -1497,38 +1501,6 @@ void wxFrameLayout::OnIdle( wxIdleEvent& event )
     event.Skip();
 }
 
-
-void wxFrameLayout::OnKillFocus( wxFocusEvent& WXUNUSED(event) )
-{
-    //wxMessageBox( "wxFrameLayoutGot Kill Focus!" );
-    //ShowFloatedWindows( false );
-}
-
-void wxFrameLayout::OnSetFocus( wxFocusEvent& WXUNUSED(event) )
-{
-    //ShowFloatedWindows( true );
-}
-
-void wxFrameLayout::OnActivate( wxActivateEvent& WXUNUSED(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;
@@ -1586,11 +1558,11 @@ void wxFrameLayout::FirePluginEvent( cbPluginEvent& event )
     {
         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 )
+        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 )
@@ -1814,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 )
@@ -2181,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
@@ -3472,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;
@@ -3494,7 +3471,7 @@ void cbDockPane::SetRowShapeData( cbRowInfo* pRow, wxList* pLst )
     if ( pLst->GetFirst() == NULL )
         return;
 
-    wxNode* pData = pLst->GetFirst();
+    wxObjectList::compatibility_iterator pData = pLst->GetFirst();
 
     size_t i;
     for ( i = 0; i != pRow->mBars.Count(); ++i )