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:
@@ -13,92 +13,92 @@
|
||||
#include "Gwen/Controls/Label.h"
|
||||
#include "Gwen/Controls/ScrollControl.h"
|
||||
|
||||
namespace Gwen
|
||||
namespace Gwen
|
||||
{
|
||||
namespace Controls
|
||||
namespace Controls
|
||||
{
|
||||
class GWEN_EXPORT TextBox : public Label
|
||||
{
|
||||
GWEN_CONTROL(TextBox, Label);
|
||||
|
||||
virtual void Render(Skin::Base* skin);
|
||||
virtual void RenderFocus(Gwen::Skin::Base* /*skin*/){};
|
||||
virtual void Layout(Skin::Base* skin);
|
||||
|
||||
virtual bool OnChar(Gwen::UnicodeChar c);
|
||||
|
||||
virtual void InsertText(const Gwen::UnicodeString& str);
|
||||
virtual void DeleteText(int iStartPos, int iLength);
|
||||
|
||||
virtual void RefreshCursorBounds();
|
||||
|
||||
virtual bool OnKeyReturn(bool bDown);
|
||||
virtual bool OnKeyBackspace(bool bDown);
|
||||
virtual bool OnKeyDelete(bool bDown);
|
||||
virtual bool OnKeyRight(bool bDown);
|
||||
virtual bool OnKeyLeft(bool bDown);
|
||||
virtual bool OnKeyHome(bool bDown);
|
||||
virtual bool OnKeyEnd(bool bDown);
|
||||
|
||||
virtual bool AccelOnlyFocus() { return true; }
|
||||
|
||||
virtual void OnPaste(Gwen::Controls::Base* pCtrl);
|
||||
virtual void OnCopy(Gwen::Controls::Base* pCtrl);
|
||||
virtual void OnCut(Gwen::Controls::Base* pCtrl);
|
||||
virtual void OnSelectAll(Gwen::Controls::Base* pCtrl);
|
||||
|
||||
virtual void OnMouseDoubleClickLeft(int x, int y);
|
||||
|
||||
virtual void EraseSelection();
|
||||
virtual bool HasSelection();
|
||||
virtual UnicodeString GetSelection();
|
||||
|
||||
virtual void SetCursorPos(int i);
|
||||
virtual void SetCursorEnd(int i);
|
||||
|
||||
virtual void OnMouseClickLeft(int x, int y, bool bDown);
|
||||
virtual void OnMouseMoved(int x, int y, int deltaX, int deltaY);
|
||||
|
||||
virtual void SetSelectAllOnFocus(bool b)
|
||||
{
|
||||
class GWEN_EXPORT TextBox : public Label
|
||||
{
|
||||
GWEN_CONTROL( TextBox, Label );
|
||||
|
||||
virtual void Render( Skin::Base* skin );
|
||||
virtual void RenderFocus( Gwen::Skin::Base* /*skin*/){};
|
||||
virtual void Layout( Skin::Base* skin );
|
||||
|
||||
virtual bool OnChar( Gwen::UnicodeChar c );
|
||||
|
||||
virtual void InsertText( const Gwen::UnicodeString& str );
|
||||
virtual void DeleteText( int iStartPos, int iLength );
|
||||
|
||||
virtual void RefreshCursorBounds();
|
||||
|
||||
virtual bool OnKeyReturn( bool bDown );
|
||||
virtual bool OnKeyBackspace( bool bDown );
|
||||
virtual bool OnKeyDelete( bool bDown );
|
||||
virtual bool OnKeyRight( bool bDown );
|
||||
virtual bool OnKeyLeft( bool bDown );
|
||||
virtual bool OnKeyHome( bool bDown );
|
||||
virtual bool OnKeyEnd( bool bDown );
|
||||
|
||||
virtual bool AccelOnlyFocus() { return true; }
|
||||
|
||||
virtual void OnPaste( Gwen::Controls::Base* pCtrl );
|
||||
virtual void OnCopy( Gwen::Controls::Base* pCtrl );
|
||||
virtual void OnCut( Gwen::Controls::Base* pCtrl );
|
||||
virtual void OnSelectAll( Gwen::Controls::Base* pCtrl );
|
||||
|
||||
virtual void OnMouseDoubleClickLeft( int x, int y );
|
||||
|
||||
virtual void EraseSelection();
|
||||
virtual bool HasSelection();
|
||||
virtual UnicodeString GetSelection();
|
||||
|
||||
virtual void SetCursorPos( int i );
|
||||
virtual void SetCursorEnd( int i );
|
||||
|
||||
virtual void OnMouseClickLeft( int x, int y, bool bDown );
|
||||
virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY );
|
||||
|
||||
virtual void SetSelectAllOnFocus( bool b ){ m_bSelectAll = b; if ( b ) OnSelectAll( this ); }
|
||||
|
||||
virtual void MakeCaratVisible();
|
||||
|
||||
virtual void OnEnter();
|
||||
|
||||
virtual bool NeedsInputChars(){ return true; }
|
||||
|
||||
Event::Caller onTextChanged;
|
||||
Event::Caller onReturnPressed;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void OnTextChanged();
|
||||
virtual bool IsTextAllowed( const Gwen::UnicodeString& /*str*/, int /*iPos*/ ){ return true; }
|
||||
|
||||
bool m_bSelectAll;
|
||||
|
||||
int m_iCursorPos;
|
||||
int m_iCursorEnd;
|
||||
|
||||
Gwen::Rect m_rectSelectionBounds;
|
||||
Gwen::Rect m_rectCaretBounds;
|
||||
|
||||
float m_fLastInputTime;
|
||||
};
|
||||
|
||||
class GWEN_EXPORT TextBoxNumeric : public TextBox
|
||||
{
|
||||
public:
|
||||
|
||||
GWEN_CONTROL( TextBoxNumeric, TextBox );
|
||||
|
||||
virtual float GetFloatFromText();
|
||||
|
||||
private:
|
||||
|
||||
virtual bool IsTextAllowed( const Gwen::UnicodeString& str, int iPos );
|
||||
|
||||
};
|
||||
m_bSelectAll = b;
|
||||
if (b) OnSelectAll(this);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void MakeCaratVisible();
|
||||
|
||||
virtual void OnEnter();
|
||||
|
||||
virtual bool NeedsInputChars() { return true; }
|
||||
|
||||
Event::Caller onTextChanged;
|
||||
Event::Caller onReturnPressed;
|
||||
|
||||
protected:
|
||||
virtual void OnTextChanged();
|
||||
virtual bool IsTextAllowed(const Gwen::UnicodeString& /*str*/, int /*iPos*/) { return true; }
|
||||
|
||||
bool m_bSelectAll;
|
||||
|
||||
int m_iCursorPos;
|
||||
int m_iCursorEnd;
|
||||
|
||||
Gwen::Rect m_rectSelectionBounds;
|
||||
Gwen::Rect m_rectCaretBounds;
|
||||
|
||||
float m_fLastInputTime;
|
||||
};
|
||||
|
||||
class GWEN_EXPORT TextBoxNumeric : public TextBox
|
||||
{
|
||||
public:
|
||||
GWEN_CONTROL(TextBoxNumeric, TextBox);
|
||||
|
||||
virtual float GetFloatFromText();
|
||||
|
||||
private:
|
||||
virtual bool IsTextAllowed(const Gwen::UnicodeString& str, int iPos);
|
||||
};
|
||||
} // namespace Controls
|
||||
} // namespace Gwen
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user