XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Drive Info new Widget https://www.bbs.xwidget.com/viewtopic.php?f=8&t=4986 |
Page 1 of 1 |
Author: | Commander-Zero [ September 7th, 2014, 1:57 am ] |
Post subject: | Drive Info new Widget |
Hello, i have to rebuild an old win 7 Gadget with Xwidget called sushi's drive info http://ftparmy.com/images/drive-info-gadget-01.jpg the basic functions I have, hard drive info, progressbar and other widget works well so far. Now I would like that not available disks are not displayed, also the drive will only appear when I plugin a USB stick, external HDD or put a CD in the CD Rom. Something like "show Only When Plugged" The basic framework consists of HDD layer for each drive letter one. https://www.dropbox.com/s/eafcadxfettt94w/widget.JPG?dl=0 can someone help me out here sorry for my bad english |
Author: | hamid [ September 7th, 2014, 3:33 am ] |
Post subject: | Re: Drive Info new Widget |
i have done this before for myself, so i can help for the DiskCore Binding: current DiskCore of Xwidget only support one drive to be select for each core, so you can do one of these: 1. adding a DiskCore for each drive-letter or 2. use one DiskCore and use script code to change the drive-letter used by the core for Creating Objects: 1. you can create Objects manually and bind each object to the core or 2. you can use script code to do the creation and managing them (Visible/Invisible them) for Aligning and Positioning: you should use Aligning to reposition the Visible Objects, current Aligning Feature of Xwidget seems a little buggy to me, so you can write script code to do this if needed |
Author: | hamid [ September 7th, 2014, 9:34 am ] |
Post subject: | Re: Drive Info new Widget |
you can use this code for visible/invisible objects: Code: //Script Author: Hamid function diskcoreOnUpdate(Sender) { if(Sender.get("%DiskType")>1) { eval(Sender.get("%Name")).Visible=1 } else { eval(Sender.get("%Name")).Visible=0 } } Note: 1. you should use function name (diskcoreOnUpdate) in the [OnUpdate] Event of each DiskCore 2. you should change the layer names to drive-letters in UpperCase (C,D,E,F,...) to make them compatible with this code |
Author: | Commander-Zero [ September 8th, 2014, 7:23 am ] |
Post subject: | Re: Drive Info new Widget |
Hi, thank you for your help i will test the Script |
Author: | Commander-Zero [ September 8th, 2014, 8:07 am ] | ||
Post subject: | Re: Drive Info new Widget | ||
Hi, Ok the Script is working Perfect thank you. But now i have a hole in the Widget. Is there an Auto position for each Layer Thanks
|
Author: | hamid [ September 8th, 2014, 10:10 am ] |
Post subject: | Re: Drive Info new Widget |
as i said here: Quote: for Aligning and Positioning: you should use Aligning to reposition the Visible Objects, current Aligning Feature of Xwidget seems a little buggy to me, so you can write script code to do this if needed there is an option named [Aligning] available but seems buggy to me, you can find it here: 1. select an object 2. on the Right-Sidebar (Inspector) goto 2nd tab (Metrics) 3. there is an option named [Align] you can change between different Aligning Options, since i don't use it so much, i don't know exactly which one will work for you, and if it work correctly, but i think the [Top] or [MostTop] can be used for this, try it first, and if it doesn't work correctly, you can write script code to do the repositioning of objects |
Author: | Commander-Zero [ September 9th, 2014, 9:47 am ] |
Post subject: | Re: Drive Info new Widget |
Thank you for your Help now it Works fine. is there a site with a script overview for Xwidget Thanks |
Author: | hamid [ September 9th, 2014, 10:15 am ] |
Post subject: | Re: Drive Info new Widget |
the default script in-use is javascript, some helpful resources are: 1. http://www.w3schools.com/js/default.asp 2. http://bbs.xwidget.com/viewtopic.php?f=8&t=2278 3. browsing the forum and find out what others used ============== Xwidget also supports vbscript, so you can change the script in-use to vbscript if you familiar with it, to change to vbscript you should do this: 1. in the designer, from the widget tree, select [Widget Attributes], 2. from the [Widget Attributes] Dialog, change the option [Script Lang] to [VBScript] 3. after changing to VBScript, you should write the codes only in VBScript language ============ edit: by using [AutoComplete], you can also find most of the things, most of the properties/commands are sorted based on the Inspector's sorting, so you can easily find what you need in code: by finding it in gui and then look for it in AutoComplete |
Author: | Commander-Zero [ September 11th, 2014, 2:46 am ] |
Post subject: | Re: Drive Info new Widget |
Hi, Thanks for the great help. Now i have an other question. how can i use the %Disktype to change the icon of the HDD logo to an USB or CD Logo thanks |
Author: | hamid [ September 11th, 2014, 3:28 am ] |
Post subject: | Re: Drive Info new Widget |
if you have the images, you just need to change their name to the outputs of the tag, the outputs and its its meaning are available in the tag's comment (in AutoComplete) ========= for example, for this one: 1. first, you should name the images like this: output.fileextension it will be something like this: (note that you should use your extension instead of png) 2.png 3.png 4.png 5.png 6.png ------------------ 2. then you should use the tag in the binding format of object, to do this: you should add the tag like this format: %Disktype.fileextension for my example it will be this way: %Disktype.png ----------------- 3. you can also place the files in another path and use the tag like this format: yourpath\%Disktype.fileextension for my example, i placed the files in the "icons" folder inside widget folder, so it will be like this: icons\%Disktype.png |
Author: | Commander-Zero [ September 11th, 2014, 4:46 am ] |
Post subject: | Re: Drive Info new Widget |
Thanks so much |
Author: | Commander-Zero [ September 11th, 2014, 11:36 pm ] |
Post subject: | Re: Drive Info new Widget |
Hi, is there a chance to use A & B with diskcore |
Author: | hamid [ September 12th, 2014, 12:12 am ] |
Post subject: | Re: Drive Info new Widget |
A & B , you mean driveletters for floppy-disks i don't know if Xwidget support it or not, the driveletter associated with the core can be set to the A or B from the code, but i don't have floppydrives to see if it works |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |