XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 1st, 2025, 4:24 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 19 posts ] 
Author Message
PostPosted: March 24th, 2020, 6:39 pm 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Hello ! :)

Wath is the way for adding external JS file and execute his script ?

I want to make some animation in JS and call it with external code but i find anything...

Thx, and take care ! :)

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 27th, 2020, 6:34 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
The widget uses and run the js added in the Designer. If you found an external js code, you need to edit it according your widget's components , add it to the designer and should work.

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 27th, 2020, 12:51 pm 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Ok but can i call external JS file in XWidget ?

i found lots of code for add external JS file but i didn't work

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 28th, 2020, 3:22 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hey Rom, sorry but I don't understand. You found js codes from sites and you want to use them to XWidget's widget but they don't work?
The key is to modify them according XWidget engine. As you know js is very sensitive and it works under certain form. But this can only be checked in practice. See the widget, check the js code, adjust it etc..
For example @yereverluvinuncleber's are all ported from Yahoo widgets.
memberlist.php?mode=viewprofile&u=1666

I don't know your knowledge about coding but you need help from a person who knows programming language, and unfortunately I'm not the one...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 28th, 2020, 8:23 pm 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Hi

So I'm going to try to be clearer ...
I created a button animation in JavaScript
and I wanted to know if it is possible that I can use this animation from a Java file and not directly in Xwidget?

Call the functions I created from an external file.

thx

My Animation => https://gyazo.com/0add7c2347a95206325659ac27222220
Code:
Doc_Top.AnimateFloat("width",103,0.4,2,6);
   Doc_Left.AnimateFloat("height",36,0.4,2,6);
   Doc_Bottom.AnimateFloat("left",-3,0.4,2,6);
   Doc_Bottom.AnimateFloat("width",102,0.4,2,6);
   Doc_Right.AnimateFloat("top",-2,0.4,2,6);
   Doc_Right.AnimateFloat("height",37,0.4,2,6);

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 28th, 2020, 10:29 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Cool animation Rom!
But this part is what I don't understand: "not directly in Xwidget"
I don't know if this is the answer you're looking for, but all the XWidget widgets can only read the js added directly in the designer. The widgets cannot communicate with external programs or activities- commands.
If you created this js out of XWidget engine, then you have to adjusted to work on the designer. But this is it.

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 30th, 2020, 9:20 am 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Thx Jimking

i have another question...i have a little bug with function OnMouseLeave
from time to time my animation stays in "ON" instead of being in "OFF". Any idea to fix this bug?

screen
https://gyazo.com/0bd3f938b08f4a4ef1da401d837154d4

like on this screen where my mouse is not on the button however the animation remains displayed.

My Code
Code:
function DocBtnOnMouseEnter(Sender)         // ----- ANNIMATION ON ----- //
{
   setTimeout(Doc_Btn_Anim_On(),0.1);
}
function Doc_Btn_Anim_On()                     // ----- ANNIMATION ----- //
{
   Doc_Top.AnimateFloat("width",103,0.4,2,6);
   Doc_Left.AnimateFloat("height",36,0.4,2,6);
   Doc_Bottom.AnimateFloat("left",-3,0.4,2,6);
   Doc_Bottom.AnimateFloat("width",102,0.4,2,6);
   Doc_Right.AnimateFloat("top",-2,0.4,2,6);
   Doc_Right.AnimateFloat("height",37,0.4,2,6);
   DocTxtHover.AnimateFloat("opacity",1,0.4,2,6);
}
function DocBtnOnMouseLeave(Sender)        // ----- ANNIMATION OFF ----- //
{
   setTimeout(Doc_Btn_Anim_Off(),0.1);
}
function Doc_Btn_Anim_Off()                    // ----- ANNIMATION ----- //
{
   Doc_Top.AnimateFloat("width",0,0.4,2,6);
   Doc_Left.AnimateFloat("height",0,0.4,2,6);
   Doc_Bottom.AnimateFloat("left",98,0.4,2,6);
   Doc_Bottom.AnimateFloat("width",0,0.4,2,6);
   Doc_Right.AnimateFloat("top",35,0.4,2,6);
   Doc_Right.AnimateFloat("height",0,0.4,2,6);
   DocTxtHover.AnimateFloat("opacity",0,0.4,2,6);
}


maybe you have idea for force close animation with the OnMouseLeave function ?

Thx

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 30th, 2020, 11:30 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I'm not an expert in JS so in my case I always try to find tricks.
Why not create two animatedpngs with the lines (multiserial images), one normal and one with the reverse movement and assign to them the onmouse over/left tag?
I don't know how it looks but you'll have 2 lines of js code instead of all this.
Another idea is to replace the mouseleave code with the simply force hide all the elements there, and force re-appear with the mouseenter before the animation part.

