Grouping

For some odd reason when I group a set of objects together they are all moving at the same time, and I’m not wanting them to. The way I use to do it was group them normal so I could have another object to control them but you could still move them independently. Any idea of what I’m doing wrong?
5,879 views 10 replies
Reply #1 Top
You can always move them seperatly by holding down the control. By grouping by definition means they act as one object.

What are you trying to control? Maybe there's a better way of doing it. Scripting maybe?
Reply #2 Top
I have one object toggling the show/hide function on a bunch of little ones all at the same time. Never seem to have a problem with the grouping before not sure what I’m doing wrong this time.
Reply #3 Top
If your object's all have the same parent but are NOT grouped you can move them at the same time by moving the parent and you can still move the child objects independantly. Could that be what you did differently?
Reply #4 Top
The only reason I want to group the little objects is so when I click on the one big object it toggles the show/hide of the whole group of little ones. I don’t want any of the objects to move together. I did this a few years back before I got DX Pro and it worked out fine. What I did was made a whole theme out of DX and on the bar there was a button that when you clicked on it would show/hide all the other objects like the clock, calendar, and the menu access.
Reply #5 Top
Hmm, I think I remember at one time there was an option to not have the objects move as one. There are other options besides grouping:

This script would go in the controller

Sub Object_OnLbuttonUp(x,y,dragged)
If Not dragged Then
'Identify if objects are already hidden or showing
Select Case Desktopx.Object("1").visible
Case True
showhide= False
Case False
showhide= True
End Select
'Set objects visibility
Desktopx.Object("1").visible = showhide
Desktopx.Object("2").visible = showhide
Desktopx.Object("3").visible = showhide
End If
End Sub




Or if you name all of the objects you want to control sequentially like this: object1, object2, object3 etc. OR item1, item2, item3 etc.

Then you could use this script:

Dim numofobjs
'Define number of objects to control
numofobjs = 3

Sub Object_OnLbuttonUp(x,y,dragged)
If Not dragged Then toggle
End Sub

Function toggle
'Check the visiblity of object
Select Case Desktopx.Object("object1").visible
Case True
showhide= False
Case False
showhide= True
End Select
'Reset visibility of objects
For x= 1 To numofobjs
desktopx.Object("object" & x).visible =showhide
Next
End Function
Reply #6 Top
Thank you for the scripts, I am by no means a scripter so I have no clue. In your first example I tried it using opjects p_01, p_02, and p_03, and the main clickable object was called main. The problem I had was it would only work if the objects started out visible, and would not show them on clicking a second time. Another question I have is once these objects are turned into wigets wouldn’t I have to change this Destopx.object(“1”).visible=showhide to wiget(“1”).visible=showhide or am I off my rocker? In your second example I could not figure out what I needed to change to get it to work.

Thank you for taking the time to help me with this.
Reply #7 Top
I can't seem to replicate the problem you're referring to on the 1st script. I set the visibilty of all the objects to 'no' so that they were hidden. Then I inserted the script and it worked. Make sure your "main" object type is set to 'layer' and not 'object controller'. In your other objects, go to Properties > Relation > Popup and make sure it's set to 'static'. Any other settings would interfere with the script.


On the 2nd script I would recommend that you change the names to p_1, p_2, p_3 (instead of p_01 etc.) it won't work otherwise. With that in mind this is how it should look:


Dim numofobjs
'Define number of objects to control
numofobjs = 3 '---Change this number to amount of objects

Sub Object_OnLbuttonUp(x,y,dragged)
If Not dragged Then toggle
End Sub

Function toggle
'Check the visiblity of object
Select Case Desktopx.Object("p_1").visible
Case True
showhide= False
Case False
showhide= True
End Select
'Reset visibility of objects
For x= 1 To numofobjs
desktopx.Object("p_" & x).visible =showhide
Next
End Function



If you are exporting all the objects together as a widget then there's no need to change desktopx.object to widget However if you are exporting them as four seperate widgets then I'm afraid I know of no way for different widgets to communicate with each other through scripts.


Reply #8 Top
Ok on my test objects this second script worked exactly how I needed it to this is awesome, my problem was in thinking I had to add other lines for the other objects in Select Case Desktopx.Object(“p_1”).visible then under that added the same line with p_2 etc. trying to learn this scripting as I go, I want to understand the meaning of each line. The one thing I understood was in the line desktopx.object(“p_&x).visible=showhide the & symbol is like a wild card. Cant wait to get to work on the real objects to test this out thank you for all your help and time.
Reply #9 Top
sVis, these snippets of code that you must spend a ton of time getting to work might go to waste if they are not captured.

Have you thought about adding them to the DX wiki here: http://scratchpad.wikia.com/wiki/DesktopX ?
Reply #10 Top
You're welcome, dreamdesign3d. Keep at it, we've all been there. Wasn't so long ago when I couldn't understand anything in DX, myself.

Be sure to check out w3schools.com for more VBScript information. You can start here at: VBScript Variables and keep going.


EDIT: I'll check it out Zubaz.
EDIT#2: I forgot to mention I just started a blog where I'll be posting some tutorials--sViz at JoeUser