X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5515f252cb0a46c2a200a14f0692e6db7c3aea47..b2a0801592284a074235c5e8f1c9987e873d6ba4:/contrib/src/fl/controlbar.cpp diff --git a/contrib/src/fl/controlbar.cpp b/contrib/src/fl/controlbar.cpp index f00ec60e10..9c00fed379 100644 --- a/contrib/src/fl/controlbar.cpp +++ b/contrib/src/fl/controlbar.cpp @@ -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(); @@ -85,7 +84,6 @@ 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... :-( @@ -272,11 +270,11 @@ wxFrameLayout::wxFrameLayout(void) : mpFrame ( NULL ), mpFrameClient( NULL ), - mDarkPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID ), - mLightPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT), 1, wxSOLID ), - mGrayPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), + mDarkPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID ), + mLightPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT), 1, wxSOLID ), + mGrayPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), mBlackPen ( wxColour( 0, 0, 0), 1, wxSOLID ), - mBorderPen( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), + mBorderPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), mNullPen( wxColour(0,0,0), 1, wxTRANSPARENT ), @@ -305,11 +303,11 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo : mpFrame( pParentFrame ), mpFrameClient(pFrameClient), - mDarkPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID ), - mLightPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT), 1, wxSOLID ), - mGrayPen ( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), + mDarkPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID ), + mLightPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT), 1, wxSOLID ), + mGrayPen ( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), mBlackPen ( wxColour( 0, 0, 0), 1, wxSOLID ), - mBorderPen( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), + mBorderPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 1, wxSOLID ), mNullPen( wxColour(0,0,0), 1, wxTRANSPARENT ), @@ -341,13 +339,13 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo // DBG:: set RED color of frame's background for the // prurpose of tracking engine bugs "visually" - GetParentFrame().SetBackgroundColour( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ); + GetParentFrame().SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) ); } 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() { @@ -389,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; @@ -627,10 +625,10 @@ 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 ); @@ -710,8 +708,8 @@ 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 ) { @@ -751,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 ); @@ -1151,8 +1154,13 @@ void wxFrameLayout::PositionPanes() void wxFrameLayout::OnSize( wxSizeEvent& event ) { if ( event.GetEventObject() == (wxObject*) mpFrame ) - + { + GetUpdatesManager().OnStartChanges(); RecalcLayout(TRUE); + GetUpdatesManager().OnFinishChanges(); + GetUpdatesManager().UpdateNow(); + } + } /*** protected members ***/ @@ -1176,15 +1184,15 @@ void wxFrameLayout::HideBarWindows() 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:: @@ -1553,9 +1561,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 ***/ @@ -2038,7 +2048,7 @@ cbCommonPaneProperties::cbCommonPaneProperties(void) : mRealTimeUpdatesOn ( TRUE ), mOutOfPaneDragOn ( TRUE ), mExactDockPredictionOn( FALSE ), - mNonDestructFirctionOn( FALSE ), + mNonDestructFrictionOn( FALSE ), mShow3DPaneBorderOn ( TRUE ), mBarFloatingOn ( FALSE ), mRowProportionsOn ( FALSE ), @@ -2050,6 +2060,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 ) @@ -2298,7 +2345,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 ); @@ -2576,7 +2623,7 @@ void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow ) size_t i = 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 +2633,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 ) { @@ -2746,7 +2793,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)