From 3b174f37c2a0c0c4d7562c2edbf55c89c5b67871 Mon Sep 17 00:00:00 2001 From: Milos Travar Date: Wed, 21 Jun 2006 17:45:29 +0000 Subject: [PATCH] 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 --- clientgui/sg_SkinClass.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 clientgui/sg_SkinClass.cpp diff --git a/clientgui/sg_SkinClass.cpp b/clientgui/sg_SkinClass.cpp new file mode 100644 index 0000000000..245f11930d --- /dev/null +++ b/clientgui/sg_SkinClass.cpp @@ -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); +}