Attention!
Dialog API represents an individual API beginning from FAR Manager version 1.70. What's in it for plugin developers? The main thing is higher control over the created dialog.
There're two different dialog types:
Regardless of the style used, dialog manager v1.0 supports only so-called Modal Dialogs. This dialog represents a window which disables user interaction with any FAR Manager object outside the boundaries of the dialog. The modal dialog cuts off all keyboard/mouse events sent to other FAR Manager objects.
This style defines the following dialog behavior:
Esc,
Ctrl-Enter, Enter (pressing Enter closes the dialog
regardless of which control element has the focus, with the exception of edit boxes with
DIF_EDITOR flag set), or clicks a mouse button beyond the
dialog bounds.
// dialog callback function with minimal code
LONG_PTR WINAPI MyDlgProc(HANDLE hDlg,int Msg,int Param1,LONG_PTR Param2)
{
return Info.DefDlgProc(hDlg,Msg,Param1,Param2);
}
Choosing dialog style is simple:
Well then, the Dialog API v1.0:
dialog.cpp file from
"Reversi" plugin sources.