Object Controllers

Wednesday, May 25, 2005 by steve54 | Discussion: DesktopX

I have created object controllers for other objects that work just fine until I exit the desktop theme and re-enter. How do stop the object that the object controllers are controlling from re-appearing every time I restart my computer or reload the desktop theme? Is there a script I can enter to keep this from happening?
MountainDragon
Reply #1 Wednesday, May 25, 2005 4:38 PM
Steve - I don't know of a way to have the object default to being toggled off (I just tried it), but you could fairly easily make a script that toggles the visibility attribute of the object you want to toggle. Then just set that object to not visble by default, and when you reload DX (or reboot) it will be gone until your script in the controller object sets it to visible. I use this a lot for dialogs and panels.

If this is not clear let me know and I will elaborate on "how to..."
steve54
Reply #2 Monday, May 30, 2005 8:28 PM
MD - Not very good writing script. Would you please elaborate.
Steve
MountainDragon
Reply #3 Monday, May 30, 2005 11:59 PM
First of all, to get in depth with DX scripting, check out the documentation: Link

Now, for the specific thing you need to do, you need one object which will appear and disappear, and one which will control that action.

You need to give the object that will be controled an Object ID. For this example we'll use "PopupOb".

For the controling object you need to create a script. In the script you need to include a callback function:

Sub Object_OnLButtonUp(x,y,dragged)
If not dragged then
If DesktopX.Object("PopupOb").Visible = TRUE Then
DesktopX.Object("PopupOb").Visible = FALSE
Else
DesktopX.Object("PopupOb").Visible = TRUE
End If
End If
End Sub

This will give you the basic functionality you want. To really do the script correctly you should also probably check to make sure the object exists before trying to access it (If DesktopX.IsObject("PopupOb") Then ...)
pjpowell
Reply #4 Thursday, June 9, 2005 10:53 AM
To make an object invisible at startup just right click it and open it's properties from in builder mode. Then change the visible at startup property on the relation tab. (Think it's relation tab, second one along).

Posted via WinCustomize Browser/Stardock Central

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01