int WINAPI Dialog( int PluginNumber, int X1, int Y1, int X2, int Y2, const char *HelpTopic, struct FarDialogItem *Item, int ItemsNumber );
"Width x Height" formula - in this case both X1 and Y1 must be set to -1, while
X2 and Y2 define dialog width and height respectively. In the latter case the dialog will be automatically centered on the screen.
X2 and Y2 parameters can't be less than zero.
FAR transforms Item elements to its own internal structure before creating a dialog. After dialog processing is over, Item elements array is adjusted according to changes made in the progress of user work with the dialog.
int Config()
{
struct InitDialogItem InitItems []={
DI_DOUBLEBOX,3,1,72,8,0,0,0,0,(char *)MConfigTitle,
DI_CHECKBOX,5,2,0,2,0,0,0,0,(char *)MConfigAddToDisksMenu,
DI_FIXEDIT,7,3,7,3,1,0,0,0,"",
DI_TEXT,9,3,0,3,0,0,0,0,(char *)MConfigDisksMenuDigit,
DI_TEXT,5,4,0,4,0,0,DIF_BOXCOLOR|DIF_SEPARATOR,0,"",
DI_CHECKBOX,5,5,0,5,0,0,0,0,(char *)MConfigCommonPanel,
DI_TEXT,5,6,0,6,0,0,DIF_BOXCOLOR|DIF_SEPARATOR,0,"",
DI_BUTTON,0,7,0,7,0,0,DIF_CENTERGROUP,1,(char *)MOk,
DI_BUTTON,0,7,0,7,0,0,DIF_CENTERGROUP,0,(char *)MCancel
};
struct FarDialogItem DialogItems[sizeof(InitItems)/sizeof(InitItems[0])];
. . .
InitDialogItems(InitItems,DialogItems,
sizeof(InitItems)/sizeof(InitItems[0]));
. . .
int ExitCode=Info.Dialog(Info.ModuleNumber,
-1,-1,76,10,
"TempCfg",DialogItems,
sizeof(DialogItems)/sizeof(DialogItems[0]));
if (ExitCode != 7)
return(FALSE);
. . .
}