Code formatting

This commit is contained in:
Maciej Suminski 2017-03-01 09:50:36 +01:00
parent 1d039cb4c1
commit f4be80a3af
1 changed files with 19 additions and 4 deletions

View File

@ -190,8 +190,10 @@ void LAYER_WIDGET::OnTabChange( wxNotebookEvent& event )
wxWindow* LAYER_WIDGET::getLayerComp( int aRow, int aColumn ) const wxWindow* LAYER_WIDGET::getLayerComp( int aRow, int aColumn ) const
{ {
unsigned ndx = aRow * LYR_COLUMN_COUNT + aColumn; unsigned ndx = aRow * LYR_COLUMN_COUNT + aColumn;
if( ndx < m_LayersFlexGridSizer->GetChildren().GetCount() ) if( ndx < m_LayersFlexGridSizer->GetChildren().GetCount() )
return m_LayersFlexGridSizer->GetChildren()[ndx]->GetWindow(); return m_LayersFlexGridSizer->GetChildren()[ndx]->GetWindow();
return NULL; return NULL;
} }
@ -199,6 +201,7 @@ wxWindow* LAYER_WIDGET::getLayerComp( int aRow, int aColumn ) const
int LAYER_WIDGET::findLayerRow( LAYER_NUM aLayer ) const int LAYER_WIDGET::findLayerRow( LAYER_NUM aLayer ) const
{ {
int count = GetLayerRowCount(); int count = GetLayerRowCount();
for( int row = 0; row < count; ++row ) for( int row = 0; row < count; ++row )
{ {
// column 0 in the layer scroll window has a wxStaticBitmap, get its ID. // column 0 in the layer scroll window has a wxStaticBitmap, get its ID.
@ -208,6 +211,7 @@ int LAYER_WIDGET::findLayerRow( LAYER_NUM aLayer ) const
if( aLayer == getDecodedId( w->GetId() )) if( aLayer == getDecodedId( w->GetId() ))
return row; return row;
} }
return -1; return -1;
} }
@ -215,8 +219,10 @@ int LAYER_WIDGET::findLayerRow( LAYER_NUM aLayer ) const
wxWindow* LAYER_WIDGET::getRenderComp( int aRow, int aColumn ) const wxWindow* LAYER_WIDGET::getRenderComp( int aRow, int aColumn ) const
{ {
int ndx = aRow * RND_COLUMN_COUNT + aColumn; int ndx = aRow * RND_COLUMN_COUNT + aColumn;
if( (unsigned) ndx < m_RenderFlexGridSizer->GetChildren().GetCount() ) if( (unsigned) ndx < m_RenderFlexGridSizer->GetChildren().GetCount() )
return m_RenderFlexGridSizer->GetChildren()[ndx]->GetWindow(); return m_RenderFlexGridSizer->GetChildren()[ndx]->GetWindow();
return NULL; return NULL;
} }
@ -224,6 +230,7 @@ wxWindow* LAYER_WIDGET::getRenderComp( int aRow, int aColumn ) const
int LAYER_WIDGET::findRenderRow( int aId ) const int LAYER_WIDGET::findRenderRow( int aId ) const
{ {
int count = GetRenderRowCount(); int count = GetRenderRowCount();
for( int row = 0; row < count; ++row ) for( int row = 0; row < count; ++row )
{ {
// column 0 in the layer scroll window has a wxStaticBitmap, get its ID. // column 0 in the layer scroll window has a wxStaticBitmap, get its ID.
@ -233,6 +240,7 @@ int LAYER_WIDGET::findRenderRow( int aId ) const
if( aId == getDecodedId( w->GetId() )) if( aId == getDecodedId( w->GetId() ))
return row; return row;
} }
return -1; return -1;
} }
@ -422,6 +430,7 @@ wxSize LAYER_WIDGET::GetBestSize() const
// size of m_LayerScrolledWindow -------------- // size of m_LayerScrolledWindow --------------
wxArrayInt widths = m_LayersFlexGridSizer->GetColWidths(); wxArrayInt widths = m_LayersFlexGridSizer->GetColWidths();
int totWidth = 0; int totWidth = 0;
if( widths.GetCount() ) if( widths.GetCount() )
{ {
for( int i = 0; i < LYR_COLUMN_COUNT; ++i ) for( int i = 0; i < LYR_COLUMN_COUNT; ++i )
@ -430,6 +439,7 @@ wxSize LAYER_WIDGET::GetBestSize() const
// printf("widths[%d]:%d\n", i, widths[i] ); // printf("widths[%d]:%d\n", i, widths[i] );
} }
} }
// Account for the parent's frame: // Account for the parent's frame:
totWidth += 10; totWidth += 10;
@ -447,6 +457,7 @@ wxSize LAYER_WIDGET::GetBestSize() const
// size of m_RenderScrolledWindow -------------- // size of m_RenderScrolledWindow --------------
widths = m_RenderFlexGridSizer->GetColWidths(); widths = m_RenderFlexGridSizer->GetColWidths();
totWidth = 0; totWidth = 0;
if( widths.GetCount() ) if( widths.GetCount() )
{ {
for( int i = 0; i < RND_COLUMN_COUNT; ++i ) for( int i = 0; i < RND_COLUMN_COUNT; ++i )
@ -616,6 +627,7 @@ COLOR4D LAYER_WIDGET::GetLayerColor( LAYER_NUM aLayer ) const
void LAYER_WIDGET::SetRenderState( int aId, bool isSet ) void LAYER_WIDGET::SetRenderState( int aId, bool isSet )
{ {
int row = findRenderRow( aId ); int row = findRenderRow( aId );
if( row >= 0 ) if( row >= 0 )
{ {
int col = 1; // checkbox is column 1 int col = 1; // checkbox is column 1
@ -629,6 +641,7 @@ void LAYER_WIDGET::SetRenderState( int aId, bool isSet )
bool LAYER_WIDGET::GetRenderState( int aId ) bool LAYER_WIDGET::GetRenderState( int aId )
{ {
int row = findRenderRow( aId ); int row = findRenderRow( aId );
if( row >= 0 ) if( row >= 0 )
{ {
int col = 1; // checkbox is column 1 int col = 1; // checkbox is column 1
@ -636,6 +649,7 @@ bool LAYER_WIDGET::GetRenderState( int aId )
wxASSERT( cb ); wxASSERT( cb );
return cb->GetValue(); return cb->GetValue();
} }
return false; // the value of a non-existent row return false; // the value of a non-existent row
} }
@ -653,6 +667,7 @@ void LAYER_WIDGET::UpdateLayouts()
void LAYER_WIDGET::UpdateLayerIcons() void LAYER_WIDGET::UpdateLayerIcons()
{ {
int rowCount = GetLayerRowCount(); int rowCount = GetLayerRowCount();
for( int row = 0; row < rowCount ; row++ ) for( int row = 0; row < rowCount ; row++ )
{ {
INDICATOR_ICON* indicator = (INDICATOR_ICON*) getLayerComp( row, COLUMN_ICON_ACTIVE ); INDICATOR_ICON* indicator = (INDICATOR_ICON*) getLayerComp( row, COLUMN_ICON_ACTIVE );