-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLGUIRIFrame.cpp
More file actions
50 lines (42 loc) · 1.09 KB
/
LGUIRIFrame.cpp
File metadata and controls
50 lines (42 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "ISXRI.h"
#include "LGUIRIFrame.h"
LGUIFactory<LGUIRIFrame> RIFrameFactory("riframe");
LGUIRIFrame::LGUIRIFrame(const char *p_Factory, LGUIElement *p_pParent, const char *p_Name):LGUIFrame(p_Factory,p_pParent,p_Name)
{
pText=0;
Count=0;
}
LGUIRIFrame::~LGUIRIFrame(void)
{
}
bool LGUIRIFrame::IsTypeOf(char *TestFactory)
{
return (!_stricmp(TestFactory,"riframe")) || LGUIFrame::IsTypeOf(TestFactory);
}
bool LGUIRIFrame::FromXML(class XMLNode *pXML, class XMLNode *pTemplate)
{
if (!pTemplate)
pTemplate=g_UIManager.FindTemplate(XMLHelper::GetStringAttribute(pXML,"Template"));
if (!pTemplate)
pTemplate=g_UIManager.FindTemplate("riframe");
if (!LGUIFrame::FromXML(pXML,pTemplate))
return false;
// custom xml properties
return true;
}
void LGUIRIFrame::OnCreate()
{
// All children of this element are guaranteed to have been created now.
pText = (LGUIText*)FindUsableChild("Output","text");
}
void LGUIRIFrame::Render()
{
Count++;
if (pText)
{
char Temp[256];
sprintf_s(Temp,"This frame has been rendered %d times.",Count);
pText->SetText(Temp);
}
LGUIFrame::Render();
}