Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -4,84 +4,79 @@
|
||||
See license in Gwen.h
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#ifndef GWEN_CONTROLS_LAYOUT_SPLITTER_H
|
||||
#define GWEN_CONTROLS_LAYOUT_SPLITTER_H
|
||||
|
||||
#include "Gwen/Controls/Base.h"
|
||||
|
||||
namespace Gwen
|
||||
namespace Gwen
|
||||
{
|
||||
namespace Controls
|
||||
namespace Controls
|
||||
{
|
||||
namespace Layout
|
||||
{
|
||||
class GWEN_EXPORT Splitter : public Base
|
||||
{
|
||||
public:
|
||||
typedef Base BaseClass;
|
||||
|
||||
Splitter(Base* pParent) : BaseClass(pParent)
|
||||
{
|
||||
namespace Layout
|
||||
for (int i = 0; i < 2; i++)
|
||||
m_pPanel[i] = NULL;
|
||||
}
|
||||
|
||||
void SetPanel(int i, Base* pPanel)
|
||||
{
|
||||
if (i < 0 || i > 1) return;
|
||||
|
||||
m_pPanel[i] = pPanel;
|
||||
|
||||
if (m_pPanel[i])
|
||||
{
|
||||
|
||||
class GWEN_EXPORT Splitter : public Base
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Base BaseClass;
|
||||
|
||||
Splitter( Base* pParent ) : BaseClass( pParent )
|
||||
{
|
||||
for ( int i=0; i<2; i++ )
|
||||
m_pPanel[i] = NULL;
|
||||
}
|
||||
|
||||
void SetPanel( int i, Base* pPanel )
|
||||
{
|
||||
if ( i < 0 || i > 1 ) return;
|
||||
|
||||
m_pPanel[i] = pPanel;
|
||||
|
||||
if ( m_pPanel[i] )
|
||||
{
|
||||
m_pPanel[i] ->SetParent( this );
|
||||
}
|
||||
}
|
||||
|
||||
Base* GetPanel( int i ) const
|
||||
{
|
||||
if ( i < 0 || i > 1 ) return NULL;
|
||||
return m_pPanel[i];
|
||||
}
|
||||
|
||||
void Layout( Skin::Base* skin )
|
||||
{
|
||||
LayoutVertical( skin );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void LayoutVertical( Skin::Base* /*skin*/ )
|
||||
{
|
||||
int w = Width();
|
||||
int h = Height();
|
||||
|
||||
if ( m_pPanel[0] )
|
||||
{
|
||||
const Margin& m = m_pPanel[0]->GetMargin();
|
||||
m_pPanel[0]->SetBounds( m.left, m.top, w-m.left-m.right, (h * 0.5) - m.top - m.bottom );
|
||||
}
|
||||
|
||||
if ( m_pPanel[1] )
|
||||
{
|
||||
const Margin& m = m_pPanel[1]->GetMargin();
|
||||
m_pPanel[1]->SetBounds( m.left, m.top + (h * 0.5f), w-m.left-m.right, (h * 0.5f) - m.top - m.bottom );
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutHorizontal( Skin::Base* /*skin*/ )
|
||||
{
|
||||
// Todo.
|
||||
}
|
||||
|
||||
Base* m_pPanel[2];
|
||||
|
||||
};
|
||||
m_pPanel[i]->SetParent(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Base* GetPanel(int i) const
|
||||
{
|
||||
if (i < 0 || i > 1) return NULL;
|
||||
return m_pPanel[i];
|
||||
}
|
||||
|
||||
void Layout(Skin::Base* skin)
|
||||
{
|
||||
LayoutVertical(skin);
|
||||
}
|
||||
|
||||
private:
|
||||
void LayoutVertical(Skin::Base* /*skin*/)
|
||||
{
|
||||
int w = Width();
|
||||
int h = Height();
|
||||
|
||||
if (m_pPanel[0])
|
||||
{
|
||||
const Margin& m = m_pPanel[0]->GetMargin();
|
||||
m_pPanel[0]->SetBounds(m.left, m.top, w - m.left - m.right, (h * 0.5) - m.top - m.bottom);
|
||||
}
|
||||
|
||||
if (m_pPanel[1])
|
||||
{
|
||||
const Margin& m = m_pPanel[1]->GetMargin();
|
||||
m_pPanel[1]->SetBounds(m.left, m.top + (h * 0.5f), w - m.left - m.right, (h * 0.5f) - m.top - m.bottom);
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutHorizontal(Skin::Base* /*skin*/)
|
||||
{
|
||||
// Todo.
|
||||
}
|
||||
|
||||
Base* m_pPanel[2];
|
||||
};
|
||||
} // namespace Layout
|
||||
} // namespace Controls
|
||||
} // namespace Gwen
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user