else
mpLayout->OnLDblClick( mevent );
- //event.Skip(FALSE);
+ //event.Skip(false);
}
return handled;
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 )
mpTopPlugin ( NULL ),
mpCaputesInput( NULL ),
- mClientWndRefreshPending( FALSE ),
- mRecalcPending( TRUE ),
- mCheckFocusWhenIdle( FALSE )
+ mClientWndRefreshPending( false ),
+ mRecalcPending( true ),
+ mCheckFocusWhenIdle( false )
{
CreateCursors();
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 )
{
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
}
#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
void wxFrameLayout::DestroyBarWindows()
{
- wxNode* pSpy = mBarSpyList.GetFirst();
+ wxObjectList::compatibility_iterator pSpy = mBarSpyList.GetFirst();
while( pSpy )
{
void wxFrameLayout::ShowFloatedWindows( bool show )
{
- wxNode* pNode = mFloatedFrames.GetFirst();
+ wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
while( pNode )
{
if ( mpNECursor )
delete mpNECursor;
- wxNode* pSpy = mBarSpyList.GetFirst();
+ wxObjectList::compatibility_iterator pSpy = mBarSpyList.GetFirst();
while( pSpy )
{
{
HookUpToFrame();
- RefreshNow( TRUE );
+ RefreshNow( true );
- ShowFloatedWindows( TRUE );
+ ShowFloatedWindows( true );
}
void wxFrameLayout::Deactivate()
{
- ShowFloatedWindows( FALSE );
+ ShowFloatedWindows( false );
UnhookFromFrame();
pInfo->mName = name;
pInfo->mpBarWnd = pBarWnd;
pInfo->mDimInfo = dimInfo;
+ pInfo->mDimInfo.mLRUPane = alignment;
pInfo->mState = state;
pInfo->mAlignment = alignment;
pInfo->mRowNo = rowNo;
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 );
// but first the "pane-postion-changed" problem
// has to be fixed
- RecalcLayout( FALSE );
+ RecalcLayout( false );
pToPane->InsertBar( pBar, shapeInParent );
- RecalcLayout( FALSE );
+ RecalcLayout( false );
// finish update "transaction"
GetUpdatesManager().UpdateNow();
}
- return TRUE;
+ return true;
}
cbBarInfo* wxFrameLayout::FindBarByName( const wxString& name )
GetUpdatesManager().OnStartChanges();
- pBar->mUMgrData.SetDirty(TRUE);
+ pBar->mUMgrData.SetDirty(true);
// check bar's previous state
if ( pBar->mpBarWnd )
{
- pBar->mpBarWnd->Show(FALSE); // to avoid flicker upon reparenting
+ pBar->mpBarWnd->Show(false); // to avoid flicker upon reparenting
- wxNode* pNode = mFloatedFrames.GetFirst();
+ wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
while( pNode )
{
if ( pFFrm->GetBar() == pBar )
{
- pFFrm->Show( FALSE ); // reduces flicker sligthly
+ pFFrm->Show( false ); // reduces flicker sligthly
ReparentWindow( pBar->mpBarWnd, &GetParentFrame() );
pBar->mAlignment = pBar->mDimInfo.mLRUPane;
- mFloatedFrames.DeleteNode( pNode );
+ mFloatedFrames.Erase( pNode );
- pFFrm->Show( FALSE );
+ pFFrm->Show( false );
pFFrm->Destroy(); break;
}
// FOR NOW:: excessive!
//if ( mpFrameClient ) mpFrameClient->Refresh();
if ( mpFrameClient )
- mClientWndRefreshPending = TRUE;
+ mClientWndRefreshPending = true;
}
}
if ( updateNow )
{
- RecalcLayout(FALSE);
+ RecalcLayout(false);
GetUpdatesManager().OnFinishChanges();
GetUpdatesManager().UpdateNow();
pBar->mAlignment = -1;
}
- this->SetBarState( pBar, newState, TRUE );
+ this->SetBarState( pBar, newState, true );
if ( newState == wxCBAR_FLOATING )
{
if ( !(mFloatingOn && pBar->mFloatingOn)) return;
- wxNode* pNode = mFloatedFrames.GetFirst();
+ wxObjectList::compatibility_iterator pNode = mFloatedFrames.GetFirst();
while( pNode )
{
if ( pBar->mpBarWnd )
- pBar->mpBarWnd->Show( FALSE );
+ pBar->mpBarWnd->Show( false );
}
else
{
if ( pBar->mpBarWnd )
- pBar->mpBarWnd->Show( FALSE );
+ pBar->mpBarWnd->Show( false );
pBar->mState = wxCBAR_HIDDEN;
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 |
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);
}
}
#endif
if ( pBarInfo->mpBarWnd ) // hides it's window
- pBarInfo->mpBarWnd->Show( FALSE );
+ pBarInfo->mpBarWnd->Show( false );
delete 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 );
if ( !mpFrameClient->IsShown() )
- mpFrameClient->Show( TRUE );
+ mpFrameClient->Show( true );
}
else
- mpFrameClient->Show( FALSE );
+ mpFrameClient->Show( false );
}
}
void wxFrameLayout::OnSize( wxSizeEvent& event )
{
mpFrame->ProcessEvent( event );
- event.Skip( FALSE ); // stop its progpagation
+ event.Skip( false ); // stop its progpagation
if ( event.GetEventObject() == (wxObject*) mpFrame )
{
GetUpdatesManager().OnStartChanges();
- RecalcLayout(TRUE);
+ RecalcLayout(true);
GetUpdatesManager().OnFinishChanges();
GetUpdatesManager().UpdateNow();
}
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()
void wxFrameLayout::OnPaint( wxPaintEvent& event )
{
if ( mRecalcPending )
- RecalcLayout( TRUE );
+ RecalcLayout( true );
wxPaintDC dc(mpFrame);
{
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& 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;
void wxFrameLayout::RefreshNow( bool recalcLayout )
{
if ( recalcLayout )
- RecalcLayout( TRUE );
+ RecalcLayout( true );
if ( mpFrame )
mpFrame->Refresh();
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;
+ isInputEvt = false;
#else
switch ( event.m_eventType )
{
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)
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 )
{
if ( mpRow->mBars.GetCount() == 0 )
{
- return FALSE;
+ return false;
}
mpBar = mpRow->mBars[0];
mpBar = mpRow->mBars[0];
else
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
cbBarInfo& wxBarIterator::BarInfo()
: mVertGap ( 0 ),
mHorizGap( 0 ),
- mIsFixed(TRUE),
+ mIsFixed(true),
mpHandler( NULL )
{
size_t i;
cbCommonPaneProperties::cbCommonPaneProperties(void)
- : mRealTimeUpdatesOn ( TRUE ),
- mOutOfPaneDragOn ( TRUE ),
- mExactDockPredictionOn( FALSE ),
- mNonDestructFrictionOn( 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 )
cbRowInfo::cbRowInfo(void)
- : mNotFixedBarsCnt( FALSE ),
+ : mNotFixedBarsCnt( false ),
mpNext ( NULL ),
mpPrev ( NULL ),
mpExpandedBar ( NULL )
cbBarInfo::cbBarInfo(void)
: mpRow( NULL ),
- mFloatingOn( TRUE ),
+ mFloatingOn( true ),
mpNext( NULL ),
mpPrev( NULL )
{}
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
void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
{
// setup mHasOnlyFixedBars flag for the row information
- pRow->mHasOnlyFixedBars = TRUE;
+ pRow->mHasOnlyFixedBars = true;
pRow->mNotFixedBarsCnt = 0;
if ( !bar.IsFixed() )
{
- pRow->mHasOnlyFixedBars = FALSE;
+ pRow->mHasOnlyFixedBars = false;
++pRow->mNotFixedBarsCnt;
}
}
if ( pRow->mHasOnlyFixedBars )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool cbDockPane::HasNotFixedRowsBelow( cbRowInfo* pRow )
if ( pRow->mHasOnlyFixedBars )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool cbDockPane::HasNotFixedBarsLeft( cbBarInfo* pBar )
if ( pBar->IsFixed() )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
if ( pBar->IsFixed() )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
pBar->mpRow->mpExpandedBar = pBar;
- mpLayout->RecalcLayout( FALSE );
+ mpLayout->RecalcLayout( false );
mpLayout->GetUpdatesManager().OnFinishChanges();
mpLayout->GetUpdatesManager().UpdateNow();
pBar->mpRow->mpExpandedBar = NULL;
- mpLayout->RecalcLayout( FALSE );
+ mpLayout->RecalcLayout( false );
mpLayout->GetUpdatesManager().OnFinishChanges();
mpLayout->GetUpdatesManager().UpdateNow();
{
pRow = mRows[rowNo];
- if ( mProps.mNonDestructFrictionOn == TRUE )
+ if ( mProps.mNonDestructFrictionOn == true )
{
// store original shape of the row (before the bar is inserted)
// 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
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 )
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 );
}
while( iter.Next() )
- if ( &iter.BarInfo() == pBar ) return TRUE;
+ if ( &iter.BarInfo() == pBar ) return true;
- return FALSE;
+ return false;
}
cbRowInfo* cbDockPane::GetRow( int row )
InsertBar( pBar, pToRow );
- mpLayout->RecalcLayout(FALSE);
+ mpLayout->RecalcLayout(false);
mpLayout->GetUpdatesManager().OnFinishChanges();
mpLayout->GetUpdatesManager().UpdateNow();
void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
{
- pLst->DeleteContents( TRUE );
+ if(pLst)
+ {
+ WX_CLEAR_LIST(wxList,*pLst);
+ }
+
pLst->Clear();
size_t i;
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 )
if ( GetNextHandler() && GetNextHandler()->ProcessEvent( event ) )
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}