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

image appear/disappear with C,D,E,F drives
https://xwidget.com/bbs/viewtopic.php?f=8&t=5730
Page 1 of 1

Author:  Jimking [ May 23rd, 2015, 5:58 am ]
Post subject:  image appear/disappear with C,D,E,F drives

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!

Author:  meme [ May 23rd, 2015, 12:16 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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);
  }
}

Author:  Jimking [ May 23rd, 2015, 12:35 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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...

Author:  Jimking [ May 23rd, 2015, 2:24 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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 298 times

Author:  meme [ May 23rd, 2015, 3:39 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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

Author:  Jimking [ May 23rd, 2015, 3:49 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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...

Author:  Jimking [ May 23rd, 2015, 4:05 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

ALL work PERFECTLY meme! Thanks a bunch!! :D

Author:  Jimking [ May 23rd, 2015, 4:09 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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...?

Author:  meme [ May 23rd, 2015, 5:01 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

Quote:
About the weather widget that I told you in the pm
Did not see that PM, please resend.

Author:  Jimking [ May 23rd, 2015, 5:10 pm ]
Post subject:  Re: image appear/disappear with C,D,E,F drives

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!

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