I am a newbie, so I am not certain if this can be done. Is it possible to do say something like Object1.Left + 5 in the Left of another Layer object?
Comments
on Oct 12, 2005
Not sure I understand your question.

If you want to place an object relative to another object, the easiest, but inflexible, way is to assign one object to be a child of another. When you do this, the X and Y numbers will be relative to the top left corner of the parent object. And this can be done from the Summary tab of the objects' properties--no script needed.

If you want a bit more dynamic control, you could use script. The exact syntax would depend on your object names and which one had the script, but it might look something like this:

BaseLeft = DesktopX.Object("BaseObject").Left
BaseTop = DesktopX.Object("BaseObject").Top
DesktopX.Object("SatelliteObject").Move BaseLeft + 5, BaseTop + 5


Just in case you don't have it, here's a link to the DXScripting PDF, https://www.stardock.com/products/desktopx/docs/3x/DXScripting.pdf


good luck!
on Oct 12, 2005
Many thanks.

I was originally referring to the first method that you mentioned. Just to check and make sure that I have my thoughts right on this. If I set the parent property on the summary tab then the Left and Top property numbers represent the offset from the upper right corner of the parent object? If this is the case then what I am I doing wrong in the following test I tried?
1) I created a new object.
2) I went to the summary tab
3) I set the parent object to be another object on my screen(at position Left-110 Top-120)
4) I set the Left on the 'new' object to 10
5) I set the Top on the 'new' object to 30
6) I used the apply button to apply changes to my new object
Results : The 'new' object positioned itself relative to the top right corner of my screen(not it's parent object)

I did not have the link. I am looking at it now


Posted via WinCustomize Browser/Stardock Central
on Oct 12, 2005
There are a couple things I didn't mention about Parent-Child.
Not only must you define the parent object as you did, but you must also set Child to "Yes" (also on Summary tab)for relative positioning to work. But, when Child is set to "Yes", the child object will be contained within the parent--any graphic that would extend beyond the parent's edge will not show (be clipped).

Also, you sometimes have to set the values twice, as DX goes through it's error checking (It will ask if you really want to make it a child and give it some whack X and Y values, then you set final numbers)>

It's a bit confusing, and experimenting is the best way to figure out how things will behave, but...

When ObjB has ObjA set as parent, with Child set to "No", you can move ObjB around without moving ObjA. But if you move ObjA, ObjB will also move, relative to its parent.

When ObjB has ObjA set as parent, with Child set to "Yes", you can move ObjB around, within the confines of the border of ObjA. Moving ObjA will again bring ObjB along with it.

Variations of Parent and Child Yes/No are handy when you have objects that will stay in position relative to eachother, but you might want to move them as a group. And other uses.

In this case it sounds like you can keep it pretty simple. If your parent is at (110,120), set the new object to (115,125), set its parent, but keep child at "No" (unless you mean for it to always stay completely within the boundaries of parent). Now, on the second obj's relations tab, set movement to "Locked". You won't be able to move it (with the mouse) anymore, but when you move the parent, the other will move along with it.

This wouldn't be so confusing if a different term was used for the Child Yes/No value-like Contained (which is used in list view). I think that should be changed, just for clarity in discussing such things, but I digress.

Keep experimenting, and you'll catch on to how these relationships work!
on Oct 12, 2005
Also, whew, there is the Group attribute to consider. Objects in the same group will move as a group when dragged (you can usually Ctrl-Click to drag an individual). The Parent-Child (Contained Yes/No) relationships can mimic this but they also establish Z-Order (what is on top of what) so I generally use P-C myself, and only use groups for reference and orginization.
on Oct 13, 2005
Thank you for this very detailed explanation. I am the 'techie' in the house. To give a more detailed explanation of what I was doing, I am converting the Warcraft 1280 to a 1024 resolution for my wife. It had no relationships between the items(most of which I think really should have been parent child). I have speculations on why this may not be(mostly based around the feature history of desktopX). The author had used the group structures to relate the objects.

Could you please give me more detail on how the zorder is handled in P-C relationships. I seem to have problems maintaining this properly in some of my conversions.

Also since some of the objects are handled by Object Controllers, I am having trouble with some of his 'backplanes' or backgrounds for different objects randomly displaying or not displaying like they should if the group is turned on using the controller button.

Should I just give up on the parent child and move into code? If so what 'event' should I hook to set my properties. (If this is in the pdf, sorry... I have not finished reading it yet).

Many thanks for these pointers. This is the first desktop conversion(or creation) I have done. Due to this I am still very much learning about this software.

My main intent with this software was just to be a consumer as I have little to no graphics ability. I do have strong programming skills in 'structured' langs(pascal, c, etcc...). I digress with that comment though. One wish I do have is that more people would actually post the desktops, and stuff they make. It would give more selection to people like me who have almost no graphics ability


Posted via WinCustomize Browser/Stardock Central
on Oct 13, 2005
coderwolf - First, I'm a bit puzzled by your wish for people to submit their desktops, etc. since if you look in the DesktopX libraries here (Objects,Themes, and Widgets) there are many to choose from.

On z-order: It seems to be somewhat random within children of a given parent, perhaps based on creation or update order, but you can set it by right-clicking and using the Z-order options. If you look at the Object Navigator (context menu for DX, List Objects), you will see the order explicitly.

On your question about scripting, if you just want to use the script to make sure of your object positioning, you can use Object_OnScriptEnter. The "Parent" object can set all of the children then, if you like. It can also be done based on other events.

Here's an (online) slightly more updated version of the docs: Link
There are tutorials included there also.

More tutorials: Link

And here's a link to my latest theme, which has many examples of scripting: Link
on Oct 13, 2005
MountainDragon,
I am by no means putting down what is available, I just wish there was more (a typical wish from many people I am sure). There are some posted on the forums that I do not see get posted. I am sure there are many reasons for this. Many of them are gorgeous, but I they are not available for download. I am sure there are many reason why this is. Ranging all the way from no time to ownership of images, etc... I see and applaud the efforts of the stardock development team to create a forum to handle a VERY STRONG ( I feel) Niche market area (resources to make that theme are available online, but some may not have been postable by the creator, so the reader can compose the theme themselves).

I was really hoping to know of a 'system' the z-order tended to use. If it is truly random, then I know that I can manually set them (hoooh boy ) I have not looked in object Navigator yet for the Z-Order yet (would do it now, but a program is tied up working so I cant get to the desktop). I wish that Z-order was shown with a numerical layout rather than a fixed 'set' type value. 3 values make it hard to tell exactly where you are in the z-order sometimes.

With the scripting, I was looking for more of an 'on_display' and 'on_hide' kind of thing.

Thanks for the links, I will check them out (and learn all I can ).

BTW, I love you latest addition for the contest as well(looks like the same one you made the link to). I have already downloaded it for the house.



Posted via WinCustomize Browser/Stardock Central