MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / GWEN_CONTROL_INLINE

Method GWEN_CONTROL_INLINE

test/GwenOpenGLTest/TextBox.cpp:9–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7{
8public:
9 GWEN_CONTROL_INLINE(TextBox, GUnit)
10 {
11 {
12 Gwen::Controls::TextBox* label = new Gwen::Controls::TextBox(this);
13 label->SetText("");
14 label->SetPos(10, 10);
15 label->onTextChanged.Add(this, &ThisClass::OnEdit);
16 label->onReturnPressed.Add(this, &ThisClass::OnSubmit);
17 }
18
19 {
20 Gwen::Controls::TextBox* label = new Gwen::Controls::TextBox(this);
21 label->SetText("Normal Everyday Label");
22 label->SetPos(10, 10 + 25);
23 }
24
25 {
26 Gwen::Controls::TextBox* label = new Gwen::Controls::TextBox(this);
27 label->SetText("Select All Text On Focus");
28 label->SetPos(10, 10 + 25 * 2);
29 label->SetSelectAllOnFocus(true);
30 }
31
32 {
33 Gwen::Controls::TextBox* label = new Gwen::Controls::TextBox(this);
34 label->SetText(L"Different Coloured Text, for some reason");
35 label->SetTextColor(Gwen::Color(255, 0, 255, 255));
36 label->SetPos(10, 10 + 25 * 3);
37 }
38
39 {
40 Gwen::Controls::TextBoxNumeric* label = new Gwen::Controls::TextBoxNumeric(this);
41 label->SetText(L"2004");
42 label->SetTextColor(Gwen::Color(255, 0, 255, 255));
43 label->SetPos(10, 10 + 25 * 4);
44 }
45
46 {
47 m_Font.facename = L"Impact";
48 m_Font.size = 50;
49
50 Gwen::Controls::TextBox* label = new Gwen::Controls::TextBox(this);
51 label->SetText(L"Different Font");
52 label->SetPos(10, 10 + 25 * 5);
53 label->SetFont(&m_Font);
54 label->SetSize(200, 55);
55 }
56 }
57
58 void OnEdit(Gwen::Controls::Base* pControl)
59 {

Callers

nothing calls this directly

Calls 5

ColorFunction · 0.85
SetPosMethod · 0.80
SetTextMethod · 0.45
AddMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected