--786
--Behaviour: Drop down box for changing Font Size
--By: Hasan Yasar Kazmi
-- Hamdard University Islamabad Pakistan
-- dir@37.com
--20/11/2000
--Instructions:
--Attach with any Field Sprite, it will be turned into a change font drop down box
-- The Initial title of the Drop down can be adjusted from the Behaviour Inspector
on getPropertyDescriptionList
set description = [:]
addProp description, #TextSpriteNum, [#default: 1,#format:#integer, #comment: "Field/Text Sprite Num To change Font:"]
addProp description, #Title, [#default:"Font Size",#format:#string, #comment: "Title Of Drop Down Box:"]
return description
end
on getBehaviorDescription---Behaviour Discription
return "Dropdown Box for Changing Font Size"
end
on beginsprite me
FontSizeList = [6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,40,42,46,50,54,58,64,68,72,78,96]
spritenum = sprite(the spritenum of me)
sprite(spritenum).member.boxType = #Adjust
sprite(spritenum).member.text = string(title)
updatestage
end beginsprite me
on MouseEnter me
repeat with i = 1 to FontSizeList.count
Val = getAt(FontSizeList,i)
sprite(spritenum).member.line[i] =Val
end repeat
updatestage
end MouseEnter me
on Mousewithin me
sprite(spritenum).member.line[the mouseline].Hilite()
updatestage
end Mousewithin me
On mouseup me
sprite(TextspriteNum).member.fontsize = value(sprite(spritenum).member.line[the mouseline])
sprite(spritenum).member.text = string(title)
updatestage
end mouseup me
on MouseLeave me
sprite(spritenum).member.text = string(title)
updatestage
end MouseLeave me
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA