Published on December 6, 2003 By Hus In WinCustomize Talk
Do you think users of this site would find tutorials on DesktopX usefull? Tutorials ranging from how to create browser windows on your desktop, simple system meters...stuff like that. I see a lot of people who may not know about all these features that DX is capable of without needing a drop of graphics skill or programming skill.
Comments (Page 1)
3 Pages1 2 3 
on Dec 06, 2003
https://www.stardock.com/documentation/manual_desktopx.pdf
on Dec 06, 2003
Hmm...yea I guess you're right China, no point in making them if there already is one...
on Dec 06, 2003
Hus, I'm always right
on Dec 06, 2003
...cheap and easy too !!!



Powered by SkinBrowser!
on Dec 06, 2003
sometimes
on Dec 06, 2003
...how 'bout tonight???

yrag sure could use a good ass kickin'



Powered by SkinBrowser!
on Dec 06, 2003
Hey hey hey...get a room!
on Dec 06, 2003
I dunno...You've been out getting some strange lately....I don't want no virii!




[Message Edited]
on Dec 06, 2003
...it wasn't strange...I asked their first name !!



Powered by SkinBrowser!
on Dec 06, 2003
yeah, ok...I feel much better now! Let's get to it...
on Dec 06, 2003
Holy cow...you are easy.....be right there



Powered by SkinBrowser!
on Dec 06, 2003
...... sorry to interrupt you two, but is that pdf doc downloadable, or do I have to be on the site to view it?



Powered by SkinBrowser!
on Dec 06, 2003
Oh shup-up Eric


No
on Dec 06, 2003
Open site and click on save ...



