Project

General

Profile

Feature #81 » theme.diff

CR7, 01/31/2009 02:03 PM

View differences:

yaepghd.c
#define EVENT_TIME_FONT THEME_FONT("eventTimeFont")
#define EVENT_DESC_FONT THEME_FONT("eventDescFont")
#define EVENT_DATE_FONT THEME_FONT("eventDateFont")
#define HELP_FONT THEME_FONT("helpFont")
#define HELP_COLOR THEME_COLOR("helpColor")
#define GRID_EVENT_COLOR THEME_COLOR("gridEventColor")
#define GRID_SEL_FG THEME_COLOR("gridSelFg")
#define GRID_SEL_BG THEME_COLOR("gridSelBg")
......
#define TLINE_BOX_COLOR THEME_COLOR("tlineBoxColor")
#define GRID_EVENT_GEOM THEME_GEOM("gridEventGeom")
#define GRID_CHAN_GEOM THEME_GEOM("gridChanGeom")
#define GRID_CHAN_NUM_WIDTH THEME_IVAL("gridChanNumWidth");
#define GRID_TIME_GEOM THEME_GEOM("gridTimeGeom")
#define GRID_DATE_GEOM THEME_GEOM("gridDateGeom")
#define EVENT_TITLE_GEOM THEME_GEOM("eventTitleGeom")
......
#define TLINE_BOX_GEOM THEME_GEOM("tlineBoxGeom")
#define VID_WIN_GEOM THEME_GEOM("vidWinGeom")
#define HELP_BAR_GEOM THEME_GEOM("helpGeom")
#define HELP_BAR_DOTDIAM THEME_IVAL("helpDotDiam")
#define HELP_TEXT_CENTER THEME_IVAL("helpTextCenter");
#define GRID_NUM_CHANS THEME_IVAL("gridNumChans")
#define LEFT_ARROW_WIDTH THEME_IVAL("leftArrowWidth")
#define RIGHT_ARROW_WIDTH THEME_IVAL("rightArrowWidth")
......
AddElement("eventTimeFont", THEME_FONT);
AddElement("eventDescFont", THEME_FONT);
AddElement("eventDateFont", THEME_FONT);
AddElement("helpFont", THEME_FONT);
AddElement("helpColor", THEME_COLOR);
AddElement("gridEventColor", THEME_COLOR);
AddElement("gridSelFg", THEME_COLOR);
AddElement("gridSelBg", THEME_COLOR);
......
AddElement("tlineBoxColor", THEME_COLOR);
AddElement("gridEventGeom", THEME_GEOM);
AddElement("gridChanGeom", THEME_GEOM);
AddElement("gridChanNumWidth", THEME_IVAL);
AddElement("gridTimeGeom", THEME_GEOM);
AddElement("gridDateGeom", THEME_GEOM);
AddElement("eventTitleGeom", THEME_GEOM);
......
AddElement("tlineBoxGeom", THEME_GEOM);
AddElement("vidWinGeom", THEME_GEOM);
AddElement("helpGeom", THEME_GEOM);
AddElement("helpDotDiam", THEME_IVAL);
AddElement("helpTextCenter", THEME_IVAL);
AddElement("gridHorizSpace", THEME_IVAL);
AddElement("gridNumChans", THEME_IVAL);
AddElement("leftArrowWidth", THEME_IVAL);
......
chanInfo[i].nameBox.FgColor(GRID_CHAN_COLOR);
chanInfo[i].nameBox.BgColor(clrTransparent);
chanInfo[i].nameBox.Flags((eTextFlags)(TBOX_VALIGN_LEFT | TBOX_HALIGN_CENTER));
chanInfo[i].nameBox.X(geom.x + (geom.w / 2));
int numWidth = GRID_CHAN_NUM_WIDTH;
chanInfo[i].nameBox.X(geom.x + numWidth);
chanInfo[i].nameBox.Y(geom.y + ROUND((float)i * (chanRowHeight + (float)horizSpace)));
chanInfo[i].nameBox.W(geom.w / 2);
chanInfo[i].nameBox.W(geom.w - numWidth);
chanInfo[i].nameBox.H(ROUND(chanRowHeight));
chanInfo[i].nameBox.Generate();
......
(tColor)0xFF0000FF
};
cYaepgHelpBar::cYaepgHelpBar(void) :
dotDiam(10)
cYaepgHelpBar::cYaepgHelpBar(void)
{
geom = HELP_BAR_GEOM;
dotDiam = HELP_BAR_DOTDIAM;
int boxWidth = geom.w / 4;
for (int i = 0; i < 4; i++) {
boxes[i].Text(tr(helpStrs[i]));
boxes[i].Font(GRID_EVENT_FONT);
boxes[i].FgColor(GRID_EVENT_COLOR);
boxes[i].Font(HELP_FONT);
boxes[i].FgColor(HELP_COLOR);
boxes[i].BgColor(clrTransparent);
boxes[i].Flags((eTextFlags)(TBOX_VALIGN_LEFT | TBOX_HALIGN_CENTER));
int center = HELP_TEXT_CENTER;
if (center > 0)
boxes[i].Flags((eTextFlags)(TBOX_VALIGN_CENTER | TBOX_HALIGN_CENTER));
else
boxes[i].Flags((eTextFlags)(TBOX_VALIGN_LEFT | TBOX_HALIGN_CENTER));
boxes[i].X(geom.x + (i * boxWidth) + dotDiam);
boxes[i].Y(geom.y);
boxes[i].W(boxWidth - dotDiam);
boxes[i].H(geom.h);
boxes[i].Generate();
dots[i].x1 = geom.x + (i * boxWidth);
dots[i].y1 = geom.y + ((geom.h - dotDiam) / 2);
dots[i].x2 = dots[i].x1 + dotDiam;
dots[i].y2 = dots[i].y1 + dotDiam;
dots[i].color = dotColors[i];
if (dotDiam > 0) {
dots[i].x1 = geom.x + (i * boxWidth);
dots[i].y1 = geom.y + ((geom.h - dotDiam) / 2);
dots[i].x2 = dots[i].x1 + dotDiam;
dots[i].y2 = dots[i].y1 + dotDiam;
dots[i].color = dotColors[i];
}
}
}
......
}
for (int i = 0; i < 4; i++) {
bmp->DrawEllipse(dots[i].x1, dots[i].y1,
if (dotDiam > 0)
bmp->DrawEllipse(dots[i].x1, dots[i].y1,
dots[i].x2, dots[i].y2,
dots[i].color);
boxes[i].Draw(bmp);
boxes[i].Draw(bmp);
}
}
yaepghd/default.theme
eventTimeFont="Accidental Presidency;20"
eventDescFont="Accidental Presidency;20"
eventDateFont="Accidental Presidency;20"
helpFont="Accidental Presidency;20"
helpColor=FFFFFFFF
gridEventColor=FFFFFFFF
gridSelFg=FF000000
gridSelBg=FFF8AF31
......
tlineBoxColor=FFFFFFFF
gridEventGeom=154,288,516,234
gridChanGeom=25,288,113,234
gridChanNumWidth=67
gridTimeGeom=154,251,516,32
gridDateGeom=25,251,113,32
eventTitleGeom=144,20,306,70
......
tlineBoxGeom=0,0,9,3
vidWinGeom=456,32,196,130
helpGeom=25,526,645,32
helpDotDiam=10
helpTextCenter=0
gridHorizSpace=4
gridNumChans=7
leftArrowWidth=16
(2-2/2)