XWidgetSoft Forum
http://bbs.xwidget.com/

Calendar font color
http://bbs.xwidget.com/viewtopic.php?f=8&t=6639
Page 1 of 1

Author:  Adiim [ 2017年 Mar 28日 02:48 ]
Post subject:  Calendar font color

i can change some calendar font color like DaysFont & WeekFont color with script code, but i dont know how to change WeekEndDays Color with script code . . . :cry:
can someone help me please . . . :D

Original

Image

function RedOnClick(Sender)
{
Calendar.DaysFont.Color = rgba(255,0,0,255);
Calendar.WeekFont.Color = rgba(255,0,0,255);
}

Image

function GreenOnClick(Sender)
{
Calendar.DaysFont.Color = rgba(0,255,0,255);
Calendar.WeekFont.Color = rgba(0,255,0,255);
}

Image

Attachments:
Help - Calendar.xwp [160.2 KiB]
Downloaded 59 times

Author:  Jimking [ 2017年 Mar 28日 05:53 ]
Post subject:  Re: Calendar font color

I don't know the answer but have you tried to use 'WeekEndDays' or a similar word with the same script..?

Author:  Adiim [ 2017年 Mar 28日 06:07 ]
Post subject:  Re: Calendar font color

yes Jim, i already try word like "WeekEndDays", "WeekDays", "EndDays", but always compile error . . . :(
so hard to find the right word, because Calendar class not available on auto complete script code list . . . ( ͡ ͡° ͜ ʖ ͡ ͡°)

Author:  Jimking [ 2017年 Mar 28日 07:20 ]
Post subject:  Re: Calendar font color

I see.. I will take a look and reply if I found the right form :)

Author:  Adiim [ 2017年 Mar 28日 07:38 ]
Post subject:  Re: Calendar font color

thanks jim, i'll be waiting . . . :D

Author:  Jimking [ 2017年 Mar 28日 08:16 ]
Post subject:  Re: Calendar font color

Adiim wrote:
thanks jim, i'll be waiting . . . :D

I'm searching..
Another way though is to create two calendars (make one with all red and one all green) and use the show/hide function.
You will have the same result ;)

Use this script: (you need to edit it according your design - components)
Code:
function menuitem1OnClick(Sender)
{
  wood.visible = true;
  metal1.visible = false;
  setValue('wood.visible',wood.Visible);
  setValue('metal1.visible',metal1.Visible);
  saveIni;
  menuitem1.checked = wood.visible;
  menuitem2.checked = metal1.visible;
}

function menuitem2OnClick(Sender)
{
  wood.visible = false;
  metal1.visible = true;
  setValue('wood.visible',wood.Visible);
  setValue('metal1.visible',metal1.Visible);
  saveIni;
  menuitem1.checked = wood.visible;
  menuitem2.checked = metal1.visible;
}


function widgetOnLoad()
{
  wood.Visible = getValue('wood.visible',wood.Visible);
  metal1.Visible = getValue('metal1.visible',metal1.Visible);

  menuitem1.checked = wood.Visible;
  menuitem2.checked = metal1.Visible;
}


You can use it for "click on" actions and right click menus/selection
Example:
http://jimking.deviantart.com/art/METEO ... -418174137

Author:  Adiim [ 2017年 Mar 28日 18:23 ]
Post subject:  Re: Calendar font color

well, i already try to create 2 calendar jim, but i want know how to change calendar font color with script code . . . :D
its ok, maybe XWidget next update, calendar function available on auto complete script code . . . :D

Author:  Jimking [ 2017年 Mar 28日 22:58 ]
Post subject:  Re: Calendar font color

I'm sure that there is a way to do it. We just need to find the right form. js is very sensitive and one letter can do the trick. I sent you the alternative way to finish your widget. ;)

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/