File Open dialog

File Open dialog
 1# This example shows how to use the FileOpenDialog Object
 2
 3# Create the dialog object (but None is displayed yet)
 4file_open_dialog = impact.gui.create_file_open_dialog()
 5
 6# Apply the specified filename, filepath and title to the new FileOpenDialog object
 7file_open_dialog.file_path = "d:\\"
 8file_open_dialog.file_name = "Picture.bmp"
 9file_open_dialog.title = "File Open"
10
11# Now display the dialog, then check which button was pressed
12if file_open_dialog.show_modal():
13    impact.gui.output_toolbox.add("The user pressed the Open button.")
14else:
15    impact.gui.output_toolbox.add("The user pressed the Cancel button.")
16
17# Output the edited filename and filepath
18impact.gui.output_toolbox.add("FilePath: " + file_open_dialog.file_path)
19impact.gui.output_toolbox.add("FileName: " + str(file_open_dialog.file_name))