Your DesktopX Documentation Resource Guide

Documentation Home

Quick Start

User's Guide

Developer's Guide

Resources

Tutorials


Fancy checkboxes

This tutorial won't go step by step but instead will show you how state filtering works starting from an existing demo.

  • Download the demo here and import it as objects inside your theme.

  • You'll see three buttons. Try to mouse over them and click on them. You'll see they behave like check-boxes. They have a selected state (green outline) and a fading in-out unselected state (yellow outline dissapearing on mouse away).
  • We got this button working by basically creating a custom Mouse over / Mouse away behaviour.
  • This is the full script used into the outline object:

Dim toggled

Sub Object_OnScriptEnter
toggled = False
End Sub

Sub Object_OnLButtonUp(x,y,bDragged)
If bDragged = False Then
  If toggled = False Then
    Object.State = "Selected"
    toggled=True
  ElseIf toggled = True Then
    Object.State = "Unselected"
    toggled=False
  End If
End If
End Sub


Sub Object_OnStateChange(newstate)
If toggled = False Then
  If newstate = "Mouse away" Then
    Object.StatePreempt = "Unselected mouse away"
  ElseIf newstate = "Mouse over" Then
    Object.StatePreempt = "Unselected mouse over"
  End If
End If
End Sub

  • The script holds a boolean with the actual status information (selected / unselected).
  • The Object_OnStateChange code receives "Mouse away" and "Mouse over" event notifications even if such states don't exist. The code redirects the state change to the actual custom states (yellow outline in-out fading, only in unselected state).

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!