XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 8:31 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: May 23rd, 2015, 5:58 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I have this panel with 4 meters for the drives C,D,F,E

Image

As you can see when a drive is not available a "lid" image appears on top.
Could you please help me with the script so I can reproduce this function (and the opposite) with XWidget..?

There is always a Drive "C" so the trick will be for the other 3 images (image1, image2, image3).

Thanks!

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


Top
 Profile  
 
PostPosted: May 23rd, 2015, 12:16 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
One method could be like that used to show and hide USB drive widgets based on when they are connected.
Code:
function diskcore2OnUpdate(Sender)    //triggered every 1.5 seconds
{
  if(diskcore2.IsBlank)    // if USB drive is not connected
  {
    if(image12usb.opacity == 1)      // if it is visible, make it not visible
      image12usb.fadeto(0.0,0.3);
  }
  else
  {
    if(image12usb.opacity != 1)     // if it is not visible, make it visible
      image12usb.fadeto(1,0.3);
  }
}


Top
 Profile  
 
PostPosted: May 23rd, 2015, 12:35 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I will try it and reply as soon as possible mate! THANKS
My laptop has a single drive C:/, so I test the cd and usb drives...

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


Top
 Profile  
 
PostPosted: May 23rd, 2015, 2:24 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Here is the widget meme without your script. I tried to enter it but I didn't see any change..
Keep in mind that the 3 three images to work with are the "up1","up2" and "up3".


Attachments:
rusty_hard_disk(s).xwp [399.84 KiB]
Downloaded 281 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: May 23rd, 2015, 3:39 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Insert this into the function diskcore4OnUpdate(Sender)

Code:
    if(diskcore4.IsBlank)    // if drive letter is not connected
    {
    up3.visible = true
    }
    else
    {
    up3.visible = false
    }


Tested it with my F drive seems to work OK


Top
 Profile  
 
PostPosted: May 23rd, 2015, 3:49 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Actually I had to rename the script to this

Code:
{
    if(diskcore3.IsBlank)    // if drive letter is not connected
    {
    up2.visible = true
    }
    else
    {
    up2.visible = false
    }


to test it with the drive E/usb in my case. And it works!! ;)

I will add the other three and check if will work for the rest...

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


Top
 Profile  
 
PostPosted: May 23rd, 2015, 4:05 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
ALL work PERFECTLY meme! Thanks a bunch!! :D

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


Top
 Profile  
 
PostPosted: May 23rd, 2015, 4:09 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
About the weather widget that I told you in the pm is ready but I need help with the temp rotator. I took the script that you gave me for the "Fusion" widget (where was -50 / 50 degrees).

But in this case the meter goes from -30 to 40 degrees so this script doesn't work properly..

Code:
function tempOnChange(Sender)
{
rotatortemp.Percent = parseInt(accweathercore1.get("${curTemp}"),10) + 50
}


Any ideas...?

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


Top
 Profile  
 
PostPosted: May 23rd, 2015, 5:01 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Quote:
About the weather widget that I told you in the pm
Did not see that PM, please resend.


Top
 Profile  
 
PostPosted: May 23rd, 2015, 5:10 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
meme wrote:
Quote:
About the weather widget that I told you in the pm
Did not see that PM, please resend.

I think that I found it by myself meme! 8-)
I use the same script but I play a little with the rotator start/end angle because in this case the "0" was a bit left and this was the problem. I changed the degrees to 162° - 360°, tested with 10 different cities/temps and seems that work ok now.

Image

Code:
function tempOnChange(Sender)
{
rotatortemp.Percent = parseInt(accweathercore1.get("${curTemp}"),10) + 50
}


A biggggg thanks for your help!

_________________
...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  [ 10 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 17 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