Difference between revisions of "Lua:Class:SaveDialog"

From Cheat Engine
Jump to navigation Jump to search
(Methods)
 
(2 intermediate revisions by one other user not shown)
Line 45: Line 45:
 
===Example usage:===
 
===Example usage:===
  
   load_dialog = createOpenDialog(self)
+
   local load_dialog = createOpenDialog(self)
 
   load_dialog.InitalDir = os.getenv('%USERPROFILE%')
 
   load_dialog.InitalDir = os.getenv('%USERPROFILE%')
   load_dialog.execute()
+
   if load_dialog.execute() then
  print(load_dialog.FileName)
+
    print(load_dialog.FileName)
 +
  end
  
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Latest revision as of 00:21, 25 January 2018

Methods[edit]

 execute(): Boolean - True, if a file was selected. False on cancel.
 copyFrom(stream, count) - Copies count bytes from the given stream to this stream
 read(count): bytetable - Returns a bytetable containing the bytes of the stream. This increases the posion
 write(bytetable, count OPTIONAL)- Writes the given bytetable to the stream

Properties[edit]

 Title: string - The caption at top of the dialog
 DefaultExt: string - When not using filters this will be the default extention used if no extension is given
 Files: Strings - Stringlist containing all seleced files if multiple files are selected
 FileName: string - The filename that was selected
 Filter: string - A filter formatted string
 FilterIndex: integer - The index of which filter to use
 InitialDir: string - Sets the folder the filedialog will show first
 Options: String 
   A string formatted as "[param1, param2, param3]" to set OpenDialogs options
   Valid parameters are:
     ofReadOnly,
     ofOverwritePrompt  : if selected file exists shows a message, that file will be overwritten
     ofHideReadOnly     : hide read only file
     ofNoChangeDir      : do not change current directory
     ofShowHelp         : show a help button
     ofNoValidate
     ofAllowMultiSelect : allow multiselection
     ofExtensionDifferent
     ofPathMustExist    : shows an error message if selected path does not exist
     ofFileMustExist    : shows an error message if selected file does not exist
     ofCreatePrompt
     ofShareAware
     ofNoReadOnlyReturn : do not return filenames that are readonly
     ofNoTestFileCreate
     ofNoNetworkButton
     ofNoLongNames
     ofOldStyleDialog
     ofNoDereferenceLinks : do not expand filenames
     ofEnableIncludeNotify
     ofEnableSizing     : dialog can be resized, e.g. via the mouse
     ofDontAddToRecent  : do not add the path to the history list
     ofForceShowHidden  : show hidden files
     ofViewDetail       : details are OS and interface dependent
     ofAutoPreview      : details are OS and interface dependent

Example usage:[edit]

 local load_dialog = createOpenDialog(self)
 load_dialog.InitalDir = os.getenv('%USERPROFILE%')
 if load_dialog.execute() then
   print(load_dialog.FileName)
 end


See also[edit]