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