mirror of https://github.com/BOINC/boinc.git
Singleton class that contains all the parsed xml values needed by application. Mostly they are paths for images(wxString) but it also contains some of the color information in wxColour format. There is also a helper function to pars string into a wxColour. It is static so it gets cleaned by application(no need to clean it manually).
svn path=/trunk/boinc/; revision=10438
This commit is contained in:
parent
c47eebf260
commit
3b174f37c2
|
@ -0,0 +1,26 @@
|
|||
#include "sg_SkinClass.h"
|
||||
|
||||
|
||||
SkinClass::SkinClass()
|
||||
{
|
||||
}
|
||||
SkinClass* SkinClass::Instance()
|
||||
{
|
||||
static SkinClass inst;
|
||||
return &inst;
|
||||
}
|
||||
wxColour SkinClass::GetColorFromStr(wxString col){
|
||||
// create color
|
||||
int delPos = col.Find(":");
|
||||
wxString rcol = col.Mid(0,delPos);
|
||||
col = col.Mid(delPos+1, col.Length() - delPos);
|
||||
delPos = col.Find(":");
|
||||
wxString gcol = col.Mid(0,delPos);
|
||||
wxString bcol = col.Mid(delPos+1, col.Length()- delPos);
|
||||
|
||||
unsigned char r_ch = atoi(rcol.c_str());
|
||||
unsigned char g_ch = atoi(gcol.c_str());
|
||||
unsigned char b_ch = atoi(bcol.c_str());
|
||||
|
||||
return wxColour(r_ch,g_ch,b_ch);
|
||||
}
|
Loading…
Reference in New Issue