Board index » cppbuilder » Re. Re: Re. Various font settings

Re. Re: Re. Various font settings


2006-05-07 06:55:43 PM
cppbuilder113
Quote
Michel Leunen wrote in Article <445dbdf9$ XXXX@XXXXX.COM >
with Subject: Re: Re. Various font settings, on 07.05.2006 11:32:10


Elmar Baumann wrote:

>the inifile in this case is a simple
>TStringList [using LoadFromFile/SaveToFile]:
But what type is inifile? TIniFile doesn't have an Add() method.
Your code is quite confusing.
Hello,
inifile is a global defined TStringList - as i said in the first line.
this demo don't use TIniFile.
Regards
Elmar Baumann
------------------------------------------------------------------------------
Indy9 NNTP Internet News Reader/Writer, E. Baumann Software 2005
Portions of this Software are Copyright (c) 1993 - 2005,
Chad Z. Hower (Kudzu) and the Indy Pit Crew
<www.IndyProject.org/>
 
 

Re:Re. Re: Re. Various font settings

Quote
Michel Leunen wrote in Article <445dbdf9$ XXXX@XXXXX.COM >
with Subject: Re: Re. Various font settings, on 07.05.2006 11:32:10



But what type is inifile? TIniFile doesn't have an Add() method.
Your code is quite confusing.
a correction in your advice:
SAVE Section
------------
inifile->BeginUpdate();
. . .
// Settings of UserList
inifile->Add(ColorToString(UserList->Color));
inifile->Add(UserList->Font->Name);
inifile->Add(UserList->Font->Color);
inifile->Add(AnsiString(UserList->Font->Size));
//
if(UserList->Font->Style.Contains(fsBold))
{
inifile->Add("fsBold");
}
else
{
inifile->Add("0");
}
if(UserList->Font->Style.Contains(fsItalic))
{
inifile->Add("fsItalic");
}
else
{
inifile->Add("0");
}
if(UserList->Font->Style.Contains(fsUnderline))
{
inifile->Add("fsUnderline");
}
else
{
inifile->Add("0");
}
if(UserList->Font->Style.Contains(fsStrikeOut))
{
inifile->Add("fsStrikeOut");
}
else
{
inifile->Add("0");
}
inifile->EndUpdate();
. . .
LOAD Section
------------
UserList->Color = StringToColor(inifile->operator [](63)); // UserList Data was stored at position 63
UserList->Font->Name = inifile->operator [](64) ;
UserList->Font->Color = StringToColor(inifile->operator [](65));
UserList->Font->Size = inifile->operator [](66).ToInt();
if(inifile->operator [](67) == "fsBold")
{
UserList->Font->Style = TFontStyles() << fsBold;
}
if(inifile->operator [](68) == "fsItalic")
{
UserList->Font->Style = TFontStyles() << fsItalic;
}
if(inifile->operator [](69) == "fsUnderline")
{
UserList->Font->Style = TFontStyles() << fsUnderline;
}
if(inifile->operator [](70) == "fsStrikeOut")
{
UserList->Font->Style = TFontStyles() << fsStrikeOut;
}
Regards
Elmar Baumann
------------------------------------------------------------------------------
Indy9 NNTP Internet News Reader/Writer, E. Baumann Software 2005
Portions of this Software are Copyright (c) 1993 - 2005,
Chad Z. Hower (Kudzu) and the Indy Pit Crew
<www.IndyProject.org/>