This would be easy to remedy if LUA allowed IF..THEN..ELSE statements, but of course it does not.
. . . . .
My basic thinking is something like IF appearance visible="%Show_week_numbers%" THEN element="bitmap.marker-narrow" ELSE element="bitmap.marker" Any idea how I can get this type of results?
First, the today-marker can automatically align the center of the date if you have setting the 'date' and 'today-marker' both are align="CENTER".
Second, your idea is right. Lua can use "if .. then .. (else ..) end" statement. You can use Rainlendar_GetVariable(SKIN, WINDOW, VariableName) to get the values of variable, and use Rainlendar_SetItemValue(WINDOW, ITEM, FIELD, VALUE) to set a new value for the item's field, like :
| Code: |
IsShowWeekNumber = Rainlendar_GetVariable("Shadow4", "Calendar", "Show_Week_nubmers")
if IsShowWeekNumber == 1 then
Rainlendar_SetItemValue("Calendar", "today_ID", "element", "bitmap.marker-narrow")
else
Rainlendar_SetItemValue("Calendar", "today_ID", "element", "bitmap.marker")
end
Rainlendar_Redraw(0, "Calendar")
|