Stylecodes now may be used in random system groups. Patch from Ianos Gnatiuc 2:5030/830.17

This commit is contained in:
Stas Degteff 2005-10-03 16:55:00 +00:00
parent 9cc99a0265
commit 49294f1f56
11 changed files with 51 additions and 31 deletions

View File

@ -2285,6 +2285,7 @@ EndGroup
// QuoteChars
// QuoteString
// SearchFor
// StyleCodes
// Tagline
// TaglineChar
// TaglineFile

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
+ Stylecodes now may be used in random system groups.
+ New color config file item: "COLOR HEADER LOCATION". This is used for define
colors of the originate node location information (see DISPHDRLOCATION and
LOCATIONALIAS).

View File

@ -88,13 +88,22 @@ void CfgStylecodepunct() {
void CfgStylecodes() {
if(strieql(val, "HIDE")) {
CFG->hidestylies = true;
CFG->usestylies = true;
bool flag1 = false, flag2;
if (strieql(val, "HIDE"))
flag1 = flag2 = true;
else
flag2 = GetYesno(val);
if (cfgingroup)
{
CFG->grp.AddItm(GRP_HIDESTYLIES, flag1);
CFG->grp.AddItm(GRP_USESTYLIES, flag2);
}
else {
CFG->hidestylies = false;
CFG->usestylies = GetYesno(val);
else
{
CFG->hidestylies = flag1;
CFG->usestylies = flag2;
}
}

View File

@ -91,7 +91,7 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
char* punctchars = CFG->stylecodepunct;
char* stylestopchars = CFG->stylecodestops;
char prevchar = ' ';
bool usestylies = dohide or CFG->usestylies;
bool usestylies = dohide or AA->adat->usestylies;
if(usestylies or CFG->highlighturls) {
while(*ptr) {

View File

@ -293,12 +293,12 @@ void IEclass::dispstring(const char* __string, uint __row, int attr, Line* line)
savechar = _buf[endblock];
_buf[endblock] = NUL;
bool oldusestylies = CFG->usestylies;
bool oldusestylies = AA->adat->usestylies;
bool oldhighlighturls = CFG->highlighturls;
CFG->usestylies = false;
AA->adat->usestylies = false;
CFG->highlighturls = false;
StyleCodeHighlight(_buf+begblock, __row, mincol+begblock, false, C_READA);
CFG->usestylies = oldusestylies;
AA->adat->usestylies = oldusestylies;
CFG->highlighturls = oldhighlighturls;
_buf[endblock] = savechar;
StyleCodeHighlight(_buf+endblock, __row, mincol+endblock, false, attr);
@ -308,32 +308,32 @@ void IEclass::dispstring(const char* __string, uint __row, int attr, Line* line)
char savechar = _buf[blockmark];
_buf[blockmark] = NUL;
bool oldusestylies = CFG->usestylies;
bool oldusestylies = AA->adat->usestylies;
bool oldhighlighturls = CFG->highlighturls;
if(selected) {
CFG->usestylies = false;
AA->adat->usestylies = false;
CFG->highlighturls = false;
}
StyleCodeHighlight(_buf, __row, mincol, false, selected ? C_READA : attr);
CFG->usestylies = oldusestylies;
AA->adat->usestylies = oldusestylies;
_buf[blockmark] = savechar;
if(not selected) {
CFG->usestylies = false;
AA->adat->usestylies = false;
CFG->highlighturls = false;
}
StyleCodeHighlight(_buf+blockmark, __row, mincol+blockmark, false, selected ? attr : C_READA);
CFG->usestylies = oldusestylies;
AA->adat->usestylies = oldusestylies;
CFG->highlighturls = oldhighlighturls;
}
else {
bool oldusestylies = CFG->usestylies;
bool oldusestylies = AA->adat->usestylies;
bool oldhighlighturls = CFG->highlighturls;
if(selected) {
CFG->usestylies = false;
AA->adat->usestylies = false;
CFG->highlighturls = false;
}
StyleCodeHighlight(_buf, __row, mincol, false, selected ? C_READA : attr);
CFG->usestylies = oldusestylies;
AA->adat->usestylies = oldusestylies;
CFG->highlighturls = oldhighlighturls;
}
}

View File

@ -140,6 +140,8 @@ void Area::InitData() {
adat->edithardterm = EDIT->HardTerm();
adat->editmixcase = EDIT->MixCase();
adat->forcetemplate = CFG->forcetemplate;
adat->hidestylies = CFG->hidestylies;
adat->usestylies = CFG->usestylies;
strcpy(adat->inputfile, CFG->inputfile);
strcpy(adat->internetaddress, CFG->internetaddress);
memcpy(&adat->internetgate, &CFG->internetgate, sizeof(Node));
@ -292,6 +294,8 @@ void Area::RandomizeData(int mode) {
CFG->grp.GetItm(GRP_EDITMIXCASE, adat->editmixcase);
CFG->grp.GetItm(GRP_EDITREPLYRE, adat->replyre);
CFG->grp.GetItm(GRP_FORCETEMPLATE, adat->forcetemplate);
CFG->grp.GetItm(GRP_HIDESTYLIES, adat->hidestylies);
CFG->grp.GetItm(GRP_USESTYLIES, adat->usestylies);
CFG->grp.GetItm(GRP_INPUTFILE, adat->inputfile, sizeof(adat->inputfile));
CFG->grp.GetItm(GRP_INTERNETADDRESS, adat->internetaddress, sizeof(adat->internetaddress));
CFG->grp.GetItm(GRP_INTERNETGATE, &adat->internetgate, sizeof(Node));

View File

@ -491,24 +491,24 @@ void Reader() {
break;
case KK_ReadStylesNone:
if(CFG->usestylies or CFG->hidestylies)
CFG->usestylies = CFG->hidestylies = false;
if (AA->adat->usestylies or AA->adat->hidestylies)
AA->adat->usestylies = AA->adat->hidestylies = false;
else
reader_keyok = true;
break;
case KK_ReadStylesShow:
if(not CFG->usestylies or CFG->hidestylies) {
CFG->usestylies = true;
CFG->hidestylies = false;
if (not AA->adat->usestylies or AA->adat->hidestylies) {
AA->adat->usestylies = true;
AA->adat->hidestylies = false;
}
else
reader_keyok = true;
break;
case KK_ReadStylesStrip:
if(not CFG->usestylies or not CFG->hidestylies)
CFG->usestylies = CFG->hidestylies = true;
if (not AA->adat->usestylies or not AA->adat->hidestylies)
AA->adat->usestylies = AA->adat->hidestylies = true;
else
reader_keyok = true;
break;

View File

@ -253,7 +253,7 @@ void ToggleTwits() {
void ToggleStyles() {
gkey k;
int setting = CFG->usestylies + CFG->hidestylies*2;
int setting = AA->adat->usestylies + AA->adat->hidestylies*2;
do {
switch(setting) {
@ -267,8 +267,8 @@ void ToggleStyles() {
w_info(NULL);
if(k != Key_Esc) {
CFG->usestylies = (setting & 1) ? true : false;
CFG->hidestylies = (setting & 2) ? true : false;
AA->adat->usestylies = (setting & 1) ? true : false;
AA->adat->hidestylies = (setting & 2) ? true : false;
}
}

View File

@ -464,10 +464,10 @@ void GMsgBodyView::PaintLine(int row, Line *line) {
if(not SearchHighlight(line, vrow, visible_width, highlight_color)) {
if(line->type & GLINE_ORIG and strneql(line->txt.c_str(), " * Origin: ", 11)) {
vputs(vrow, 0, color, " * Origin: ");
StyleCodeHighlight(line->txt.c_str()+11, vrow, 11, not AA->attr().hex() and CFG->hidestylies, color);
StyleCodeHighlight(line->txt.c_str()+11, vrow, 11, not AA->attr().hex() and AA->adat->hidestylies, color);
}
else
StyleCodeHighlight(line->txt.c_str(), vrow, 0, not AA->attr().hex() and CFG->hidestylies, color);
StyleCodeHighlight(line->txt.c_str(), vrow, 0, not AA->attr().hex() and AA->adat->hidestylies, color);
int tlen = strlen(line->txt.c_str());
vputns(vrow, tlen, color, "", visible_width-tlen);
}

View File

@ -278,6 +278,8 @@ struct AreaData {
bool edithardterm;
bool editmixcase;
bool forcetemplate;
bool hidestylies;
bool usestylies;
IAdr internetaddress;
Node internetgate;
bool internetmsgid;

View File

@ -61,6 +61,8 @@ enum {
GRP_EDITMIXCASE,
GRP_EDITREPLYRE,
GRP_FORCETEMPLATE,
GRP_HIDESTYLIES,
GRP_USESTYLIES,
GRP_INPUTFILE,
GRP_INTERNETADDRESS,
GRP_INTERNETGATE,
@ -128,7 +130,7 @@ private:
TYPE_INT,
TYPE_STRING,
TYPE_OBJECT
};
};
int type;
union {