GroupBox.cpp 787 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #include "Gwen/Controls/GroupBox.h"
  7. using namespace Gwen;
  8. using namespace Gwen::Controls;
  9. GWEN_CONTROL_CONSTRUCTOR( GroupBox )
  10. {
  11. // Set to true, because it's likely that our
  12. // children will want mouse input, and they
  13. // can't get it without us..
  14. SetMouseInputEnabled( true );
  15. SetTextPadding( Padding( 10, 0, 0, 0 ) );
  16. SetAlignment( Pos::Top | Pos::Left );
  17. Invalidate();
  18. m_InnerPanel = new Base( this );
  19. m_InnerPanel->Dock( Pos::Fill );
  20. }
  21. void GroupBox::Layout( Skin::Base* skin )
  22. {
  23. m_InnerPanel->SetMargin( Margin( TextHeight() + 3, 6, 6, 6 ) );
  24. BaseClass::Layout( skin );
  25. }
  26. void GroupBox::Render( Skin::Base* skin )
  27. {
  28. skin->DrawGroupBox( this, TextX(), TextHeight(), TextWidth() );
  29. }