Changed all the wxASSERT(0) calls to use wxFAIL_MSG()

Removed the TABs in the source replacing with the standard number of spaces
Removed variable definitions from FOR statements defining the variables before the FOR statement


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2001-12-03 10:54:38 +00:00
parent e6b01b78a3
commit 5515f252cb
3 changed files with 2645 additions and 2654 deletions

View File

@@ -293,8 +293,8 @@ wxFrameLayout::wxFrameLayout(void)
{
CreateCursors();
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
mPanes[i] = NULL;
mFloatingOn = CanReparent();
@@ -329,8 +329,8 @@ wxFrameLayout::wxFrameLayout( wxWindow* pParentFrame, wxWindow* pFrameClient, bo
{
CreateCursors();
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
mPanes[i] = new cbDockPane( i, this );
if ( activateNow )
@@ -421,7 +421,8 @@ void wxFrameLayout::DestroyBarWindows()
mBarSpyList.Clear();
for( size_t i = 0; i != mAllBars.Count(); ++i )
size_t i;
for ( i = 0; i != mAllBars.Count(); ++i )
{
if ( mAllBars[i]->mpBarWnd )
{
@@ -476,7 +477,6 @@ wxFrameLayout::~wxFrameLayout()
// destroy contents of arrays and lists
size_t i = 0;
for ( i = 0; i != MAX_PANES; ++i )
{
if ( mPanes[i] )
@@ -509,7 +509,6 @@ wxFrameLayout::~wxFrameLayout()
}
for ( i = 0; i != mAllBars.Count(); ++i )
delete mAllBars[i];
}
@@ -652,10 +651,9 @@ bool wxFrameLayout::RedockBar( cbBarInfo* pBar,
cbBarInfo* wxFrameLayout::FindBarByName( const wxString& name )
{
for( size_t i = 0; i != mAllBars.Count(); ++i )
size_t i;
for ( i = 0; i != mAllBars.Count(); ++i )
if ( mAllBars[i]->mName == name )
return mAllBars[i];
return NULL;
@@ -663,10 +661,9 @@ cbBarInfo* wxFrameLayout::FindBarByName( const wxString& name )
cbBarInfo* wxFrameLayout::FindBarByWindow( const wxWindow* pWnd )
{
for( size_t i = 0; i != mAllBars.Count(); ++i )
size_t i;
for ( i = 0; i != mAllBars.Count(); ++i )
if ( mAllBars[i]->mpBarWnd == pWnd )
return mAllBars[i];
return NULL;
@@ -955,7 +952,8 @@ void wxFrameLayout::RemoveBar( cbBarInfo* pBarInfo )
pPane->RemoveBar( pBarInfo );
}
for( size_t i = 0; i != mAllBars.Count(); ++i )
size_t i;
for ( i = 0; i != mAllBars.Count(); ++i )
{
if ( mAllBars[i] == pBarInfo )
{
@@ -973,9 +971,7 @@ void wxFrameLayout::RemoveBar( cbBarInfo* pBarInfo )
return;
}
}
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning); // DBG:: bar info should be present in the list of all bars of all panes
wxFAIL_MSG("bar info should be present in the list of all bars of all panes");
}
bool wxFrameLayout::LocateBar( cbBarInfo* pBarInfo,
@@ -985,7 +981,8 @@ bool wxFrameLayout::LocateBar( cbBarInfo* pBarInfo,
(*ppRow) = NULL;
(*ppPane) = NULL;
for( int n = 0; n != MAX_PANES; ++n )
int n;
for ( n = 0; n != MAX_PANES; ++n )
{
wxBarIterator i( mPanes[n]->GetRowList() );
@@ -1146,8 +1143,8 @@ void wxFrameLayout::PositionPanes()
// FOR NOW:: excessive updates!
// reposition bars within all panes
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
mPanes[i]->SizePaneObjects();
}
@@ -1162,10 +1159,9 @@ void wxFrameLayout::OnSize( wxSizeEvent& event )
void wxFrameLayout::HideBarWindows()
{
for( size_t i = 0; i != mAllBars.Count(); ++i )
size_t i;
for ( i = 0; i != mAllBars.Count(); ++i )
if ( mAllBars[i]->mpBarWnd && mAllBars[i]->mState != wxCBAR_FLOATING )
mAllBars[i]->mpBarWnd->Show( FALSE );
// then floated frames
@@ -1251,9 +1247,10 @@ void wxFrameLayout::HookUpToFrame()
cbDockPane* wxFrameLayout::GetBarPane( cbBarInfo* pBar )
{
for( int i = 0; i != MAX_PANES; ++i )
if ( mPanes[i]->BarPresent( pBar ) ) return mPanes[i];
int i;
for ( i = 0; i != MAX_PANES; ++i )
if ( mPanes[i]->BarPresent( pBar ) )
return mPanes[i];
return NULL;
}
@@ -1302,13 +1299,15 @@ cbDockPane* wxFrameLayout::HitTestPanes( const wxRect& rect,
return pCurPane;
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
{
if ( pCurPane != mPanes[i] &&
rect_hits_rect( mPanes[i]->GetRealRect(), rect ) )
{
return mPanes[i];
}
}
return 0;
}
@@ -1319,7 +1318,6 @@ void wxFrameLayout::ForwardMouseEvent( wxMouseEvent& event,
wxPoint pos( event.m_x, event.m_y );
pToPane->FrameToPane( &pos.x, &pos.y );
#if wxCHECK_VERSION(2,3,0)
if ( eventType == cbEVT_PL_LEFT_DOWN )
{
cbLeftDownEvent evt( pos, pToPane );
@@ -1355,36 +1353,6 @@ void wxFrameLayout::ForwardMouseEvent( wxMouseEvent& event,
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning); // DBG::
}
#else
switch ( eventType )
{
case cbEVT_PL_LEFT_DOWN : { cbLeftDownEvent evt( pos, pToPane );
FirePluginEvent( evt ); break;
}
case cbEVT_PL_LEFT_DCLICK:{ cbLeftDClickEvent evt( pos, pToPane );
FirePluginEvent( evt ); break;
}
case cbEVT_PL_LEFT_UP : { cbLeftUpEvent evt( pos, pToPane );
FirePluginEvent( evt ); break;
}
case cbEVT_PL_RIGHT_DOWN: { cbRightDownEvent evt( pos, pToPane );
FirePluginEvent( evt ); break;
}
case cbEVT_PL_RIGHT_UP : { cbRightUpEvent evt( pos, pToPane );
FirePluginEvent( evt ); break;
}
case cbEVT_PL_MOTION : { cbMotionEvent evt( pos, pToPane );
FirePluginEvent( evt ); break;
}
default : wxASSERT(0); // DBG::
}
#endif // #if wxCHECK_VERSION(2,3,0)
} // wxFrameLayout::ForwardMouseEvent()
@@ -1394,15 +1362,18 @@ void wxFrameLayout::RouteMouseEvent( wxMouseEvent& event, int pluginEvtType )
ForwardMouseEvent( event, mpPaneInFocus, pluginEvtType );
else
for( int i = 0; i != MAX_PANES; ++i )
{
int i;
for ( i = 0; i != MAX_PANES; ++i )
{
if ( HitTestPane( mPanes[i], event.m_x, event.m_y ) )
{
ForwardMouseEvent( event, mPanes[i], pluginEvtType );
return;
}
}
}
}
/*** event handlers ***/
@@ -1437,8 +1408,10 @@ void wxFrameLayout::OnMouseMove( wxMouseEvent& event )
ForwardMouseEvent( event, mpPaneInFocus, cbEVT_PL_MOTION );
else
for( int i = 0; i != MAX_PANES; ++i )
{
int i;
for ( i = 0; i != MAX_PANES; ++i )
{
if ( HitTestPane( mPanes[i], event.m_x, event.m_y ) )
{
if ( mpLRUPane && mpLRUPane != mPanes[i] )
@@ -1453,6 +1426,8 @@ void wxFrameLayout::OnMouseMove( wxMouseEvent& event )
return;
}
}
}
if ( mpLRUPane )
{
@@ -1465,12 +1440,12 @@ void wxFrameLayout::OnMouseMove( wxMouseEvent& event )
void wxFrameLayout::OnPaint( wxPaintEvent& event )
{
if ( mRecalcPending )
RecalcLayout( TRUE );
wxPaintDC dc(mpFrame);
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
{
wxRect& rect = mPanes[i]->mBoundsInParent;
@@ -1545,17 +1520,19 @@ void wxFrameLayout::GetPaneProperties( cbCommonPaneProperties& props, int alignm
void wxFrameLayout::SetPaneProperties( const cbCommonPaneProperties& props, int paneMask )
{
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
{
if ( mPanes[i]->MatchesMask( paneMask ) )
mPanes[i]->mProps = props;
}
}
void wxFrameLayout::SetMargins( int top, int bottom, int left, int right,
int paneMask )
{
for( int i = 0; i != MAX_PANES; ++i )
int i;
for ( i = 0; i != MAX_PANES; ++i )
{
cbDockPane& pane = *mPanes[i];
@@ -1735,7 +1712,7 @@ void wxFrameLayout::AddPlugin( wxClassInfo* pPlInfo, int paneMask )
void wxFrameLayout::AddPluginBefore( wxClassInfo* pNextPlInfo, wxClassInfo* pPlInfo,
int paneMask )
{
wxASSERT( pNextPlInfo != pPlInfo ); // DBG:: no sence
wxASSERT( pNextPlInfo != pPlInfo ); // DBG:: no sense
cbPluginBase* pNextPl = FindPlugin( pNextPlInfo );
@@ -1929,7 +1906,8 @@ cbDimInfo::cbDimInfo()
mIsFixed(TRUE),
mpHandler( NULL )
{
for( size_t i = 0; i != MAX_BAR_STATES; ++i )
size_t i;
for ( i = 0; i != MAX_BAR_STATES; ++i )
{
mSizes[i].x = 20;
mSizes[i].y = 20;
@@ -1953,7 +1931,8 @@ cbDimInfo::cbDimInfo( cbBarDimHandlerBase* pDimHandler,
mpHandler->AddRef();
}
for( size_t i = 0; i != MAX_BAR_STATES; ++i )
size_t i;
for ( i = 0; i != MAX_BAR_STATES; ++i )
{
mSizes[i].x = -1;
mSizes[i].y = -1;
@@ -1990,7 +1969,8 @@ cbDimInfo::cbDimInfo( int dh_x, int dh_y,
mSizes[wxCBAR_FLOATING ].x = f_x;
mSizes[wxCBAR_FLOATING ].y = f_y;
for( size_t i = 0; i != MAX_BAR_STATES; ++i )
size_t i;
for ( i = 0; i != MAX_BAR_STATES; ++i )
mBounds[i] = wxRect( -1,-1,-1,-1 );
}
@@ -2015,7 +1995,8 @@ cbDimInfo::cbDimInfo( int x, int y,
mSizes[wxCBAR_FLOATING ].x = x;
mSizes[wxCBAR_FLOATING ].y = y;
for( size_t i = 0; i != MAX_BAR_STATES; ++i )
size_t i;
for ( i = 0; i != MAX_BAR_STATES; ++i )
mBounds[i] = wxRect( -1,-1,-1,-1 );
}
@@ -2028,10 +2009,11 @@ cbDimInfo::~cbDimInfo()
const cbDimInfo& cbDimInfo::operator=( const cbDimInfo& other )
{
if ( this == &other ) return *this;
for( int i = 0; i != MAX_BAR_STATES; ++i )
if ( this == &other )
return *this;
int i;
for ( i = 0; i != MAX_BAR_STATES; ++i )
mSizes[i] = other.mSizes[i];
mIsFixed = other.mIsFixed;
@@ -2140,8 +2122,8 @@ cbDockPane::cbDockPane( int alignment, wxFrameLayout* pPanel )
cbDockPane::~cbDockPane()
{
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
delete mRows[i];
mRowShapeData.DeleteContents( TRUE );
@@ -2249,7 +2231,6 @@ void cbDockPane::PaintPane( wxDC& dc )
// than handles
for ( i = 0; i != mRows.Count(); ++i )
PaintRowHandles( mRows[i], dc );
// and finally
@@ -2266,15 +2247,15 @@ void cbDockPane::SizeBar( cbBarInfo* pBar )
void cbDockPane::SizeRowObjects( cbRowInfo* pRow )
{
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
SizeBar( pRow->mBars[i] );
}
void cbDockPane::SizePaneObjects()
{
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
SizeRowObjects( mRows[i] );
}
@@ -2305,9 +2286,12 @@ int cbDockPane::GetNotFixedBarsCount( cbRowInfo* pRow )
{
int cnt = 0;
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
if ( !pRow->mBars[i]->IsFixed() ) ++cnt;
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( !pRow->mBars[i]->IsFixed() )
++cnt;
}
return cnt;
}
@@ -2336,7 +2320,8 @@ void cbDockPane::SyncRowFlags( cbRowInfo* pRow )
pRow->mNotFixedBarsCnt = 0;
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
cbBarInfo& bar = *pRow->mBars[i];
@@ -2430,7 +2415,8 @@ void cbDockPane::PaneToFrame( wxRect* pRect )
int cbDockPane::GetRowAt( int paneY )
{
if ( paneY < 0 ) return -1;
if ( paneY < 0 )
return -1;
int curY = 0;
@@ -2494,7 +2480,8 @@ int cbDockPane::GetRowAt( int upperY, int lowerY )
int mid = upperY + (lowerY - upperY)/2;
if ( mid < 0 ) return -1;
if ( mid < 0 )
return -1;
int curY = 0;
size_t i = 0;
@@ -2515,9 +2502,11 @@ int cbDockPane::GetRowY( cbRowInfo* pRow )
{
int curY = 0;
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
{
if ( mRows[i] == pRow ) break;
if ( mRows[i] == pRow )
break;
curY += mRows[i]->mRowHeight;
}
@@ -2594,7 +2583,6 @@ void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
cbBarInfo& bar = *pInRow->mBars[i];
if ( !bar.IsFixed() )
totalWidth += bar.mBounds.width;
}
@@ -2605,7 +2593,6 @@ void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
cbBarInfo& bar = *pInRow->mBars[i];
if ( !bar.IsFixed() )
bar.mLenRatio = double(bar.mBounds.width)/double(totalWidth);
}
}
@@ -2703,18 +2690,17 @@ void cbDockPane::ContractBar( cbBarInfo* pBar )
void cbDockPane::InitLinksForRow( cbRowInfo* pRow )
{
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
cbBarInfo& bar = *pRow->mBars[i];
if ( i == 0 )
bar.mpPrev = NULL;
else
bar.mpPrev = pRow->mBars[i-1];
if ( i == pRow->mBars.Count() - 1 )
bar.mpNext = NULL;
else
bar.mpNext = pRow->mBars[i+1];
@@ -2723,18 +2709,17 @@ void cbDockPane::InitLinksForRow( cbRowInfo* pRow )
void cbDockPane::InitLinksForRows()
{
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
{
cbRowInfo& row = *mRows[i];
if ( i == 0 )
row.mpPrev = NULL;
else
row.mpPrev = mRows[i-1];
if ( i == mRows.Count() - 1 )
row.mpNext = NULL;
else
row.mpNext = mRows[i+1];
@@ -2825,12 +2810,13 @@ void cbDockPane::InsertBar( cbBarInfo* pBarInfo )
void cbDockPane::RemoveRow( cbRowInfo* pRow )
{
size_t i;
// first, hide all bar-windows in the removed row
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( pRow->mBars[i]->mpBarWnd )
pRow->mBars[i]->mpBarWnd->Show( FALSE );
}
mRows.Remove( pRow );
@@ -2849,8 +2835,8 @@ void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
pRow->mUMgrData.SetDirty(TRUE);
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
pRow->mBars[i]->mUMgrData.SetDirty( TRUE );
SyncRowFlags( pRow );
@@ -2859,7 +2845,6 @@ void cbDockPane::InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow )
void cbDockPane::SetPaneWidth(int width)
{
if ( IsHorizontal() )
mPaneWidth = width - mLeftMargin - mRightMargin;
else
mPaneWidth = width - mTopMargin - mBottomMargin;
@@ -2868,7 +2853,6 @@ void cbDockPane::SetPaneWidth(int width)
void cbDockPane::SetBoundsInParent( const wxRect& rect )
{
mBoundsInParent = rect;
// set pane dimensions in local coordinates
@@ -2972,14 +2956,14 @@ cbRowInfo* cbDockPane::GetRow( int row )
int cbDockPane::GetRowIndex( cbRowInfo* pRow )
{
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
{
if ( mRows[i] == pRow )
return i;
}
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning); // DBG:: row should be present
wxFAIL_MSG("Row must be present to call cbDockPane::GetRowIndex()");
return 0;
}
@@ -3027,8 +3011,7 @@ bool cbDockPane::MatchesMask( int paneMask )
case FL_ALIGN_RIGHT : thisMask = FL_ALIGN_RIGHT_PANE; break;
default:
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning); // DBG:: bogus alignment type
wxFAIL_MSG("Bad FL alignment type detected in cbDockPane::MatchesMask()");
}
return ( thisMask & paneMask ) != 0;
@@ -3043,8 +3026,8 @@ void cbDockPane::RecalcLayout()
// then horizontally in each row
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
RecalcRowLayout( mRows[i] );
}
@@ -3076,7 +3059,8 @@ int cbDockPane::HitTestPaneItems( const wxPoint& pos,
(*ppRow) = NULL;
(*ppBar) = NULL;
for( size_t i = 0; i != mRows.Count(); ++i )
size_t i;
for ( i = 0; i != mRows.Count(); ++i )
{
cbRowInfo& row = *mRows[i];
@@ -3102,7 +3086,8 @@ int cbDockPane::HitTestPaneItems( const wxPoint& pos,
// hit-test bar handles and bar content
for( size_t k = 0; k != row.mBars.Count(); ++k )
size_t k;
for ( k = 0; k != row.mBars.Count(); ++k )
{
cbBarInfo& bar = *row.mBars[k];
wxRect& bounds = bar.mBounds;
@@ -3126,7 +3111,6 @@ int cbDockPane::HitTestPaneItems( const wxPoint& pos,
}
if ( HasPoint( pos, bounds.x, bounds.y, bounds.width, bounds.height ) )
return CB_BAR_CONTENT_HITTED;
} // hit-test next bar
@@ -3201,18 +3185,17 @@ int cbDockPane::GetMinimalRowHeight( cbRowInfo* pRow )
{
int height = mProps.mMinCBarDim.y;
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( pRow->mBars[i]->IsFixed() )
height = wxMax( height, pRow->mBars[i]->mBounds.height );
}
if ( pRow->mHasUpperHandle )
height += mProps.mResizeHandleSize;
if ( pRow->mHasLowerHandle )
height += mProps.mResizeHandleSize;
return height;
@@ -3228,12 +3211,13 @@ void cbDockPane::SetRowHeight( cbRowInfo* pRow, int newHeight )
newHeight -= mProps.mResizeHandleSize;
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( !pRow->mBars[i]->IsFixed() )
pRow->mBars[i]->mBounds.height = newHeight;
}
}
void cbDockPane::GetRowResizeRange( cbRowInfo* pRow, int* from, int* till,
bool forUpperHandle )
@@ -3379,7 +3363,8 @@ void cbDockPane::DrawVertHandle( wxDC& dc, int x, int y, int height )
dc.DrawLine( x,y, x, lower );
dc.SetPen( mpLayout->mGrayPen );
for( int i = 0; i != mProps.mResizeHandleSize-1; ++i )
int i;
for ( i = 0; i != mProps.mResizeHandleSize-1; ++i )
{
++x;
dc.DrawLine( x,y, x, lower );
@@ -3403,7 +3388,8 @@ void cbDockPane::DrawHorizHandle( wxDC& dc, int x, int y, int width )
dc.SetPen( mpLayout->mGrayPen );
for( int i = 0; i != mProps.mResizeHandleSize-1; ++i )
int i;
for ( i = 0; i != mProps.mResizeHandleSize-1; ++i )
{
++y;
dc.DrawLine( x,y, right, y );
@@ -3434,7 +3420,8 @@ void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
pLst->DeleteContents( TRUE );
pLst->Clear();
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
cbBarInfo& bar = *pRow->mBars[i];
@@ -3449,11 +3436,13 @@ void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst )
void cbDockPane::SetRowShapeData( cbRowInfo* pRow, wxList* pLst )
{
if ( pLst->First() == NULL ) return;
if ( pLst->First() == NULL )
return;
wxNode* pData = pLst->First();
for( size_t i = 0; i != pRow->mBars.Count(); ++i )
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
wxASSERT( pData ); // DBG::

View File

@@ -208,16 +208,17 @@ void wxFrameManager::EnableMenusForView( wxFrameView* pView, bool enable )
wxMenuBar* pMenuBar = GetParentFrame()->GetMenuBar();
int count = pMenuBar->GetMenuCount();
if ( !pMenuBar ) return;
if ( !pMenuBar )
return;
wxStringListNode* pNode = pView->mTopMenus.GetFirst();
int i;
while ( pNode )
{
for( int i = 0; i != count; ++i )
for ( i = 0; i != count; ++i )
{
if ( pMenuBar->GetMenu(i)->GetTitle() == pNode->GetData() )
pMenuBar->EnableTop( i, enable );
}
@@ -293,7 +294,6 @@ void wxFrameManager::Init( wxWindow* pMainFrame, const wxString& settingsFile )
}
if ( mActiveViewNo >= mViews.Number() )
mActiveViewNo = -1;
ActivateView( GetView( ( mActiveViewNo == -1 ) ? 0 : mActiveViewNo ) );
@@ -311,8 +311,7 @@ void wxFrameManager::AddView( wxFrameView* pFrmView )
void wxFrameManager::RemoveView( wxFrameView* pFrmView )
{
// TBD::
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning);
wxFAIL_MSG("wxFrameManager::RemoveView() has not been implemented yet.");
}
int wxFrameManager::GetActiveViewNo()
@@ -393,7 +392,8 @@ wxWindow* wxFrameManager::GetClientWindow()
void wxFrameManager::DeactivateCurrentView()
{
if ( mActiveViewNo == -1 ) return;
if ( mActiveViewNo == -1 )
return;
wxFrameView* pView = GetActiveView();
@@ -403,7 +403,6 @@ void wxFrameManager::DeactivateCurrentView()
GetParentFrame()->PopEventHandler();
if ( pView->mpLayout )
pView->mpLayout->Deactivate();
EnableMenusForView( pView, FALSE );
@@ -429,7 +428,6 @@ bool wxFrameManager::ReloadViews()
// TBD: ????
#if 0
if ( mSettingsFile == "" || !wxFileExists( mSettingsFile ) )
return FALSE;
DestroyViews();

View File

@@ -34,7 +34,9 @@ static int* create_array( int width, int height, int fill = 0 )
int* array = new int[width*height];
int len = width*height;
for( int i = 0; i != len; ++i ) array[i] = fill;
int i;
for ( i = 0; i != len; ++i )
array[i] = fill;
return array;
}
@@ -110,24 +112,28 @@ static void gray_out_pixmap( int* src, int* dest, int width, int height )
if ( IS_IN_ARRAY(x+1,y-1) )
{
++x;--y;
++x;
--y;
}
else
{
while ( IS_IN_ARRAY(x-1,y+1) )
{
--x;++y;
--x;
++y;
}
if ( IS_IN_ARRAY(x,y+1) )
{
++y; continue;
++y;
continue;
}
else
{
if ( IS_IN_ARRAY(x+1,y) )
{
++x; continue;
++x;
continue;
}
else break;
}
@@ -152,23 +158,22 @@ void gray_out_image_on_dc( wxDC& dc, int width, int height )
int* src = create_array( width, height, MASK_BG );
int* dest = create_array( width, height, MASK_BG );
int y = 0;
int x, y;
for ( y = 0; y != height; ++y )
for( int x = 0; x != width; ++x )
{
for ( x = 0; x != width; ++x )
{
wxColour col;
dc.GetPixel( x,y, &col );
GET_ELEM(src,x,y) = MAKE_INT_COLOR( col.Red(), col.Green(), col.Blue() );
}
}
gray_out_pixmap( src, dest, width, height );
for ( y = 0; y != height; ++y )
for( int x = 0; x != width; ++x )
{
for ( x = 0; x != width; ++x )
{
int mask = GET_ELEM(dest,x,y);
@@ -186,7 +191,7 @@ void gray_out_image_on_dc( wxDC& dc, int width, int height )
default : break;
}
}
}
delete [] src;
delete [] dest;
}
@@ -425,8 +430,7 @@ void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
}
else
{
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning);// unsupported alignment type
wxFAIL_MSG("Unsupported FL alignment type detected in wxNewBitmapButton::RenderLabelImage()");
}
}
else