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:
erwincoumans
2018-09-23 14:17:31 -07:00
parent b73b05e9fb
commit ab8f16961e
1773 changed files with 1081087 additions and 474249 deletions

View File

@@ -15,68 +15,67 @@
#include "Gwen/Controls/Symbol.h"
#include "Gwen/Controls/LabelClickable.h"
namespace Gwen
namespace Gwen
{
namespace Controls
namespace Controls
{
class GWEN_EXPORT CheckBox : public Button
{
public:
GWEN_CONTROL(CheckBox, Button);
virtual void Render(Skin::Base* skin);
virtual void OnPress();
virtual void SetChecked(bool Checked);
virtual void Toggle() { SetChecked(!IsChecked()); }
virtual bool IsChecked() { return m_bChecked; }
Gwen::Event::Caller onChecked;
Gwen::Event::Caller onUnChecked;
Gwen::Event::Caller onCheckChanged;
private:
// For derived controls
virtual bool AllowUncheck() { return true; }
void OnCheckStatusChanged();
bool m_bChecked;
};
class GWEN_EXPORT CheckBoxWithLabel : public Base
{
public:
GWEN_CONTROL_INLINE(CheckBoxWithLabel, Base)
{
SetSize(200, 19);
class GWEN_EXPORT CheckBox : public Button
{
public:
m_Checkbox = new CheckBox(this);
m_Checkbox->Dock(Pos::Left);
m_Checkbox->SetMargin(Margin(0, 3, 3, 3));
m_Checkbox->SetTabable(false);
GWEN_CONTROL( CheckBox, Button );
m_Label = new LabelClickable(this);
m_Label->Dock(Pos::Fill);
m_Label->onPress.Add(m_Checkbox, &CheckBox::ReceiveEventPress);
m_Label->SetTabable(false);
virtual void Render( Skin::Base* skin );
virtual void OnPress();
virtual void SetChecked( bool Checked );
virtual void Toggle() { SetChecked( !IsChecked() ); }
virtual bool IsChecked() { return m_bChecked; }
Gwen::Event::Caller onChecked;
Gwen::Event::Caller onUnChecked;
Gwen::Event::Caller onCheckChanged;
private:
// For derived controls
virtual bool AllowUncheck(){ return true; }
void OnCheckStatusChanged();
bool m_bChecked;
};
class GWEN_EXPORT CheckBoxWithLabel : public Base
{
public:
GWEN_CONTROL_INLINE( CheckBoxWithLabel, Base )
{
SetSize( 200, 19 );
m_Checkbox = new CheckBox( this );
m_Checkbox->Dock( Pos::Left );
m_Checkbox->SetMargin( Margin( 0, 3, 3, 3 ) );
m_Checkbox->SetTabable( false );
m_Label = new LabelClickable( this );
m_Label->Dock( Pos::Fill );
m_Label->onPress.Add( m_Checkbox, &CheckBox::ReceiveEventPress );
m_Label->SetTabable( false );
SetTabable( false );
}
virtual CheckBox* Checkbox() { return m_Checkbox; }
virtual LabelClickable* Label() { return m_Label; }
virtual bool OnKeySpace( bool bDown ) { if ( bDown ) m_Checkbox->SetChecked( !m_Checkbox->IsChecked() ); return true; }
private:
CheckBox* m_Checkbox;
LabelClickable* m_Label;
};
SetTabable(false);
}
}
virtual CheckBox* Checkbox() { return m_Checkbox; }
virtual LabelClickable* Label() { return m_Label; }
virtual bool OnKeySpace(bool bDown)
{
if (bDown) m_Checkbox->SetChecked(!m_Checkbox->IsChecked());
return true;
}
private:
CheckBox* m_Checkbox;
LabelClickable* m_Label;
};
} // namespace Controls
} // namespace Gwen
#endif