Powered by SkinBrowser!
on Dec 06, 2003
1
The User Guide - Version 2
DesktopX is a program that lets people easily create desktop “objects” (sometimes called
“widgets”). These objects can be combined together to build entire desktops as well as
create micro-programs that extend desktop functionality in many different ways.
It runs on Windows 98, ME, 2000 and XP.
2
Table of Contents
What is DesktopX 2
Enhanced Desktop Icons 3
Desktop Objects 3
Using IconX 4
Basic Configuration - Themes and Objects 7
Creating a Theme 8
Creating an Object 11
DesktopX Settings 30
How to secure your desktop 31
Object Z-Order, Movement, Activation, etc. 32
Object Relationship – Parent, Child, Identity 35
Sending messages to Objects 37
Using Scripts to extend DesktopX 39
Living with DesktopX 46
Living with DesktopX 51
On-Line Support and Content 52
What is DesktopX
There are 4 main uses for DesktopX:
1) It can enhance your existing desktop by giving users the ability to enhance their
existing icons to be much more visually appealing.
2) Users can import or create objects (sometimes called “Widgets”) onto their
desktop that can display information such as stock tickers, sports scores,
calendars, weather info, website info, RSS feeds, etc.
3) Users can “build” their own custom desktop environments for use in movies,
kiosks, power users, or corporate environments.
3
4) With the Pro version, objects can be turned into stand alone executables that
can be distributed (without requiring any support files) to anyone.
In all cases, desktops and desktop objects can be exported and distributed on the net.
There are thousands of objects and themes (a theme is an exported desktop) available for
download on the Internet on websites such as WinCustomize.com.
Enhanced Desktop Icons
Just running DesktopX will bring an immediate improvement to your Windows desktop.
Windows, by default, only allows for a single sized icon choice system wide. That means
if you want to have the standard 32x32 pixel icons in Explorer but would like to have
64x64 pixel icons on your desktop you’re out of luck – unless you have DesktopX.
DesktopX not only allows users to control
the size of their desktop icons but also add
shadows to both the icon and icon label
and make icon labels on the desktop any
size, color, and font they choose.
Moreover, users can set up different visual
options for icons depending on the mouse
event. For example, a user could have an
icon grow to 128x128 pixels in size when
the mouse is over that icon.
Sound effects and visual effects can also
be added to icons in response to mouse
events such as clicking, double clicking,
mouse over, etc.
Desktop Objects
DesktopX extends Windows to support objects right on the desktop. This means that
items on the desktop are no longer limited to being just static pictures (icons). They can
be interacted with and interact with each other.
Users can take these objects and use them to create widgets that display information
about anything that can be pulled from the system or from the Internet.
A user can, for instance, create their own media player without having to program
anything. They could create a news feed from their favorite website and
display it on their desktop without having to learn programming.
4
Developers and companies have been creating “widgets” for the desktop for years. The
difference is that each one was an actual program written in C++ or Java that might take
weeks or months to do. With DesktopX, the same thing could be created in hours because
DesktopX handles all the layout and drawing.
End users don’t even have to do that. They can go to sites like WinCustomize and
download objects/widgets that other users have created and exported to be used by other
people.
Using IconX
When you run DesktopX for the first time you will
get an initial prompt as to whether you want IconX
to control the appearance of your desktop icons, or
whether you want to maintain existing windows
functionality.
There's no reason really to retain standard
functionality so I'd recommend letting IconX do it's
stuff!
After this first prompt if you open the DesktopX
Settings dialogue, you can amend your choice on
the IconX tab.
To open the DesktopX Settings dialogue, you can
double click the DesktopX icon in the system tray.
5
If you click 'Configure' in the above view you will be
presented with a dialogue where you can totally
configure IconX to your liking.
It might look quite intimidating, but really it's very
easy.
If you consider your regular desktop the icons on it
can either be selected or deselected, which is done
by clicking them, or dragging a box around them.
IconX lets you change the appearance of icons in
both these states. In either state the mouse can be
'away' from the icon or 'over' it. In either of these
scenarios, IconX allows you to adjust the
appearance of both the icon and it's label.
This should explain the list of options on the left.
Around this you have a whole range of options which
can be changed for any of these permutations. This
range of customization may seem a bit daunting, but
remember you can you click 'Apply' at any point and
see the impact of your changes on the desktop icons.
Also, you can select from the 'Presets' at the bottom and click 'Load' at any point if you want to get back to
a a predefined style.
To start below, you can specify if you want changes between states to be animated, and if so, over how
many frames. By varying the 'Icon size' of the items's 'Mouse away' and 'Mouse over' state, you can
specify how much the icon 'zooms' when you move over it. The larger the difference, the more frames you
will need to make the transition smooth.
Most of the options on the right should be fairly self-explanitory. For these, checking the box implements
the effect and the slider/text box allows you to specify the degree of effect.
The only option that may be slightly unclear is the 'Merge color' option. If you check this box, and then
select a color, then adjusting the slider gradually fades the colors in the icon from it's default (Blend = 0) to
being completely the merged color (Blend = 255).
'Offset' lets you shift the icon or label away from it's default position. By adjusting this between the 'Mouse
away' and 'Mouse over' states, you can get some quite interesting sliding icon effects!
Remember, once you have some settings you like, you can enter a name in the 'Presets' box and click
save to store them.
6
The next tab allows you to add some
special effects when you interact with
your icons.
You can specify a different effect for
when the mouse moves over the icon,
when it is clicked and when it is double
clicked.
In each of these scenarios, you can
choose a sound and a visual effect to
occur by selecting an item from the lists
on the right.
The final tab allows you to specify a few
parameters which affect how IconX
displays icons.
You can either place icons anywhere, or
check the first option so they snap to a
grid on the screen You can then specify
the size of the grid to adjust spacing
between icons.
Windows can also display special icons
on the desktop. On this screen you will
see a list of these icons, and you can
specify for each one whether you want it
to be displayed on your screen using
IconX.
7
Basic Configuration - Themes and Objects
Before we get too far, we need a quick definition of these elements.
An 'object' is a single DesktopX item which has it's own unique properties
including it's visual appearance and functionality.
Themes are basically large collections of objects which are grouped together,
typically because in combination they provide a collective desktop experience.
Where people have essentially tried to define the complete look and feel of the
desktop they will have created a theme.
DesktopX can either Load or Save themes from the
'Desktop' tab of the DesktopX Settings dialogue. You can
also Import objects here. We'll talk more about saving them
later.
You can download themes and objects from WinCustomize
(www.wincustomize.com). Themes that you download will
have the extension '.dxtheme' and objects will have the
extension '.dxpack'
You should be aware that object packs do not necessarily
contain just a single object. In reality they often contain
several objects grouped together. Most 'objects' are actually
made up of several separate objects that work together. For
example, a media player 'object' would contain separate
objects to play music, stop music, display the song title etc.
8
Creating a Theme
If you are planning to start working on DesktopX objects it is often easier to start
with a blank canvas so you aren't distracted by other objects on your desktop.
The easiest way to do this is to select 'New Theme' from the
DesktopX configuration dialogue that you saw in the last section.
After choosing whether to save your existing theme, you will then
be asked to confirm that you reset all of the existing theme's
elements like wallpaper and work areas.
In the DesktopX settings, you will find all the
theme related items that you can define. These
are ways of ensuring that the user experience of
this theme will be consistent.
On the first tab in this section you can define
elements relating to the user 'Desktop'.
To start with, the 'Theme information' section
allows you to enter some information about the
theme to inform the user what it contains and
give credit to anyone who has supported you.
Below this you have two further options. 'Hide
desktop icons' means that no icons will be
displayed on the desktop, not even IconX
objects. By doing this you can be sure that the desktop will be totally clear. You
can also remove the taskbar from the desktop by checking 'Hide explorer
taskbar'. This will mean that the user has no access to the start menu, running
applications, or system tray unless you create objects to replicate these functions
so you should use this option cautiously.
'Reduce work area' allows you to fool Windows into thinking the desktop is
actually smaller than it is. Why would you want to do this you may wonder. Well,
one example is if you create objects along the edge of the screen, like the
windows taskbar. If you do this without reducing the area then there are two things
that occur; either maximized applications cover your objects so you can't see
them, or your object covers the window so you can't see that. Obviously, you don't
really want this so in this example if you click the 'Work area' button and then
9
check the 'Reduce work area' box then enter a number in the 'Bottom' box to
specify the number of pixels you want to reduce the desktop by. Once you have
done this then applications (when maximized) will not intrude into this space so
your objects are visible.
There is also a 'Resolutions' button so you can specify the screen resolutions
your theme is optimally designed to work with. DesktopX provides some advanced
features to allow you to define how individual objects position themselves
dependant on changes in the screen resolution . This section is definitely optional,
as if you set up the objects properly DesktopX themes should work with different
resolutions. There will be cases however when themes need to work at specific
resolutions. For example, you may have many objects which won't all fit onto a
smaller screen. Where this is the case, then you should check the boxes of all
resolutions at which the theme is designed to work. Whilst this will not stop users
of other resolutions using your theme, it will at least prompt them that the theme
wasn't designed for that resolution, and as such may not look as it was intended
to.
On the next tab, 'Appearance' you can access additional
configuration optiond.
One of the quickest ways of changing the visual user
experience is to use a wallpaper just as you would on a
standard desktop. If you check the 'Wallpaper' box you can
then 'Browse' to find the wallpaper you want. You can use
several graphic formats for wallpaper but using a JPG will
keep the theme as small as possible. You can also specify the
visual style of the wallpaper here, just as you can do in
Windows.
You can also choose to use a 'Solid Color' on the desktop by
checking this option and selecting a color by clicking the
'Change' button.
If you are using the 'Centre' style you may want to use the
'Solid color' option as well, so you can define the color of the
desktop around the wallpaper when the desktop is larger than
the image size.
All your objects can have a text label, so DesktopX allows you to set a default for
these at a theme level so you can ensure that the color and font is consistent with
your theme.
In the 'Labels' sections you can define the color and font in which the label
appears.
In both cases you can choose to use the system defaults as defined in the
Windows Display Properties. Alternatively you can custom define them. In this
case you can choose the default color of labels and the color when the item is
10
selected.
When selecting a custom font, if you are going to distribute the theme to other
users make sure that they will have the font on their machine as well.
11
Creating an Object
OK, so we've done the background work and now it's down to the good stuff. The
majority of the rest of the User Guide is dedicated to objects and all that they can
do. What you'll be pleased to know is that the actual creation of a starting object is
very simple.
There are several ways that you can create a new object.
On the DesktopX Settings dialogue, you can simply click 'New'
on the 'Objects' row at the bottom of the dialogue.
There are two other ways to do the same. If you right click the
DesktopX icon on the system tray you can then select 'New
object' from the menu that appears.
Where you have hidden desktop icons in a theme, you can also
get this menu by right clicking on the desktop.
When you select this a basic object will appear on the desktop
ready for you to customize.
When you do this the 'Object
Properties' dialogue will also be
displayed to allow you to start
configuring your object.
This is where all the fun begins!
12
Basic Configuration - Object Types
The default type of object created is a
'Layer'. A layer object doesn't interact
with the user in any way. There are
several reasons why you may want
objects of this type. They may be a text
label proving information to the user, or
they may just be a graphic enhancing the
visual experience for the user.
To do this click the 'Change' button next to where it
says 'Type of object' in the 'Object properties
dialogue.
This will present you with a list of the other basic
object types you can use without having to even
consider plugins or script.
Typically the chosen activity will occur when an
object is clicked, though the object's 'Start with'
parameter can be changed to alter when this
occurs. More on this later.
We will go through each of these items in turn and
explain how to use them. I encourage you to try them out as you go and experiment with the
functionality on offer. This is the best way to learn.
Different object types will have a range of options. For a layer, you can choose to make it 'Accept Drag
& Drop'. Normally, you can drag files from applications (e.g. Explorer) onto the desktop to create a
DesktopX object which links to that file. If you select this option for a layer, it means that if you drag a
file on top of it, it becomes 'Contained' within that object and moves when the 'Parent' object moves.
A 'Shortcut' allows you to link to a file or a folder on your machine. If you choose a file (e.g.
Notepad.exe) you can add arguments to that link. For example, if the file shortcut was Notepad.exe,
you could add the argument c:\mydoc.txt which would launch Notepad and then open the file
mydoc.txt. You can also how that application will appear when launched (e.g. maximized).
If you choose a 'Folder shortcut', you can either choose a system folder such as the Control Panel, or
you can choose to browse for any folder on your computer. In either case, this will cause an Explorer
window to open displaying the contents of that file.
You can however, check the box below the dropdown menu to popup a menu of the contents of that
folder. You can then click an item on that menu to run that item directly. You can even specify where the
menu appears relative to either the cursor or object itself.
What you should know is that these objects will function like the real target of the shortcut. For example,
if you drag the file c:\mydoc.txt to an object which is a shortcut to Notepad.exe then that file will
open up in Notepad. Dragging a file to a folder shortcut will move or copy the file to that actual folder.
13
A 'URL' object type is similar to the shortcut but it is dedicated to launching webpages in your browser,
so all you need to do is enter the web address (e.g. www.wincustomize.com).
The next object type is the 'Object Controller'.
Objects can interact with other objects and this is a
way to do some of the most common of those
things.
An individual object or groups of objects can be
defined as 'popups', which means that they can be
shown on screen only when they are required. We
will define how to do this later, but at the moment it
is enough to know that you can select one of the
first 2 options here to show or hide the object.
You can also choose to 'Destroy' an object. This
might seem somewhat destructive, but is
sometimes useful. For example, when a theme is
loaded you may want to display a welcome
message to the user. You don't want this after it has been read though, so you
may set it so it destroys itself when clicked.
Obviously these commands mean nothing without specifying which object is the
target of this action. You do this by selecting the object from the 'Target object'
dropdown list.
The 'Taskbar' object offers some immediate functionality. This
transforms the object into a display of the applications running on
your machine.
Obviously there are a few configuration options to adjust how
you want the taskbar to look.
You can choose whether the taskbar runs horizontally or
vertically, and at which end of the taskbar new items are added,
and the size of the icons used to represent the items on the
taskbar.
If you want, you can add labels which display the name of the
application, and choose the color of the text used dependant of
whether the item is selected or not.
The final 4 items really define the structure of the taskbar. The
first item lets you define how much space the maximum size of
each item on the taskbar. Essentially this defines how wide (in pixels) each item will be where 'Use
labels' is selected.
You also need to specify how much space there is between items. The final option allows you to
vertically offset the contents of the taskbar. This may be important depending on the graphic used in
your object. The graphic is defined like any other except you get a customized 'Advanced' option which
you need to make good use of to customize the object. We will get onto this in the appropriate section.
14
Normally, the taskbar just grows and shrinks depending on the number of items in it, but the final option
is a check box that allows you to lock the size of the taskbar. When this option is set the size is defined
by the height or width option on the Object Properties 'Summary' tab (depending on the taskbar
orientation). This value can be an absolute number of pixels (e.g. 400), or a percentage relative to the
screen width (e.g. 80%).
Once you have understood this, the 'System Tray' class is easy, as it used a subset of these options
that creates an object to display the icons in you system tray.
The 'System' class allows you to access some of the other standard Windows
functionality.
Selecting this class provides you with a dropdown list of items from which you can
select. Each of these items has a corresponding Windows dialogue box that will
be displayed when the user interacts with the object.
The final class to explain is the 'DesktopX' class, though it's actually fairly self
explanatory!
This provides you will a list of things to do that relate to DesktopX. You can open
the configuration dialogue, browse for objects and themes and unload DesktopX
(though why you'd want to do that I don't know!).
OK, well done, you've conquered the basics. Now lets start making the objects
look cool!
15
Basic Configuration - Other Object Basics
The object is now created in a rough form, but
now is an opportunity to run through the other
basic elements relating to objects before we
move onto more complex things.
The first thing you can do is to add a text label to
your object. You simply do this by entering the
label text into the 'Label' box at the top of the
General tab.
If you want to explicitly set the 'Label color' just
hop over to the Relation tab, and at the bottom of
it you will see 2 buttons where you can set the
color of the label depending on whether the
object is selected or not. Clicking the button
offers you the choice of using the default color as
set in the DesktopX Settings ... Theme Settings
... Labels area, or defining a different color
specifically for this object.
16
If you look at the 'Summary' tab of
the object, you will see a range of
other parameters that you can
change.
Here, you can tweak the objects
position and size as well as assigning
a 'Tooltip' message that appears
when you hover over the object.
In the 'Description' section you can
add some information to the object in
order to identify yourself as it's
creator, and also add any comments
that you feel may be useful to new
users of the object.
Most of the content of the 'Origin'
section we will cover in the Interaction
sections, but for now, the 'Object ID'
is important for you to learn about.
This is a unique identifier for the
object. It is crucial to assign a unique name to the object for a range of reasons.
Any time you deal with object interaction, all types of which we will come onto later
you need to identify the object you want to interact with so it must be identified
using the 'Object ID'.
Even before you get onto object interaction you will quickly understand the need for this when you try to
use the 'Object Navigator'. This is a tool that allow you to see all the objects within your theme, along
with their properties.
To open the Object Navigator, right-click the DesktopX icon in the Taskbar and click Object Navigator.
The Object Navigator will show you all your objects, relationships they have with other objects, position
and size, z-order and images used. It is not designed to tell you everything, but rather a summary
17
reference that you can use to identify and tweak objects.
You can select objects using this interface by clicking on them. Use the SHIFT and CTRL keys to select
multiple objects. You can also right click an object to access it's properties, just as you would by right
clicking the actual object on screen.
Image the chaos if you didn't use the Object ID property and all the objects were called !!!
Another useful thing to remember is that when an object is selected you can move it by using the cursor
keys to fine tune it's position. If you hold down the 'ctrl' key at the same time then the object will move
by 10 pixels at a time in the direction specified.
18
Basic Configuration - Importing & Exporting
OK, you've learnt the basics of creating objects, but now you need to know how to
import and export Objects and Themes.
First thing to note quickly, is that though it's a great idea to save your work
frequently, every time you unload DesktopX, the current work on the desktop will
be saved and then reloaded next time DesktopX is reloaded.
One of the best ways to learn about DesktopX Objects and Themes is to learn
from the work of others.
DesktopX comes with several objects and themes installed by default, and there
and many thousands of other objects available online. Sites such as
WinCustomize have great sections for both objects and themes. Click 'here' to
visit the Objects library and 'here' to visit the Themes library.
Importing Themes and objects couldn't be
easier!
Earlier on you will have been introduced to this
dialogue box which is shown when you open the
DesktopX settings by double clicking the
DesktopX icon in the System Tray.
To Load in an entire Theme or an Object, click
'Load' on the appropriate row of buttons.
Both of these will present a similar dialogue box
to the one you see below.
19
If you click an object/theme to
select it, you can then click
'Load' to load the theme of
import the object into your
current theme.
You can also choose to click
the 'Browse' button in order to
find objects or themes
elsewhere on your machine.
There are 3 buttons on the left
side of the dialogue. The first
2 allow you to switch between
your object and theme
libraries.
The third is a quick shortcut to the Wincustomize website so you can get more
objects and themes online.
Once you've created your great new object or theme you need to be able to save
them, either for your own personal use or so you can distribute them to others.
Saving a theme is quick and easy. In the DesktopX Settings dialogue above, all
you need to do is click the 'Save As' button. You will then be prompted to specify
and name for your theme and choose where you want to save it. At various
locations, you may see a 'Save' option along side the 'Save as...' option. This
simply saves details of your existing theme to the hard drive so if anything went
wrong with your machine, DesktopX would be able to restore to this position when
reloaded.
Exporting objects is also really
easy. To do this, the first thing to
do is select the object(s) you want
to export.
You can do this on the screen by
dragging a rectangle with your
cursor. A selection area will be
highlighted and those objects
selected will take on a 'blue tint'.
20
You can also do this
by selecting the
objects in the Object
Navigator.
Once you've selected
the objects you can
right click one of the
selected objects and
Click 'Export
Selected'. If any of the
objects you selected is
part of a group then you will be prompted to save any other members of that
group as it is unlikely that you would want to export only part of a group.
After doing this, all you do is specify a name and location for the Object Pack and
then it is saved.
Remember that you can upload your work to the WinCustomize website. By doing
this others can benefit from your creations and you may get feedback from users
that helps you develop in the future.
21
Enhancing Objects - Object Appearance & States
OK, there's no getting away form it - this section is a big one in which you will learn a
lot!
Don't worry though, you can take it bit by bit, and after this section you will be well
armed to create some visually stunning objects.
First of all you need to understand what 'states' are. DesktopX does not restrict you
to having one way that an object can appear. Under different circumstances the
object can have a different appearance. Each different appearance is referred to as
a 'state'.
The default state is 'Mouse away' which is how the object looks when the cursor is
not over the object. Unless you create any other states, this is how an object will
look at all times.
First we will go over the basics of what you can
define in a 'state' and then we will return to looking
at the creation of additional states.
Below the list of states you will notice a series of
tabs. The tab shown by default is 'Appearance' so
that is where we will start.
An object can fundamentally have two different
types of 'Appearance', either 'Image' or 'Text'.
For an image, as you can see on the left, you can
choose an image already in the theme by selecting
it from the drop-down list, or you can Browse to find
a new image. Images of various types are
supported (BMP, ICO, PNG and TGA).
When you same images they are saved as
rectangular images, but obviously you don't want to
be restricted to rectangles for your images. Both PNG and TGA images allow you to
include transparency information with the file, which means that although the saved
image may be a rectangle, the actual image that you see on your screen can be any
color you want.
22
The first image on the right is a PNG image created in Macromedia
Fireworks with a checkerboard effect showing the transparency.
When this image is used in DesktopX all transparency is preserved
and the background shows through as you can see in the second of
the images.
DesktopX even allows this sort of effect in image formats that don't
support transparency such as BMP. In these image formats,
DesktopX will interpret the color referred to as magic pink to be
transparent. 'Magic pink' is pure pink with an RGB value of
255,0,255.
Although using this method you can't have a graduated transparency
as you find in the PNG example, you can make a close
approximation. Note, that you need hard crisp edges as if you 'antialias'
to soften the object edges, your object will have a pink glow as
these colors are not pure 'magic pink'.
One final advanced tip for you. If you're forced to use BMP images
'magic pink' for transparency there is a final enhancement you can
make to achieve graduated transparency like PNG files can provide.
What you need to do is double the height of your source image and in
the lower half use grayscales to indicate the level of transparency.
This is best explained by looking at the image on the right.
Black represents total transparency, and the closer you get to white
the more the object will appear.
If you use this graphic normally you will see the grayscale part, so you need to go to
the transparency tab and check the box as shown below
23
Once you have selected the image to use you can
distort the image by entering a width and height for
the image in the appropriate boxes. By checking the
'Lock ratio' box you can ensure that the object is
proportionally resized.
Desktop is not content with skewing objects in such
a brutal fashion, so provides an advanced tab to
allow you to resize the image more intelligently.
Clicking the 'Advanced' button brings up the
dialogue on the left. This allows you to specify
different scaling horizontally and vertically. At each
edge you can specify a number of pixels that you do
not want to stretch and then you can choose to
either Tile (repeat) or Stretch the area in between.
For example, if you have an image that is 40 pixels by 30 pixels and you want the outer 5 pixels at each
edge to remain unstretched, then the corresponding values A-D would be 5, 35, 5, 25.
You could then choose to either tile or stretch the area in the middle.
If you choose a 'Text' state then the
configuration options change to a
more simple set.
You can enter the text you want in the
text area, and set it's alignment in the
dropdown 'Alignment' list.
To further customize your text, you
can specify the font (including style
and size) and color in which the text
will appear.
If you want, you can specify that the text has a border by clicking the box and
selecting a border color. By having a colored border and setting the text color to
'Magic pink' you can create text which is purely an outline.
We will come onto the 'Animation', an d
'Messages' tabs later, but the remaining four
allow extra tweaking of your image.
The 'Transparency' tab allows you you make
the whole image partially transparent (in addition
to any transparency specified in the image).
You have a 'No transparency' or you can specify
the percent opacity of the image. In the example
shown the object will be 40% visible (60%
transparent).
The final option allows you to vary transparency
24
as the object animates but we will discuss that in the appropriate section.
If you choose a 'Text' state then the
configuration options change to a
more simple set.
You can enter the text you want in the
text area, and set it's alignment in the
dropdown 'Alignment' list.
To further customize your text, you
can specify the font (including style
and size) and color in which the text
will appear.
The 'Shadow' tab allows you to display a drop
shadow on the object giving it the appearance of
floating above the desktop.
If you click the use button you can specify four
parameters to customize the shadow.
A low 'Sharpness' value gives a crisp edges
shadow whereas a high value makes it softer.
The higher the 'Darkness' value the darker the
shadow will be.
'Height' affects the distance between the object
and the shadow, whilst the 'Angle' options
determines the angle at which the shadow falls
from the object.
One of the coolest features of
DesktopX is the ability to change the
color of things without replacing the
image. In the 'Color' tab you can
adjust the objects hue (color) by
selecting a value between 1 and 255 .
Experiment until you find a shade you
like! Setting the value to 0 will set the
object color to that of it's original
image.
You can further fine tune the color by
tweaking it's brightness and contrast across the specified ranges.
We will come onto additional states later but note that the is a button here to quickly
apply the change you have made to all different states of the image.
25
The final tab that we will cover in this section is
the 'Sound' tab. Here you can specify that a
sound is played when the state occurs simply by
browsing to it on your hard drive.
Although we will discuss animation later, you can
see options for looping the sound when the state
is animated. You can choose to repeat the
sound once with every loop of the animation,
loop continuously irrespective of where in the
animation you are, or not loop at all.
You now know the basics of configuring a single state object. A multi-state object is
no more complicated.
To add a new state simply click the 'Add' button. You will then be presented by a list
of the common states not yet used from which you can select:
Mouse over - occurs when the user moves the cursor over the active part of the
object (as defined by the 'Activation' option on the 'Relation' tab.
Mouse down - occurs which the user presses down the left mouse button over the
object
Mouse up - occurs when the left mouse button is released whilst over the object
Show - occurs when the object appears on screen (either when loaded or via script)
Hide - occurs when the object is removed from the screen (either when unloaded or
via script)
Command executed - occurs when the object is activated as defined by the 'Starts
with' option on the 'Relation' tab.
You can then configure this state just as you did for the first one. One thing to
remember is that all the images used must be exactly the same size.
The other buttons in this are should be fairly clear as to what they do. Obviously the
'Remove' button removes a created state though you obviously need to have one
state for an object.
Once you have spend time setting up the first state, the likelihood is that other states
will be fine tuned versions of that state, so for speed you can use the 'Copy From'
button to copy the settings from another created state to the currently selected one.
The 'Reset' button clears all modifications in the currently selected state so you can
start again.
When you create a state the drop-down list shows you the states that exist by
default in DesktopX, but you aren't just limited to these. In the drop-down list box you
can just type any name in and a 'Custom State' of that name will be created which
26
can be configured just like any other.
Though these states are not triggered by user interaction they can be activated by
Messages and Script which we will come onto later and are very useful for that
purpose.
The one final thing to define in a multiple state object is the 'Default Appearance'.
On the 'General' tab you can specify the image to be used when the object first
loads. This will not change until the object is interacted with in some way. Note that
this image must be the same size as all the other state images.
Enhancing Objects - Animating Objects
Whilst everything you learnt in the previous section was great, there's nothing that
catches the eye like movement, so DesktopX makes it easy for you to add animation
to your objects.
The animation tab is where you can
define how your object animates.
The first thing to explain is that there
are the two different types of
animation that DesktopX can do.
A 'Static animation' is the most simple
option. This simply changes the level
of transparency rather than the image
itself.
Slightly more complex is a standard animation with different images over time.
To start with a 'Static animation'. To start with, set a number of frames. A frame is
an individual part of an animation, so the higher the number of states the more
different 'images' an animation has. Once you set this value higher than '1', the
'Interval' is enabled. This is how long each part of the animation lasts in
milliseconds. The higher the value the longer the animation takes. For example, a 5
frame image with an interval of 50ms will take 250ms (1/4 of a second). You also
need to check the 'Static animation' checkbox so that DesktopX knows not to expect
an animated image, just to vary transparency.
If you check the 'Loop' box then the animation will be repeated as long as the object
is in that state. Normally if the state changes then the animation will play through to
the end, but if you check the 'Interuptable' box then to state will change immediately
without playing to the end.
27
After that you simply need to set the direction in which the animation will fun by
selecting one of the 4 options
available.
If you are looping the animation it will
probably make sense to choose one of
the bottom pair as this will lead to a
nice smooth pulsing transparency
effect.
The final thing that you need to do is
specify the change in transparency.
This is where you get to use the third
option on the 'Transparency' tab. Here
you specify how the transparency
varies in one cycle of the animation. This will then be impacted by the animation
style you chose and whether you chose to 'Loop' the animation.
Try experimenting with these options and see how they change the appearance of
the object.
Now, on to actually animating the image itself rather than just transparency.
Though I said that this is more complicated, it still isn't actually that difficult. The change you need to make
is to combine all the frames of the animation into your source image.
What you need to do is place the frames of the animation side by side from left to right.
The above is the source image for a six frame animation of the DesktopX logo being worked on in
Fireworks. There are six 100x100 images next to each other in one 600x100 image.
If you run this forwards then the image will increase in size.
Once you have done this then just change the other settings as you were shown for the 'Static animation'.
This includes transparency so you can change both the image and the transparency over the course of an
animation.
28
Enhancing Objects - Using Plugins
DesktopX is a flexible program that opens itself up
to developers who can create 'plugins'. These are
additional models providing packaged functionality
that you as a user can access.
To create an object based on a plugin simply
create an object as normal, then in the 'Additional
Abilities' section of the 'General' tab, click the
'Add' button.
This will then pop up a list of available plugins on
your system like the one below.
All you need to do is select the
plugin you want to use, and then
click OK.
Each plugin needs to be configured
differently but we will go through a
few examples of the different types
here.
Digital Clock
This plugin when used immediately creates a
digital clock on your desktop.
In a plugin the developer can create customization features to tweak the plugin. If you select the plugin on
the 'Additional Abilities' list the 'Configure' button will be enabled.
Clicking this allows brings up a dialogue which allows you to change the time format and the font and color
in which it is displayed.
Digital Clock (Text State)
This plugin shows a different way the developer can implement the same type of
29
functionality but give more flexibility to the user. When this is used the immediate impression may be that
nothing has happened.
However, if you go to the 'States' tab and check 'Text' on 'Appearance' then all or a sudden you have a
digital clock on your desktop. What's cool about this implementation is that it uses standard DesktopX text
so you can tweak the text any way you like including shadows, and it is exposed to manipulation via script
such as the ability to change it's color dynamically.
Email Notify
You can configure this plugin by entering your mailbox details and how often you want
to check. The way it works it to create two new Custom states (you recall we
mentioned these earlier?) called 'New mail' and 'No new mail'. You can define each of
these states to be representative of whether you have mail of not. The could be images
or simply different text.
You may even decide that it makes sense that rather than this object being a 'Layer' it is a Shortcut to your
email program.
Performance Meters
This delivers dynamic graphics to your desktop that would be difficult to create otherwise.
You can chart CPU and other performance measures in a range of graphs and a range of
colors, all accessible via the 'Configure' button. Tweak to your hearts content! Remember
that 'Magic pink' provides transparency. Also remember that 'magic pink' doesn't work in gradients because
most of the pink in the gradient isn't 'pure' and hence 'magic'.
DX Player
This delivers complete interaction with your media player be it ObjectMedia, Winamp or WMP.
You can define what happens when the user interacts with the object, even to the degree of whether they
are holding down any keys.
In some cases images are needed and you
can define them here as well such as gauges
for volume etc.
I'm not going into the detail of the plugin here.
Check out the 'Sputnik' player that comes by
default with DesktopX to see what can be
achieved with this plugin.
30
If you need to remove a plugin, simply select the plugin in 'Additional Abilities' and click 'Remove'.
DesktopX Settings
DesktopX has a series of options which you can tweak to change the environment to
your liking. It makes sense to go through them now as some of these affect the
things we are going to discuss in later sections.
To access these settings, open up the DesktopX Settings by double clicking the
DesktopX system tray icon, and then click the DX Settings tab. There are 2 sub-tabs
('DesktopX', and 'Security') which we will now go through one at a time.
The 'DesktopX' tab allows you to configure the
basic elements of how DesktopX works.
The first, 'Start command on' allows you to
define how many times a user needs to click an
object before the command associated with the
object is executed.
You can also define whether by default objects
can be moved by dragging in the 'Default
movement' section.
Also on this tab, there are a series of checkboxes,
the purpose of which is fairly obvious.
There is an option to set the quality of the text
antialiasing (smoothness against the background). The higher you set this the better
it is. In theory, it makes DesktopX work harder, but I've not really noticed any impact.
Having set that, the default text is really good so I see no need to change this.
The final option here highlights a fairly cool feature. Normally, if desktop icons are
enabled, dragging an application to the desktop from Explorer will create a link to
that object. However, if you disable Desktop icons then dragging to the desktop
actually creates a DesktopX object, based on the icon for the application itself. In the
'Object creation on dragging' setting you can specify how big the object will be,
and whether to add a text label to display the application name.
31
How to secure your desktop
In certain environments, security is important, and
DesktopX provides a range of security options to
secure the computer. Checking these boxes stops
the user from doing a range of things that put
machine security at risk when DesktopX is
running in User mode.
User mode? DesktopX has two modes of
operation, 'User' mode and 'Edit' mode. In User
mode the objects that have been created cannot
be edited. To switch mode you right click on the
DesktopX icon and select 'Switch to xxxx mode'.
There is also a button to allow you to specify a
password. This will be requested when the user
tries to switch to Edit mode to prevent them changing the theme or security settings.
These settings are not fool proof, but they will certainly prevent all but the hardiest of
individuals from manipulating the theme.
You can also Remove the Logoff button to further enhance security by stopping the
user switching to another user profile that may be less secure.
Normally, each user who runs DesktopX on a single machine can have their own
personal theme. However, in a managed environment, this is not particularly
desirable. The final option allows you to ensure that all users use exactly the same
theme.
Through use of these features, you will find that DesktopX is the ideal solution for a
managed desktop, be it parental control, a standard corporate desktop, or kiosk
functionality.
32
Object Z-Order, Movement, Activation, etc.
You've already learn about how the objects you create can interact with the user,
and will soon learn how they interact with each other.
DesktopX allows you to tweak how they interact with users, but also how they
interact with the desktop and other applications on screen.
To access these settings, open up the Object Properties dialogue and then click the
'Relation' tab.
If you consider a desktop, then all
objects on there have an 'x' and 'y'
position which defines where they are
on the screen. What you might not
consciously have thought about is their
'Z-Order'. This defines which object or
application appears 'on top' of the other
when they overlap. Objects with a
higher Z-Order appear on top of those
with a lower Z-Order.
You have three Z-Order options for your
objects. The first is 'Desktop'. This
means that running applications will
always appear above your objects. They
will open on the desktop. Those
interacted with most recently
(clicked/moved), will be on top of other
objects.
A 'Normal' Z-Order means like the
object will behave like a miniapplication.
Objects with a 'Normal' ZOrder
appear above or below applications and other 'Normal' Z-Order objects
depending on which were interacted with most recently.
An 'Always on Top' Z-Order means that this object will always be visible above all
applications and objects. It functions in the same way as the 'Always on top' setting
of the default Windows taskbar.
'Movement' can be defined as 'Normal' or 'Locked'. If it is 'Normal' then the user
can drag the object around the screen. If 'Locked', this is not possible. The user can
33
still move the object by holding down the CTRL key and dragging, but accidental
movement is not possible. You can also choose the 'Default' mode, which means
that it's movement is defined by the User's DesktopX Settings as we discussed in
the last section.
'Activation' defines how the user can interact with the object. If the setting is
'Default' then it simply follows the user's settings, but you have three other options.
'Rectangular' activation is based on the size of the source graphic and ignores any
transparency in the object, whereas 'Visible Area' means that only those areas of
the object visible on screen can be interacted with. The final option 'None' means
that the user cannot interact with this object and any attempts to do so are ignored.
This is usually most important for cosmetic objects on the desktop.
'Start with' defines the way in which a user interacts with an object. It is not always
the case that you want a user to have to click an object to activate it. In addition to
the standard 'Default' option, you have four more ways in which a user can interact
with the object. Sometimes for example you may simply want the user to move over
an object for something to occur.
OK, now onto 'Popups'. These are a really cool feature in DesktopX that we briefly
mentioned in the Object Types section.
You don't always want objects to be visible on the screen, you you can set them to
be 'Popups' whose appearance on screen is controlled by other objects that have
the 'Object Controller' type.
If you don't want an object to be a popup, this option should simply be set to 'No',
but if you do then you have 5 more options. We will look at the way each of these
works below, but the best way for you to experience them is to have a go for
yourself.
'Static' popups - Normally, an Object Controller will toggle the appearance of a
popup (open it or close it depending on whether it already is visible). Once these
'Static' popups are opened they must have a different Object Controller to the
original one to close them. Think of them like a normal program. Clicking a link to a
program will open it, but clicking the link again will not close the application. A
separate 'Object Controller', the close button, is required to do this.
'Toggle' popups - Are the simplest types. If the popup is hidden when you click the
Object Controller it will be shown. If the popup is visible when you click the Object
Controller it will be hidden.
'Menu' popups - These popups once displayed, will only remain until the user
interacts with the desktop in anyway. They have this name because they function
just like menus; unless you click them immediately to carry out the function they are
34
there to do they disappear.
'Volatile' popups - Once a 'Volatile' popup is shown, it will remain until either the
controller is toggled or another popup is opened.
'Volatile (No toggle)' popups - This is just like the previous version, except that
toggling the Object Controller is disabled like in a 'Static' popup, so the only way to
make it disappear is to activate another popup.
By default, popups are hidden but in certain cases you may want them visible. To do this, simply check the
'Initially visible' option.
Whilst we will come onto Groups (several objects collected together for ease) in a minute it's worth noting
here that once you set one object in a Group to be a popup, all other objects in the Group become a popup
as well, so they all popup or hide together.
When you are developing for yourself you
will design everything so it fits your screen
perfectly. So, what happens if you change
your screen resolution or you give your
work to another user who runs at a
different resolution?
Well, DesktopX can make a fairly good guess but it is certainly not perfect, so if you
are going to make good objects you should pay attention to the two options you see
above.
By specifying values in here, you can define how the object will reposition itself
when the screen resolution changes. DesktopX logs what resolution the screen was
designed on and therefore detects changes and reacts according.
The 'Dock to Left' and 'Dock to Right' options mean that the object will remain the
same distance from that edge as it was when originally designed.
'Dock to Nearest xxxx Border' means that the object will align itself to the nearest
edge of the screen (vertical or horizontal depending on option). For example, if you
have an object against the tight edge of the screen then increase the resolution, you
run the risk that it will end up floating away from the new edge.
An object that repositions based on the 'Center' option will be relatively the same
distance from the center of the screen as it was in the resolution for which it was
developed.
The final option 'Rescale' means that the object will be relatively the same distance
across the screen at different resolutions. For example, and object positioned at
200,200 on an 800x600 screen would be positioned at 320x341 on a 1280x1024
screen (25% across, 33% down).
35
Object Relationship – Parent, Child, Identity
When developing you will soon realize that many of the best objects are created by
several objects working together. For example, consider a simple 'button' made up
of a single image. Whilst this may be a good object, it's not very flexible. For
example, if you want another similar button you have to create an entire new
graphic; text on the button cannot be changed dynamically, the font cannot change,
if you share the object it may not be relevant.
Now, consider creating that button from a background image and a separate text
object. All of a sudden it is much more flexible as the text element can easily be
changed and all the above problems are gone.
One problem that remains however is the fact that you need to ensure that these
objects work together as a single unit. Groups, Parents and Children make this very
easy.
If you want several objects to work
together is to assign them to the same
'Group'.
An object's Group is defined on it's
Summary tab. Any predefined groups
are available in a combo box so you an
allocate an object to that, or you can
simply type in a group name to create a
new group. Alternatively you can select
one of more objects, right-click and click
Group from where you can get the same
options.
Once a group exists, objects within that
group share some basic functionality.
All objects in a group move together, so
as you drag one, all other objects in the
group move at the same time. Note, that
you can hold down CTRL when
dragging to just move that single object.
Also, as we saw earlier, popups work well with groups. All objects in a group popup
36
or hide together.
Note that you can remove an object or objects for a group by selecting 'Ungroup' on
the right-click menu, or clearing the content of the 'Group' field in it's properties.
'Parent / Child' relationships are slightly more intimate in that a Child is directly
affected by changes made to it's Parent. Again, in the same section there is a
'Parent' drop-down list where all the other objects in the theme are listed. Simply
select one of them and your current object becomes a child of that object.
If a Parent is hidden or moved then the same is applied to the Child. Also, a Child
will also be shown higher in the z-order than (above) it's Parent. You might initially
think that this is excessive when Groups work in almost the similar way. Consider
however, that this saves so creating many named groups to manage where they are
unnecessary, it provides increased control over the z-order and also that it provides
increased flexibility to control visibility within a group without affecting the whole
group.
One added option you have for a Child is to make it 'Contained'. This means two
things. The first is that it's position is defined relative to the Parent object not the
screen. This makes positioning within the parent easier. Also, the object is only
visible while it is in the confines of the Parent object. Nor that this is based on the
actual rectangular size of the object, not defined by the visible area.
Contained Children also make DesktopX more efficient and therefore should be
used wherever possible.
37
Sending messages to Objects
Sending Messages in DesktopX is actually a really simple concept to understand
and simple to achieve.
In summary, sending messages means
when a user interacts with one object,
cause one or more different objects to
react. Consider a light in your room.
When you flick the switch it changes
state, but also the light bulb itself
changes state. When you flick the
switch, a message is sent to the light
bulb which also changes state.
Sending messages is very simple.
Simply, go to the 'States' tab of the
object you want to send then message
from, select the state which you want to
occur in order for the message to be
sent (e.g. Command executed) and then
click the 'Messages' tab.
Once you have done this click the 'Add'
button to pop up the messages
dialogue.
38
There are two things to define in this
dialogue; the Destination and the
Message to send.
The 'Destination' is the object to
which you want to send the
message. For example in the
example above the object to which
we would be sending the message is
the Light Bulb.
You have two options here. The first
is to send the message to every
other object in the theme. You
should use this option very carefully
as obviously in a large theme this
could cause several objects to change state at once and you may end up with a
massive cascade of state changes, or even a loop you can't get out of if objects
send messages to each other.
The more likely option is that you will be sending a message to a specific object, in
which case you should select that option and choose the object from the list.
The second thing to define is the message itself. The drop down list will show a list
of the default messages from which you can select. Alternatively, if you know of a
custom message that has been set up for the destination object you can send that
message by typing in the name of that message.
You can add as many messages as you want and an object can send different
messages in different states - e.g. it may send one message when the mouse is
over an object, and a different one when the mouse moves away from the object.
That's it - sending messages is that simple and the results can be really impressive.
39
Using Scripts to extend DesktopX
By now you should realize just what amazing results can be achieved using
DesktopX. DXScript takes things to an entirely new level!
Whilst DesktopX is flexible, DXScript allows a user with a hint of programming
experience to really extend the possibilities of what you can do.
DXScript allows you to program in either VBScript and JScript, two of the most
simple and common languages available. This document is not designed to teach
you how to program these languages, we assume you know the basics. If not, I
suggest you take a little time to learn and then you can join the fun. Before you
recoil in fear at the works 'programming' and 'script', this is not a trip into the world of
the uber-geek. Let me say this once and say it loud - "Learning DXScript is not
hard!".
Adding script to objects is very easy. Simply open up the Object Properties dialogue
of the object to which you want to add script and on the General tab you will see a
button saying 'New' in the Script section.
Clicking this brings up the
dialogue you see on the left.
You will note that the main
window is prepared for you to
start entering script, but
before we do that let's look
around the 'Script' menu.
Under this there are three
sections. The second one,
'Language' allows you to
specify whether you want to
program in VBScript or
JScript. Whilst both work in
pretty much the same way,
we will be using VBScript
examples here.
Once you have decided on a Scripting language you are ready to go. This is where
you start to need a bit of scripting or programming knowledge.
As with most programming languages, everything is based around a series of
40
Events and then Methods and Properties are used to make things happen.
By default two events are created. You will also see comment lines (starting with ' )
that explain when they occur. So lets get scripting straight away in the traditional
way!
Edit the script to display the following:
Sub Object_OnScriptEnter
MsgBox "Hello, World!"
End Sub
Sub Object_OnScriptExit
MsgBox "So Long, And Thanks For All The Fish!"
End Sub
Note that the indents on the code are just for clarity. If you now close the script you
will now have an object the pops up a message every time the script is enabled or
disabled. OK, so this is a bit fake because you're enabling the script and disabling
script, but in the real world this will pop up a message when DesktopX loads (and
the object's script is enabled), and a message when DesktopX unloads (and the
object's script exits).
One of the other key Events is Object_OnStateChange(state). This identifies when an
object switches from one state to another and allows script to be run at that time. By
querying the state that has arisen, script can be run in response to that. In the below
example, the script pops up a message if the user activates the object (the
'Command executed' state).
Sub Object_OnStateChange(state)
If state = "Command executed" Then
MsgBox "You activated me!"
End If
End Sub
Note that you can also check for Custom Messages, and not just the default states
that exist.
The final state that needs discussing here is the Object_OnTimer event.
DesktopX can create timers which mean that script can be run at set intervals.
Although we will be discussing object methods later, we need to use one here.
Before a timer event can run you need to define that timer by using an Object.SetTimer
command. In this command you give the timer a unique numeric identifier and
specify the interval (in milliseconds) at which the timer will run.
In the below example a timer with the identifier 12345 is set up when the script starts
to run every 10 minutes (600000 milliseconds). Each time this timer occurs, the
41
script flashes up the current time using the VBScript command Time().
Sub Object_OnScriptEnter
Object.SetTimer 12345, 600000
End Sub
Sub Object_OnTimer12345
MsgBox "The time is " & Time()
End Sub
Now that we have discussed events, obviously you can use any VBScript or
JavaScript within an event, but to properly interact with DesktopX you need specific
Methods and Properties. More detail and examples are also available in the
DXScript Reference, but we will discuss some of the basics here to get you started.
To start with you need to know how to refer to objects and then we'll move onto the
things you can do with them.
To refer to the current object (i.e. the one who's script you are editing), simply use
Object.xxxx. For example, Object.Left = 200.
To refer to another object in the theme you use DesktopX.Object("ObjectName").xxxx. For
example, DesktopX.Object("Button").Left = 200.
Now, let's look at what you can do with them.
Object Basics
Object.Name
Object.Parent
Object.Visible
Through use of these commands you can set an
objects name, though it is more likely you will want to
retrieve the name of an object or it's parent.
Object.Parent is used to retrieve the entire object
model of the parent, so you can refer to the object
The 'Visible' property is most useful allowing you to
show or hide an object without the use of popups or
messaging.
Examples:
1) MsgBox "This object is called " & Object.Name
2) Msgbox "This object's parent is " & Object.Parent.Object.Name
3) Object.Visible = False
42
Object Creation / Destruction
Object.Clone "newname", xpos,
ypos
Object.Delete
This allows you to either duplicate or delete
the specified object. You may for example
want to delete temporary objects such as
instructions once the user has taken note of
them.
Examples:
1) Object.Clone "myobject", 300,200
2) If Msgbox("Delete object", vbYesNo) = vbYes Then Object.Delete
Object Positioning
Object.Top
Object.Bottom
Object.Left
Object.Right
Object.Move
Object.Rotation
With these positioning properties, you can explicitly set
or retrieve the location of one side of the object.
If you want to reposition an object, the most efficient
was to do it is via 'Move' To do this you specify x and y
coordinates in pixels of where you want to place the
object.
You can also rotate an object using Object.Rotation.
Examples:
1) Object.Top = 500
2) Object.Move 500,200
3) For x = 1 To 10
Object.Rotation = x*36
Object.Sleep 200
Next
Object Size
Object.Height
Object.Width
With this command you can retrieve or redefine the
actual height and width of the object. Obviously this will
stretch the graphic used until it reaches this size.
Examples:
1) Object.Height = 120
2) Object.Width = Object.Width * 2
43
Object Color
Object.Hue
Object.Brightness
Object.Contrast
If you want to dynamically change the color or
brightness of an object, it is easy to do with these
commands. Simply set a value of 1-255 for hue, or -
128 - 128 for hue and brightness. Set it to 0 to remove
any previously made changes.
Examples:
1) For x = 0 To 255
Object.Hue = x
Next
2) Object.Brightness = -30
3) DesktopX.Object("anotherobject").Contrast = 40
Object State
Object.State
Object.StatePreempt
Through use of Object.State you can change or retrieve
the state of an object. This is one of the most common
commands used in script as it is used to trigger objects
to act certain ways. Object.StatePreempt should be used
when you want to set a state immediately without
waiting for any animations etc to complete.
Examples:
1) If Object.State = "Command executed" Then ...
2) x = DesktopX.Object("anotherobject).State
3) DesktopX.ScriptObject("scriptedobject).Object.StatePreempt = "Hide"
Object Text
Object.Text
Object.TextColor
If your object is a text object rather than an image, you
can set/retrieve the text or it's color via these
commands. The text value is most easily set using an
RGB value separated via commas.
Examples:
1) If Instr(Object.Text, "Data") Then Msgbox "String found"
2) Object.TextColor = RGB(120,200,255)
Script Timers
Object.SetTimer As discussed earlier, the Object.SetTimer sets an
44
Object.KillTimer
Object.Sleep
event and an interval to which you can then add code
to run at the predefined interval. If you need to stop a
timer running you can use KillTimer to stop it. e.g.
Object.KillTimer 12345 will stop any code in the
Object_OnTimer12345 event from running.
Object.Sleep stops code running temporarily for a
defined period of time. For example Object.Sleep 1000
will wait for 1 second before continuing to run.
Example:
Sub Object_OnScriptEnter
Object.SetTimer 12345, 600000
End Sub
Sub Object_OnTimer12345
MsgBox "The time is " & Time()
End Sub
Sub Object_OnScriptExit
Object.KillTimer 12345
End Sub
Data Storage
Object.LocalStorage
Object.PersistStorage
When coding it is often useful to store information
which can be retrieved and used as required. To store
data you need to give the data a unique reference (for
that object) and set it's value. For example
Object.LocalStorage("MyZip") = 48152 would place the value
48152 in a storage variable called MyZip. The
difference between the two types is that LocalStorage
data is only stored when the object is loaded, and is
destroyed when the object is destroyed or unloaded.
PersistStorage data is saved with the object and is after
an object has been saved and reloaded.
Example:
Sub Object_OnScriptEnter
If Object.LocalStorage("MyZip") = "" Then
Object.LocalStorage("MyZip") = "48152"
End If
Object.SetTimer12346, 3600000
End Sub
Sub Object_OnTimer12346
GetWeather(Object.LocalStorage("MyZip"))
45
End Sub
Sub Object_OnScriptExit
Object.KillTimer 12346
End Sub
Function GetWeather(zip)
...
End Function
Another set of properties can be retrieved about the actual system on which
DesktopX is running. This allows you to retrieve information and perform actions
dependant on the value.
Cursor position
System.CursorX
System.CursorY
These returns the current coordinates of the mouse
cursor.
Example:
1) Object.Text = "X:" & System.CursorX & " Y:" & System.CursorY
Pixel color
System.PixelColor This returns the color of the pixel at the specified
coordinates.
Example:
hexcolor = Hex(System.PixelColor(System.CursorX, System.CursorY))
red = Right(hexcolor, 2)
green = Mid(hexcolor, 2,2)
blue = Left(hexcolor, 2)
Object.Text = CStr(CLng("&H" & red)) & ", " & CStr(CLng("&H" & green)) & ", " &
CStr(CLng("&H" & blue))
Connectivity
System.InternetConnected
System.Ping
Many good examples of DXScript objects make use of
the Internet, so it makes sense to detect whether
access to the Internet is available. You can also check
the speed of access to a web address (ping) by using
System.Ping.
46
Examples:
1) If System.InternetConnected = False Then Msgbox "Go online"
2) x = System.Ping("www.wincustomize.com")
Desktop Size
System.ScreenHeight
System.ScreenWidth
System.VScreenHeight
System.VScreenWidth
System.VScreenTop
System.VScreenLeft
These parameters return a range of information about
the desktop size. System.ScreenHeight and
System.ScreenWidth return the height and width of the
primary monitor. On a multi-monitor system
VScreenHeight and VScreenWidth return the total desktop
size.
Also in a multi-monitor setup, you can use
System.VScreenTop and System.VScreenLeft to
determine the position of the top/furthest left pixel
relative to the primary monitor.
Examples:
1) Msgbox "Desktop res: " & System.ScreenHeight & "x" & System.ScreenWidth
2) Msgbox "Total res: " & System.VScreenHeight & "x" & System.VScreenWidth
3) Object.Left = System.VScreenTop + 50
Living with DesktopX
The important thing about DesktopX is to remember that it is just a tool. It allows you to
extend your desktop in any way you wish. You can use it for doing a lot or very little.
Because of its flexibility, Stardock has focused on making sure DesktopX, by default,
uses very little in system resources (memory and CPU). This way, even if you just use it
to have nicer icons, it’s using up very little memory. At the same time, you can use it to
add all kinds of new functionality right on your desktop or even build a secure, custom
desktop that still uses relatively little in memory and CPU resources.
47
DXScript - ActiveX Controls in DXScript
The power of script is enhanced by the ability to display ActiveX controls on the
desktop instead of using images or text. You can then manipulate these using
scripts.
For example, imagine an Excel spreadsheet, Windows Media Player, Combo box,
Web Browser all embedded on your desktop. All are possible and very easy to
create.
In the DesktopX Script Editor, the first
option on the script menu is 'ActiveX
Control' from which there is a 'Select
Control' option.
We'll look at how to create one of these
controls now.
From the list that appears when you
click 'Select Control', choose a control
and then click OK. In our examples
below we will use the 'Microsoft Web
Browser' control.
As you will see below, the Script Editor immediately changes to reflect your choice.
On the right of the editor you will see a preview of the object, and below that you will
see the properties of that object.
48
Note that the ActiveX Control menu item now has a 'Properties' option where you
can toggle to display of this extra information.
If you close the editor via the close button top right or via
'File ... Exit' you will now see a control on your desktop.
You will see that as you move your mouse over the object
the cursor changes. You can move the control or resize it
using the black handles at the edge.
If you right click the object, you will notice a new item, 'Script Enabled' at the
bottom of the list. This is the place where you can toggle the script between a
'running' and 'not running' state. At the moment it is not running which is why the
resize handles are visible. Click 'Script Enabled' to toggle the running state and you
will see these disappear.
OK, so at the moment it's a dull white box, not very exciting, but nevertheless it's a
control and we're about to ramp up the excitement. Let's go back to the editor.
If you right click the control you will note that nothing happens. This is because you
are effectively right clicking the Web Browser control, not a DesktopX object. Hold
down CTRL so the resize edges appear and right click. You will see that the script is
49
enabled because of the check mark next to that item. Click the Edit Script item and
the dialogue will reappear.
OK, try changing the script you see to the one below:
Sub Object_OnScriptEnter
Control.Navigate2 "www.wincustomize.com"
End Sub
OK, so exit out of here and enabled the script. Caboom - all of a sudden you have a
genuine webpage on your desktop!
You will note from this that scripting is basically the same for Controls as it is for
regular objects. The only real difference is that when referring to the ActiveX control
you use the Control prefix. Note that you can also use Object methods and properties
in the script but these refer to the host object. For example Object.Visible in an object
containing an ActiveX control would hide that object and hence that control.
Each ActiveX control
will expose it's own
properties and these
are displayed in the
autocomplete feature.
This makes it really
easy to start coding
for a control.
In addition to this it is useful to know which events are associated with a control.
With this, we are able to react to events occurring in the control. DesktopX provides
a tool to do just this. In the Script Editor, go to the Script Menu and select 'Event
Wizard'.
50
Select the event you want to add and click OK to add it to your script. Click 'Done'
when you have added all the events you want to.
You can now add script to that event. For example:
Sub Control_DocumentComplete(pDisp, URL)
Msgbox "Finished downloading the page " & URL
End Sub
Now, you will be advised when the page is completely loaded.
One final thing you should know is that DesktopX installs three controls by default.
There is an Edit control (to allow you to accept and react to user input), a Push
Button control (which acts just like a regular button), and a Check Box control (to
give you an on/off switch).
Each of these controls have specific events and properties associated with them.
PushButton Control
The PushButton control allows you to use a regular push button for interaction
with your scripts.
Properties:
Caption: The text caption of the button.
Enabled: Whether or not the button is disabled.
Events:
OnClick: Fired when the button is clicked
CheckBox Control
The CheckBox control allows you to use a regular checkbox for interaction
51
with your scripts.
Properties:
Caption: The text caption of the checkbox.
Enabled: Whether or not the checkbox is disabled.
Checked: Whether or not the checkbox is checked.
Events:
OnCheck(variant checked): Fired when the checkbox is checked or
unchecked
Edit Control
The Edit control allows you to support text-based user input without dependency
on 3rd party controls.
Properties:
Text: The text of the control.
MultiLine: Whether the control is single line or multi, with scrollbars
ClientEdge: Whether the control has a client edge
Border: Whether the control has a border
Events:
OnKeyPress(key): Fired when a key is entered, returns the ASCII value of the key.
Methods:
ScrollToEnd(): Scrolls to the bottom of the text.
Really that's all you need to know about adding ActiveX controls to DesktopX. The
possibilities now open to you are unlimited!
Living with DesktopX
It is important to remember that DesktopX is a tool. It exists to allow you, the user, to
customize your Windows desktop environment in whatever way you wish to.
How much or how little of it you use is up to you. You can use it just to have nicer
desktop icons or you could use it to provide a real time update to how much of your
network’s bandwidth is being consumed. You can use it to display family photos on your
desktop or use it to build a secure corporate kiosk.
In all cases, DesktopX has been designed to use as little memory and CPU resources as
possible.
52
On-Line Support and Content
More Documentation: http://www.desktopx.net/howto.asp
DesktopX objects on the net:
https://www.wincustomize.com/skins.asp?library=3
DesktopX themes on the net:
https://www.wincustomize.com/skins.asp?library=31
DesktopX discussion on the net:
News://news.stardock.com/stardock.desktopx
3 Pages1 2 3