00001 #include "stdafx.h"
00002 #include "Formatter.h"
00003
00004 namespace GMEConsole
00005 {
00006 CString Formatter::MakeObjectHyperlink(const CString & text, const CString& objectId)
00007 {
00008
00009 CString result("<a href=\"mga:");
00010 result+= objectId;
00011 result+= "\">";
00012 result+= text ;
00013 result+= "</a>";
00014
00015 return result;
00016 }
00017
00018 CString Formatter::MakeObjectHyperlink(const CString & text, long objectId)
00019 {
00020
00021 unsigned long id = objectId, c, p;
00022 p=id%100000000;
00023 c=id/100000000;
00024 c+=100;
00025
00026 CString result;
00027 result.Format(_T("<a href=\"mga:id-%04X-%08X\">"), c, p);
00028 result+= text;
00029 result+=_T("</a>");
00030 return result;
00031 }
00032
00033 CString Formatter::MakeColored(const CString & text, COLORREF color)
00034 {
00035 CString result;
00036 result.Format(_T("<font color=\"#%02X%02X%02X\"> %s </font>"), (int)GetRValue(color), (int)GetGValue(color),(int)GetBValue(color), text);
00037 return result;
00038 }
00039 }
00040
00041
00042
00043
00044
00045