Attention!
void InitMenuItems(
const struct InitMenuItem *Init,
struct FarMenuItem *Item,
int ItemsNumber)
{
int I;
struct FarMenuItem *PItem=Item;
const struct InitMenuItem *PInit=Init;
for (I=0; I < ItemsNumber; I++,PItem++,PInit++)
{
PItem->Selected=PInit->Selected;
PItem->Checked=PInit->Checked;
PItem->Separator=PInit->Separator;
if ((unsigned int)PInit->Text < 2000)
strcpy(PItem->Text,GetMsg((unsigned int)PInit->Text));
else
strcpy(PItem->Text,PInit->Text);
}
}
None.
Use of the InitMenuItems function is reasoned by the following:
FarMenuItem.Text variable is large, that's why direct
initalization of an array of FarMenuItem structures may significantly increase
memory usage.
Example bellow shows how to use the InitMenuItems function and the InitMenuItem structure to create a menu.