DIF_HISTORY

Far Manager

DIF_HISTORY

DIF_HISTORY flag allows to keep a history list for edit controls. When this flag is set, the History field must contain the address of a text string that will be used as the internal history name. If several edit controls have the same history name, they will share the same history list. For the following example (ARCPROC.CPP file from MultiArc):

const char *PathHistoryName="ExtrDestPath";
struct InitDialogItem InitItems[]={
 ...
 DI_EDIT,5,3,70,3,1,(DWORD)PathHistoryName,DIF_HISTORY,0,DestPath,
 ...
};

the history will be stored in the registry (under HKCU\Software\Far\SavedDialogHistory\ExtrDestPath key), one line (key names look like "Line<number>", of REG_SZ type) for each value entered by the user.
Kyes with names looking like "Locked<number>" (REG_DWORD) are intended for marking lines that cannot be deleted (while in the list, this state can be changed with the <Insert> key).

Controls

The DIF_HISTORY flag is applicable to the following dialog items:

ControlDescription
DI_EDIT Edit box.
DI_FIXEDIT Fixed size edit box.

Remarks

  1. The DIF_HISTORY flag DOES NOT WORK with the DI_PSWEDIT control!
  2. DIF_HISTORY has higher priority than the DIF_MASKEDIT flag.
  3. FAR 1.70 beta 3: If a plugin has an edit box with a history list, it is assumed that the user will leave the dialog using the Esc key (Enter is reserved for other needs), then the data will not be stored in the history because Esc means rejection of further dialog processing. In such case, plugin can add necessary strings to the history list. It can be carried out by sending the DM_ADDHISTORY message to the Dialog Manager.
  4. If an item has the DIF_MANUALADDHISTORY flag, then the Dialog Manager will not add strings to the history list when the dialog closes.
  5. Also, a plugin can keep united history lists using predefined names:
    name purpose
    "SearchText" search edit box
    "ReplaceText" replace edit box
    "PersPath" personal plugins' paths
    "Copy" destination edit box in copy dialog
    "LineNumber" editor goto (Alt-F8)
    "ViewerOffset" viewer goto (Alt-F8)
    "NewEdit" edited files (Shift-F4/Shift-F2)
    "Masks" file masks (selection, associations, filters, file search)
    "UserVarN" user variables
    "ApplyCmd" "apply command" (Ctrl-G)
    "DizText" file description edit box
    "NewFolder" folder creation
See also: