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
CopyFiles form AnyPath Include CD-ROM,DVD,HDD...etc
myMailTo
f3SoundFX
cXtraDateTimePicker
File Save as..
PopUp Menu Behavior
PDFCreator Xtra
Direct-L
Graphic Puzzle Dragger
Set DirectToStage of a Animated Gif Sprite
 

 

 

Behavior File Open Dialog Behavior

Added on 2/24/2003

 

Compatibilities:
behavior D6_5 D7 D8 D8_5 D9 PC US

Required Xtras:
HandyDialog Xtra

Rating:

Author: Shockdev

Generic Behavior to display File Open Dialog.

-- File Open 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 Title, FileType, FileExt, MultiSelect, FileMustExist, ShowReadOnlyBox, InitReadOnlyBox, InitFile, InitDir

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Title, [#default:"", #format:#string, #comment:"Dialog Title:"]
  addProp description, #FileType, [#default:"", #format:#string, #comment:"File Group Description:"]
  addProp description, #FileExt, [#default:"", #format:#string, #comment:"File Extensions (*.bmp; *.jpg):"]
  addProp description, #MultiSelect, [#default:false, #format:#boolean, #comment:"Allow multiselection:"]
  addProp description, #FileMustExist, [#default:false, #format:#boolean, #comment:"If the file to be opened must exist:"]
  addProp description, #ShowReadOnlyBox, [#default:false, #format:#boolean, #comment:"Display Read Only Checkbox:"]
  addProp description, #InitReadOnlyBox, [#default:false, #format:#boolean, #comment:"Read Only Checkbox is checked by default:"]
  addProp description, #InitFile, [#default:"", #format:#string, #comment:"Initial file name (uncheck multiselection):"]
  addProp description, #InitDir, [#default:the moviePath, #format:#string, #comment:"Initial path:"]
  return description
end

on mouseDown
  fileOpenDialog
end

on fileOpenDialog
  
  -- File Dialog Init Settings
  set Filters = [[FileType, FileExt]]
  set InitFilter = 1
  set InitSettings = [:]
  addProp InitSettings, #Filters, Filters
  addProp InitSettings, #Title, Title
  addProp InitSettings, #InitFilter, InitFilter
  addProp InitSettings, #MultiSelect, MultiSelect
  addProp InitSettings, #FileMustExist, FileMustExist
  addProp InitSettings, #ShowReadOnly, ShowReadOnlyBox
  addProp InitSettings, #InitReadOnly, InitReadOnlyBox
  addProp InitSettings, #InitFile, InitFile
  addProp InitSettings, #InitDir, InitDir
  
  set Ok = showFileDialog("Open", InitSettings)
  
  if getAt(Ok,1) = 0 then
    if count(Ok) = 3 then
      -- Some file 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 "- -   File Open Dialog Behavior   - -"
end

 


Contact

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

Send e-mail