Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Puzzler II - Slider
Scroll Thumb
Windows for Shockwave 4.5
Sprite Group Movement behavior
New bitmap from existing member
Deleting a range of frames
Display Mode
RavJoystick Xtra
Gang Buster
Add a unique property to a property list
MediaMacros Xtras Mall
 

 

 

Behavior Color Dialog behavior

Added on 2/24/2003

 

Compatibilities:
behavior D6_5 D7 D8 D8_5 D9 PC US

Required Xtras:
HandyDialog Xtra

This item has not yet been rated

Author: Shockdev

Generic behavior to display Color Selection Dialog.

-- Color Dialog Behavior
-- HandyDialog Xtra 1.0 or later is required
-- by Meliora Software www.meliorasoft.com/xtras/
-- Compatibilities: Director 6.0 or higher, Windows

property Version, Color1, Color2, Color3, IC

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Version, [#default:"", #format:#string, #comment:"Dialog Type (Basic, Full or NoFullOpen):"]
  addProp description, #Color1, [#default:"", #format:#string, #comment:"Custom Color 1 (R,G,B):"]
  addProp description, #Color2, [#default:"", #format:#string, #comment:"Custom Color 2 (R,G,B):"]
  addProp description, #Color3, [#default:"", #format:#string, #comment:"Custom Color 3 (R,G,B):"]
  addProp description, #IC, [#default:"", #format:#string, #comment:"Initially Selected Color (R,G,B):"]
  return description
end

on mouseDown
  colorDialog
end

on colorDialog
  -- Color Dialog Init Settings
  set InitSettings = [:]
  addProp InitSettings, #Version, Version
  set TempDelimiter = the itemDelimiter
  set the itemDelimiter = ","
  set C1 = [integer(item 1 of Color1), integer(item 2 of Color1), integer(item 3 of Color1)]
  set C2 = [integer(item 1 of Color2), integer(item 2 of Color2), integer(item 3 of Color2)]
  set C3 = [integer(item 1 of Color3), integer(item 2 of Color3), integer(item 3 of Color3)]
  set Colors = [C1, C2, C3]
  addProp InitSettings, #CustomColors, Colors
  set InitColor = [integer(item 1 of IC), integer(item 2 of IC), integer(item 3 of IC)]
  addProp InitSettings, #InitColor, InitColor
  
  set Ok = showColorDialog(InitSettings)
  
  if getAt(Ok,1) = 0 then
    if count(Ok) = 3 then
      -- Some color was selected
      put getAt(Ok,3)
    else
      --  Cancel button was clicked
      put "Cancel button was clicked"
    end if
  else
    -- Error occured
    alert("Error: " & getAt(Ok, 1) & " - base error code")
  end if
  
  set the itemDelimiter = TempDelimiter
  
end

on getBehaviorDescription
  return "- -   Color Selection Dialog Behavior   - -"
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail