X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cbc57f086cee690f397ac5622d3f1d7153b300e..3527f29c8769e09d796c547c0c309f8b86407012:/contrib/src/fl/controlbar.cpp diff --git a/contrib/src/fl/controlbar.cpp b/contrib/src/fl/controlbar.cpp index 93234730f6..780f9960f8 100644 --- a/contrib/src/fl/controlbar.cpp +++ b/contrib/src/fl/controlbar.cpp @@ -387,7 +387,7 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent ) pChild->Reparent(pNewParent); return; -#elif defined(__WXGTK__) +#elif defined(__WXGTK__) || defined(__WXX11__) // FOR NOW:: floating with wxGtk still very buggy return; @@ -402,11 +402,11 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent ) void wxFrameLayout::DestroyBarWindows() { - wxNode* pSpy = mBarSpyList.First(); + wxNode* pSpy = mBarSpyList.GetFirst(); while( pSpy ) { - cbBarSpy& spy = *((cbBarSpy*)pSpy->Data()); + cbBarSpy& spy = *((cbBarSpy*)pSpy->GetData()); if ( spy.mpBarWnd->GetEventHandler() == &spy ) @@ -414,7 +414,7 @@ void wxFrameLayout::DestroyBarWindows() delete &spy; - pSpy = pSpy->Next(); + pSpy = pSpy->GetNext(); } mBarSpyList.Clear(); @@ -432,15 +432,15 @@ void wxFrameLayout::DestroyBarWindows() void wxFrameLayout::ShowFloatedWindows( bool show ) { - wxNode* pNode = mFloatedFrames.First(); + wxNode* pNode = mFloatedFrames.GetFirst(); while( pNode ) { - cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data()); + cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData()); pFFrm->Show( show ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } @@ -491,11 +491,11 @@ wxFrameLayout::~wxFrameLayout() if ( mpNECursor ) delete mpNECursor; - wxNode* pSpy = mBarSpyList.First(); + wxNode* pSpy = mBarSpyList.GetFirst(); while( pSpy ) { - cbBarSpy& spy = *((cbBarSpy*)pSpy->Data()); + cbBarSpy& spy = *((cbBarSpy*)pSpy->GetData()); if ( spy.mpBarWnd->GetEventHandler() == &spy ) @@ -503,7 +503,7 @@ wxFrameLayout::~wxFrameLayout() delete &spy; - pSpy = pSpy->Next(); + pSpy = pSpy->GetNext(); } for ( i = 0; i != mAllBars.Count(); ++i ) @@ -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; @@ -715,11 +715,11 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) { pBar->mpBarWnd->Show(FALSE); // to avoid flicker upon reparenting - wxNode* pNode = mFloatedFrames.First(); + wxNode* pNode = mFloatedFrames.GetFirst(); while( pNode ) { - cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data()); + cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData()); if ( pFFrm->GetBar() == pBar ) { @@ -739,7 +739,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) pFFrm->Destroy(); break; } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } // FOR NOW:: excessive! @@ -749,6 +749,11 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) } } + if ( pBar->mDimInfo.GetDimHandler() ) + { + pBar->mDimInfo.GetDimHandler()->OnChangeBarState( pBar, newState ); + } + pBar->mState = newState; DoSetBarState( pBar ); @@ -819,13 +824,13 @@ void wxFrameLayout::ApplyBarProperties( cbBarInfo* pBar ) void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar ) { - if ( !mFloatingOn ) return; + if ( !(mFloatingOn && pBar->mFloatingOn)) return; - wxNode* pNode = mFloatedFrames.First(); + wxNode* pNode = mFloatedFrames.GetFirst(); while( pNode ) { - cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data()); + cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData()); if ( pFFrm->GetBar() == pBar ) { @@ -843,7 +848,7 @@ void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar ) break; } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } @@ -866,7 +871,8 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar ) } else { - if ( !mFloatingOn ) return; + if ( !(mFloatingOn && pBar->mFloatingOn) ) + return; // float it @@ -891,7 +897,9 @@ void wxFrameLayout::DoSetBarState( cbBarInfo* pBar ) pMiniFrm->Create( &GetParentFrame(), -1, pBar->mName, wxPoint( 50,50 ), wxSize ( 0, 0 ), - wxFRAME_FLOAT_ON_PARENT | wxFRAME_TOOL_WINDOW + wxFRAME_FLOAT_ON_PARENT | + wxFRAME_TOOL_WINDOW | + wxFRAME_NO_TASKBAR ); pMiniFrm->SetClient( pBar->mpBarWnd ); @@ -969,7 +977,7 @@ void wxFrameLayout::RemoveBar( cbBarInfo* 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, @@ -1148,9 +1156,17 @@ void wxFrameLayout::PositionPanes() void wxFrameLayout::OnSize( wxSizeEvent& event ) { + mpFrame->ProcessEvent( event ); + event.Skip( FALSE ); // stop its progpagation + if ( event.GetEventObject() == (wxObject*) mpFrame ) - + { + GetUpdatesManager().OnStartChanges(); RecalcLayout(TRUE); + GetUpdatesManager().OnFinishChanges(); + GetUpdatesManager().UpdateNow(); + } + } /*** protected members ***/ @@ -1457,7 +1473,7 @@ void wxFrameLayout::OnPaint( wxPaintEvent& event ) event.Skip(); } -void wxFrameLayout::OnEraseBackground( wxEraseEvent& event ) +void wxFrameLayout::OnEraseBackground( wxEraseEvent& WXUNUSED(event) ) { // do nothing } @@ -1468,7 +1484,7 @@ 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 ); @@ -1480,18 +1496,18 @@ void wxFrameLayout::OnIdle( wxIdleEvent& event ) } -void wxFrameLayout::OnKillFocus( wxFocusEvent& event ) +void wxFrameLayout::OnKillFocus( wxFocusEvent& WXUNUSED(event) ) { //wxMessageBox( "wxFrameLayoutGot Kill Focus!" ); //ShowFloatedWindows( FALSE ); } -void wxFrameLayout::OnSetFocus( wxFocusEvent& event ) +void wxFrameLayout::OnSetFocus( wxFocusEvent& WXUNUSED(event) ) { //ShowFloatedWindows( TRUE ); } -void wxFrameLayout::OnActivate( wxActivateEvent& event ) +void wxFrameLayout::OnActivate( wxActivateEvent& WXUNUSED(event) ) { #if 0 if ( event.GetActive() == FALSE ) @@ -1551,9 +1567,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 ***/ @@ -1604,7 +1622,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 ); @@ -1622,7 +1640,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 ); @@ -2036,7 +2054,7 @@ cbCommonPaneProperties::cbCommonPaneProperties(void) : mRealTimeUpdatesOn ( TRUE ), mOutOfPaneDragOn ( TRUE ), mExactDockPredictionOn( FALSE ), - mNonDestructFirctionOn( FALSE ), + mNonDestructFrictionOn( FALSE ), mShow3DPaneBorderOn ( TRUE ), mBarFloatingOn ( FALSE ), mRowProportionsOn ( FALSE ), @@ -2048,6 +2066,43 @@ cbCommonPaneProperties::cbCommonPaneProperties(void) 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 ) @@ -2073,7 +2128,7 @@ IMPLEMENT_DYNAMIC_CLASS( cbBarInfo, wxObject ) cbBarInfo::cbBarInfo(void) : mpRow( NULL ), - + mFloatingOn( TRUE ), mpNext( NULL ), mpPrev( NULL ) {} @@ -2296,7 +2351,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 ); @@ -2445,7 +2500,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; @@ -2453,7 +2508,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; @@ -2472,7 +2527,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY ) ++row; curY += rowHeight; - pRow = pRow->Next(); + pRow = pRow->GetNext(); } */ @@ -2744,7 +2799,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) @@ -2961,7 +3016,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; } @@ -3009,7 +3064,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; @@ -3434,10 +3489,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(); + wxNode* pData = pLst->GetFirst(); size_t i; for ( i = 0; i != pRow->mBars.Count(); ++i ) @@ -3446,12 +3501,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(); } }