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
Set Frame Rate for Flash Member
zOpen
Set Rotation angle of a Flash Member
RealLingo
A Simple Coloring Book
Curve Sprite - Move a sprite along a curved path.
Check user's administrative privileges on NT platform
Elapsed Time
EXE Screen Saver
e-mail tech support
 

 

 

Behavior Custom Alert

Added on 7/8/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: Penworks (website)

Creates a custom alert with the above properties. Requires MUI Xtra Reproduced with permission from Penworks Lingo User"s Journal

-- Custom alert handler
-- Buttons can be #OkCancel, #AbortRetryIgnore, #YesNoCancel,
-- #YesNo, or #RetryCancel
-- Icons can be #stop,#note,#caution,#question,#error or #none
-- Default (button) can be #Ok, #Cancel, #Abort, #Retry, #Ignore,
-- #Yes, or #No (but must be on the dialog, of course)
-- Return value is symbol of button (#Ok, #Cancel, #Abort, etc.)

on customAlert buttons, default, icon, moveable, message, title
  set alertObj =new(xtra "MUI")
  if (not objectP(alertObj)) then
    return(#failed)
  end if
  
  if icon =#none then
    set icon =0
  end if
  
  set alertInitList =[:]
  setAProp(alertInitList, #buttons, buttons)
  setAProp(alertInitList, #default, default)
  setAProp(alertInitList, #icon, icon)
  setAProp(alertInitList, #moveable, moveable)
  setAProp(alertInitList, #message, message)
  setAProp(alertInitList, #title, title)
  
  -- Now choose the default
  if (symbolP(default)) then
    case buttons of
      #OkCancel:
        set default =getPos([#Ok, #Cancel], default)
        
      #AbortRetryIgnore:
        set default =getPos([#Abort, #Retry, #Ignore], default)
        
      #YesNoCancel:
        set default =getPos([#Yes, #No, #Cancel], default)
        
      #YesNo:
        set default =getPos([#Yes, #No], default)
        
      #RetryCancel:
        set default =getPos([#Retry, #Cancel], default)
    end case
    setAProp(alertInitList, #default, default)
  end if
  
  
  set result = Alert( alertObj, alertInitList )
  set alert =0            -- Discard the object
  
  case buttons of
    #OkCancel:
      return(getAt([#Ok, #Cancel], result))
      
    #AbortRetryIgnore:
      return(getAt([#Abort, #Retry, #Ignore], result))
      
    #YesNoCancel:
      return(getAt([#Yes, #No, #Cancel], result))
      
    #YesNo:
      return(getAt([#Yes, #No], result))
      
    #RetryCancel:
      return(getAt([#Retry, #Cancel], result))
      
    otherwise:
      return(#unsupported)
  end case
end

 


Contact

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

Send e-mail