Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Export to Pocket PC Xtra
FreePPP Control
DirectEmail
3DPI
macromedia.director.basics
Opening a page in a browser frame
Get Easter Date
Set ViewScale Property of a Flash Sprite
Slow Searches - Valentina
VideoCodecCheck II
 

 

 

Behavior Generic behavior to set System Colors

Added on 1/21/2002

 

Compatibilities:
behavior D6_5 D7 D8 D8_5 PC UK US

Required Xtras:
Desktop Xtra

This item has not yet been rated

Author: Shockdev

Allows to set RGB color for all desktop items

-- Generic behavior to set System Colors
-- Desktop Xtra 1.0 or later required
-- Compatibilities: Director 6.x, 7.x, 8.x, Windows

property Elements, OldScheme
property Activewndtitle, Activewndtitlegradient, Appworkspace, Desktop, Buttontext, Captiontext
property Highlight, Highlighttext, Inactivewndtitle, Inactivewndtitlegradient, Inactivewndtitletext
property Menubackgrnd, Menutext, Windowbackgrnd, Windowtext

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Activewndtitle, [#default: "0,0,0", #format:#string, #comment:"Active window title bar (R,G,B):"]
  addProp description, #Activewndtitlegradient, [#default: "0,0,0", #format:#string, #comment:"Active window right side (R,G,B):"]
  addProp description, #Appworkspace, [#default: "0,0,0", #format:#string, #comment:"Backgroung for apps (R,G,B):"]
  addProp description, #Desktop, [#default: "0,0,0", #format:#string, #comment:"Desktop (R,G,B):"]
  addProp description, #Buttontext, [#default: "0,0,0", #format:#string, #comment:"Text on push buttons (R,G,B):"]
  addProp description, #Captiontext, [#default: "0,0,0", #format:#string, #comment:"Text in caption, size box and and scroll bar arrow box (R,G,B):"]
  addProp description, #Highlight, [#default: "0,0,0", #format:#string, #comment:"Items selected in a control (R,G,B):"]
  addProp description, #Highlighttext, [#default: "0,0,0", #format:#string, #comment:"Text of items selected in a control (R,G,B):"]
  addProp description, #Inactivewndtitle, [#default: "0,0,0", #format:#string, #comment:"Inactive window title bar (R,G,B):"]
  addProp description, #Inactivewndtitlegradient, [#default: "0,0,0", #format:#string, #comment:"Inactive window right side(R,G,B):"]
  addProp description, #Inactivewndtitletext, [#default: "0,0,0", #format:#string, #comment:"Text in an inactive caption (R,G,B):"]
  addProp description, #Menubackgrnd, [#default: "0,0,0", #format:#string, #comment:"Menu background (R,G,B):"]
  addProp description, #Menutext, [#default: "0,0,0", #format:#string, #comment:"Text in menus (R,G,B):"]
  addProp description, #Windowbackgrnd, [#default: "0,0,0", #format:#string, #comment:"Window background (R,G,B):"]
  addProp description, #Windowtext, [#default: "0,0,0", #format:#string, #comment:"Text in windows (R,G,B):"]
  return description
end

on getBehaviorDescription
  return "            " &
  "- -    System Color Behavior    - -" & RETURN &
  "Sets color for all system elements."
end

on mouseDown
  -- List of elements for which we change the color
  set Elements = []
  add Elements, "Activewndtitle"
  add Elements, "Activewndtitlegradient"
  add Elements, "Appworkspace"
  add Elements, "Desktop"
  add Elements, "Buttontext"
  add Elements, "Captiontext"
  add Elements, "Highlight"
  add Elements, "Highlighttext"
  add Elements, "Inactivewndtitle"
  add Elements, "Inactivewndtitlegradient"
  add Elements, "Inactivewndtitletext"
  add Elements, "Menubackgrnd"
  add Elements, "Menutext"
  add Elements, "Windowbackgrnd"
  add Elements, "Windowtext"
  setColor
end

on setColor
  set the itemDelimiter = ","
  set element = ""
  set OldScheme = [:]
  repeat with i = 1 to count(Elements)
    do "set element="&getAt(Elements,i)
    set r = integer (item 1 of element)
    set g = integer (item 2 of element)
    set b = integer (item 3 of element)
    
    set Ok = setSystemColor (getAt(Elements,i), r, g, b)
    if getAt(Ok, 1) = 0 then
      -- Ok, we save all previous values as the OldScheme property list
      addProp OldScheme, getAt(Elements,i), [getAt(Ok, 3), getAt(Ok, 4), getAt(Ok, 5)]
    else
      -- Error
      alert("Error: " & getAt(Ok, 1) & " - base error code")
    end if
  end repeat
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail