XWidgetSoft Forum
https://www.bbs.xwidget.com/

change colour with one click
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=3754
Page 1 of 1

Author:  Jimking [ November 10th, 2013, 4:20 pm ]
Post subject:  change colour with one click

I want to make a widget with a multicolor function like this one:
viewtopic.php?f=11&t=3752

but using an image. Creating a white image in the Designer (background->solid color->white) is it possible to add a click on function so the user can change the color of the image with RGB..?

Author:  meme [ November 10th, 2013, 11:33 pm ]
Post subject:  Re: change colour with one click

Do you mean like this ?

function image1OnClick(Sender)
{
image1.Background.SolidColor.Color = SelectColor(image1.Background.SolidColor.Color);
}

//Note- the change will not be saved unless you save the value in the ini file and load it at startup - SetValue and getinivalue

Author:  Jimking [ November 11th, 2013, 2:35 am ]
Post subject:  Re: change colour with one click

Hi meme. Yes, exactly like this! :D
Thanksssss

Here is the widget that uses this function:
viewtopic.php?f=11&t=3757

Author:  Jimking [ November 11th, 2013, 4:12 pm ]
Post subject:  Re: change colour with one click

And in case of a text meme..??
I try this but doesn't work.. :(
Quote:
function image2OnClick(Sender)
{
text1.Text.FontColor = SelectColor(text1.Text.FontColor);
}

//Note- the change will not be saved unless you save the value in the ini file and load it at startup - SetValue and getinivalue


Also when we want with this simple click on function change multiple texts having the same color we have to add:

Quote:
function image2OnClick(Sender)
{
text1.Text.FontColor = SelectColor(text1.Text.FontColor);
text2...........(same)
text3..........
}

???

Author:  qiancang [ November 11th, 2013, 9:02 pm ]
Post subject:  Re: change colour with one click

viewtopic.php?f=10&t=3684
the attribute name is wrong

Author:  Jimking [ November 12th, 2013, 1:34 am ]
Post subject:  Re: change colour with one click

qiancang wrote:
http://bbs.xwidget.com/viewtopic.php?f=10&t=3684
the attribute name is wrong

Thanks qiancang! I didn't notice this topic...

Author:  Jimking [ November 12th, 2013, 1:43 am ]
Post subject:  Re: change colour with one click

I replaced the script and now works great! :) But there is a command for multi-selection? (ALL the txts will have the same color with one click)
I have these components/texts but using this script the RGB window shows for each txt separately, the user have to confirm x9 times the color...
Quote:
function image2OnClick(Sender)
{
text1.font.fill.color = selectColor(text1.font.fill.color);
text2.font.fill.color = selectColor(text1.font.fill.color);
text3.font.fill.color = selectColor(text1.font.fill.color);
text4.font.fill.color = selectColor(text1.font.fill.color);
text5.font.fill.color = selectColor(text1.font.fill.color);
text6.font.fill.color = selectColor(text1.font.fill.color);
text7.font.fill.color = selectColor(text1.font.fill.color);
text8.font.fill.color = selectColor(text1.font.fill.color);
dot2.font.fill.color = selectColor(text1.font.fill.color);
}

Author:  qiancang [ November 12th, 2013, 2:28 am ]
Post subject:  Re: change colour with one click

text1.font.fill.color = selectColor(text1.font.fill.color);

text2.font.fill.color = text1.font.fill.color;

Author:  Jimking [ November 12th, 2013, 2:35 am ]
Post subject:  Re: change colour with one click

Great! :D
It will be nice if you update the "Attributes and Functions Relevant to Color" topic with this particular, when we want to control more than one txt, so the other users can find it helpful..
Thanks again qiancang!

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