Note, you must call w32release_mem() when you have finished with the structure.
atom lOfn lOfn = buildDefaultOfn(0, "newfile.txt", {"Text Files","*.txt"}, OFN_FILEMUSTEXIST) w32store(lOfn, OfnDefExt, "TXT") if w32Func(xGetOpenFileName, {lOfn}) then -- get the name fName = w32fetch( lOfn, ofnFile ) fNamePtr = w32fetch( lOfn, ofnFileOffset) fExtPtr = w32fetch( lOfn, ofnFileExtension) else fName = "" end if w32release_mem(lOfn)
See Also: getColorDialog, getFindText, getFontDialog, getOpenFileName, getPageSetup, getPageSetupEx, getReplaceText, getSaveFileName
Calling this function brings up the modal "Select Color" dialog, allowing the user to select a color from the default color list, or add a color to the custom color list.
The parameter passed in default color is an atom representing the default color to select, in #RRGGBB format. Passing -1 specifies that the color black (#000000) is the default color.
Example:
-- get a color; red ( #FF0000 ) is the default atom color color = getColorDialog( Window, #FF0000 )
See Also: buildDefaultOfn, getFindText, getFontDialog, getOpenFileName, getPageSetup, getPageSetupEx, getReplaceText, getSaveFileName
id should be the id of the control in which the Find Dialog will search. The Find dialog is a modeless dialog, which means that it will remain open and on top, until the user closes it.
See Also: buildDefaultOfn, getColorDialog, getFontDialog, getOpenFileName, getPageSetup, getPageSetupEx, getReplaceText, getSaveFileName
Calling this function brings up the modal "Select Font" dialog, allowing the user to select a font from the list of available fonts.
Example:
integer flags, points atom color sequence font object result-- get a font choice from the user result = getFontDialog( MyWindow ) if sequence( result ) then -- get the values font = result[1] points = result[2] flags = result[3] color = result[4] end if
See Also: buildDefaultOfn, getColorDialog, getFindText, getOpenFileName, getPageSetup, getPageSetupEx, getReplaceText, getSaveFileName
Calling this function brings up the modal "Open File" dialog, allowing the user to select a file name. file is a sequence holding the default file name. filters is a list of patterns to limit displayed files to, in the format:
{ "text", pattern, "text", pattern ... }
For example:
constant FileTypes = { "Text File", "*.TXT", "Euphoria Program", "*.EX;*.EXW;*.E;*.EW", "All Files", "*.*" }
Note that a pattern can contain several different values.
Example:
-- get file name to open sequence filenamefilename = getOpenFileName( TheWindow, -- parent window "", -- no default name { "Text File", "*.TXT", -- text files "All Files", "*.*" } ) -- everything else
It is possible to modify the default flags set for the dialog by adding a special 'pattern' of "DIALOG FLAGS" followed by the additional flags required. The usual use of this is to allow multiple files to be selected.
Multiple Selections
When doing this, the routine returns a sequence of sequences. The first element
is the directory name, which always ends with a '\', and each subsequent
element is a file name selected from that directory.
filename = getOpenFileName( TheWindow, -- parent window "", -- no default name { "Dialog Flags", {OFN_ALLOWMULTISELECT}, "Text File", "*.TXT", -- text files "All Files", "*.*" } ) -- everything elseif length(filename) > 0 then theDir = filename[1] for i = 2 to length(filename) do ProcessTheFile( theDir, filename[i]) end for end if
See Also: buildDefaultOfn, getColorDialog, getFindText, getFontDialog, getPageSetup, getPageSetupEx, getReplaceText, getSaveFileName
This calls getPageSetupEx() using the default flags of ...
See Also: buildDefaultOfn, getColorDialog, getFindText, getFontDialog, getOpenFileName, getPageSetupEx, getReplaceText, getSaveFileName
Flags are the or'd flags...
The return values are ...
This also sets the printer to the user's selection.
See Also: buildDefaultOfn, getColorDialog, getFindText, getFontDialog, getOpenFileName, getPageSetup, getReplaceText, getSaveFileName
id should be the id of the control in which the Replace Dialog will search. The Replace dialog is a modeless dialog, which means that it will remain open and on top, until the user closes it.
See Also: buildDefaultOfn, getColorDialog, getFindText, getFontDialog, getOpenFileName, getPageSetup, getPageSetupEx, getSaveFileName
Calling this function brings up the modal "Save File" dialog, allowing the user to select a file name. file is a sequence holding the default file name. filters is a list of patterns to limit displayed files to, in the format:
{ "text", pattern, "text", pattern ... }
For example:
constant FileTypes = { "Text File", "*.TXT", "Euphoria Program", "*.EX;*.EXW;*.E;*.EW", "All Files", "*.*" }
Note that a pattern can contain several different values.
Example:
-- get file name to save filename = getSaveFileName( TheWindow, -- parent window "MyFile.txt", -- default name { "Text File", "*.TXT", -- text files "All Files", "*.*" } ) -- everything else
See Also: buildDefaultOfn, getColorDialog, getFindText, getFontDialog, getOpenFileName, getPageSetup, getPageSetupEx, getReplaceText