X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11a68fa3af72d8a237e5dc509b820de0077f1a56..0966aee3d9eac832fe7dcf66db2eb06e76c51da5:/contrib/src/fl/barhintspl.cpp?ds=sidebyside diff --git a/contrib/src/fl/barhintspl.cpp b/contrib/src/fl/barhintspl.cpp index 90985f7d17..eab4e83738 100644 --- a/contrib/src/fl/barhintspl.cpp +++ b/contrib/src/fl/barhintspl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: barhintspl.h +// Purpose: Implementation for cbBarHintsPlugin // Author: Aleksandras Gluchovas // Modified by: // Created: 30/11/98 (my 22th birthday :-) // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -61,9 +61,9 @@ END_EVENT_TABLE() cbBarHintsPlugin::cbBarHintsPlugin(void) : mpPane( 0 ), - mBtnPressed ( FALSE ), - mCloseBoxOn ( TRUE ), - mCollapseBoxOn( TRUE ), + mBtnPressed ( false ), + mCloseBoxOn ( true ), + mCollapseBoxOn( true ), mGrooveCount ( 2 ), mHintGap ( 4 ), mXWeight ( 2 ) @@ -76,9 +76,9 @@ cbBarHintsPlugin::cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask ) : cbPluginBase( pLayout, paneMask ), mpPane( 0 ), - mBtnPressed ( FALSE ), - mCloseBoxOn ( TRUE ), - mCollapseBoxOn( TRUE ), + mBtnPressed ( false ), + mCloseBoxOn ( true ), + mCollapseBoxOn( true ), mGrooveCount ( 2 ), mHintGap ( 5 ), mXWeight ( 2 ) @@ -121,16 +121,16 @@ void cbBarHintsPlugin::CreateBoxes() } -void cbBarHintsPlugin::Draw3DBox( wxDC& dc, const wxPoint& pos, bool pressed ) +void cbBarHintsPlugin::Draw3DBox( wxDC& WXUNUSED(dc), const wxPoint& WXUNUSED(pos), bool WXUNUSED(pressed) ) { } -void cbBarHintsPlugin::DrawCloseBox( wxDC& dc, const wxPoint& pos, bool pressed ) +void cbBarHintsPlugin::DrawCloseBox( wxDC& WXUNUSED(dc), const wxPoint& WXUNUSED(pos), bool WXUNUSED(pressed) ) { } -void cbBarHintsPlugin::DrawCollapseBox( wxDC& dc, const wxPoint& pos, - bool atLeft, bool disabled, bool pressed ) +void cbBarHintsPlugin::DrawCollapseBox( wxDC& WXUNUSED(dc), const wxPoint& WXUNUSED(pos), + bool WXUNUSED(atLeft), bool WXUNUSED(disabled), bool WXUNUSED(pressed) ) { } @@ -200,7 +200,7 @@ void cbBarHintsPlugin::ExcludeHints( wxRect& rect, cbBarInfo& info ) } void cbBarHintsPlugin::DoDrawHint( wxDC& dc, wxRect& rect, - int pos, int boxOfs, int grooveOfs, + int pos, int WXUNUSED(boxOfs), int grooveOfs, bool isFixed ) { if ( !isFixed ) @@ -280,7 +280,7 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info, if ( info.IsExpanded() ) { - isAtLeft = FALSE; + isAtLeft = false; cbBarInfo* pCur = info.mpPrev; @@ -288,7 +288,7 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info, { if ( !pCur->IsFixed() ) { - isAtLeft = TRUE; break; + isAtLeft = true; break; } pCur = pCur->mpPrev; @@ -363,7 +363,7 @@ int cbBarHintsPlugin::HitTestHints( cbBarInfo& info, const wxPoint& pos ) wxRect& rect = info.mBoundsInParent; - if ( info.IsFixed() ) return FALSE; + if ( info.IsFixed() ) return false; int boxOfs, grooveOfs, coord; @@ -413,7 +413,7 @@ int cbBarHintsPlugin::HitTestHints( cbBarInfo& info, const wxPoint& pos ) } } - return FALSE; + return false; } // handlers for plugin-events @@ -467,12 +467,17 @@ void cbBarHintsPlugin::OnLeftDown( cbLeftDownEvent& event ) { int i; for ( i = 0; i != BOXES_IN_HINT; ++i ) + { + mBoxes[i]->mPressed = false; + mBoxes[i]->mWasClicked = false; + } + for ( i = 0; i != BOXES_IN_HINT; ++i ) { mBoxes[i]->OnLeftDown( inFrame ); if ( mBoxes[i]->mPressed ) { - mBtnPressed = TRUE; + mBtnPressed = true; mpClickedBar = &bar; return; // event handled @@ -495,7 +500,7 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event ) GetHintsLayout( mpClickedBar->mBoundsInParent, *mpClickedBar, boxOfs, grooveOfs, pos ); - int result = HitTestHints( *mpClickedBar, event.mPos ); + HitTestHints( *mpClickedBar, event.mPos ); int i; for ( i = 0; i != BOXES_IN_HINT; ++i ) @@ -506,7 +511,10 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event ) { if ( i == 0 ) { - mpLayout->SetBarState( mpClickedBar, wxCBAR_HIDDEN, TRUE ); + mpLayout->SetBarState( mpClickedBar, wxCBAR_HIDDEN, true ); + // Notify bar child window of close event: + if(mpClickedBar->mpBarWnd!=NULL) + mpClickedBar->mpBarWnd->Close(); } else { @@ -518,7 +526,7 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event ) } } - mBtnPressed = FALSE; + mBtnPressed = false; return; } else