Your DesktopX Documentation Resource Guide

Documentation Home

Quick Start

User's Guide

Developer's Guide

Resources

Tutorials


How to use drag and drop and dynamic pictures

  • Make sure DesktopX is in authoring mode. Right click the DesktopX systray icon. If you see "Switch to Authoring mode", then select it.
  • Right click again the DesktopX systray icon and select "New Object".
  • A new object is created and the Properties panel for it is opened.
  • Click New in the Script section of the General tab.

  • The DesktopX Script Editor opens.

  • Now copy and paste the following code into the editor:

Sub Object_OnDropFiles(files)
Object.picture = files
End Sub

  • Close the editor. Click Ok in the Properties panel.
  • Now try to drag and drop some image files over the object. The picture will change accordingly.
  • If you open the object properties again and look into States -> Appearance, Image path, you'll see that the current path changed to the last dragged image.
  • A couple things about the .Picture property: it works in 3 possible ways:
Object.Picture It will read/write the picture for the current state. It is suggested you use this only if your object has one state, use one of the other two methods if you have more states since that better guarantees the expected result.
Object.States("statename").Picture It let you specify the actual state you want to modify.
Object.States("").Picture It'll read/apply the picture to ALL states.

 


7/29 

SkinStudio 6.2 Released

7/25 

A God Has Fallen - New Demigod Trailer Released

7/24 

Sins of a Solar Empire v1.1 Beta has Arrived

7/23 

Stardock Releases New WindowBlinds 6.2 Update

7/22 

Stardock Releases The Political Machine v1.04 with New Characters

7/22 

Stardock Releases MyColors 2.5

7/17 

DesktopX 3.5 Officially Released

7/11 

Corel WinDVD 9 and Painter X Now Available on Impulse!