Code:
xxx.visible = false;
xxx.visible = true;


Btw I'll be glad to upload your work in the official gallery when it's ready. It's always nice having more people who make widgets :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 30th, 2020, 2:30 pm 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
ok i will try with an animatedpng.
otherwise I was thinking of using a gif to see.

Thanks anyway, I'm working hard on this widget :)

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 30th, 2020, 2:55 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Yes, I understand how it feels.. Seems great from your screenshots!
Let me know how it goes, when it will be ready to share :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 30th, 2020, 4:07 pm 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
No problem ;)

I tested with a "pnganimate" and that fixes the bug I had, and you had it reduced my code considerably :)

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 30th, 2020, 5:18 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Great Rom! Glad I helped :)
My limited js knowledge made me think for alternative "tricks". ;)
Keep the great work!

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 30th, 2020, 7:54 pm 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Thx you :D :D :D
https://gyazo.com/5e83e0072974aed521165f691141638f

can make this more speed ?
https://gyazo.com/8f9846c14b36297efa3af53daf48a8bd

realy thx Jim :)

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: March 31st, 2020, 1:31 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
It came up nice as I see!
About the speed, yes you can. The "Interval(MS) controls the speed.
Less value > more speed

In case that you didn't notice, here is also a cool and a bit hidden feature of the Designer

The gears button. You can create single png serial images with one click. ;)

Image

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 31st, 2020, 4:26 am 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Hello :)

I had never seen this little button indeed.
on the other hand obviously I can't get it to work.

I tried with "Combo Images List" but it created an empty image file .....

And with "Clip ImageList" after importing my files, I click on "Create Image List" except that nothing happens ....

I can be missed a step, I do not know because I have never used this tool which seems to be useful :)

Edit :

I have a question
is it possible to change the icon of a "checkbutton" with a "OnMouseEnter" function. Like this.
Media_Play_Btn is the "checkbutton".
Code:
function Media_Play_BtnOnMouseEnter(Sender)
{
   pnganimate1.Inverse=0
   pnganimate1.Play=1
   Media_Play_Btn.srcUnChecked(widgetpath+"\\Media\\play_hover.png");
}

Of course it does not work, but I have not mistake in debug mode.


Attachments:
test..png
test..png [ 120 Bytes | Viewed 26619 times ]

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140
Top
 Profile  
 
PostPosted: March 31st, 2020, 6:29 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Rom wrote:
Hello :)

I had never seen this little button indeed.
on the other hand obviously I can't get it to work.

It's easy Rom. Just tested and works.
1. Click on the little gears button
2. "Combo Images to List" tab > Import
(add all your png images - in numerical order it will be more easy to know the first and the last one)
3. Click on "Create Image List" and save with any name the extracted png.
That's all

(I made a test png from the moon phases)


Attachments:
test..png
test..png [ 351.23 KiB | Viewed 26617 times ]
11.jpg
11.jpg [ 200.44 KiB | Viewed 26617 times ]

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: March 31st, 2020, 6:35 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Rom wrote:
I have a question
is it possible to change the icon of a "checkbutton" with a "OnMouseEnter" function. Like this.
Media_Play_Btn is the "checkbutton".

It's not always easy understand when you don't have the widget in front, but from what I think you want to do , an idea is to use the "Binding Tooltip control" option to make any component visible only on mouse enter
or
if you want to include it in code, you can simply add on top an image/button with your secondary image , make it invisible , and create two separate js codes with again the simple known visible hide/show function for each mouse action.
You can enable the "mouse through" option under "others" tab to not have conflit with the button function below.

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: April 1st, 2020, 1:00 am 
Offline

Joined: September 16th, 2016, 3:30 am
Posts: 68
Hi Jim !

For the Hover effect i use a image simply
and i use "if". :)

Code:
function Media_Play_BtnOnMouseEnter(Sender)
{
   pnganimate1.Inverse=0
   pnganimate1.Play=1
   if (!Media_Play_Btn.Checked)Media_Play_Hover.visible = true;
}
function Media_Play_BtnOnMouseLeave(Sender)
{
   pnganimate1.Inverse=1
   pnganimate1.Play=1
   Media_Play_Hover.visible = false;
}
function Media_Play_BtnOnClick(Sender)
{
   Media_Play_Hover.visible = false;
   playercontrolcore1.cmd(null,"!Play")
}

_________________
// ===== Contact ===== //
https://discord.gg/9vyhv3F

// ===== My Widget ===== //
http://xwidget.com/xwidget/plus/view.php?aid=2140


Top
 Profile  
 
PostPosted: April 1st, 2020, 4:46 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Ok then! The important thing is that it works :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group