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
cXtraPrintRTF
Bevel Static-Alphamania
Direct-L
OSControl Xtra Review
Append a File
RUNNING LED's
Get Crazy
Mastering Macromedia Director 6
DisplayRes
f3Export
 

 

 

Behavior Font 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 Font Selection Dialog.

-- Font 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 Effects, InitFont, InitStyle, InitColor, InitSize, InitStrike, InitUnder, Scripts, SetScript, MinSize, MaxSize

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Effects, [#default:false, #format:#boolean, #comment:"Display strikeout, underline and color options:"]
  addProp description, #InitFont, [#default:"", #format:#string, #comment:"Initially selected font:"]
  addProp description, #InitStyle, [#default:"", #format:#string, #comment:"Initial font style:"]
  addProp description, #InitColor, [#default:"", #format:#string, #comment:"Initial font color:"]
  addProp description, #InitSize, [#default:"", #format:#integer, #comment:"Initial font size:"]
  addProp description, #InitStrike, [#default:"", #format:#boolean, #comment:"Initial strikeout:"]
  addProp description, #InitUnder, [#default:"", #format:#boolean, #comment:"Initial underline:"]
  addProp description, #Scripts, [#default:"", #format:#boolean, #comment:"Show scripts:"]
  addProp description, #SetScript, [#default:"", #format:#string, #comment:"Character Set:"]
  addProp description, #MinSize, [#default:"", #format:#integer, #comment:"Minimal font size:"]
  addProp description, #MaxSize, [#default:"", #format:#integer, #comment:"Maximal font size:"]
  return description
end

on mouseDown
  fontDialog
end

on fontDialog
  -- Font Dialog Init Settings
  set InitSettings = [:]
  addProp InitSettings, #ShowEffects, Effects
  addProp InitSettings, #InitFont, InitFont
  addProp InitSettings, #InitStyle, InitStyle
  addProp InitSettings, #InitColor, InitColor
  addProp InitSettings, #InitSize, InitSize  
  set LimitSize = [#Min: MinSize, #Max: MaxSize]
  addProp InitSettings, #LimitSize, LimitSize
  addProp InitSettings, #InitStrikeout, InitStrike
  addProp InitSettings, #InitUnderline, InitUnder
  addProp InitSettings, #ShowScripts, Scripts
  addProp InitSettings, #SetScript, SetScript
  
  set Ok = showFontDialog(InitSettings)

  if getAt(Ok,1) = 0 then
    if count(Ok) = 3 then
      -- Some font 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
  
end

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

 


Contact

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

Send e-mail