Welcome, Guest
Please Login or Register.    Lost Password?

Month and Year %visible%
(1 viewing) (1) Guest
Go to bottomPage: 123
TOPIC: Month and Year %visible%
#14801
Re:Month and Year %visible% 3 Years, 4 Months ago  
The showmonth should work in the time element too:

Code:

<time x="50" y="0" element="font.normal" align="CENTER" format="%B - %Y" showmonth="%Visible_month%" />
Rainy
Moderator
Posts: 5914
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#14802
Re:Month and Year %visible% 3 Years, 4 Months ago  
Thank You Everyone.

anoob - that code worked perfectly.

Rainy - I swear I tried that and did not work for me. I suppose I forgot a closing or SOMETHING when I first tried it. This time I copied your code exactly as posted and I removed all references to the script as well as the script in the folder just to make SURE Rainlendar was loading it without the lua ... but, it DOES WORK!
Rodger
Junior Boarder
Posts: 33
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Manyk Photography Location: Canada Birthday: 05/07
The administrator has disabled public write access.
 
#14809
Re:Month and Year %visible% 3 Years, 4 Months ago  
anoob wrote:
I had run Jorge's code, and find some doubt:

a) Rainlendar_SetEventHandler() can only transfer two parameters, so "function SkinFormatTime_ChangeDate(params, window, userData)" is wrong, it's not working.

b) The lua file is not working when it's first time to draw window.

About the a) item, I based all my scripts on Rainy's previous scripts. I found in photos.lua this two EventHandlers:
Code:

-- Set handlers for mouse enter and leave events
Rainlendar_SetEventHandler(Shadow4_Photos_OnMouseEnter, 7, window)
Rainlendar_SetEventHandler(Shadow4_Photos_OnMouseLeave, 8, window)


and the functions are:
Code:

function Shadow4_Photos_OnMouseEnter(eventData, window, userData) 
function Shadow4_Photos_OnMouseLeave(eventData, window, userData)


What's (or where's) the difference?

On b), when did not work? Really, because it worked for me when I added it, when I refreshed, when i restarted..., but another guy has the same problem with another skin of me and I would like to find a way to solve this.

Another thing: In the way I send the window's name to the function and without splitting it worked for me. Is this a bug? It's the same?

Although the showmonth is the better answer, I'm trying to improve my Lua and Rainlendar knowledge, because in the last weeks my answers seem too odd. I had previously a confusion with the translation of "Settings..." and "Options..." because the two are translated as "Opciones" in Spanish.
Jorge_Luis
Platinum Boarder
Posts: 786
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
The administrator has disabled public write access.
 
#14810
Re:Month and Year %visible% 3 Years, 4 Months ago  
Jorge:

About the a) item:
i am reference help file, it wrote:
"The callback is a normal lua function which gets an event data and the userdata as parameters [function NameOfTheCallback(eventData, userData)].",
so i thought that SetEventHanlder() can only transfer two parameters, but i know i am wrong after saw the photos.lua you say, your way can work also.

Then, i checked the parameters you used, i found
params = eventData <-- it's a table
window = "#SKIN#::#WINDOW#" <-- it's equal "userData" i used
userData = "" <-- it's always empty
so, (params, window, userData) is equal (_, userData).

About the b) item:
it no worked for me when I added it, refreshed, restarted;
i must click a button or press arrow key,
so i add Rainlendar_Redraw(1, window) to make worked.
anoob
Platinum Boarder
Posts: 494
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#14812
Re:Month and Year %visible% 3 Years, 4 Months ago  
Thanks anoob.
I will try the Redraw thing the next time.

about the first, userData is always empty because no value is passed.
After reading your code, I tried this (forget the names, they're just mixed ):
Code:

function SkinFormatTime_Initialize(skin, window)
  Rainlendar_SetEventHandler(SkinFormatTime_ChangeDate, 4, window, "test")
end 
function SkinFormatTime_ChangeDate(params, window, userData)
   if params then Rainlendar_Log("params: " .. params.button) end
   if window then Rainlendar_Log("window: " .. window) end
   if userData then Rainlendar_Log("userData: " .. userData) end
end


The output is:
16:00:11: [1:20:53.156] params: 3
16:00:11: [1:20:53.156] window: Counter Clock::SkinFormatTime
16:00:11: [1:20:53.156] userData: test


So, I think there is a third hidden argument. Maybe its just something missing in the help file.
Jorge_Luis
Platinum Boarder
Posts: 786
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
The administrator has disabled public write access.
 
#14814
Re:Month and Year %visible% 3 Years, 4 Months ago  
I think so.
So, I think the whole syntax should be like this:

Rainlendar_SetEventHandler(callback, event, window, moreData)
function callback(eventData, windowData, moreData)
anoob
Platinum Boarder
Posts: 494
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
Go to topPage: 123
get the latest posts directly to your desktop