aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/skin/widgets/stats/statswnd.cpp
blob: 116c6c9543eb59bc9081b32a785dc242dc8d58b8 (plain) (blame)
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
#include <precomp.h>
#include "statswnd.h"
#include <bfc/string/StringW.h>

StatsWnd::StatsWnd() 
{
  registerXml();
  WASABI_API_WNDMGR->autopopup_registerGroupId(L"statswnd.group", L"Internal Statistics");
  WASABI_API_SYSCB->syscb_registerCallback(this);
}

StatsWnd::~StatsWnd() 
{
  WASABI_API_SYSCB->syscb_deregisterCallback(this);
}

int StatsWnd::skincb_onBeforeLoadingElements() 
{
  registerXml();
  return 1;
}

void StatsWnd::registerXml() 
{
  StringW xml;
  
  xml = L"buf:";

  xml += L"<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"yes\"?>\n";
  xml += L"<WasabiXml version=\"1.0\">\n";
  xml += L"<groupdef id=\"statswnd.group\" name=\"Internal Statistics\">\n";
  xml += L"  <Wasabi:Stats fitparent=\"1\" />\n";
  xml += L"</groupdef>\n";
  xml += L"</WasabiXml>\n";

  WASABI_API_SKIN->loadSkinFile(xml);
}