Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      Input Primitives
         . . .
         Other Input Functions
         Dialogs
            Standard Dialogs
            Button Dialogs
            Windowed Dialogs
         The Main Loop
         . . .

Previous   Up    Next
Other Input Functions  Primitives and EEL Subroutines   Button Dialogs


Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Input Primitives > Dialogs >

Standard Dialogs

short common_file_dlg(char *fname, char *title,
                      int *flags, int save,
                      ?char *filt_str, ?char *cust_filter,
                      ?int *filt_index)
short use_common_file_dlg(char *fname, char *title,
                          int *flags, int save)
int use_common_file_dialog()

Under Windows, the common_file_dlg( ) primitive displays the Common Open/Save File Dialog. The fname parameter should be initialized to the desired default file name; on return it will hold the file name the user selected. The title parameter specifies the title of the dialog window. Epsilon passes the flags parameter to Windows; definitions for useful flag values appear in codes.h. Windows modifies some of the flags before it returns from the dialog. If the parameter save is nonzero, Epsilon displays the Save dialog, if zero it uses the Open dialog. This primitive uses the common-open-curdir variable to hold the directory that this dialog should display.

The filter parameters let you specify the file types the user can select; these are all passed directly to Windows. Epsilon normally invokes common_file_dlg( ) through the use_common_file_dlg( ) subroutine, which uses the filter definitions from the file filter.txt to construct the filt_str parameter. You can edit that file to add new filters.

The parameter filt_str has the following format. It consists of pairs of null-terminated strings. The first string says what to display in the dialog, while the second is a Windows-style list of file patterns, separated by semicolons. For example, the first string might be "Fortran files" and the second string might be "*.for;*.f77". A final null character follows the last pair.

The use_common_file_dialog( ) subroutine examines the want-common-file-dialog variable and other settings and tells whether a command should use the common file dialog in place of Epsilon's traditional file dialog.

find_dialog(int show)
find_dialog_say(char *text)

Under Windows, the find_dialog( ) primitive displays a find/replace dialog, when its parameter show is nonzero. When its parameter show is zero, it hides the dialog. While a find/replace dialog is on the screen, the getkey( ) function returns certain predefined keys to indicate dialog events such as clicking a button or modifying the search string. The _find() subroutine defined in search.e interprets these key codes to control the dialog. The global variable find_data lets that subroutine control the contents of the dialog.

When a find/replace dialog is on the screen, an EEL program can display an error message in it using the find_dialog_say( ) primitive. This also adds an alert symbol to the dialog. To clear the message and remove the alert symbol, pass a parameter of "".

short window_lines_visible(int w)

The window_lines_visible( ) primitive returns the number of lines of a given window that are visible above a find/replace dialog. If the given window contains twelve lines, but a find/replace dialog covers the bottom three, this function would return nine. If Epsilon isn't displaying a find/replace dialog, the function returns the number of lines in the given window.

int comm_dlg_color(int oldcolor, char *title)

In Epsilon for Windows, the comm_dlg_color( ) primitive lets the user select a color using the Windows common color dialog. The oldcolor parameter specifies the default color, and title specifies the dialog's title. The primitive returns the selected color, or -1 if the user canceled.

about_box()

The about_box( ) primitive displays Epsilon's "About" box under Windows. In other versions of Epsilon, it inserts similar information into the current buffer. The about-epsilon command uses this primitive.



Previous   Up    Next
Other Input Functions  Primitives and EEL Subroutines   Button Dialogs


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.