Multiple Questions

Taskbar, Sliding, Auto-grids

Hi everyone. I'm new to desktop x and have a few questions.

1. I have a PNG taskbar image that I want to use that contains the taskbar and 'taskbar selected' button if you will. I do not know how to configure this image to create a taskbar. I just get my image all stretched out with missing pieces, etc.

2. How do I get a layer with icons on it (for example a custom programs list) to slide out from off the desktop and into the center of the screen?

3. Is there a way to auto-grid dragged and dropped icons, or make lining them up easier?

Thanks in advance for your responses!
4,885 views 4 replies
Reply #1 Top
There are some good tutorials here:

https://www.wincustomize.com/articles.aspx?aid=145066
Reply #2 Top
For question # 1.

Your image should have 3 parts: base image (background), normal button, selected button. (In that order) For me, it usually helps if all three parts are of equal length. Also, for the life of me I can't get anything but a bitmap to work.




Now, when you first set the object type to taskbar make sure all your settings are set the way you want it. *If you're going to use a fixed size make sure to set the width in the summary tab when you're done.*



Next, go to States > Appearance. After browsing for your image, click on the 'Advanced' button.



Take a look at the example image and apply the explanation to your own image. I've put the two images together and you can see the how the margins look in Photoshop with the guides and pixel rulers.



A = The left margin of the base image (the background of your taskbar). It will usually be anywhere from 2-10 pixels in from the very edge.

b = The right margin of the base image. Again 2-10 pixels in from the right edge of the base image.

c = Where your normal button image starts; the very edge.

d = The left margin of your normal button image; 2-10 pixels in from the left edge.

e = The right margin of your normal button image; 2-10 pixels in from the right edge.

Once you've determined all that, you can then input the information into the marked fields. (See image above)

A = Left margin of base image
C-B = Distance between the right margin of the base image and the left edge of where your normal button image starts. (Probably anywhere from 2-10 pixels, depending.)
C = Where your normal button image starts.
D = Left margin of normal button
E = Right margin of normal button

So if your taskbar image is 300 pixels wide, and each image is 100 px (base, normal, selected), you'll wind up with something like this:

a = 10
c-b = 10
c = 100
d = 110
e = 190


Lastly, set it to 'stretch'.

Apply and check out the results. If you take the time to get all the parameters correct you shouldn't have to do much adjusting and re-adjusting. But if it's not appearing correctly go back, review your image sizes, calculate the parameters, and make the adjustments.

Hope this helps.
Reply #3 Top
Thank you, very much, for posting this. I have been trying to figure this out for months. :CONGRAT:  :CONGRAT:  :CONGRAT: 
Reply #4 Top
Your welcome. :)

Re-reading this thread got me thinking about that auto-grid function, so I decided to try it out. Came up with this rough script (goes in the main object)

Code: vbscript
  1. 'Called when files are dropped onto object
  2. Sub Object_OnDropFiles(files)
  3. object.SetTimer 1, 100
  4. End Sub
  5. Sub Object_OnTimer1
  6. gap = 28 '--padding between icons
  7. i = 1
  8. For Each elem In object.Children
  9. elem.name = "icon_" & i
  10. i = i + 1
  11. Next
  12. For x = 1 To object.Children.count
  13. If x = 1 Then
  14. DesktopX.Object("icon_" & x).move 10,10
  15. Else
  16. lastx = DesktopX.Object("icon_" & x-1).right + gap
  17. lasty = DesktopX.Object("icon_" & x-1).top
  18. If lastx => object.width - gap Then
  19. lastx = 10
  20. lasty = DesktopX.Object("icon_" & x-1).bottom + gap
  21. End If
  22. DesktopX.Object("icon_" & x).move lastx, lasty
  23. End If
  24. Next
  25. object.KillTimer 1
  26. End Sub



The only problem with this is that it moves the icon and not the label. It'd be great if we could control the labels from script but as far as I can see there's no way to resolve this.

Anyone else have any ideas?